/* ============================================================
   Tilio — minimal design system
   Apple-adjacent: near-neutral canvas, a single restrained blue
   accent (green kept only for positive states), solid confident
   headings, SF Pro type. Compositor-only motion.
   ============================================================ */

:root {
  /* Type — SF Pro on Apple hardware, Inter as the cross-platform stand-in */
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
  --fs-hero: clamp(2.55rem, 1rem + 5.9vw, 5.25rem);
  --fs-h2: clamp(1.9rem, 1rem + 3vw, 3.35rem);
  --fs-h3: clamp(1.08rem, 0.98rem + 0.55vw, 1.35rem);
  --fs-lede: clamp(1.1rem, 1rem + 0.66vw, 1.4rem);
  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --fs-eyebrow: clamp(0.74rem, 0.7rem + 0.12vw, 0.82rem);

  /* Text on a filled accent surface is white in both themes */
  --on-accent: #ffffff;

  /* Space & shape */
  --space-section: clamp(5rem, 3rem + 8vw, 11rem);
  --shell: min(1180px, 92vw);
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* Motion */
  --dur: 0.6s;
  --dur-fast: 0.28s;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Dark theme (default) ---------- */
:root,
[data-theme="dark"] {
  --bg: #07080c;
  --bg-2: #0d0e13;
  --bg-3: #16171d;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --text-faint: #6e6e73;

  /* Accent — Apple blue (bright on black); green reserved for positive states */
  --accent: #2997ff;
  --accent-2: #47a6ff;
  --accent-strong: #0071e3;
  --good: #30d158;
  --accent-soft: rgba(41, 151, 255, 0.14);
  --accent-line: rgba(41, 151, 255, 0.4);
  --good-soft: rgba(48, 209, 88, 0.14);
  --good-line: rgba(48, 209, 88, 0.4);

  /* Aliases keep existing rules resolving to the new palette */
  --violet: var(--accent);
  --violet-2: var(--accent);
  --violet-deep: var(--accent-strong);
  --mint: var(--good);
  --grad: var(--accent);
  --grad-text: linear-gradient(var(--text), var(--text));

  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  --shadow-violet: 0 24px 60px -28px rgba(0, 0, 0, 0.65);
  --nav-bg: rgba(0, 0, 0, 0.72);
  --mock-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  --ambient-1: rgba(41, 151, 255, 0.22);
  --ambient-2: rgba(128, 104, 255, 0.16);
  --ambient-3: rgba(41, 151, 255, 0.1);
  --mock-glow: rgba(41, 151, 255, 0.3);
  --grain-color: rgba(255, 255, 255, 0.05);
  --grain-opacity: 0.28;
  --grain-blend: screen;

  /* Hero (night launch — deep space that resolves into the page bg) */
  --hero-bg: radial-gradient(125% 88% at 50% 6%, #0a0f1e 0%, #06070d 52%, var(--bg) 100%);
  --hero-ink: #ffffff;
  --hero-kicker: rgba(255, 255, 255, 0.88);
  --hero-title-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
  --hero-glow: radial-gradient(circle at 50% 35%, rgba(60, 90, 200, 0.16), transparent 70%);
  --nav-ink-top: rgba(255, 255, 255, 0.78);
  --nav-ink-top-hover: #ffffff;
  color-scheme: dark;
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #fbfbfd;
  --bg-3: #f5f5f7;
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.14);
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --text-faint: #86868b;

  --accent: #0071e3;
  --accent-2: #0077ed;
  --accent-strong: #0060c8;
  --good: #1a9e4b;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --accent-line: rgba(0, 113, 227, 0.28);
  --good-soft: rgba(26, 158, 75, 0.12);
  --good-line: rgba(26, 158, 75, 0.3);

  --violet: var(--accent);
  --violet-2: var(--accent);
  --violet-deep: var(--accent-strong);
  --mint: var(--good);
  --grad: var(--accent);
  --grad-text: linear-gradient(var(--text), var(--text));

  --shadow: 0 30px 60px -34px rgba(0, 0, 0, 0.2);
  --shadow-violet: 0 18px 44px -24px rgba(0, 0, 0, 0.22);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --mock-bg: linear-gradient(160deg, #ffffff, #f5f5f7);
  --ambient-1: rgba(0, 113, 227, 0.06);
  --ambient-2: rgba(0, 113, 227, 0.035);
  --ambient-3: rgba(0, 113, 227, 0.02);
  --mock-glow: rgba(0, 113, 227, 0.12);
  --grain-color: rgba(0, 0, 0, 0.04);
  --grain-opacity: 0;
  --grain-blend: multiply;

  /* Hero (morning launch — daybreak sky that melts into the white page) */
  --hero-bg: linear-gradient(180deg, #cfe4ff 0%, #e2eeff 30%, #f0f6ff 58%, #ffffff 100%);
  --hero-ink: #16233f;
  --hero-kicker: rgba(22, 35, 63, 0.68);
  --hero-title-shadow: 0 6px 24px rgba(120, 155, 220, 0.30);
  --hero-glow: radial-gradient(circle at 50% 30%, rgba(255, 236, 200, 0.55), transparent 68%);
  --nav-ink-top: rgba(22, 35, 63, 0.74);
  --nav-ink-top-hover: #16233f;
  color-scheme: light;
}


/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  /* fixed nav offset so anchor targets aren't hidden under the bar */
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient atmosphere behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(58vw 52vw at 82% -6%, var(--ambient-1), transparent 60%),
    radial-gradient(50vw 48vw at 2% 20%, var(--ambient-2), transparent 58%),
    radial-gradient(54vw 48vw at 55% 112%, var(--ambient-3), transparent 62%),
    var(--bg);
  animation: bgDrift 26s var(--ease) infinite alternate;
  will-change: transform;
}
@keyframes bgDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(2%, -1.6%, 0) scale(1.08); }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: radial-gradient(var(--grain-color) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: var(--grain-blend);
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3 { line-height: 1.06; letter-spacing: -0.022em; font-weight: 700; }

.icon { width: 22px; height: 22px; fill: currentColor; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 34px; height: 34px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.85em 1.4em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 2px solid var(--violet-2);
  outline-offset: 3px;
}
.btn .icon { transition: transform var(--dur-fast) var(--ease); }
.btn:hover .icon { transform: translateX(3px); }

.btn--primary {
  --btn-fg: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  box-shadow: var(--shadow-violet);
  font-weight: 600;
}
.btn--primary:hover { background: var(--accent-2); box-shadow: var(--shadow); }

.btn--ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--text);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--line-2); }

