/* ============================================================================
   Sorcha marketing site — Refined Visual System
   Implements docs/design-system (README + production/sorcha-tokens.css) and
   docs/marketing/website-overhaul-spec.md. One stylesheet for the landing
   (index.html) and every marketing sub-page. Themes resolve via
   [data-theme="light"|"dark"] on <html>; the verification accent via
   [data-accent="violet"|"gold"] (ship violet). Light is the default; the
   nav toggle + localStorage switch to dark. Hero, quantum and footer sit on
   the brand ground in both themes.
   ============================================================================ */

/* ===========================  TOKENS (production drop-in)  ================= */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-pill: 999px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  --grid-size: 56px;

  --brand-indigo: #6366F1;
  --brand-indigo-deep: #4F46E5;
  --brand-violet: #818CF8;
  --brand-lilac: #A5B4FC;
  --ground-1: #090A14;
  --ground-2: #0F1020;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);

  --container: 1180px;
  --container-prose: 760px;
  --nav-h: 64px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0B14; --surface: #14162B; --surface-alt: #0E1020; --surface-sunk: #070810;
  --border: #282C46; --border-strong: #3A3F63;
  --text: #EDEEF8; --text-muted: #9A9FBC; --text-faint: #6B7095;
  --primary: #6366F1; --primary-strong: #818CF8; --link: #A5B4FC;
  --btn-primary-bg: #4F46E5; --btn-primary-text: #FFFFFF; --btn-primary-hover: #5A52EA;
  --verify: #A5B4FC; --verify-quiet: #818CF8;
  --border-grid: rgba(99,102,241,0.10); --particle: #818CF8;
  --bloom: rgba(99,102,241,0.16); --bloom-strong: rgba(99,102,241,0.32);
  --success: #34D399; --warning: #FBBF24; --error: #F87171;
  --success-bg: rgba(52,211,153,0.12); --warning-bg: rgba(251,191,36,0.12); --error-bg: rgba(248,113,113,0.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.6); --shadow: 0 10px 34px rgba(0,0,0,0.55); --shadow-lg: 0 28px 60px rgba(0,0,0,0.6);
  --bloom-shadow: 0 0 0 1px rgba(99,102,241,0.35), 0 10px 44px rgba(79,70,229,0.40);
  --focus-ring: #A5B4FC; --focus-ring-offset: #0A0B14;
}
[data-theme="dark"][data-accent="gold"] { --verify: #F4C04E; --verify-quiet: #E0A93A; }

[data-theme="light"] {
  color-scheme: light;
  --bg: #FCFCFE; --surface: #FFFFFF; --surface-alt: #F3F4FB; --surface-sunk: #F0F1F8;
  --border: #E4E5F1; --border-strong: #CDD0E4;
  --text: #14162B; --text-muted: #585E7C; --text-faint: #8A8FA8;
  --primary: #6366F1; --primary-strong: #4F46E5; --link: #4F46E5;
  --btn-primary-bg: #4F46E5; --btn-primary-text: #FFFFFF; --btn-primary-hover: #4338CA;
  --verify: #4338CA; --verify-quiet: #4F46E5;
  --border-grid: rgba(99,102,241,0.08); --particle: #6366F1;
  --bloom: rgba(99,102,241,0.10); --bloom-strong: rgba(99,102,241,0.18);
  --success: #047857; --warning: #B45309; --error: #C81E1E;
  --success-bg: rgba(4,120,87,0.10); --warning-bg: rgba(180,83,9,0.10); --error-bg: rgba(200,30,30,0.08);
  --shadow-sm: 0 1px 2px rgba(20,22,43,0.06); --shadow: 0 10px 30px rgba(79,70,229,0.08); --shadow-lg: 0 24px 50px rgba(79,70,229,0.12);
  --bloom-shadow: 0 0 0 1px rgba(99,102,241,0.30), 0 10px 36px rgba(79,70,229,0.18);
  --focus-ring: #4F46E5; --focus-ring-offset: #FCFCFE;
}
[data-theme="light"][data-accent="gold"] { --verify: #92560B; --verify-quiet: #B45309; }

[data-accent="violet"] { --accent-fill: #A5B4FC; --accent-hover: #B7C2FD; --accent-text: #0A0B14; }
[data-accent="gold"]   { --accent-fill: #F4C04E; --accent-hover: #F7CD6E; --accent-text: #1A1405; }

/* Suppress transitions for one frame during a theme swap (Chromium var() guard). */
html.swapping, html.swapping * { transition: none !important; }

/* ===========================  RESET / BASE  =============================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s var(--ease), color .4s var(--ease);
}
::selection { background: var(--brand-indigo); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm);
}

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--btn-primary-bg); color: #fff; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); z-index: 2000; }
.skip-link:focus { left: var(--sp-3); top: var(--sp-3); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.container-prose { max-width: var(--container-prose); margin: 0 auto; padding: 0 28px; }
.mono { font-family: var(--font-mono); }

/* ===========================  TYPE SCALE  ================================= */
h1, h2, h3, h4, h5 { color: var(--text); font-weight: 700; }
h1 { font-size: clamp(38px, 5.2vw, 56px); line-height: 1.05; letter-spacing: -.022em; }
h2 { font-size: clamp(30px, 3.6vw, 40px); line-height: 1.12; letter-spacing: -.018em; }
h3 { font-size: clamp(24px, 2.4vw, 28px); font-weight: 600; line-height: 1.2; letter-spacing: -.012em; }
h4 { font-size: 22px; font-weight: 600; line-height: 1.3; }
h5 { font-size: 18px; font-weight: 600; line-height: 1.4; }

/* ===========================  NAV  ======================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.nav-container { max-width: var(--container); margin: 0 auto; padding: 0 28px; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); }
.nav-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: var(--sp-5); }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s var(--ease); }
.nav-link:hover { color: var(--text); }
.nav-icon { display: inline-flex; color: var(--text-muted); }
.nav-icon:hover { color: var(--primary-strong); }
.theme-toggle { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { border-color: var(--primary); color: var(--primary-strong); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* The S brand mark used in nav + footer */
.brand-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm); position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--ground-1), var(--ground-2));
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(99,102,241,.25);
  color: #fff; font-weight: 900; font-size: 19px; line-height: 1; text-shadow: 1px 2px 0 rgba(79,70,229,.7);
}
.brand-icon::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 50% 45%, var(--bloom-strong), transparent 70%); }
.brand-icon span, .brand-icon { z-index: 0; }

