/* ============================================================
   Typefaces — self-hosted so there is no CDN dependency and no
   silent fallback. Latin subset, variable weight: 48 KB + 31 KB.
   ============================================================ */
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-var-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   Tokens — light is the base, dark is a selected set (not a flip).
   Chart roles follow the validated palette; see charts.js.
   ============================================================ */
:root {
  color-scheme: light;

  --surface-1:      #fcfcfb;   /* cards, chart surface */
  --plane:          #f6f6f3;   /* page */
  --plane-alt:      #efeee9;   /* alternating sections */
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,.10);
  --border-strong:  rgba(11,11,11,.16);

  --series-1:       #2a78d6;   /* the one data hue */
  --series-1-soft:  rgba(42,120,214,.12);
  --fail:           #d03b3b;
  --good-text:      #006300;

  --shadow-sm: 0 1px 2px rgba(11,11,11,.05), 0 1px 1px rgba(11,11,11,.03);
  --shadow-md: 0 4px 16px rgba(11,11,11,.07), 0 1px 3px rgba(11,11,11,.05);

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --wrap: 1160px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --plane:          #101010;
    --plane-alt:      #161615;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --baseline:       #383835;
    --border:         rgba(255,255,255,.10);
    --border-strong:  rgba(255,255,255,.17);
    --series-1:       #3987e5;
    --series-1-soft:  rgba(57,135,229,.16);
    --fail:           #d03b3b;
    --good-text:      #0ca30c;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1:      #1a1a19;
  --plane:          #101010;
  --plane-alt:      #161615;
  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #898781;
  --gridline:       #2c2c2a;
  --baseline:       #383835;
  --border:         rgba(255,255,255,.10);
  --border-strong:  rgba(255,255,255,.17);
  --series-1:       #3987e5;
  --series-1-soft:  rgba(57,135,229,.16);
  --fail:           #d03b3b;
  --good-text:      #0ca30c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,.45);
}

/* ============================================================ Base */
* { box-sizing: border-box; }
/* Several rules below set display:flex/grid, which would otherwise beat the
   `hidden` attribute the demo JS toggles. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-feature-settings: "cv05" 1, "ss03" 1;  /* single-storey l, curved r — Inter */
  background: var(--plane);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
code { font-family: var(--mono); font-size: .88em; background: var(--series-1-soft); padding: .12em .38em; border-radius: 4px; }
em { font-style: normal; color: var(--text-primary); font-weight: 500; }
.dim { color: var(--text-muted); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--surface-1); padding: 10px 16px; border-radius: var(--r-sm);
}
.skip:focus { left: 16px; }

:where(a, button, summary):focus-visible {
  outline: 2px solid var(--series-1); outline-offset: 2px; border-radius: 4px;
}

/* ============================================================ Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--plane) 84%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 14.5px; text-decoration: none; letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-mark {
  width: 16px; height: 16px; border-radius: 3px; flex: none;
  background: var(--series-1);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--surface-1) 55%, transparent);
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 6px 11px; border-radius: var(--r-sm); text-decoration: none;
  font-size: 13.5px; color: var(--text-secondary); transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--border); color: var(--text-primary); }
.nav-links a[aria-current="true"] { color: var(--text-primary); font-weight: 500; }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
  border-radius: var(--r-sm); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--border); color: var(--text-primary); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 500; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--series-1); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--series-1) 86%, #000); }
.btn-ghost { border-color: var(--border-strong); color: var(--text-primary); background: transparent; }
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================ Hero */
.hero { padding: 88px 0 72px; border-bottom: 1px solid var(--border); }
.hero-inner { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,.8fr); gap: 64px; align-items: center; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(38px, 5.6vw, 62px); letter-spacing: -.035em; }
/* Band sits below Inter's x-height without clipping descenders. */
.hl {
  background: linear-gradient(180deg, transparent 70%, var(--series-1-soft) 70%, var(--series-1-soft) 94%, transparent 94%);
  color: var(--series-1);
}
.lede { margin-top: 22px; font-size: 17px; color: var(--text-secondary); max-width: 58ch; }
.lede strong { color: var(--text-primary); font-weight: 600; }
.hero-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