.btn--sm { padding: 0.6em 1.05em; font-size: 0.85rem; }
.btn--lg { padding: 1.05em 1.85em; font-size: 1.02rem; }

/* ---------- Shared type blocks ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet-2);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--violet-2), transparent);
}
.eyebrow--light { color: var(--violet-2); }
.eyebrow--light::before { background: linear-gradient(90deg, var(--violet-2), transparent); }

.section-head {
  width: var(--shell);
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 4vw, 4.5rem);
}
.section-title {
  font-size: var(--fs-h2);
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-lede {
  font-size: var(--fs-lede);
  color: var(--text-dim);
  max-width: 56ch;
  margin-inline: auto;
}

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 100;
  background: transparent;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transform-origin: left;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.1rem, 4vw, 2.4rem);
  transition: background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    backdrop-filter var(--dur-fast) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: var(--nav-bg);
  border-bottom-color: var(--line);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand__logo-text {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  transform: rotate(-3deg);
  display: inline-block;
  text-shadow: 0 0 16px rgba(41, 151, 255, 0.45);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nav-ink-top);
}
.nav__links a {
  position: relative;
  color: var(--nav-ink-top);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.nav__links a:hover {
  color: var(--nav-ink-top-hover);
}
.nav.is-scrolled .nav__links a {
  color: var(--text-dim);
}
.nav.is-scrolled .nav__links a:hover {
  color: var(--text);
}
.btn--pill {
  border-radius: 9999px !important;
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  padding: 0.6rem 1.45rem !important;
  box-shadow: 0 4px 18px rgba(41, 151, 255, 0.4) !important;
  border: none !important;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease) !important;
}
.btn--pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(41, 151, 255, 0.55) !important;
}
.nav__links a:hover::after { transform: scaleX(1); }

.nav__actions { display: flex; align-items: center; gap: 0.9rem; }

/* Language toggle */
.lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.lang__btn {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.32em 0.7em;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.lang__btn[aria-pressed="true"] {
  color: var(--bg);
  background: var(--text);
}
.lang__btn:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }

/* Theme toggle (sun/moon cross-fade) */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }
.theme-toggle svg {
  grid-area: 1 / 1;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.theme-toggle__moon { opacity: 0; transform: rotate(-45deg) scale(0.55); }
[data-theme="light"] .theme-toggle__sun { opacity: 0; transform: rotate(45deg) scale(0.55); }
[data-theme="light"] .theme-toggle__moon { opacity: 1; transform: none; }

/* ---------- Hero (Figma Launch Composition — Pure Space Dark) ---------- */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Center the title block in the upper-middle: big bottom padding lifts it
     up so the shuttle rises out of the cloud bank below it (Figma layout). */
  justify-content: center;
  padding: clamp(5rem, 11vh, 7rem) 1rem clamp(9rem, 26vh, 17rem);
  overflow: hidden;
  isolation: isolate;
  background: var(--hero-bg);
  color: var(--hero-ink);
  /* Scroll-launch progress (0→1), set from app.js; inherited by the rocket
     and both cloud layers so they animate together as the hero scrolls out. */
  --launch: 0;
}