/* ===========================  BUTTONS  =================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600; line-height: 1;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .18s var(--ease), box-shadow .22s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .08s var(--ease);
}
.btn-lg { font-size: 16px; padding: 14px 26px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background-color: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-primary:hover { background-color: var(--btn-primary-hover); box-shadow: var(--bloom-shadow); }
.btn-accent { background-color: var(--accent-fill); color: var(--accent-text); }
.btn-accent:hover { background-color: var(--accent-hover); box-shadow: var(--bloom-shadow); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-strong); box-shadow: inset 0 0 0 1px var(--primary); }
.btn-text { background: transparent; color: var(--link); padding: 11px 8px; }
.btn-text:hover { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }
/* On the always-dark hero ground */
.btn-on-dark { background: transparent; color: #EDEEF8; border-color: rgba(165,180,252,0.45); }
.btn-on-dark:hover { border-color: var(--brand-lilac); box-shadow: inset 0 0 0 1px rgba(165,180,252,0.5); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; }

/* ===========================  SECTION SHELLS  ============================ */
.section { padding: var(--sp-9) 28px; border-top: 1px solid var(--border); background: var(--bg); }
.section-alt { background: var(--surface-alt); }
.section-head { max-width: 760px; margin: 0 auto var(--sp-7); text-align: center; }
.section-eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--verify); margin-bottom: var(--sp-3);
}
.section-sub { font-size: 19px; color: var(--text-muted); margin-top: var(--sp-4); line-height: 1.6; }