.hero-figure {
  margin: 0; padding: 32px; border-radius: var(--r-lg);
  background: var(--surface-1); border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.hero-num {
  font-size: clamp(52px, 7vw, 72px); font-weight: 650; letter-spacing: -.045em;
  line-height: 1; color: var(--series-1);
}
.hero-figure figcaption { margin-top: 14px; display: grid; gap: 3px; }
.hero-figure figcaption strong { font-size: 14px; font-weight: 600; }
.hero-figure figcaption span:last-child { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.hero-mini {
  list-style: none; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.hero-mini li { display: grid; gap: 2px; }
.mini-v { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.mini-l { font-size: 11.5px; color: var(--text-muted); }

/* ============================================================ Sections */
.section { padding: 88px 0; }
.section.alt { background: var(--plane-alt); border-block: 1px solid var(--border); }
.sec-head { max-width: 68ch; margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -.03em; }
.sec-sub { margin-top: 16px; font-size: 16.5px; color: var(--text-secondary); }

/* ============================================================ Demo */
.demo { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; align-items: start; }

.demo-stage {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md);
}
.viewport {
  position: relative; aspect-ratio: 16/9; background: #0a0a0a;
  display: grid; place-items: center; overflow: hidden;
}
.viewport canvas, .viewport video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; image-rendering: pixelated; display: none;
}
.viewport.is-live canvas, .viewport.is-replay video { display: block; }

.vp-overlay {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 14px; background: radial-gradient(ellipse at center, rgba(10,10,10,.55), rgba(10,10,10,.88));
  transition: opacity .25s;
}
.viewport.running .vp-overlay { opacity: 0; pointer-events: none; }

.play-btn {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 14px 26px; border: 0; border-radius: 999px;
  background: var(--series-1); color: #fff;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,.45); transition: transform .15s, background .15s;
}
.play-btn:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--series-1) 88%, #fff); }
.play-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.vp-hint { font-size: 13px; color: rgba(255,255,255,.62); max-width: 42ch; text-align: center; }

.vp-hud {
  position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap;
}
.hud-pill {
  font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums;
  padding: 4px 9px; border-radius: 5px;
  background: rgba(10,10,10,.72); color: rgba(255,255,255,.9);
  backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12);
}

.demo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.demo-status { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-secondary); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.dot[data-state="live"]    { background: var(--good-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good-text) 22%, transparent); }
.dot[data-state="replay"]  { background: var(--series-1); box-shadow: 0 0 0 3px var(--series-1-soft); }
.dot[data-state="offline"] { background: var(--fail); }
.demo-controls { display: flex; gap: 8px; }

.demo-side {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm);
}
.demo-side h3 { font-size: 15px; }
.side-sub { margin-top: 7px; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

.chain { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: c; }
.chain li {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--r-sm); font-size: 13.5px;
  color: var(--text-muted); transition: color .3s, background .3s;
}
.chain li .ci {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--baseline); font-size: 10px; font-weight: 700;
  color: var(--text-muted); transition: all .3s;
}
.chain li .cs { font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .3s; }
.chain li.hit { color: var(--text-primary); background: var(--series-1-soft); }
.chain li.hit .ci { border-color: var(--series-1); background: var(--series-1); color: #fff; }
.chain li.hit .cs { opacity: 1; color: var(--text-secondary); }
.chain li.current .ci { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--series-1-soft); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .chain li.current .ci { animation: none; } }

.chain-foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}
.chain-foot > div { display: grid; gap: 2px; }
.cf-v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cf-l { font-size: 11.5px; color: var(--text-muted); }