/* Bottom hand-off: dissolve the cloud base into the page background so the
   hero flows straight into the showcase with no hard seam — in both themes
   (into deep navy at night, into white at daybreak). */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: clamp(56px, 8vh, 96px);
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: 5;
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  left: 50%;
  top: 15%;
  transform: translateX(-50%);
  width: min(1000px, 92vw);
  height: min(800px, 80vh);
  background: var(--hero-glow);
  pointer-events: none;
  z-index: 1;
}

.hero__typography {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 1440px;
  pointer-events: none;
  user-select: none;
}

.hero__kicker {
  font-size: clamp(0.95rem, 0.7rem + 0.9vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  text-transform: uppercase;
  color: var(--hero-kicker);
  margin: 0 0 clamp(0.3rem, 1.2vh, 0.8rem);
}

.hero__title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  line-height: 0.85;
  font-size: clamp(3.8rem, 1.5rem + 12vw, 10.5rem);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--hero-ink);
  text-shadow: var(--hero-title-shadow);
}

.hero__title-part {
  flex: 1 1 0;
  letter-spacing: 0.02em;
}
.hero__title-part--left {
  text-align: right;
}
.hero__title-part--right {
  text-align: left;
}

.hero__title-spacer {
  display: inline-block;
  width: clamp(92px, 7vw, 108px);
  flex-shrink: 0;
}

.hero__sub {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: clamp(0.5rem, 2vh, 1.4rem) 0 0;
  font-size: clamp(1.1rem, 0.7rem + 1.8vw, 2.4rem);
  font-weight: 800;
  text-transform: uppercase;
  color: #ff5238;
  letter-spacing: 0.36em;
  text-shadow: 0 0 26px rgba(255, 82, 56, 0.45);
}

.hero__sub-part--left {
  flex: 1 1 0;
  text-align: right;
  text-indent: 0.36em;
}
.hero__sub-part--right {
  flex: 1 1 0;
  text-align: left;
  letter-spacing: 0.36em;
}

.hero__sub-spacer {
  display: inline-block;
  width: clamp(220px, 26vw, 360px);
  flex-shrink: 0;
}

/* ── Uzbek hero balance (≥641px) ──────────────────────────────────────────
   EN splits ONE word ("ENG|LISH") around the shuttle, so short fragments hug
   it and read as a pun. UZ shows TWO full words ("INGLIZ" / "TILI") of unequal
   length; hugging the centre spacer made the longer word reach far left and
   the shorter one float right (ink centre ~74px off), so it read lopsided.
   Keep the shuttle dead-centre but *centre each word inside its own half* so
   the two words sit mirror-symmetric around it. Same for the "10× / TEZROQ"
   sub. Scoped to ≥641px so the ≤640px phone split stays intact. */
@media (min-width: 641px) {
  html[lang="uz"] .hero__title { font-size: clamp(3.4rem, 0.5rem + 7.2vw, 7.4rem); }
  html[lang="uz"] .hero__title-part--left,
  html[lang="uz"] .hero__title-part--right { text-align: center; }
  html[lang="uz"] .hero__title-spacer { width: clamp(150px, 14vw, 260px); }
  html[lang="uz"] .hero__sub-part--left,
  html[lang="uz"] .hero__sub-part--right { text-align: center; text-indent: 0; }
  html[lang="uz"] .hero__sub-spacer { width: clamp(170px, 18vw, 300px); }
}

/* Cloud bank — two mirror-complementary PNG layers stacked for depth.
   The shuttle (z-3) sits BETWEEN them, so its red exhaust dives from the
   back layer down behind the front layer = "launching out of the clouds".
   Both layers cover a modest bank height cropped from the top
   (object-position: top) so the puffy silhouette shows at the horizon
   while the solid body still fills flush to the viewport edge — a shorter,
   calmer bank than the full natural-aspect art. */
.hero-clouds {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: clamp(175px, 22vh, 275px);
  line-height: 0;
  pointer-events: none;
}

.hero-clouds__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  will-change: transform, opacity;
}

/* Each hero image is wrapped in <picture> (WebP source + PNG fallback). Keep the
   wrapper transparent to layout so the inner <img> still fills its positioned
   parent (both use width/height:100%). */
.hero-clouds picture,
.hero-rocket picture { display: contents; }

