/* ============================================================================
   GrammarBurst — website stylesheet (v3: dark→light diagnostic narrative)
   One shared sheet for index.html + legal pages (privacy/terms/impressum).
   Semantic token system derived from a single brand blue (#2B6BEE).
   A `.theatre` scope remaps the SAME tokens to a near-black ink-blue canvas,
   so every component works unchanged inside the dark "diagnostic lab" sections.
   No second hue. No blue→purple gradient. Motion is transform/opacity only.
   ============================================================================ */

/* ---------- Self-hosted display face (Nunito, latin subset) --------------- */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/nunito-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/nunito-latin-800.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("/assets/fonts/nunito-latin-900.woff2") format("woff2");
}

/* Metric-matched fallback so the swap from Arial → Nunito does not shift
   layout (kills CLS on the display headings). Values tuned to Nunito metrics. */
@font-face {
  font-family: "Nunito Fallback";
  src: local("Arial");
  ascent-override: 101.06%;
  descent-override: 35.29%;
  line-gap-override: 0%;
  size-adjust: 100.06%;
}

/* ---------- Tokens -------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* Brand — the single hue everything is derived from */
  --brand: #2B6BEE;
  --brand-ink: #ffffff;                                             /* text on brand fill */
  --brand-text: #1E5AD6;                                           /* darker brand for small text on tint/bg-1 (>=4.5:1) */
  --brand-strong: color-mix(in oklab, var(--brand) 86%, black);    /* hover / pressed */
  --brand-tint: color-mix(in oklab, var(--brand) 12%, var(--bg-0));
  --brand-line: color-mix(in oklab, var(--brand) 26%, var(--line));
  --ring: color-mix(in oklab, var(--brand) 55%, transparent);

  /* Surfaces & ink (light "repair shop" — v2 tokens verbatim) */
  --bg-0: #FBFCFE;
  --bg-1: #F3F6FA;
  --surface: #FFFFFF;
  --ink: #12233F;
  --body: #5B6B82;
  --muted: #607085;                                                /* AA on bg-0/bg-1/surface (>=4.5:1) */
  --line: #E4EAF2;

  /* Functional diff colours (only wrong/right states) */
  --wrong-text: #B0413A;
  --wrong-bg: #FBE3DE;
  --right-text: #176B42;
  --right-bg: #D7F0E2;
  --success: #12B76A;
  --success-tint: color-mix(in oklab, var(--success) 14%, var(--surface));

  /* Radii */
  --r-card: 18px;
  --r-btn: 14px;
  --r-chip: 10px;
  --r-pill: 999px;

  /* Shadows — soft, blue-tinted */
  --shadow: 0 4px 14px rgba(20, 36, 63, 0.05);
  --shadow-lg: 0 10px 30px rgba(20, 36, 63, 0.08);

  /* Fluid type scale (authoritative clamps from the design lead) */
  --step--1: clamp(0.83rem, 0.79rem + 0.2vw, 0.94rem);
  --step-0:  clamp(1rem, 0.94rem + 0.3vw, 1.17rem);
  --step-1:  clamp(1.19rem, 1.1rem + 0.45vw, 1.44rem);
  --step-2:  clamp(1.43rem, 1.28rem + 0.72vw, 1.84rem);
  --step-3:  clamp(1.72rem, 1.5rem + 1.1vw, 2.35rem);
  --step-4:  clamp(2.06rem, 1.7rem + 1.8vw, 3.1rem);               /* section h2, Nunito 900 */
  --step-5:  clamp(2.7rem, 1.9rem + 4.2vw, 4.9rem);               /* hero h1, Nunito 900 */

  /* Fluid space scale */
  --space-3xs: clamp(0.25rem, 0.24rem + 0.05vw, 0.31rem);
  --space-2xs: clamp(0.5rem, 0.47rem + 0.15vw, 0.63rem);
  --space-xs:  clamp(0.75rem, 0.71rem + 0.20vw, 0.94rem);
  --space-s:   clamp(1rem, 0.95rem + 0.24vw, 1.25rem);
  --space-m:   clamp(1.5rem, 1.40rem + 0.50vw, 1.88rem);
  --space-l:   clamp(2rem, 1.86rem + 0.70vw, 2.5rem);
  --space-xl:  clamp(3rem, 2.80rem + 1vw, 3.75rem);
  --space-section: clamp(4rem, 3rem + 5vw, 8rem);

  --container: 1120px;

  --font-display: "Nunito", "Nunito Fallback", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, "JetBrains Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5B8DF5;
    --brand-ink: #0D1420;                                          /* dark ink on the lighter dark-mode brand fill (>=4.5:1) */
    --brand-text: #5B8DF5;                                         /* dark-mode brand text already clears AA on tint (5.06:1) */
    --bg-0: #0D1420;
    --bg-1: #111B2A;
    --surface: #18202E;
    --ink: #F2F5FA;
    --body: #A8B4C6;
    --muted: #8B98AC;                                              /* AA on dark surface/bg-1 (>=4.5:1) */
    --line: #26303F;

    --wrong-text: #F0A79E;
    --wrong-bg: #3A2420;
    --right-text: #7FE0B5;
    --right-bg: #12332A;
    --success: #3CCF8E;

    --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- The theatre scope: near-black ink-blue diagnostic canvas ------- */
