/* ============================================================
   RENTKHATA — microsite styles (dark)
   Palette pulled from lib/core/theme/app_colors.dart, blue dark
   theme (the app's default): bg #0A0C16 · surface #142545 ·
   border #191D30 · primary #3580FF · heading #ffffff ·
   bodyText #848A94 (meta) · type: Inter, self-hosted woff2
   (assets/google_fonts in the flutter repo, the app's own font).
   Custom design — standalone; not derived from the _template starter kit.
   ============================================================ */

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0A0C16;
  --surface: #142545;
  --surface-2: #101E36;
  --border: #22304F;
  --primary: #3580FF;
  --primary-bright: #5D9BFF;
  --heading: #FFFFFF;
  --body: #B8C1D4;
  --meta: #848A94;
  --max-w: 44rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 500 16px/1.75 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ambient glow orbs — the app's dark-blue atmosphere */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.orb.one {
  width: 42rem; height: 42rem;
  left: -14rem; top: -16rem;
  background: radial-gradient(circle, rgba(53, 128, 255, 0.20), transparent 65%);
  animation: drift-1 22s ease-in-out infinite alternate;
}
.orb.two {
  width: 36rem; height: 36rem;
  right: -12rem; bottom: -12rem;
  background: radial-gradient(circle, rgba(53, 128, 255, 0.14), transparent 65%);
  animation: drift-2 28s ease-in-out infinite alternate;
}

@keyframes drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6rem, 4rem) scale(1.12); }
}
@keyframes drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-5rem, -3rem) scale(1.08); }
}

.page {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

/* ── header ─────────────────────────────────────────────── */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

header.site .brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header.site .brand img {
  width: 3.25rem; height: 3.25rem;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(53, 128, 255, 0.35), 0 6px 24px rgba(53, 128, 255, 0.28);
  animation: glow-pulse 4.5s ease-in-out infinite;
}

header.site .brand-text { display: flex; flex-direction: column; gap: 0.15rem; }

header.site .brand .name {
  font-size: 1.45rem; font-weight: 700; color: var(--heading);
  letter-spacing: -0.01em; line-height: 1.1;
}
header.site .brand .name a { color: var(--heading); text-decoration: none; }

header.site .maker {
  font-size: 0.8rem; font-weight: 500; color: var(--meta);
  display: inline-flex; align-items: center; gap: 0.45rem;
}
header.site .maker::before {
  content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(53, 128, 255, 0.9);
  flex: none;
}

header.site .parent-link {
  font-size: 0.8rem; font-weight: 600; color: var(--body);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(20, 37, 69, 0.6);
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
header.site .parent-link:hover {
  color: #FFFFFF;
  border-color: rgba(53, 128, 255, 0.6);
  box-shadow: 0 4px 18px rgba(53, 128, 255, 0.2);
}
header.site .parent-link span { color: var(--primary-bright); }

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(53,128,255,0.35), 0 6px 24px rgba(53,128,255,0.28); }
  50%      { box-shadow: 0 0 0 1px rgba(53,128,255,0.55), 0 6px 32px rgba(53,128,255,0.45); }
}

/* ── pill nav ───────────────────────────────────────────── */
nav.tabs {
  position: sticky;
  top: 1rem;
  z-index: 10;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 3rem;
  padding: 0.35rem;
  background: rgba(16, 30, 54, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  animation: fade-up 0.7s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

nav.tabs .pill {
  position: absolute;
  left: 0; top: 0.35rem; bottom: 0.35rem;
  width: 0;
  transform: translateX(0);
  border-radius: 999px;
  background: linear-gradient(135deg, #3580FF, #2563EB);
  box-shadow: 0 4px 18px rgba(53, 128, 255, 0.4);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

nav.tabs a {
  position: relative;
  z-index: 1;
  color: var(--meta);
  text-decoration: none;
  font-size: 0.85rem; font-weight: 600;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.3s ease;
}

nav.tabs a:hover { color: var(--heading); }

nav.tabs a[aria-current="page"] { color: #FFFFFF; }

/* ── document sections (single-page layout) ─────────────── */
section.doc { scroll-margin-top: 5.5rem; }

section.doc + section.doc {
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px dashed var(--border);
}

h2.doctitle {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  position: relative;
  padding-bottom: 0.85rem;
  display: block;
}

h2.doctitle::before { display: none; }

h2.doctitle::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 3.5rem; height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #7FB3FF);
}

/* ── typography ─────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--heading);
  letter-spacing: -0.015em;
}

h1 {
  font-size: 2.15rem; font-weight: 700; line-height: 1.15;
  margin: 0 0 0.5rem;
  position: relative;
  padding-bottom: 0.85rem;
  animation: fade-up 0.7s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

h1::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 3.5rem; height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #7FB3FF);
  transform-origin: left;
  animation: grow-bar 0.9s 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

h2 {
  font-size: 1.3rem; font-weight: 600;
  margin: 3rem 0 0.9rem;
  display: flex; align-items: center; gap: 0.6rem;
}

h2::before {
  content: "";
  width: 0.35rem; height: 1.15rem;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), #2563EB);
  flex: none;
}

h3 { font-size: 1.05rem; font-weight: 600; margin: 1.75rem 0 0.6rem; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes grow-bar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── content ────────────────────────────────────────────── */
p { margin: 0.8rem 0; }

ul { padding-left: 1.25rem; }
li { margin: 0.4rem 0; }

li::marker { color: var(--primary); }

a {
  color: var(--primary-bright);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.2s ease, background-size 0.3s ease;
}
a:hover { color: #8CB8FF; background-size: 100% 1.5px; }

.meta {
  color: var(--meta);
  font-size: 0.875rem;
  margin: 0 0 2rem;
  animation: fade-up 0.7s 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.box {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.35rem;
  margin: 1.75rem 0;
  font-size: 0.95rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent 70%);
  opacity: 0.8;
}

.box:hover {
  border-color: rgba(53, 128, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(53, 128, 255, 0.12);
}

.box strong { color: var(--heading); }

/* ── footer ─────────────────────────────────────────────── */
footer.site {
  margin-top: 4.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--meta);
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

footer.site a { color: var(--meta); }
footer.site a:hover { color: var(--heading); }

/* ── scroll reveal ──────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

[data-reveal].revealed { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .orb, header.site .brand img, nav.tabs .pill { animation: none; }
  nav.tabs .pill { transition: none; }
  h1::after { animation: none; transform: scaleX(1); }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  nav.tabs { width: 100%; border-radius: 16px; }
  nav.tabs a { flex: 1; text-align: center; }
}