/* Back row: right-heavy art, scaled up slightly from the bottom so its
   horizon peeks above the front layer (depth) while staying flush below. */
.hero-clouds--back {
  z-index: 2;
  /* Roll in from below on load (mirrors the rocket's fly-in easing). */
  animation: cloudRise 1.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.hero-clouds--back .hero-clouds__img {
  /* Rests at scale(1.07); on scroll-launch it lifts, billows and fades out. */
  transform: translateY(calc(var(--launch, 0) * -55px))
             scale(calc(1.07 + var(--launch, 0) * 0.06));
  transform-origin: bottom center;
  filter: brightness(0.95);
  opacity: calc(1 - var(--launch, 0) * 0.92);
}

/* Front row: left-heavy art, full brightness, overlapping the exhaust base. */
.hero-clouds--front {
  z-index: 4;
  /* Rolls in a beat after the back layer for depth. */
  animation: cloudRise 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.32s both;
}
.hero-clouds--front .hero-clouds__img {
  /* On scroll-launch it sinks, billows and fades — parting from the back layer. */
  transform: translateY(calc(var(--launch, 0) * 60px))
             scale(calc(1 + var(--launch, 0) * 0.14));
  transform-origin: bottom center;
  filter: drop-shadow(0 -12px 30px rgba(255, 120, 110, 0.18));
  opacity: calc(1 - var(--launch, 0) * 0.92);
}

/* Cloud bank entrance: roll up into place from below on page load. */
@keyframes cloudRise {
  0% {
    transform: translateY(72px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ---------- Mock window chrome ---------- */
.mock {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--mock-bg);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* Soft top-lit screen glare — reads as glass, adds depth without washing text. */
.mock::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.09), transparent 40%);
  opacity: 0.8;
  pointer-events: none;
  z-index: 3;
}
.mock--dark {
  background:
    radial-gradient(130% 90% at 82% -12%, rgba(41, 151, 255, 0.16), transparent 54%),
    linear-gradient(160deg, #22232c, #0b0c11);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  /* Dark mock internals stay legible + on-brand regardless of page theme.
     color: var(--text) resolves to the light value redefined just below, so
     descendants that inherit color (flashcard word, AI bubbles) stay light
     even when the page is in light theme. */
  color: var(--text);
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --text-faint: rgba(245, 245, 247, 0.45);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.16);
  --violet: #2997ff;
  --violet-2: #2997ff;
  --mint: #30d158;
  --accent: #2997ff;
  --accent-soft: rgba(41, 151, 255, 0.16);
  --accent-line: rgba(41, 151, 255, 0.42);
  --good-soft: rgba(48, 209, 88, 0.16);
  --good-line: rgba(48, 209, 88, 0.42);
}
.mock__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.mock__bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}
.mock__bar i:nth-child(2) { background: #febc2e; }
.mock__bar i:nth-child(3) { background: #28c840; }
.mock__title {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.mock__body { padding: clamp(1.1rem, 2vw, 1.8rem); display: grid; gap: 1rem; }

.mock__reader { font-size: 1.05rem; line-height: 1.7; color: var(--text); }
.mock__reader mark {
  background: linear-gradient(transparent 62%, var(--accent-line) 0);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  cursor: pointer;
}
.mock__pop {
  justify-self: start;
  display: grid;
  gap: 2px;
  padding: 0.7rem 0.95rem;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  box-shadow: var(--shadow);
}
.mock__pop strong { color: var(--violet-2); font-size: 0.95rem; }
.mock__pop span { font-size: 0.82rem; color: var(--text-dim); }
.mock__chip {
  justify-self: start;
  font-size: 0.8rem;
  color: var(--mint);
  padding: 0.35em 0.75em;
  border-radius: 999px;
  background: var(--good-soft);
  border: 1px solid var(--good-line);
}

/* Speaking */
.mock__chat { gap: 0.6rem; }
.bubble {
  max-width: 82%;
  padding: 0.6rem 0.9rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.bubble--ai {
  justify-self: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.bubble--me {
  justify-self: end;
  background: var(--grad);
  color: var(--on-accent);
  border-bottom-right-radius: 5px;
}
.bubble em { font-style: normal; font-weight: 700; text-decoration: underline; }
.wave { display: flex; align-items: flex-end; gap: 4px; height: 26px; margin-top: 0.2rem; }
.wave i {
  width: 4px;
  border-radius: 2px;
  background: var(--violet-2);
  animation: waveBar 1.1s var(--ease) infinite;
}
.wave i:nth-child(odd) { animation-delay: 0.15s; }
.wave i:nth-child(3n) { animation-delay: 0.3s; }
@keyframes waveBar {
  0%, 100% { height: 6px; opacity: 0.5; }
  50% { height: 24px; opacity: 1; }
}

/* Video */
.mock__video {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--text);
  background:
    radial-gradient(120% 120% at 50% 0%, var(--accent-line), transparent 60%),
    linear-gradient(160deg, #1c1c1e, #0a0a0c);
  border: 1px solid var(--line);
}
.loopbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.loopbar__a, .loopbar__b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--violet-2);
  border: 1px solid var(--accent-line);
}
.loopbar__range {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 18%, var(--accent) 18%, var(--accent) 74%, transparent 74%);
}

/* Vocabulary */
.flashcard {
  display: grid;
  gap: 0.4rem;
  padding: 1.4rem 1.2rem;
  border-radius: var(--r-sm);
  text-align: center;
  background: linear-gradient(160deg, var(--accent-soft), transparent);
  border: 1px solid var(--line-2);
}
.flashcard__word { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.flashcard__hint { font-size: 0.85rem; color: var(--text-dim); }
.srs { display: flex; gap: 0.5rem; }
.srs__btn {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5em 0;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.srs__btn--easy { background: var(--good-soft); border-color: var(--good-line); color: var(--mint); }

/* Writing */
.mock__write { position: relative; gap: 0.7rem; }
.mock__write .line {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
}
.mock__write .line--short { width: 55%; }
.ring {
  position: relative;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: var(--surface-2); stroke-width: 3; }
.ring .ring__val {
  stroke: var(--violet);
  stroke-linecap: round;
  stroke-dasharray: 100.5;
  stroke-dashoffset: 18;
}
.ring span { font-size: 0.85rem; font-weight: 800; color: var(--mint); }

/* Shared mock scaffolding — doc header, footer meta, glassy input bar. These
   let each device screen fill its frame top-to-bottom instead of floating. */
.mock__doc {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.mock__doc-title { font-size: 0.94rem; font-weight: 600; color: var(--text); }
.mock__doc-meta { font-size: 0.76rem; color: var(--text-faint); letter-spacing: 0.02em; white-space: nowrap; }
.mock__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.35rem;
}
.mock__meta { font-size: 0.78rem; color: var(--text-faint); }
.mock__chip, .mock__pop { align-self: flex-start; }
.bubble--ai { align-self: flex-start; }
.bubble--me { align-self: flex-end; }
.mock__inputbar {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.mock__inputbar .wave { margin-top: 0; flex: 1; }
.mock__listening { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }
.mock__cap { font-size: 0.9rem; line-height: 1.55; color: var(--text-dim); }
.mock__cap em { color: var(--text); font-style: normal; font-weight: 600; }
.mock__foot .loopbar { flex: 1; }
.mock__speed {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--violet-2);
  padding: 0.3em 0.6em;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  white-space: nowrap;
}
.mock__streak {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--mint);
  padding: 0.3em 0.7em;
  border-radius: 999px;
  background: var(--good-soft);
  border: 1px solid var(--good-line);
}

/* Scroll cue */
.scrollcue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.scrollcue__dot {
  width: 22px;
  height: 34px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2);
  position: relative;
}
.scrollcue__dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet-2);
  transform: translateX(-50%);
  animation: cueDot 1.6s var(--ease) infinite;
}
@keyframes cueDot {
  0% { opacity: 0; transform: translate(-50%, 0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* ---------- Showcase (pinned scrollytelling) ---------- */
.showcase { position: relative; padding-block: var(--space-section); overflow-x: clip; }
.showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(46% 38% at 20% 24%, var(--ambient-2), transparent 72%),
    radial-gradient(42% 42% at 82% 74%, var(--ambient-3), transparent 72%);
  opacity: 0.55;
  pointer-events: none;
}
.showcase__intro {
  width: var(--shell);
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(3rem, 6vw, 5.5rem);
}
.showcase__title {
  font-size: var(--fs-h2);
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.showcase__lede {
  font-size: var(--fs-lede);
  color: var(--text-dim);
  max-width: 54ch;
  margin-inline: auto;
}
.showcase__scroll {
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 6rem);
  align-items: start;
}
.showcase__stage {
  position: sticky;
  top: clamp(84px, 16vh, 150px);
  height: min(68vh, 580px);
}
.showcase__stage::before {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: -1;
  background: radial-gradient(58% 54% at 50% 46%, var(--mock-glow), transparent 70%);
  filter: blur(40px);
  opacity: 0.9;
  pointer-events: none;
}
.stage { position: relative; width: 100%; height: 100%; }
.stage__panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(26px) scale(0.97);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  pointer-events: none;
}
.stage__panel .mock { height: 100%; display: flex; flex-direction: column; }
.stage__panel .mock__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.2rem, 2vw, 1.9rem);
}
.stage__panel.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.stage__panel.is-active .mock {
  box-shadow: var(--shadow), 0 40px 100px -46px var(--mock-glow);
}
/* Fill: give each content-light panel one dominant element that grows to fill
   the frame, so screens read as real app views instead of leaving a dead gap
   above the pinned status footer. */