/* Brand-ground bands (hero / quantum / footer) — dark in both themes */
.section-ink {
  position: relative; overflow: hidden; color: #EDEEF8;
  background: linear-gradient(180deg, var(--ground-1), var(--ground-2));
  border-top: 1px solid #1c1f38;
}
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .section-sub { color: #B6BAD4; }
.section-ink .section-eyebrow { color: var(--brand-lilac); }
.section-ink .card { background: rgba(255,255,255,0.03); border-color: rgba(99,102,241,0.22); }
.section-ink .card h3 { color: #fff; }
.section-ink .card p { color: #A7ACC9; }

/* ===========================  HERO  ===================================== */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--ground-1), var(--ground-2)); color: #EDEEF8; }
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(99,102,241,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,.10) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 75%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 75%);
}
.hero-bloom { position: absolute; left: 50%; top: -10%; width: 760px; height: 760px; transform: translateX(-50%); z-index: 0; pointer-events: none; background: radial-gradient(circle, rgba(99,102,241,.18), transparent 60%); }
.hero-inner { position: relative; z-index: 2; max-width: var(--container); margin: 0 auto; padding: var(--sp-9) 28px var(--sp-8); }
.hero-mark {
  width: 72px; height: 72px; border-radius: 18px; position: relative; overflow: hidden; margin-bottom: var(--sp-5);
  background: linear-gradient(135deg, #090A14, #0F1020); display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,.30), 0 14px 40px rgba(79,70,229,.35);
}
.hero-mark::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 50% 45%, rgba(99,102,241,.30), transparent 70%); }
.hero-mark span { font-family: "Helvetica Neue", Arial, sans-serif; font-weight: 900; font-size: 44px; color: #fff; position: relative; z-index: 1; text-shadow: 2px 3px 0 rgba(79,70,229,.65); }
.hero-eyebrow { display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-lilac); margin-bottom: var(--sp-4); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero-highlight { color: var(--brand-lilac); }
.hero-sub { font-size: 19px; line-height: 1.6; color: #B6BAD4; max-width: 56ch; margin: var(--sp-5) 0 var(--sp-6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ===========================  THREE DOORS  ============================== */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.door {
  position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 188px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-5); text-decoration: none; color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
}
.door::before {
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(var(--border-grid) 1px, transparent 1px), linear-gradient(90deg, var(--border-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(120px 120px at 100% 0, #000, transparent 70%);
  mask-image: radial-gradient(120px 120px at 100% 0, #000, transparent 70%);
}
.door:hover { border-color: var(--primary); box-shadow: var(--bloom-shadow); transform: translateY(-3px); }
.door > * { position: relative; z-index: 1; }
.door-icon { width: 40px; height: 40px; margin-bottom: var(--sp-4); color: var(--primary-strong); display: inline-flex; }
.door h3 { margin: 0 0 8px; font-size: 22px; }
.door p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.door-cta { margin-top: auto; padding-top: var(--sp-4); color: var(--link); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.door:hover .door-cta { gap: 10px; }
.section-ink .door { background: rgba(255,255,255,.03); border-color: rgba(99,102,241,.22); }
.section-ink .door h3 { color: #fff; }
.section-ink .door p { color: #A7ACC9; }
.section-ink .door-cta { color: var(--brand-lilac); }
.section-ink .door-icon { color: var(--brand-violet); }

/* ===========================  GRIDS / CARDS  ============================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-5); box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--primary); box-shadow: var(--bloom-shadow); transform: translateY(-3px); }
.card h3 { font-size: 22px; margin-bottom: var(--sp-2); }
.card p { color: var(--text-muted); font-size: 14.5px; }

/* ===========================  FOUR STEPS  ============================== */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); }
.step-num { font-family: var(--font-mono); font-size: 12px; color: var(--verify); font-weight: 600; }
.step h3 { font-size: 18px; margin: var(--sp-3) 0 6px; }
.step p { margin: 0; font-size: 14px; color: var(--text-muted); }

/* ===========================  DESIGNER STAGES  ========================= */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); }
.stage-label { display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--verify); margin-bottom: var(--sp-2); }
.stage p { color: var(--text-muted); font-size: 14px; }

/* ===========================  CHIPS  =================================== */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px;
  border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--text);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--verify); box-shadow: 0 0 0 3px color-mix(in srgb, var(--verify) 22%, transparent); }
.chip.roadmap { border-style: dashed; border-color: var(--border-strong); background: transparent; color: var(--text-muted); }
.chip.roadmap::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-faint); }
.section-ink .chip { color: #EDEEF8; }

/* ===========================  STAT BAND  =============================== */
.statband { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-top: var(--sp-5); }
.stat { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); padding: var(--sp-4); text-align: left; }
.stat p { color: var(--text-muted); font-size: 14.5px; }
.stat strong { color: var(--text); }
.stat cite { display: block; margin-top: var(--sp-2); font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); font-style: normal; }