/* Remaps the semantic tokens so shared components render "blue-blooded" dark.
   Pinned to explicit values (independent of scheme) so it is always deeper and
   glowier than the page — under prefers-color-scheme: dark it stays distinct. */
.theatre {
  --bg-0: #070D1A;
  --bg-1: #0B1424;
  --surface: #101B30;
  --ink: #F4F7FC;
  --body: #9FAEC6;
  --muted: #7A8CA5;                                                /* AA on #070D1A and #0B1424 */
  --line: #1C2A42;

  --brand: #5B8DF5;                                                /* accents/glow */
  --brand-text: #5B8DF5;
  --brand-ink: #071022;
  --ring: color-mix(in oklab, #5B8DF5 70%, transparent);

  --wrong-text: #F0A79E;
  --wrong-bg: #3A2420;
  --right-text: #7FE0B5;
  --right-bg: #12332A;

  --shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 26px 64px rgba(3, 8, 20, 0.72);

  background: var(--bg-0);
  color: var(--body);
}
/* Real Use theatre — a deliberate one-step-lighter progression */
.theatre-lift { --bg-0: #0B1424; }
/* Any brand button inside a theatre stays #2B6BEE bg + #FFF text (4.57:1) */
.theatre .btn-primary { background: #2B6BEE; color: #ffffff; }

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--body);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-weight: 900; }
h2 { font-weight: 800; font-size: var(--step-3); }
h3 { font-weight: 800; font-size: var(--step-1); }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { margin: 0; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
.theatre :focus-visible,
.phone-screen :focus-visible { outline-color: #5B8DF5; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 0.7rem + 2vw, 2rem);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-text);
  margin: 0 0 var(--space-2xs);
}

.lead {
  font-size: var(--step-1);
  color: var(--body);
  max-width: 54ch;
}

/* Reusable mono fragments ------------------------------------------------- */
.mono { font-family: var(--font-mono); }

.diff-del,
.diff-ins {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0.05em 0.4em;
  border-radius: 6px;
  white-space: nowrap;
}
.diff-del { color: var(--wrong-text); background: var(--wrong-bg); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.diff-ins { color: var(--right-text); background: var(--right-bg); font-weight: 600; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  padding: 0.3em 0.7em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill-neutral { color: var(--muted); background: color-mix(in oklab, var(--muted) 12%, var(--surface)); border-color: color-mix(in oklab, var(--muted) 22%, transparent); }
.pill-brand   { color: var(--brand-text); background: var(--brand-tint); border-color: var(--brand-line); }
.pill-review  { color: var(--wrong-text); background: var(--wrong-bg); border-color: color-mix(in oklab, var(--wrong-text) 30%, transparent); }
.pill-mastered { color: var(--right-text); background: var(--right-bg); border-color: color-mix(in oklab, var(--right-text) 30%, transparent); }

/* ============================================================================
   NAV
   ============================================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-0) 80%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 0.3rem + 1.6vw, 1.6rem);
}
/* Plain text links (the button is excluded, so it never inherits this colour) */
.nav-links a:not(.btn) {
  color: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.nav-links a:not(.btn):hover { color: var(--ink); text-decoration: none; }
/* Belt-and-suspenders: the CTA's colour out-specifies any nav link rule. */
.nav-links a.btn-primary { color: var(--brand-ink); }
.nav-links a.btn-primary:hover { color: var(--brand-ink); }

/* Under 680px the nav collapses to logo + CTA only.
   Uses a.nav-hide so it out-specifies `.nav-links a:not(.btn)` above. */
@media (max-width: 680px) {
  .nav-links a.nav-hide { display: none; }
}

/* Narrow phones: shrink the wordmark + CTA so brand and the sticky
   "Coming soon" button sit side-by-side without wrap or box escape.
   Kicks in early enough (<=430px) to clear 375px devices. */
@media (max-width: 430px) {
  .nav-inner { gap: var(--space-3xs); }
  .brand { font-size: 0.98rem; gap: 7px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .nav .btn { padding-inline: 0.75em; font-size: 0.88rem; }
}

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0.7em 1.3em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--brand-strong); color: var(--brand-ink); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn-ghost:hover { border-color: var(--brand-line); text-decoration: none; }

/* App Store "coming soon" badge (not yet a link) ------------------------- */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 20px;
  border-radius: var(--r-btn);
  background: #0b0f16;
  color: #ffffff;
  font-family: var(--font-display);
  border: 1px solid color-mix(in oklab, #ffffff 12%, transparent);
  user-select: none;
}
.appstore-badge svg { width: 26px; height: 26px; flex-shrink: 0; fill: #fff; }
.appstore-badge .as-text { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.appstore-badge .as-small { font-size: 0.64rem; font-weight: 600; opacity: 0.85; letter-spacing: 0.02em; }
.appstore-badge .as-big { font-size: 1.05rem; font-weight: 800; }
/* On the near-black canvas, lift the (already dark) badge with a brand rim */
.theatre .appstore-badge {
  border-color: color-mix(in oklab, #5B8DF5 45%, transparent);
  box-shadow: 0 0 0 1px color-mix(in oklab, #5B8DF5 20%, transparent), 0 10px 30px rgba(0,0,0,0.5);
}

/* ============================================================================
   SECTION SCAFFOLD + treatments (hard cuts between treatments = the separation)
   ============================================================================ */
.section { padding-block: var(--space-section); position: relative; }
.section-alt { background: var(--bg-1); }
.section-tight { padding-block: clamp(3rem, 2.4rem + 3vw, 5rem); }

.section-head { max-width: 62ch; margin-bottom: var(--space-l); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: var(--step-4); font-weight: 900; }

/* ============================================================================
   HERO — dark theatre (#070D1A): the diagnostic lab
   ============================================================================ */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) var(--space-section);
  overflow: clip;
  isolation: isolate;
}
/* Faint scan-grid hairlines, faded to nothing at the edges by a radial mask */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to right, rgba(91,141,245,0.05) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, rgba(91,141,245,0.05) 0 1px, transparent 1px 72px);
  -webkit-mask-image: radial-gradient(120% 100% at 60% 20%, #000 0%, transparent 78%);
  mask-image: radial-gradient(120% 100% at 60% 20%, #000 0%, transparent 78%);
  pointer-events: none;
  z-index: -2;
}
/* Soft ~600px radial brand glow behind the phone */
.hero::after {
  content: "";
  position: absolute;
  top: -6%;
  right: 2%;
  width: 600px;
  max-width: 90%;
  aspect-ratio: 1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(43,107,238,0.28), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 1rem + 6vw, 4.5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.08fr 0.92fr; }
}

.hero-copy { min-width: 0; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--brand-text);
  background: color-mix(in oklab, #5B8DF5 15%, transparent);
  border: 1px solid color-mix(in oklab, #5B8DF5 38%, transparent);
  border-radius: var(--r-pill);
  padding: 0.5em 0.95em;
  margin-bottom: var(--space-s);
  text-transform: uppercase;
}
.hero-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5B8DF5; flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(91,141,245,0.25);
}
.hero h1 {
  font-size: var(--step-5);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -0.03em;
  max-width: 16ch;
  margin-bottom: var(--space-s);
  text-wrap: balance;
}
.hero h1 .pat { color: var(--brand-text); }
.hero-sub {
  font-size: var(--step-1);
  color: var(--body);
  max-width: 48ch;
  margin-bottom: var(--space-m);
}
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.hero-micro {
  margin-top: var(--space-s);
  font-size: var(--step--1);
  color: var(--muted);
}

/* Trust-chip row under the hero */
.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55em 0.7em;
  margin-top: var(--space-l);
}
.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--body);
  background: color-mix(in oklab, #5B8DF5 8%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.45em 0.85em;
}
.trust-chip .tc-dot { width: 6px; height: 6px; border-radius: 50%; background: #5B8DF5; flex-shrink: 0; }

/* ---------- The phone (pure CSS device) --------------------------------- */
.phone-wrap { position: relative; display: grid; place-items: center; min-width: 0; }
.phone {
  position: relative;
  z-index: 1;
  width: min(300px, 80vw);
  aspect-ratio: 9 / 19.5;
  border-radius: 46px;
  padding: 10px;
  background: #05080F;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.04),
    0 40px 80px rgba(3, 8, 20, 0.7),
    0 0 60px rgba(43, 107, 238, 0.22);
  margin-inline: auto;
}
@media (min-width: 900px) { .phone { width: min(300px, 42vw); } }
/* Dynamic Island */
.phone::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 26px;
  border-radius: var(--r-pill);
  background: #05080F;
  z-index: 4;
}
.phone-screen {
  /* Light-token remap: the calm light app glowing inside the dark theatre */
  --bg-0: #F3F6FA;
  --bg-1: #FBFCFE;
  --surface: #FFFFFF;
  --ink: #12233F;
  --body: #5B6B82;
  --muted: #607085;
  --line: #E4EAF2;
  --brand: #2B6BEE;
  --brand-text: #1E5AD6;
  --brand-ink: #ffffff;
  --wrong-text: #B0413A;
  --wrong-bg: #FBE3DE;
  --right-text: #176B42;
  --right-bg: #D7F0E2;
  height: 100%;
  border-radius: 38px;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--body);
  display: flex;
  flex-direction: column;
  position: relative;
}
.app-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 24px 7px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
  flex-shrink: 0;
}
.app-statusbar .sb-icons { display: inline-flex; align-items: center; gap: 5px; }
.app-statusbar .sb-icons svg { width: 16px; height: 12px; display: block; fill: var(--ink); }

/* The scan screen fills the space between status bar and tab bar */
.app-scan { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }

/* Nav bar of the app screen (also hosts the injected pause toggle) */
.scan-head {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.scan-head .scan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.scan-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: -0.01em; }
.scan-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  color: var(--brand-text);
}
/* Pause/play toggle for the auto-advancing scan (injected by script) */
.scan-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 0.35em;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
}
.scan-toggle:hover { border-color: var(--brand-line); }
.scan-toggle svg { width: 13px; height: 13px; display: block; fill: currentColor; }
.scan-stage {
  display: grid;
  align-content: start;
  padding: 14px;
}
.scan-slide { min-width: 0; }
/* No-JS / no active slide: show the first example in its final mastered state */
.scan-slide { display: none; }
.scan-card:not(.js-on) .scan-slide:first-child { display: block; }
.scan-card.js-on .scan-slide { grid-area: 1 / 1; display: block; }
/* Static hiding of inactive slides (not motion): keeps them out of the
   accessibility tree and prevents stacking if reduce-motion flips mid-session. */