.stage__panel[data-panel="0"] .mock__page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.95rem;
}
.stage__panel[data-panel="3"] .flashcard {
  flex: 1;
  place-content: center;
}
.stage__panel[data-panel="4"] .mock__sheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: clamp(0.95rem, 1.6vw, 1.25rem) clamp(1rem, 1.8vw, 1.3rem);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.mock__sheet .line--short { position: relative; }
.mock__sheet .line--short::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 2px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--accent);
  border-radius: 1px;
  animation: caretBlink 1.15s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.showcase__steps { list-style: none; padding: 0; margin: 0; position: relative; }
.showcase__steps::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 14%;
  bottom: 14%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--line-2) 12%, var(--line-2) 88%, transparent);
  pointer-events: none;
}
.step {
  min-height: 62vh;
  display: grid;
  grid-template-columns: 54px 1fr;
  column-gap: 1.4rem;
  row-gap: 0.55rem;
  align-content: center;
  padding-block: 2rem;
  position: relative;
}
.step__icon {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: start;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.step__num {
  grid-column: 2;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--text-faint);
  transition: color var(--dur-fast) var(--ease);
}
.step__title {
  grid-column: 2;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.2rem);
  color: var(--text-dim);
  transition: color var(--dur-fast) var(--ease);
}
.step__text {
  grid-column: 2;
  font-size: var(--fs-lede);
  color: var(--text-dim);
  max-width: 42ch;
}
.step.is-active .step__icon {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 14px 34px -12px var(--mock-glow), 0 0 0 5px var(--accent-soft);
  transform: translateY(-1px) scale(1.04);
}
.step.is-active .step__num { color: var(--violet-2); }
.step.is-active .step__title { color: var(--text); }