/* ===========================  SECTORS / DAD  ========================== */
.sector { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); }
.sector h3 { font-size: 20px; margin-bottom: var(--sp-2); }
.sector .when { display: block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--verify); margin-bottom: var(--sp-3); letter-spacing: .02em; }
.sector p { color: var(--text-muted); font-size: 14px; margin: 0; }
.dad { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: var(--radius); padding: var(--sp-5); }
.dad h3 { font-size: 22px; margin-bottom: var(--sp-2); }
.dad p { color: var(--text-muted); font-size: 14.5px; }

/* ===========================  COMPARE TABLE  ========================== */
.compare-table { width: 100%; border-collapse: collapse; margin-top: var(--sp-5); font-size: 14.5px; }
.compare-table caption { caption-side: top; }
.compare-table th, .compare-table td { text-align: left; padding: var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.compare-table thead th { font-weight: 700; color: var(--text); border-bottom: 2px solid var(--border-strong); }
.compare-table tbody th { font-weight: 600; color: var(--text); }
.compare-table td { color: var(--text-muted); }
.compare-note { font-size: 13px; color: var(--text-muted); margin-top: var(--sp-3); }

/* ===========================  PROSE (sub-pages)  ====================== */
.prose { padding: calc(var(--nav-h) + var(--sp-7)) 28px var(--sp-8); }
.prose .lead { font-size: 19px; color: var(--text-muted); margin-bottom: var(--sp-6); }
.prose h2 { margin: var(--sp-7) 0 var(--sp-4); }
.prose p { margin-bottom: var(--sp-4); color: var(--text); }
.prose ul { margin: 0 0 var(--sp-5) 1.25rem; color: var(--text); }
.prose li { margin-bottom: var(--sp-3); }
.prose code { font-family: var(--font-mono); background: var(--surface-sunk); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 0.9em; color: var(--verify); }
.prose .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--sp-6); }
.prose .sector { margin-top: var(--sp-3); }