.scan-card.js-on .scan-slide:not(.is-active) { opacity: 0; visibility: hidden; }

.scan-sentence {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink);
  margin: 0 0 12px;
}
.scan-clue {
  display: flex;
  gap: 0.5em;
  font-size: 0.8rem;
  color: var(--body);
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  padding: 0.65em 0.75em;
  margin: 0 0 12px;
}
.scan-clue b { color: var(--ink); font-weight: 700; }
.scan-clue .bulb { color: var(--brand); flex-shrink: 0; }
.scan-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5em; flex-wrap: wrap; }
.scan-foot .scan-label { font-size: 0.72rem; color: var(--muted); }

/* Static (no-JS) pill state = mastered only */
.scan-card:not(.js-on) .pill-review { display: none; }
.scan-pill { display: inline-grid; }
.scan-card.js-on .scan-pill > .pill { grid-area: 1 / 1; }
.scan-card.js-on .scan-slide .pill-mastered { opacity: 0; }

/* Compact Pattern Map bug rows below the scan card. margin-top:auto pins the
   block to the bottom of the flex screen column, so any remaining slack at
   tall/wide sizes opens between scan card and map — never below the rows. */
.app-map { padding: 0 14px 12px; display: grid; gap: 8px; margin-top: auto; }
.app-map .map-label { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.app-bugrow {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}
.app-bugrow .r-top { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink); }
.app-bugrow .r-top .r-sev { font-size: 0.58rem; font-weight: 600; padding: 0.15em 0.5em; border-radius: var(--r-pill); }
.app-bugrow .r-bar { height: 6px; border-radius: var(--r-pill); background: color-mix(in oklab, var(--muted) 18%, var(--surface)); overflow: hidden; }
.app-bugrow .r-bar > span { display: block; height: 100%; background: var(--brand); }
/* Quiet meta row under the map: "Next review · Tue" with a calendar glyph */
.map-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
}
.map-meta svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Tab bar with the elevated centre "Burst" circle (the app's fingerprint) */
.app-tabbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 9px 8px 15px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.app-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 8.5px;
  letter-spacing: 0.01em;
  color: var(--muted);
  flex: 1;
}
.app-tab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-tab.is-active { color: var(--brand-text); }
.app-tab-center { justify-content: flex-end; }
.app-tab-center .burst-circle {
  width: 54px;
  height: 54px;
  margin-top: -24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  border: 3px solid var(--surface);
  box-shadow: 0 8px 18px color-mix(in oklab, var(--brand) 42%, transparent);
}
.app-tab-center .burst-circle svg { width: 24px; height: 24px; stroke: #fff; }

/* ============================================================================
   SCENARIOS — "You know this moment" (light bg-0)
   ============================================================================ */
.scenarios {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.scenario {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}
.s-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.s-quote {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}
.bug-underline {
  text-decoration: underline wavy color-mix(in oklab, var(--wrong-text) 70%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.s-sting { font-size: var(--step--1); color: var(--body); margin: 0; }
.scenarios-close {
  margin: var(--space-l) auto 0;
  max-width: 42ch;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-2);
  line-height: 1.25;
  color: var(--ink);
  text-wrap: balance;
}

/* ============================================================================
   OUTCOME — Pattern Map vignette (bg-1)
   ============================================================================ */
.mapframe {
  display: grid;
  gap: var(--space-l);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 820px) { .mapframe { grid-template-columns: 1fr 1fr; } }
.map-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  padding: var(--space-m);
  min-width: 0;
}
.map-panel .panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6em;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-s);
}
.mapfrag { display: grid; gap: var(--space-xs); }