/* ---------- Stats ---------- */
.stats { padding-block: clamp(3rem, 6vw, 6rem); }
.stats__inner {
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.stat { display: grid; gap: 0.4rem; text-align: center; }
.stat__value {
  font-size: clamp(2.4rem, 1rem + 5vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: 0.92rem; color: var(--text-dim); }

/* ---------- Download ---------- */
.download { padding-block: var(--space-section); }
.os-grid {
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
}
.os-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  padding: clamp(1.8rem, 3vw, 2.6rem) 1.4rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.os-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.os-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.os-card:hover::before { transform: scaleX(1); }

.os-card__logo { width: 46px; height: 46px; fill: var(--text); opacity: 0.92; }
.os-card__name { font-size: 1.35rem; }
.os-card__meta { font-size: 0.85rem; color: var(--text-dim); text-align: center; }
.os-card__btn { width: 100%; justify-content: center; margin-top: 0.4rem; }
.os-card__btn.is-disabled {
  background: var(--surface-2, rgba(128, 128, 128, 0.18));
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.os-card__ext { font-size: 0.78rem; color: var(--text-faint); letter-spacing: 0.04em; }
.os-card__alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.os-card__alt a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.os-card__alt a:hover { color: var(--text); border-bottom-color: var(--line-2); }
.os-card__alt span { color: var(--text-faint); }

.os-card.is-detected {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface));
  box-shadow: var(--shadow);
}
.os-card.is-detected::before { transform: scaleX(1); }
.os-card.is-detected::after {
  content: attr(data-badge);
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--mint);
  padding: 0.25em 0.6em;
  border-radius: 999px;
}
.download__note {
  width: var(--shell);
  margin: clamp(2rem, 3vw, 3rem) auto 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-faint);
}

/* ---------- Install help (unsigned-app guidance) ---------- */
.install-help {
  width: var(--shell);
  max-width: 760px;
  margin: clamp(2.2rem, 4vw, 3.2rem) auto 0;
}
.install-help__title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}
.install-help__lede {
  text-align: center;
  margin: 0.5rem auto 1.4rem;
  max-width: 62ch;
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.55;
}
.ihelp {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-block: 0.7rem;
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.ihelp[open] { border-color: var(--accent-line); background: var(--surface-2); }
.ihelp__summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  transition: background var(--dur-fast) var(--ease);
}
.ihelp__summary::-webkit-details-marker { display: none; }
.ihelp__summary:hover { background: var(--surface-2); }
.ihelp__summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ihelp__ic { width: 22px; height: 22px; fill: var(--text); opacity: 0.9; flex: none; }
.ihelp__summary > span[data-i18n] { flex: 1; }
.ihelp__chevron {
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform var(--dur-fast) var(--ease);
}
.ihelp[open] .ihelp__chevron { transform: rotate(-135deg); }
.ihelp__steps {
  margin: 0;
  padding: 0 1.4rem 1.2rem 2.6rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}