/* ===========================  CTA / FOOTER  =========================== */
.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: var(--sp-2); }
.footer { background: linear-gradient(180deg, var(--ground-1), var(--ground-2)); color: #B6BAD4; padding: var(--sp-8) 28px var(--sp-6); border-top: 1px solid #1c1f38; }
.footer-grid { max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--sp-7); }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; margin-bottom: var(--sp-3); color: #fff; }
.footer-tagline { color: #9094b4; font-size: 14px; max-width: 32ch; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: var(--sp-3); color: #c7cae6; font-family: var(--font-mono); }
.footer-col a, .footer-col button { display: block; color: #9094b4; text-decoration: none; font-size: 14px; margin-bottom: var(--sp-2); background: none; border: none; cursor: pointer; text-align: left; font: inherit; }
.footer-col a:hover, .footer-col button:hover { color: #fff; }
.footer-base { max-width: var(--container); margin: var(--sp-6) auto 0; padding-top: var(--sp-4); border-top: 1px solid rgba(255,255,255,0.08); text-align: center; color: #6f7494; font-size: 13px; }
.footer-base a { color: inherit; }
.footer-base a:hover { color: #fff; }

/* ===========================  REVEAL  ================================= */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  #heroCanvas { opacity: .5; }
}

/* ===========================  RESPONSIVE  ============================= */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps, .stages { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
}
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-4);
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: var(--sp-5) 28px;
  }
  .nav-toggle { display: flex; }
  .doors, .grid-2, .grid-3, .grid-4, .steps, .stages, .statband { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .compare-table, .compare-table thead, .compare-table tbody, .compare-table th, .compare-table td, .compare-table tr { display: block; }
  .compare-table thead { display: none; }
  .compare-table tbody th { border: none; padding-bottom: 0; }
  .compare-table td { border: none; padding-top: var(--sp-1); }
  .compare-table tbody tr { border-bottom: 1px solid var(--border); padding: var(--sp-3) 0; }
}

/* =====================================================================
   STACKING DECK — used only by index.html (guarded by `.deck`).
   Each top-level section becomes a sticky, full-viewport panel; the next
   panel scrolls up and over it. JS adds the recede (scale+dim) and a
   per-panel sticky `top` so panels taller than the viewport scroll fully
   into view before they pin. Reduced-motion falls back to normal flow.
   ===================================================================== */
.deck { position: relative; z-index: 1; }
.deck > .panel {
  position: sticky; top: 0; min-height: 100svh; overflow: visible;
  display: flex; flex-direction: column;
  border-top: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -24px 60px rgba(9, 10, 20, .28);
  transform-origin: 50% 0%; will-change: transform;
}
.deck > .panel:first-child { border-radius: 0; box-shadow: none; }
/* neutralise .section's own vertical padding (sp-9) and 28px sides — the
   panel centres its .container, which already has its own 28px padding. */
.deck > .panel.section { padding: var(--nav-h) 0 var(--sp-6); }
/* In the flex column, margin:auto centres the .container when there's room and
   top-aligns it (never clipping) when the content is taller than the viewport. */
.deck > .panel.section > .container { margin: auto; }
/* hero carries its own inner padding, so it needs no nav-clearance pad. */
.deck > .panel.hero { padding-top: 0; }
.deck > .panel.hero .hero-inner { margin-block: auto; }
/* the recede dim veil — opacity driven by a CSS var the JS sets per panel */
.deck > .panel::after {
  content: ""; position: absolute; inset: 0; background: #05060c;
  opacity: var(--veil, 0); pointer-events: none;
  z-index: 40;
}

/* Right-edge progress dots (built by JS; safe to keep even if JS is off). */
.deck-dots { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 60; display: flex; flex-direction: column; gap: 12px; }
.deck-dots button { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--primary); background: transparent; cursor: pointer; padding: 0; opacity: .5; transition: .2s var(--ease); }
.deck-dots button:hover { opacity: 1; }
.deck-dots button.is-active { background: var(--primary); opacity: 1; transform: scale(1.25); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
@media (max-width: 820px) { .deck-dots { display: none; } }

/* Hook-card footer: the single "exit" + where it leads. Theme-aware. */
.panel-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: var(--sp-7); }
.panel-foot.start { align-items: flex-start; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.leads-to { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-faint); }
.leads-to svg { width: 15px; height: 15px; flex: none; opacity: .8; }
.leads-to code { font-family: var(--font-mono); color: var(--verify); background: color-mix(in srgb, var(--primary) 9%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); padding: 2px 8px; border-radius: 6px; }
.section-ink .leads-to { color: #8388ad; }
.section-ink .leads-to code { color: var(--brand-lilac); background: rgba(99, 102, 241, .14); border-color: rgba(165, 180, 252, .28); }

/* Cross-page push/pop via the View Transitions API. Shared across all
   marketing pages (this stylesheet is global). landing.js tags each
   navigation 'forward' (going deeper) or 'back' (returning). */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  html:active-view-transition-type(forward)::view-transition-old(root) { animation: .5s var(--ease) both vt-out-left; }
  html:active-view-transition-type(forward)::view-transition-new(root) { animation: .5s var(--ease) both vt-in-right; z-index: 2; }
  html:active-view-transition-type(back)::view-transition-old(root)    { animation: .5s var(--ease) both vt-out-right; z-index: 2; }
  html:active-view-transition-type(back)::view-transition-new(root)    { animation: .5s var(--ease) both vt-in-left; }
}
@keyframes vt-out-left  { to   { transform: translateX(-24%); filter: brightness(.62); } }
@keyframes vt-in-right  { from { transform: translateX(100%); } }
@keyframes vt-out-right { to   { transform: translateX(100%); } }
@keyframes vt-in-left   { from { transform: translateX(-24%); filter: brightness(.62); } to { transform: translateX(0); filter: none; } }

/* Reduced motion: no stacking, no recede, no slide — plain readable flow. */
@media (prefers-reduced-motion: reduce) {
  .deck > .panel { position: static; min-height: 0; border-radius: 0; box-shadow: none; transform: none !important; }
  .deck > .panel.section { padding: var(--sp-9) 0; }
  .deck > .panel.hero { padding-top: 0; }
  .deck > .panel::after { display: none; }
  .deck-dots { display: none; }
}