/* Bug cards (Pattern Map) — shared with the How-it-works vignette */
.bugcard {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  padding: 0.8em 0.9em;
  display: grid;
  gap: 0.55em;
  min-width: 0;
}
.bugcard-top { display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap; }
.sev {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.03em; padding: 0.25em 0.6em; border-radius: var(--r-pill);
  border: 1px solid transparent;
}
.sev-high { color: var(--wrong-text); background: var(--wrong-bg); border-color: color-mix(in oklab, var(--wrong-text) 30%, transparent); }
.sev-med  { color: var(--brand-text); background: var(--brand-tint); border-color: var(--brand-line); }
.sev-low  { color: var(--right-text); background: var(--right-bg); border-color: color-mix(in oklab, var(--right-text) 30%, transparent); }
.bugcard-diff { font-family: var(--font-mono); font-size: 0.86rem; color: var(--ink); }
.bugcard-state { margin-left: auto; }
.bugbar { height: 7px; border-radius: var(--r-pill); background: color-mix(in oklab, var(--muted) 18%, var(--surface)); overflow: hidden; }
.bugbar > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.bugbar-note { font-size: 0.7rem; color: var(--muted); }

/* Stat strip */
.statstrip {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4em 0.9em;
  margin-top: var(--space-s); padding-top: var(--space-s);
  border-top: 1px dashed var(--line);
}
.statstrip .stat { display: inline-flex; align-items: baseline; gap: 0.4em; }
.statstrip .stat b { font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; color: var(--ink); }
.statstrip .stat span { font-size: var(--step--1); color: var(--muted); }
.statstrip .sep { color: var(--line); }