.note {
  margin-top: 24px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0 18px;
}
.note summary {
  cursor: pointer; padding: 15px 0; font-size: 14px; font-weight: 500; list-style: none;
  display: flex; align-items: center; gap: 9px;
}
.note summary::-webkit-details-marker { display: none; }
.note summary::before {
  content: ""; width: 6px; height: 6px; flex: none;
  border-right: 1.6px solid var(--text-muted); border-bottom: 1.6px solid var(--text-muted);
  transform: rotate(-45deg); transition: transform .2s;
}
.note[open] summary::before { transform: rotate(45deg); }
.note p { padding-bottom: 15px; font-size: 14px; color: var(--text-secondary); max-width: 78ch; }
.note p + p { border-top: 1px solid var(--border); padding-top: 15px; }

/* ============================================================ Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-sm);
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card-n { font-family: var(--mono); font-size: 11px; color: var(--series-1); font-weight: 600; letter-spacing: .06em; }
.card h3 { font-size: 16.5px; margin: 10px 0 9px; }
.card p { font-size: 14.5px; color: var(--text-secondary); }
.card strong { color: var(--text-primary); font-weight: 600; }

.gapfig { margin: 44px 0 0; }
.fig-head { margin-bottom: 20px; }
.fig-head h3 { font-size: 18px; }
.fig-head p { margin-top: 6px; font-size: 14px; color: var(--text-secondary); max-width: 70ch; }

/* ============================================================ Stages */
.stages {
  list-style: none; margin: 0; padding: 0; counter-reset: s;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
}
.stage {
  position: relative; min-width: 0;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 26px 28px; box-shadow: var(--shadow-sm);
}
.stage::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--series-1); opacity: .85;
}
.stage-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.stage-n {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--series-1);
}
.stage-head h3 { font-size: 19px; }
.stage-body { margin-top: 12px; min-width: 0; font-size: 15px; color: var(--text-secondary); max-width: 82ch; }
/* The equations must not wrap mid-formula, so the row scrolls on its own
   rather than widening the page. min-width:0 is what lets it shrink. */
.eq {
  margin-top: 16px; padding: 13px 16px; border-radius: var(--r-sm); min-width: 0;
  background: var(--plane-alt); border: 1px solid var(--border);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 18px;
}
.eq-body {
  font-family: var(--mono); font-size: 13.5px; color: var(--text-primary);
  white-space: nowrap; min-width: 0; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: thin;
}
.eq-note { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 700px) {
  .eq { grid-template-columns: minmax(0, 1fr); }
  .eq-note { grid-row: 2; }
}

.arch {
  margin-top: 40px; min-width: 0; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 28px;
}
.arch h3 { font-size: 17px; margin-bottom: 20px; }
.arch-flow {
  display: flex; align-items: stretch; gap: 10px; min-width: 0;
  overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin;
}
.node {
  flex: 1 0 auto; min-width: 132px; display: grid; gap: 4px; align-content: center;
  padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--plane-alt); border: 1px solid var(--border);
}
.node-t { font-size: 13.5px; font-weight: 600; }
.node-s { font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); }
.arrow {
  flex: none; align-self: center; width: 16px; height: 1.5px; background: var(--baseline); position: relative;
}
.arrow::after {
  content: ""; position: absolute; right: -1px; top: 50%; width: 5px; height: 5px;
  border-top: 1.5px solid var(--baseline); border-right: 1.5px solid var(--baseline);
  transform: translateY(-50%) rotate(45deg);
}
.arch-note { margin-top: 20px; font-size: 14px; color: var(--text-secondary); max-width: 82ch; }

/* ============================================================ Results */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 36px; }
.tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px; display: grid; gap: 4px; box-shadow: var(--shadow-sm);
}
.tile-l { font-size: 12.5px; color: var(--text-muted); }
.tile-v { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.tile-d { font-size: 12.5px; color: var(--text-secondary); }

.panel {
  margin: 0 0 20px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 26px; box-shadow: var(--shadow-sm);
}
.grid-2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px; margin-bottom: 20px; align-items: start;   /* no stretched dead space */
}
.grid-2 .panel { margin: 0; min-width: 0; }
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }

.callout {
  margin-top: 12px; padding: 24px 26px; border-radius: var(--r-md);
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 3px solid var(--fail);
}
.callout h3 { font-size: 16px; }
.callout p { margin-top: 9px; font-size: 14.5px; color: var(--text-secondary); max-width: 82ch; }

/* Chart bits shared by charts.js */
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend-swatch.hollow { background: transparent; border: 2px solid var(--fail); }

.chart-tip {
  position: fixed; z-index: 90; pointer-events: none; opacity: 0;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 9px 12px; box-shadow: var(--shadow-md);
  font-size: 12.5px; line-height: 1.45; max-width: 240px; transition: opacity .12s;
}
.chart-tip.on { opacity: 1; }
.chart-tip b { display: block; font-size: 13px; margin-bottom: 3px; }
.chart-tip .t-v { font-variant-numeric: tabular-nums; color: var(--text-secondary); }

.table-toggle {
  margin-top: 14px; background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--text-muted); text-decoration: underline;
  text-underline-offset: 3px;
}
.table-toggle:hover { color: var(--text-primary); }
table.data { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--gridline); }
table.data th { color: var(--text-muted); font-weight: 500; font-size: 12px; }
table.data td:last-child, table.data th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================ Gallery */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.shot {
  margin: 0; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.shot-img {
  aspect-ratio: 16/9; background: var(--plane-alt); display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.shot-img img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.shot-ph {
  display: grid; gap: 6px; justify-items: center; text-align: center; padding: 16px;
  font-size: 11.5px; color: var(--text-muted); font-family: var(--mono);
}
.shot-ph svg { opacity: .4; }
.shot figcaption { padding: 12px 14px; display: grid; gap: 3px; border-top: 1px solid var(--border); }
.shot-t { font-size: 13.5px; font-weight: 600; }
.shot-s { font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); }

.video-wrap { margin: 32px 0 0; }
.video-frame {
  position: relative; aspect-ratio: 16/9; border-radius: var(--r-lg); overflow: hidden;
  background: #0a0a0a; border: 1px solid var(--border); box-shadow: var(--shadow-md);
  display: grid; place-items: center;
}
.video-frame video { width: 100%; height: 100%; object-fit: contain; display: block; }
.video-frame.no-src video { display: none; }
.video-fallback { display: none; text-align: center; padding: 24px; color: rgba(255,255,255,.6); font-size: 13.5px; line-height: 1.7; }
.video-frame.no-src .video-fallback { display: block; }
.video-fallback strong { color: rgba(255,255,255,.88); }
.video-fallback code { background: rgba(255,255,255,.09); color: inherit; }
.video-wrap figcaption { margin-top: 12px; font-size: 13px; color: var(--text-muted); }

/* ============================================================ Team */
.team { list-style: none; margin: 0 0 32px; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.member {
  display: flex; align-items: center; gap: 13px; padding: 14px 22px 14px 14px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--series-1-soft); color: var(--series-1);
  font-size: 13px; font-weight: 700; letter-spacing: .02em; flex: none;
}
.m-meta { display: grid; gap: 1px; }
.m-name { font-size: 15px; font-weight: 600; }
.m-role { font-size: 12.5px; color: var(--text-muted); }

.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.link-card {
  display: grid; gap: 4px; padding: 20px; text-decoration: none;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color .2s, transform .2s;
}
.link-card:hover { border-color: var(--series-1); transform: translateY(-2px); }
.lc-t { font-size: 15px; font-weight: 600; }
.lc-s { font-size: 13px; color: var(--text-muted); font-family: var(--mono); }

/* ============================================================ Footer */
.footer { border-top: 1px solid var(--border); padding: 32px 0; background: var(--plane); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }

/* ============================================================ Responsive */
@media (max-width: 940px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .demo { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .hero { padding: 56px 0 48px; }
  .section { padding: 60px 0; }
  .wrap { padding-inline: 18px; }
  .stage { padding: 22px 20px; }
  .panel { padding: 20px 16px; }
}