.ihelp__steps li { margin-block: 0.4rem; }
.ihelp__steps code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.15em 0.45em;
  color: var(--text);
  word-break: break-all;
}
@media (prefers-reduced-motion: reduce) {
  .ihelp__chevron { transition: none; }
}

/* Prominent pre-download variant — shown above the OS cards so every visitor
   sees the unsigned-app guidance before downloading. */
.install-help--pre {
  max-width: 720px;
  margin-block: clamp(1.6rem, 3vw, 2.4rem) clamp(2rem, 4vw, 3rem);
  padding: clamp(1.4rem, 3vw, 2rem) clamp(1.2rem, 3vw, 1.8rem);
  background: var(--surface-2);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
}
.install-help__badge {
  display: block;
  width: fit-content;
  margin: 0 auto 0.7rem;
  padding: 0.32em 0.85em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.install-help--pre .ihelp { background: var(--surface); }

/* ---------- Download warning modal ---------- */
.dlmodal {
  border: none;
  padding: 0;
  margin: 0;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: transparent;
  color: var(--text);
}
.dlmodal[open] { display: flex; align-items: center; justify-content: center; }
.dlmodal::backdrop { background: rgba(4, 6, 10, 0.62); backdrop-filter: blur(3px); }
.dlmodal__card {
  width: min(92vw, 520px);
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.1rem);
  box-shadow: 0 30px 90px -24px rgba(0, 0, 0, 0.65);
  animation: dlmodal-in var(--dur-fast) var(--ease);
}
@keyframes dlmodal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.dlmodal__badge {
  display: block;
  width: fit-content;
  margin-bottom: 0.7rem;
  padding: 0.32em 0.85em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.dlmodal__title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.dlmodal__lede {
  margin: 0.6rem 0 1rem;
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.55;
}
.dlmodal__os {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.dlmodal__os:empty { display: none; }
.dlmodal__steps .ihelp__steps { padding: 0.2rem 0 0.4rem 1.4rem; }
.dlmodal__actions {
  display: flex;
  gap: 0.7rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}
.dlmodal__cancel {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  cursor: pointer;
}
.dlmodal__cancel:hover { background: var(--surface-2); color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .dlmodal__card { animation: none; }
}

/* ---------- Closing CTA ---------- */
.cta-band { position: relative; overflow: hidden; padding-block: var(--space-section); }
.cta-band__inner {
  position: relative;
  width: var(--shell);
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
  display: grid;
  gap: 1.2rem;
  justify-items: center;
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1.5rem, 4vw, 4rem);
  border-radius: var(--r-xl);
  background: var(--bg-3);
  border: 1px solid var(--line);
  overflow: hidden;
}
.cta-band__aurora {
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 160%;
  z-index: 0;
  background: radial-gradient(40% 60% at 50% 0%, var(--accent-soft), transparent 70%);
  filter: blur(50px);
}
.cta-band__inner > * { position: relative; z-index: 1; }
.cta-band__title { font-size: var(--fs-h2); }
.cta-band__text { font-size: var(--fs-lede); color: var(--text-dim); max-width: 52ch; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 4vw, 3.5rem);
}
.footer__inner {
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  text-align: center;
}
.footer__tag { color: var(--text-dim); font-size: 0.95rem; }
.footer__copy { color: var(--text-faint); font-size: 0.82rem; }

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px) scale(0.986);
  filter: blur(6px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
  will-change: opacity, transform, filter;
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero {
    min-height: min(90svh, 760px);
    padding-top: clamp(4rem, 16vh, 7rem);
  }
  /* Mobile: the pinned two-column stage can't survive in one column — a sticky
     panel would paint straight over the step text it illustrates. Flatten the
     stage + steps into one flow (display:contents) and interleave each app mock
     with its caption, so the section reads as a clean vertical story instead. */
  .showcase__scroll {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(1.1rem, 4vw, 1.75rem);
  }
  .showcase__stage,
  .showcase__stage .stage,
  .showcase__steps { display: contents; }

  .stage__panel {
    position: static;
    inset: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    height: clamp(390px, 90vw, 480px);
  }
  .stage__panel .mock,
  .stage__panel.is-active .mock {
    box-shadow: var(--shadow), 0 26px 64px -46px var(--mock-glow);
  }
  .step {
    min-height: auto;
    padding-block: 0;
    align-content: start;
  }

  /* Interleave order: mock 0, its caption, mock 1, its caption … */
  .stage__panel[data-panel="0"] { order: 1; }
  .step[data-step="0"] { order: 2; }
  .stage__panel[data-panel="1"] { order: 3; }
  .step[data-step="1"] { order: 4; }
  .stage__panel[data-panel="2"] { order: 5; }
  .step[data-step="2"] { order: 6; }
  .stage__panel[data-panel="3"] { order: 7; }
  .step[data-step="3"] { order: 8; }
  .stage__panel[data-panel="4"] { order: 9; }
  .step[data-step="4"] { order: 10; }
  /* Tighten the hero stack on phones (rocket sizing lives after the base
     .hero-rocket rule below so it wins the cascade). */
  .hero__title { margin-bottom: clamp(1.25rem, 7vh, 3.5rem); }
  .hero__sub { font-size: clamp(0.85rem, 0.4rem + 2.4vw, 1.6rem); }
  /* The shuttle boosters get proportionally wide on tablets; widen the gap so
     "FASTER" clears them instead of hiding its first letter. */
  .hero__sub-spacer { width: clamp(240px, 40vw, 380px); }
}