.map-aside { align-self: center; }
.map-aside h2 { font-size: var(--step-4); font-weight: 900; }

/* ============================================================================
   HOW IT WORKS — asymmetric bento (light bg-0)
   ============================================================================ */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-s);
}
.bento-cell {
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 1rem + 1vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}
@media (min-width: 900px) {
  .cell-scan   { grid-column: span 2; }
  .cell-map    { grid-column: span 4; }
  .cell-burst  { grid-column: span 4; }
  .cell-review { grid-column: span 2; }
}
.cell-step {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cell-step .n {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand-text);
  font-weight: 800; font-size: 0.72rem; flex-shrink: 0;
}
.bento-cell h3 { font-size: var(--step-1); margin: 0; }
.bento-cell p { font-size: var(--step--1); color: var(--body); margin: 0; }
.cell-vignette { margin-top: auto; padding-top: var(--space-2xs); }

/* Scan vignette */
.scan-mini {
  display: flex; align-items: baseline; gap: 0.5em;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r-chip); padding: 0.7em 0.85em;
}
.scan-mini .big { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; color: var(--ink); line-height: 1; }
.scan-mini .cap { font-size: var(--step--1); color: var(--muted); }

/* Burst — option pills */
.quiz-prompt { font-family: var(--font-mono); font-size: 0.95rem; color: var(--ink); margin: 0 0 0.7em; }
.options { display: grid; gap: 0.5em; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5em;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-btn); padding: 0.7em 0.85em;
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink);
  min-height: 44px;
}
.option.is-selected { border-color: var(--brand); background: var(--brand-tint); }
.option.is-correct {
  border-color: color-mix(in oklab, var(--success) 45%, transparent);
  background: var(--right-bg);
  color: var(--right-text);
  font-weight: 700;
}
.option.is-correct svg { width: 16px; height: 16px; stroke: var(--right-text); flex-shrink: 0; }

/* Review — status lifecycle strip */
.lifecycle { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em; }
.lifecycle .arrow { color: var(--muted); font-size: 0.8rem; }

/* ============================================================================
   REAL USE + ERROR DNA — dark theatre #2 (#0B1424, shorter)
   ============================================================================ */
.trio {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.trio-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}
.trio-card h3 { font-size: var(--step-1); margin: 0; }
.trio-card p { font-size: var(--step--1); color: var(--body); margin: 0; }
.trio-vignette { margin-top: auto; padding-top: var(--space-2xs); }

/* Real Use — message bubble with a diff */
.msg {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  padding: 0.8em 0.9em;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.85;
  color: var(--ink);
}
.msg .msg-meta { display: block; font-family: var(--font-display); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5em; }

/* Error DNA — taxonomy chips */
.dna-chips { display: flex; flex-wrap: wrap; gap: 0.45em; }
.dna-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--body);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  padding: 0.4em 0.65em;
}
.dna-chip b { color: var(--brand-text); font-weight: 700; }

/* Review — calendar-dot strip */
.cal-strip { display: flex; align-items: center; gap: 0.4em; flex-wrap: wrap; }
.cal-dot {
  display: grid; place-items: center;
  width: 30px; height: 34px; border-radius: 8px;
  background: var(--bg-1); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted);
}
.cal-dot.done { background: var(--right-bg); border-color: color-mix(in oklab, var(--right-text) 30%, transparent); color: var(--right-text); }
.cal-dot.due { background: var(--brand-tint); border-color: var(--brand-line); color: var(--brand-text); font-weight: 700; }

/* ============================================================================
   COMPARE — light bg-0, honest table inside a surface card
   ============================================================================ */
.compare-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: clamp(0.5rem, 0.2rem + 1vw, 1rem);
}
.table-wrap { overflow-x: auto; }
.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--step--1);
}
.compare-table th, .compare-table td {
  text-align: left;
  padding: 0.95em 1em;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.compare-table thead th {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-size: 0.72rem;
}
.compare-table thead th:not(:first-child) { text-align: center; width: 16%; }
.compare-table tbody th {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}
.compare-table tbody th .row-note { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.82rem; color: var(--muted); margin-top: 0.2em; }
.compare-table td.mark { text-align: center; font-size: 1.1rem; }
.compare-table .yes { color: var(--right-text); }
.compare-table .no { color: var(--muted); }
.compare-table tbody tr.is-us td, .compare-table tbody tr.is-us th { background: var(--brand-tint); }
.compare-table tbody tr.is-us th { color: var(--brand-text); border-left: 2px solid var(--brand); }
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-foot { font-size: var(--step--1); color: var(--muted); margin-top: var(--space-s); max-width: 72ch; }

/* ============================================================================
   PRIVACY tiles (bg-1)
   ============================================================================ */
.privacy-tiles {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.privacy-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--space-m);
  min-width: 0;
}
.privacy-tile .p-ico {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: var(--space-xs);
  background: var(--brand-tint); color: var(--brand-text);
}
.privacy-tile .p-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.privacy-tile .fact { font-family: var(--font-display); font-weight: 900; font-size: var(--step-0); color: var(--ink); margin: 0 0 0.35em; line-height: 1.2; }
.privacy-tile .cap { font-size: var(--step--1); color: var(--body); margin: 0; }

/* ============================================================================
   PERSONAS (light bg-0)
   ============================================================================ */
.personas {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.persona {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}
.persona .p-tag {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brand-text);
}
.persona h3 { font-size: var(--step-1); margin: 0; }
.persona p { font-size: var(--step--1); color: var(--body); margin: 0; }
.persona .p-sentence {
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.8; color: var(--ink);
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-chip);
  padding: 0.6em 0.75em; margin-top: var(--space-2xs);
}

/* ============================================================================
   PRICING (bg-1)
   ============================================================================ */
.pricing {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  align-items: stretch;
}
@media (min-width: 720px) {
  .pricing { grid-template-columns: 0.85fr 1.15fr; }
}
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}
.plan-pro { border-color: var(--brand-line); box-shadow: var(--shadow-lg); position: relative; }
.plan h3 { font-size: var(--step-1); margin: 0; }
.plan .plan-sub { font-size: var(--step--1); color: var(--muted); margin: 0; }
.plan .amount { font-family: var(--font-display); font-weight: 900; color: var(--ink); font-size: var(--step-3); line-height: 1; }
.plan .amount .per { font-size: 1rem; font-weight: 700; color: var(--muted); }

.plan-list { list-style: none; margin: var(--space-2xs) 0 0; padding: 0; display: grid; gap: 0.5em; }
.plan-list li { display: flex; gap: 0.6em; align-items: flex-start; font-size: var(--step--1); color: var(--body); }
.plan-list li svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; stroke: var(--success); }