@media (max-width: 640px) {
  .nav__links { display: none; }
  .stats__inner { grid-template-columns: 1fr; gap: 1.8rem; }
  .os-grid { grid-template-columns: 1fr; }

  /* Keep the nav on one comfortable row: the CTA pill must never wrap
     (EN "Get the app" broke to 3 lines, UZ "Ilovani oling" to 2). Tighten
     the actions cluster so brand + lang + theme + pill fit at 360px. */
  .nav { gap: 0.5rem; padding-inline: clamp(0.9rem, 3.6vw, 1.4rem); }
  .nav__actions { gap: 0.5rem; }
  .btn--pill {
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.03em !important;
    padding: 0.55rem 0.95rem !important;
  }
  .lang__btn { padding: 0.3em 0.58em; font-size: 0.74rem; }
  .theme-toggle { width: 34px; height: 34px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .stage__panel { transition: opacity 0.2s linear; }
}

/* ============================================================
   Hero rocket — Figma-style PNG shuttle centered over the title:
   flies in on load, launches away on scroll (--launch, set in app.js).
   ============================================================ */
.hero-rocket {
  position: absolute;
  left: 50%;
  bottom: clamp(60px, 10vh, 110px);
  z-index: 3;
  height: clamp(410px, 56vh, 600px);
  aspect-ratio: 285 / 743;
  /* --launch (0 grounded → 1 flown away) is inherited from .hero, where
     app.js sets it from scroll progress (shared with the cloud layers). */
  /* keep the horizontal centering while launching upward on scroll */
  transform: translate(-50%, calc(var(--launch) * -130vh))
             scale(calc(1 - var(--launch) * 0.32));
  transform-origin: 50% 100%;
  opacity: calc(1 - var(--launch) * 0.75);
  will-change: transform, opacity;
  pointer-events: none;
}
/* Fly-IN on load: rise the shuttle up into frame from below. */
.hero-rocket__ship {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.7))
          drop-shadow(0 0 50px rgba(255, 82, 56, 0.3));
  animation: rocketFlyIn 1.5s cubic-bezier(0.16, 1, 0.3, 1) both,
             rocketHover 3.8s ease-in-out 1.5s infinite;
}
@keyframes rocketFlyIn {
  0% { transform: translateY(110vh) scale(0.92); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes rocketHover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 5rem;
  }
  .hero__title {
    font-size: clamp(2.2rem, 11vw, 3.8rem);
  }
  .hero__title-spacer {
    width: clamp(70px, 18vw, 110px);
  }
  .hero__sub {
    font-size: clamp(0.85rem, 3.5vw, 1.2rem);
  }
  .hero__sub-spacer {
    width: clamp(150px, 42vw, 210px);
  }
  .hero-rocket {
    height: clamp(300px, 50vh, 410px);
    bottom: clamp(40px, 8vh, 80px);
  }
  /* Natural-aspect clouds get thin at phone widths, so give the bank a real
     height and let the art cover it (aspect preserved, sides cropped) — this
     keeps the bank flush to the bottom instead of floating with a gap below. */
  .hero-clouds { height: clamp(150px, 26vh, 220px); }
  .hero-clouds__img { height: 100%; object-fit: cover; object-position: bottom center; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-rocket { transform: translate(-50%, 0); opacity: 1; }
  .hero-rocket__ship { animation: none; }
  .hero-clouds--back, .hero-clouds--front { animation: none; }
}