.plan-options { display: grid; gap: 0.6em; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); margin-top: var(--space-2xs); }
.plan-opt {
  border: 1.5px solid var(--line);
  border-radius: var(--r-btn);
  padding: 0.9em 1em;
  display: grid;
  gap: 0.15em;
  min-width: 0;
}
.plan-opt.featured { border-color: var(--brand); background: var(--brand-tint); }
.plan-opt .opt-name { display: flex; align-items: center; gap: 0.5em; font-weight: 700; color: var(--ink); font-size: var(--step-0); }
.plan-opt .opt-price { font-family: var(--font-display); font-weight: 900; color: var(--ink); font-size: var(--step-2); }
.plan-opt .opt-price .per { font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.save-badge {
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--right-text); background: var(--right-bg);
  border-radius: var(--r-pill); padding: 0.2em 0.6em;
}
.trial-badge {
  align-self: flex-start;
  font-family: var(--font-display); font-weight: 800; font-size: 0.72rem;
  letter-spacing: 0.02em; color: var(--brand-text); background: var(--brand-tint);
  border: 1px solid var(--brand-line); border-radius: var(--r-pill);
  padding: 0.3em 0.8em;
}
.pricing-note { margin-top: var(--space-s); font-size: var(--step--1); color: var(--muted); }

/* ============================================================================
   FAQ (light bg-0) — <details> rows separated by 1px lines
   ============================================================================ */
.faq {
  max-width: 780px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.faq details + details { border-top: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  min-height: 48px;
  padding: 0.9em 1.15em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-0);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
/* Custom +/− indicator */
.faq summary .faq-ind {
  position: relative;
  width: 16px; height: 16px; flex-shrink: 0;
}
.faq summary .faq-ind::before,
.faq summary .faq-ind::after {
  content: "";
  position: absolute;
  background: var(--brand);
  border-radius: 2px;
}
.faq summary .faq-ind::before { top: 7px; left: 0; width: 16px; height: 2px; }
.faq summary .faq-ind::after  { left: 7px; top: 0; width: 2px; height: 16px; }
.faq details[open] summary .faq-ind::after { opacity: 0; }
.faq .faq-body { padding: 0 1.15em 1.1em; }
.faq .faq-body p { font-size: var(--step--1); color: var(--body); margin: 0; }

/* ============================================================================
   FINAL CTA — closing dark theatre bookend (#070D1A)
   ============================================================================ */
.bookend {
  position: relative;
  overflow: clip;
  border-radius: var(--r-card);
  padding: clamp(2.2rem, 1.4rem + 3vw, 3.75rem);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: var(--space-s);
  border: 1px solid var(--line);
  background: var(--surface);
}
.bookend::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto 0;
  height: 90%;
  background: radial-gradient(50% 60% at 50% 0%, rgba(43,107,238,0.3), transparent 70%);
  pointer-events: none;
}
.bookend > * { position: relative; }
.bookend h2 { font-size: var(--step-2); max-width: 24ch; margin: 0; }
.bookend p { color: var(--body); max-width: 46ch; margin: 0; }

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-l);
  background: var(--bg-1);
}
/* On the index, the footer joins the closing theatre (#070D1A) */
.footer.theatre { background: var(--bg-0); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  align-items: center;
  justify-content: space-between;
}
.footer .brand { font-size: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-s); }
.footer-links a { color: var(--body); font-weight: 600; font-size: 0.92rem; display: inline-flex; align-items: center; min-height: 44px; }
.footer-links a:hover { color: var(--ink); text-decoration: none; }
.footer-note { color: var(--muted); font-size: var(--step--1); width: 100%; margin: 0; }
.footer-assure { color: var(--muted); font-size: var(--step--1); width: 100%; margin: 0; }

/* ============================================================================
   LEGAL / PROSE PAGES
   ============================================================================ */
.legal { padding-block: clamp(2.5rem, 1.8rem + 3vw, 4.5rem) var(--space-xl); }
.legal .container { max-width: 780px; }
.legal h1 { font-size: var(--step-3); }
.legal .updated { color: var(--muted); font-size: 0.9rem; margin-top: -0.4em; margin-bottom: 2.2em; }
.legal h2 { font-size: var(--step-1); margin-top: 2em; }
.legal h3 { font-size: 1.08rem; margin-top: 1.5em; }
.legal p, .legal li { color: var(--body); }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 0.5em; }
.legal a { text-decoration: underline; }
.legal .placeholder {
  background: var(--brand-tint);
  color: var(--brand-text);
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 600;
}
.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-chip);
  padding: 16px 20px;
  margin: 1.6em 0;
}
.callout p:last-child { margin-bottom: 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.94rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { font-family: var(--font-display); color: var(--ink); font-weight: 800; }

/* ============================================================================
   CROSS-CARD ALIGNMENT — subgrid row baselines for multi-card rows.
   Every card in a row shares row tracks with its neighbours, so all titles,
   body texts, and example/vignette blocks start at the same top edge even
   when a neighbour's title wraps. Each card overrides the inherited parent
   gap with its own previous internal gap, so spacing is unchanged; in
   single-column stacks each card simply spans its own rows (no giant gaps).
   Non-supporting browsers keep the existing flex layout untouched.
   ============================================================================ */
@supports (grid-template-rows: subgrid) {
  /* Scenario cards: eyebrow / mono sentence / sting line */
  .scenario {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: var(--space-xs);
    align-content: start;
  }
  /* Real Use / Error DNA / Review theatre cards: title / body / vignette */
  .trio-card {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: var(--space-xs);
    align-content: start;
  }
  /* Privacy tiles: icon / title / body (spacing carried by child margins) */
  .privacy-tile {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
    align-content: start;
  }
  /* Persona cards: eyebrow / title / body / mono example */
  .persona {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    row-gap: var(--space-2xs);
    align-content: start;
  }
}

/* ============================================================================
   MOTION — transform/opacity only, all behind the reduced-motion guard
   ============================================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* Free cross-page fades */
  @view-transition { navigation: auto; }

  /* Smooth in-page anchor scrolling — only when motion is welcome */
  html { scroll-behavior: smooth; }

  /* Pause control: freeze every scan-card animation on demand (WCAG 2.2.2) */
  .scan-card.is-paused,
  .scan-card.is-paused * { animation-play-state: paused !important; }

  .btn, .brand-mark, .appstore-badge, .option, .plan-opt {
    transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
  }
  .btn-primary:hover, .appstore-badge:hover { transform: translateY(-1px); }
  .brand:hover .brand-mark { transform: rotate(-4deg); }

  /* Hero one-time load-in choreography (fade-up 500ms, staggered) */
  .hero-eyebrow { animation: fade-up 500ms cubic-bezier(0.22,1,0.36,1) 0ms both; }
  .hero h1      { animation: fade-up 500ms cubic-bezier(0.22,1,0.36,1) 80ms both; }
  .hero-sub     { animation: fade-up 500ms cubic-bezier(0.22,1,0.36,1) 160ms both; }
  .hero-cta     { animation: fade-up 500ms cubic-bezier(0.22,1,0.36,1) 240ms both; }
  .hero-micro   { animation: fade-up 500ms cubic-bezier(0.22,1,0.36,1) 240ms both; }
  .trust-chips  { animation: fade-up 500ms cubic-bezier(0.22,1,0.36,1) 320ms both; }
  .phone-wrap   { animation: phone-in 700ms cubic-bezier(0.22,1,0.36,1) 200ms both; }
  @keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes phone-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

  /* Scan card choreography (the one calm loop, ~7.5s per example) */
  .scan-card.js-on .scan-slide.is-active { animation: slide-in 600ms ease both; }
  .scan-card.js-on .scan-slide.is-active .diff-ins { animation: ins-reveal 1600ms ease both; }
  .scan-card.js-on .scan-slide.is-active .scan-clue { animation: clue-reveal 1600ms ease both; }
  .scan-card.js-on .scan-slide.is-active .pill-review { animation: pill-out 3200ms ease both; }
  .scan-card.js-on .scan-slide.is-active .pill-mastered { animation: pill-in 3200ms ease both; }
  .scan-card.js-on .scan-head .scan-dot { animation: dot-pulse 2.4s ease-in-out infinite; }
  .scan-card.js-on .scan-head .scan-status { animation: status-flip 7.5s ease-in-out infinite; }

  @keyframes slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes ins-reveal { 0% { opacity: 0; transform: translateY(4px); } 55% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }
  @keyframes clue-reveal { 0%, 40% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }
  @keyframes pill-out { 0%, 42% { opacity: 1; } 55%, 100% { opacity: 0; } }
  @keyframes pill-in  { 0%, 48% { opacity: 0; } 60%, 100% { opacity: 1; } }
  @keyframes dot-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }
  @keyframes status-flip { 0%, 40% { opacity: 1; } 46%, 100% { opacity: 0.55; } }

  /* Scroll-driven reveals — only where supported; base state stays fully visible.
     Applied only to scenarios, outcome, compare, personas (nothing else on scroll).
     Time-based stagger isn't meaningful on a scroll timeline, so the requested
     0/90/180ms cascade is expressed as incremental animation-range starts. */
  @supports (animation-timeline: view()) {
    .reveal   { animation: reveal-up linear both;    animation-timeline: view(); animation-range: entry 5% cover 30%; }
    .reveal-r { animation: reveal-right linear both; animation-timeline: view(); animation-range: entry 5% cover 30%; }

    .stagger > *              { animation: reveal-up linear both; animation-timeline: view(); animation-range: entry 5% cover 30%; }
    .stagger > *:nth-child(2) { animation-range: entry 9% cover 34%; }
    .stagger > *:nth-child(3) { animation-range: entry 13% cover 38%; }

    @keyframes reveal-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
    @keyframes reveal-right { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
  }
}
