/* ═══════════════════════════════════════════════════════════════════════
 * Cross-AI Memory — site.css
 *
 * Design system: Neutral Modern (active project design system).
 * The :root colour block below is the brand's tokens.css contract,
 * pasted verbatim. No literal colour value appears outside it —
 * every surface, line and glow in this site is a color-mix() of the
 * brand palette (--bg / --surface / --fg / --accent / semantic).
 *
 * Surface strategy
 *   LIGHT canvas, following the reference composition: a near-white
 *   page with a large soft accent mist behind the hero, oversized
 *   centred display type, and one dark primary button. Depth comes
 *   from the mist and from type scale, NOT from stacked grey cards.
 *   The dark code surfaces are scoped components (.code, .console)
 *   so the dev-tool/technical register lives where the protocol is
 *   shown, while the page chrome stays bright and airy.
 *
 *   · --bg / --void  — page canvas
 *   · --mark-*       — hues lifted from the shipped icon set
 *                      (icons/icon512.png), used only for the logo-adjacent
 *                      glow so the mark and the page agree on colour
 *   · --mist         — wide blurred accent wash behind the hero
 *   · --accent       — the only signal colour; ≤2 lit moments/screen
 * ═══════════════════════════════════════════════════════════════════════ */

/* ═══ Neutral Modern — tokens.css, verbatim ═════════════════════════ */
:root {
  /* ─── Surface (3 levels — #Gap 2) ───────────────────────────────── */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-warm: var(--surface);

  /* ─── Foreground ramp (4 levels — #Gap 1) ─────────────────────── */
  --fg: #111111;
  --fg-2: var(--fg);
  --muted: #6b6b6b;
  --meta: var(--muted);

  /* ─── Border (2 levels — #Gap 3) ──────────────────────────────── */
  --border: #e5e5e5;
  --border-soft: var(--border);

  /* ─── Accent ────────────────────────────────────────────────────── */
  --accent: #2f6feb;
  --accent-on: #ffffff;

  /* ─── Accent states (#Gap 4) ──────────────────────────────────── */
  --accent-hover: color-mix(in oklab, var(--accent), black 8%);
  --accent-active: color-mix(in oklab, var(--accent), black 14%);

  /* ─── Semantic ──────────────────────────────────────────────────── */
  --success: #17a34a;
  --warn: #eab308;
  --danger: #dc2626;

  /* ─── Typography ────────────────────────────────────────────────── */
  --font-display: "Inter", -apple-system, system-ui, sans-serif;
  --font-body: "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 48px;
  --text-4xl: 64px;

  --leading-body: 1.5;
  --leading-tight: 1.2;
  --tracking-display: -0.01em;

  /* ─── Spacing ───────────────────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  --section-y-desktop: 80px;
  --section-y-tablet: 48px;
  --section-y-phone: 32px;

  /* ─── Radius ────────────────────────────────────────────────────── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* ─── Elevation (3 levels — #Gap 5) ───────────────────────────── */
  --elev-flat: none;
  --elev-ring: 0 0 0 1px var(--border);
  --elev-raised: 0 2px 8px color-mix(in oklab, var(--fg), transparent 92%);

  /* ─── Focus ring ────────────────────────────────────────────────── */
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 70%);

  /* ─── Motion ────────────────────────────────────────────────────── */
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* ─── Layout ────────────────────────────────────────────────────── */
  --container-max: 1200px;
  --container-gutter-desktop: 24px;
  --container-gutter-tablet: 16px;
  --container-gutter-phone: 12px;
}

/* ═══ Derived site surfaces ══════════════════════════════════════════
 * Every value below is a color-mix() of the palette above. Light
 * canvas; dark code surfaces are scoped, not global. */
:root {
  /* mist — the soft accent wash behind the hero. Wide, blurred, low
     opacity: it reads as atmosphere, not as a gradient background. */
  --mist-1: color-mix(in oklab, var(--accent) 22%, var(--bg));
  --mist-2: color-mix(in oklab, var(--accent) 13%, var(--bg));
  --mist-3: color-mix(in oklab, var(--accent) 6%,  var(--bg));

  /* dark code surfaces — scoped to .code / .console only */
  --code-bg:  color-mix(in oklab, var(--fg) 94%, var(--accent));
  --code-bg2: color-mix(in oklab, var(--fg) 88%, var(--accent));
  --code-line: color-mix(in oklab, var(--surface) 13%, var(--fg));
  --code-ink:  color-mix(in oklab, var(--surface) 92%, var(--fg));
  --code-ink2: color-mix(in oklab, var(--surface) 60%, var(--fg));
  --code-ink3: color-mix(in oklab, var(--surface) 34%, var(--fg));

  /* hairlines on light */
  --line:       var(--border);
  --line-soft:  color-mix(in oklab, var(--border) 62%, var(--bg));

  /* ink ramp */
  --ink:        var(--fg);
  --ink-2:      color-mix(in oklab, var(--fg) 78%, var(--bg));
  --ink-muted:  var(--muted);
  --ink-faint:  color-mix(in oklab, var(--muted) 72%, var(--bg));
  --ink-ghost:  color-mix(in oklab, var(--muted) 46%, var(--bg));

  /* accent behaviour on light */
  --accent-lit:  var(--accent);
  --accent-haze: color-mix(in oklab, var(--accent) 8%, transparent);
  --accent-edge: color-mix(in oklab, var(--accent) 30%, transparent);
  --panel:       var(--surface);
  --void:        var(--bg);

  /* semantic on light */
  --ok-lit:   color-mix(in oklab, var(--success) 88%, var(--fg));
  --warn-lit: color-mix(in oklab, var(--warn) 70%, var(--fg));

  /* type scale — fluid */
  --fs-display: clamp(34px, 6.6vw, 88px);
  --fs-h2: clamp(27px, 3.3vw, 44px);
  --fs-h3: clamp(18px, 1.55vw, 21px);
  --fs-lead: clamp(16.5px, 1.45vw, 21px);
  --fs-body: 16.5px;
  --fs-meta: 13.5px;
  --fs-code: 13.5px;

  /* label family — the mono micro-type used for eyebrows, chips,
     captions, table heads. One size + one tracking value so the whole
     page's small type shares a single rhythm instead of six. */
  --fs-label: 12.5px;
  --tracking-label: 0.1em;

  --container: 1200px;
  --prose: 68ch;
  --gutter: var(--container-gutter-desktop);
  --section-y: clamp(64px, 8vw, 112px);
  --topnav-h: 64px;
  --mono-grid: 44px;      /* the ambient grid pitch */
}

@media (max-width: 1023px) { :root { --gutter: var(--container-gutter-tablet); --section-y: clamp(52px, 8vw, 72px); } }
@media (max-width: 639px)  { :root { --gutter: var(--container-gutter-phone);  --section-y: 44px; --mono-grid: 32px; } }

/* ═══ Base ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
/* `overflow-x: clip` on `body` made body a scroll container, which
   broke `position: sticky` on the topnav — the bar stuck to the body's
   clip box instead of the viewport, so it scrolled away and read as
   "the bar disappears". The mist/grid are already clipped by `.hero`
   and by `body::before`, so this is not needed on body at all.
   Keeping it on `html` (the viewport root) is safe and still prevents
   any accidental horizontal scrollbar. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ═══ Ambient field ══════════════════════════════════════════════════
 * Two very quiet layers, fixed behind everything: an engineering grid
 * and a single accent bloom at the top of the document. Both are
 * pseudo-elements on <body>, so no markup carries decoration. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: var(--mono-grid) var(--mono-grid);
  opacity: 0.5;
  /* mask stops are alpha, not colour — #000 here is fully-opaque black
     used as an alpha channel; it never paints a pixel. */
  mask-image: radial-gradient(120% 78% at 50% 0%, #000 12%, transparent 74%);
  -webkit-mask-image: radial-gradient(120% 78% at 50% 0%, #000 12%, transparent 74%);
}
body::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  top: calc(var(--topnav-h) * -3); left: 50%; transform: translateX(-50%);
  width: min(1180px, 130vw); height: 620px;
  background: radial-gradient(58% 50% at 50% 50%, var(--accent-haze), transparent 72%);
}
@media (max-width: 639px) { body::after { height: 400px; } }

main, .topnav, .pagefoot { position: relative; z-index: 1; }

img, svg { display: block; max-width: 100%; }
a { color: var(--accent-lit); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
p { text-wrap: pretty; margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
::selection { background: var(--accent-edge); color: var(--ink); }

/* ═══ Layout ════════════════════════════════════════════════════════ */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
main > .section + .section { border-top: 1px solid var(--line-soft); }
.section--sunk { background: color-mix(in oklab, var(--accent) 4%, var(--bg)); }

.skip-link {
  position: absolute; left: var(--gutter); top: -70px; z-index: 100;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: var(--text-sm); color: var(--ink);
  transition: top var(--motion-fast) var(--ease-standard);
}
.skip-link:focus { top: 8px; }

/* ═══ Type ══════════════════════════════════════════════════════════ */
.display, h1.display {
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-display);
  line-height: 1.04; letter-spacing: -0.036em; color: var(--ink);
}
h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h2); line-height: 1.22; letter-spacing: -0.026em; color: var(--ink); }
h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); line-height: 1.28; letter-spacing: -0.017em; color: var(--ink); }
h4 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); line-height: 1.4; letter-spacing: -0.012em; color: var(--ink); }

.lead { font-size: var(--fs-lead); line-height: 1.62; letter-spacing: -0.011em; color: var(--ink-2); max-width: var(--prose); }
.prose p.lead, .prose .lead { max-width: var(--prose); }
.prose p { max-width: var(--prose); color: var(--ink-2); }
.prose p + p { margin-top: var(--space-4); }
.prose h2 { margin-top: var(--space-12); }
.prose h3 { margin-top: var(--space-8); }
.prose strong { color: var(--ink); }

/* Eyebrow — the section label. Deliberately *not* uppercase: Chinese
   has no case, so `text-transform` only ever affected the latin tail,
   which made these read as broken. Sentence-ish weight, tight
   tracking, one hairline rule instead of a dot-in-a-halo. */
.eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.04em; color: var(--ink-muted); margin: 0; font-weight: 500;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 1px; flex: none;
  background: var(--accent-edge);
  box-shadow: none;
}
.eyebrow--lit { color: var(--accent-lit); }
.eyebrow--lit::before { background: var(--accent); }
.eyebrow--bare::before { display: none; }

.meta { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--ink-muted); font-variant-numeric: tabular-nums; letter-spacing: -0.004em; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }
.sm { font-size: var(--text-sm); line-height: 1.62; color: var(--ink-2); }
.sm + .sm { margin-top: var(--space-2); }
.hl { color: var(--ink); font-weight: 500; }

/* ═══ Chrome: topnav ════════════════════════════════════════════════
 * One continuous contraction, no morph. The bar is always the same
 * object — a floating capsule — and scrolling only narrows its width,
 * shrinks its height, and lets it settle onto a real edge. Nothing
 * changes shape, nothing changes its own stacking order, nothing
 * fades in from nowhere.
 *
 * Implementation notes that matter (both were bugs in the last pass):
 *   · `.topnav-inner` establishes its own stacking context
 *     (`position: relative; z-index: 1`) so no sibling pseudo-element
 *     can ever paint over the bar itself.
 *   · The scrim behind the bar is its own absolutely-positioned layer
 *     BELOW the pill in z-order, not a `z-index: -1` pseudo-element on
 *     a `position: sticky` parent — that escaped the parent's stacking
 *     context and washed the bar out to pure white on scroll.
 *   · The contraction is driven by one custom property `--nav-t`
 *     (0 → 1) so every dimension animates off a single clock and the
 *     bar can never animate out of sync with itself. */
.topnav {
  position: sticky; top: 0; z-index: 40;
  padding-block: calc(var(--space-3) - var(--nav-t, 0) * var(--space-1));
  background: transparent;
}
.topnav::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--nav-t, 0);
  /* A soft top-down fade, not a flat panel — a hard-edged white band
     above the pill read as a seam against the tinted page below. */
  background: linear-gradient(to bottom,
              color-mix(in oklab, var(--void) 96%, transparent) 0%,
              color-mix(in oklab, var(--void) 78%, transparent) 62%,
              transparent 100%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.topnav-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: var(--space-6);
  margin-inline: auto;
  /* width contracts 1200 → 1040, minus gutters */
  width: min(calc(100% - var(--gutter) * 2),
             calc(var(--container) - var(--nav-t, 0) * 160px));
  height: calc(var(--topnav-h) - var(--nav-t, 0) * 8px);
  padding-inline: calc(var(--space-5) + var(--nav-t, 0) * var(--space-3));
  border-radius: var(--radius-pill);
  /* Edge is the load-bearing part: the page is #fafafa and so is the
     pill, so without a real border the bar is white-on-white and reads
     as "disappeared" the moment it leaves the hero's mist. Border ramps
     in with the contraction so the bar becomes a defined object. */
  border: 1px solid color-mix(in oklab, var(--fg) calc(4% + var(--nav-t, 0) * 8%), transparent);
  background: color-mix(in oklab, var(--bg) 76%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow:
    0 1px 2px color-mix(in oklab, var(--fg) calc(var(--nav-t, 0) * 6%), transparent),
    0 calc(var(--nav-t, 0) * 14px) calc(var(--nav-t, 0) * 34px) color-mix(in oklab, var(--fg) calc(var(--nav-t, 0) * 8%), transparent);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
/* the shipped icon (icons/icon48.png). 48px is the source because it is the
 * smallest size where icons/generate.py keeps the circuit traces — 16 and 32px
 * crop to the M only. Rendered slightly above its native 24px so the traces
 * survive at nav size; the mark is the whole point of the asset. */
.brand-mark { width: 26px; height: 26px; flex: none; display: block; object-fit: contain; transition: transform var(--motion-base) var(--ease-standard); transform: scale(calc(1 - var(--nav-t, 0) * 0.08)); }
.pagefoot .brand-mark { width: 30px; height: 30px; }
/* the icon inside the hero badge sits on the dark #111 pill, so it needs the
 * light-friendly crop (16px = M only) and a size matched to the 11px mono line */
.hero-badge-mark { width: 15px; height: 15px; display: block; flex: none; object-fit: contain; }
.brand-text { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.018em; }
.brand-text em { font-style: normal; color: var(--ink-muted); font-weight: 500; }

.topnav nav { display: flex; gap: var(--space-6); margin-left: var(--space-4); }
.topnav nav a { font-size: var(--text-sm); color: var(--ink-muted); text-decoration: none; padding: 6px 0; transition: color var(--motion-fast) var(--ease-standard); }
.topnav nav a:hover { color: var(--ink); }
.topnav nav a[aria-current="page"] { color: var(--ink); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }
.topnav-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
/* the nav CTA is the pill shape from the reference, not a bordered box */
.topnav-actions .btn-sm {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
  border-radius: var(--radius-pill); padding-inline: 18px;
}
.topnav-actions .btn-sm:hover { background: color-mix(in oklab, var(--fg) 86%, var(--bg)); border-color: color-mix(in oklab, var(--fg) 86%, var(--bg)); }

.nav-toggle {
  display: none; margin-left: auto; width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink);
}
@media (max-width: 860px) {
  .topnav-inner { padding-inline: var(--space-4); width: calc(100% - var(--gutter) * 2); }
  .topnav nav { display: none; }
  /* Open menu anchors to the pill's inner box, not the viewport edge. */
  .topnav nav.is-open {
    display: flex; flex-direction: column; gap: 0; margin: 0;
    position: absolute; left: 0; right: 0; top: calc(100% + var(--space-2));
    background: color-mix(in oklab, var(--bg) 99%, transparent);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-4) var(--space-3);
    box-shadow: 0 1px 2px color-mix(in oklab, var(--fg) 5%, transparent),
                0 16px 40px color-mix(in oklab, var(--fg) 9%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  .topnav-inner { position: relative; }
  .topnav nav.is-open a { padding: 13px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--text-base); color: var(--ink); }
  .topnav nav.is-open a:last-child { border-bottom: 0; }
  .topnav nav.is-open a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent); padding-left: 12px; }
  /* While open, the pill squares off so it reads as one surface with
     the panel hanging from it. */
  .topnav:has(nav.is-open) .topnav-inner { border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-sm); }
  .topnav-actions .btn { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ═══ Buttons ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 20px; min-height: 44px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; letter-spacing: -0.008em;
  text-decoration: none; white-space: nowrap; position: relative;
  transition: background var(--motion-fast) var(--ease-standard),
              border-color var(--motion-fast) var(--ease-standard),
              color var(--motion-fast) var(--ease-standard),
              box-shadow var(--motion-base) var(--ease-standard),
              transform var(--motion-fast) var(--ease-standard);
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--fg) 18%, transparent),
              0 8px 24px color-mix(in oklab, var(--fg) 14%, transparent);
}
.btn-primary:hover {
  background: color-mix(in oklab, var(--fg) 88%, var(--bg)); border-color: color-mix(in oklab, var(--fg) 88%, var(--bg));
  box-shadow: 0 2px 4px color-mix(in oklab, var(--fg) 20%, transparent), 0 12px 32px color-mix(in oklab, var(--fg) 18%, transparent);
}
.btn-primary:active { background: color-mix(in oklab, var(--fg) 94%, var(--bg)); }
.btn-secondary { background: color-mix(in oklab, var(--surface) 5%, transparent); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-faint); background: color-mix(in oklab, var(--surface) 8%, transparent); }
/* outlined button — white fill, hairline edge, lift on hover */
.btn-outline {
  background: var(--surface); color: var(--ink); border-color: var(--line);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--fg) 7%, transparent);
}
.btn-outline:hover {
  border-color: var(--ink-ghost); background: var(--surface);
  box-shadow: 0 2px 4px color-mix(in oklab, var(--fg) 9%, transparent), 0 10px 26px color-mix(in oklab, var(--fg) 9%, transparent);
  transform: translateY(-1px);
}
.btn-outline svg { color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; padding-inline: 10px; }
.btn-ghost:hover { color: var(--accent-lit); }
.btn-lg { padding: 15px 28px; font-size: var(--text-base); min-height: 52px; letter-spacing: -0.012em; }
.btn-sm { padding: 8px 15px; min-height: 38px; font-size: var(--fs-label); letter-spacing: 0.01em; }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn .arrow { transition: transform var(--motion-fast) var(--ease-standard); }
.btn:hover .arrow { transform: translateX(2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ═══ Panels & cards ════════════════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius-md); padding: var(--space-5);
  transition: border-color var(--motion-base) var(--ease-standard),
              box-shadow var(--motion-base) var(--ease-standard),
              transform var(--motion-base) var(--ease-standard);
}.card--lg { padding: var(--space-6); }
.card--quiet { background: transparent; border-color: transparent; padding: 0; }
.card--accent { border-color: var(--accent-edge); }
.card-hover:hover { border-color: var(--line); background: var(--surface); box-shadow: 0 2px 4px color-mix(in oklab, var(--fg) 6%, transparent), 0 12px 30px color-mix(in oklab, var(--fg) 7%, transparent); transform: translateY(-2px); }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { text-decoration: none; }

/* corner tick — a 1px L in the panel corner, the only ornament
   allowed on a panel. Pure CSS, no markup. */
.card--tick { position: relative; }
.card--tick::before {
  content: ""; position: absolute; left: -1px; top: -1px; width: 12px; height: 12px;
  border-top: 1px solid var(--accent-edge); border-left: 1px solid var(--accent-edge);
  border-top-left-radius: var(--radius-md);
}

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: 216px minmax(0, 1fr); gap: var(--space-12); align-items: start; }
.grid--gap-lg { gap: var(--space-8); }

/* ─── Split: editorial heading column ──────────────────────────────
   Distinct from .grid--sidebar. That one is a fixed 216px nav rail,
   correct for docs where labels are 2-4 characters. It is WRONG for
   an editorial h2: at --fs-h2 a CJK glyph is ~38px wide, so 216px
   fits 5 glyphs and a 19-character headline shatters into 5 ragged
   lines with a one-glyph orphan.

   Here the label column is content-sized with a floor, so short
   labels (问题 / 安装) sit in a narrow rail while long headlines push
   the column wider and keep a usable 8-12 glyph measure. */
/* Editorial split: a section label rail + a wide prose column.
 *
 * HISTORY — this rail was `13ch`, which is a trap. `ch` resolves
 * against the *element's own* font, and the rail is a plain <div>
 * inheriting 16px body text where 1ch ≈ 8px. So `13ch` computed to
 * ~104px, not the ~390px the number implied, and a 40px CJK headline
 * in a 104px column stacked one glyph per line. `ch` is a latin
 * average-glyph unit; it must never size a CJK measure. The rail is
 * therefore sized in real units, and the headline gets a separate,
 * narrower track for itself below. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: var(--space-16);
  align-items: start;
}
.split > :first-child { min-width: 0; }
.split h2 { text-wrap: balance; letter-spacing: -0.028em; max-width: 15em; }
/* A CJK headline breaks better on phrase boundaries than on a hard
   punctuation wrap; `balance` alone will still orphan 己。 at narrow
   measures, so headings here get a slightly tighter leading. */
.split h2 + .sm, .split h2 + p { margin-top: var(--space-5); }

@media (max-width: 1023px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .split > :first-child { max-width: none; }
}
.stack > * + * { margin-top: var(--space-4); }
.stack-6 > * + * { margin-top: var(--space-6); }
.stack-8 > * + * { margin-top: var(--space-8); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: var(--space-3); }

@media (max-width: 1023px) {
  /* Every collapsed track uses `minmax(0, 1fr)`, never a bare `1fr`.
     `1fr` is `minmax(auto, 1fr)`, so the track's floor is the widest
     descendant's min-content width — on docs.html that pinned the
     column at 562px and forced the whole page to 574px wide inside a
     390px viewport. `minmax(0, …)` removes the intrinsic floor so the
     column can actually shrink. */
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ─── Section intro: heading + lead above a wide figure ────────────
   Replaces an inline `max-width: 52ch` inside a flex row. That failed
   because 52ch measured against a 40px CJK glyph is several hundred
   pixels wider than the column the flex algorithm actually granted,
   so the h2 was shrunk to an arbitrary middle width and broke
   mid-phrase. A block with an explicit measure and `balance` gives
   the line-breaker a stable target. */
.section-intro > div { max-width: 46ch; }
.section-intro h2 { text-wrap: balance; max-width: 22ch; }
.section-intro .lead { max-width: 44ch; }
@media (max-width: 860px) {
  .section-intro > div, .section-intro h2, .section-intro .lead { max-width: none; }
}

/* ─── Section head: an eyebrow + h2 block standing alone ──────────
 * Replaces two inline `max-width: 56ch` / `52ch` wrappers on plain
 * <div>s. Those tokens were evaluated against 16px body text
 * (1ch ≈ 8.4px, so ~416–470px) while the element they wrapped is a
 * 40px CJK headline needing ~680px for its 17 glyphs — so the h2
 * broke into ragged mid-phrase lines. `ch` is a latin average-glyph
 * unit and must never be the measure for CJK display type; this
 * block sets an em-based cap on the heading itself, where `em`
 * tracks the glyph size it is actually constraining. */
.section-head { max-width: 46rem; }
.section-head h2 { max-width: 15em; text-wrap: balance; }
.section-head .lead { max-width: 34em; }
@media (max-width: 860px) {
  .section-head, .section-head h2, .section-head .lead { max-width: none; }
}

/* ─── Name pronunciation panel ────────────────────────────────────
 * The name is a portmanteau, so it reads ambiguously — "memory-sack"
 * and "memo-say-ik" are both plausible to a first-time reader. This
 * panel answers that once, in both languages, before the visitor
 * meets the name in prose. Mono for the phonetic breakdown (it is
 * notation, not prose), display face for the word itself. */
.name-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}
.name-panel-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--surface) 60%, var(--bg));
}
.name-panel-body { padding: var(--space-6); }

.name-word {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-3) var(--space-4);
  margin: 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(28px, 4.2vw, 44px); line-height: 1.15; letter-spacing: -0.038em;
  color: var(--fg);
}
.name-ipa {
  font-family: var(--font-mono); font-size: clamp(14px, 1.6vw, 19px);
  font-weight: 500; letter-spacing: 0.01em; color: var(--ink-muted);
}

.name-say {
  margin: var(--space-4) 0 0;
  max-width: 40em;
  font-size: var(--fs-body); line-height: 1.7; color: var(--ink-muted);
}
.name-say strong, .name-note strong { color: var(--fg); font-weight: 600; }
.name-say em { font-style: normal; color: var(--accent); font-weight: 600; }

.name-breakdown {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; margin-top: var(--space-6);
  border: 1px solid var(--line-soft); border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--line-soft);
}
.name-part {
  display: flex; flex-direction: column; gap: 6px;
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
}
.name-part-k {
  font-family: var(--font-mono); font-size: 16px; font-weight: 600;
  letter-spacing: 0.01em; color: var(--fg);
}
.name-part-v {
  font-size: var(--fs-meta); line-height: 1.5; color: var(--ink-muted);
}
/* the stressed syllable carries the one accent mark in this block */
.name-part--lit { background: color-mix(in oklab, var(--accent) 5%, var(--surface)); }
.name-part--lit .name-part-k { color: var(--accent); }
.name-part--lit .name-part-k::after {
  content: "ˈ"; font-size: 0.72em; vertical-align: 0.18em; opacity: 0.62;
}

.name-note {
  margin: var(--space-6) 0 0; padding-top: var(--space-5);
  border-top: 1px solid var(--line-soft);
  max-width: 44em;
  font-size: var(--fs-meta); line-height: 1.75; color: var(--ink-muted);
}
.name-note .inline-code { font-size: 0.94em; }

@media (max-width: 639px) {
  .name-panel-body { padding: var(--space-5); }
  .name-panel-head { padding: var(--space-4) var(--space-5); }
  .name-breakdown { grid-template-columns: minmax(0, 1fr); }
  .name-part { flex-direction: row; align-items: baseline; gap: var(--space-3); }
}

/* ═══ Pills / tags / badges ═════════════════════════════════════════ */
/* ─── Chip family ──────────────────────────────────────────────────
 * Previously every chip was 11px mono uppercase with 0.06–0.09em
 * tracking — six near-identical sizes, all shouting at one volume.
 * Now: one size, sentence case (uppercase is meaningless for CJK and
 * only mangles the latin), tabular figures, and colour doing the
 * semantic work instead of capitalisation. */
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px;
  border-radius: var(--radius-pill); background: var(--accent-haze); color: var(--accent-lit);
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.01em;
  font-weight: 500; white-space: nowrap; line-height: 1.35;
  border: 1px solid var(--accent-edge);
}
.pill--quiet { background: color-mix(in oklab, var(--fg) 4%, var(--surface)); color: var(--ink-2); border-color: var(--line-soft); }
.pill--outline { background: transparent; border: 1px solid var(--line); color: var(--ink-muted); }
.tag {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px;
  border: 1px solid color-mix(in oklab, var(--success) 26%, transparent);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.01em;
  color: var(--ok-lit); background: color-mix(in oklab, var(--success) 7%, var(--surface));
  line-height: 1.35;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot--live { box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 18%, transparent); }
.badge-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: var(--fs-label); padding: 4px 11px; line-height: 1.35;
  border-radius: var(--radius-pill); border: 1px solid var(--line-soft);
  background: var(--surface); color: var(--ink-muted);
}
.badge-status--new { color: var(--accent-lit); border-color: var(--accent-edge); background: var(--accent-haze); }
.badge-status--fix { color: var(--ok-lit); border-color: color-mix(in oklab, var(--success) 34%, transparent); background: color-mix(in oklab, var(--success) 10%, transparent); }
.badge-status--chg { color: var(--ink); }

/* ═══ Code surfaces ═════════════════════════════════════════════════
 * SCOPE: deliberate dark island on the light page. This is where the
 * dev-tool / technical register lives, and it is the only place in the
 * design that inverts. Values come from --code-* (color-mix of the
 * palette), never from raw hex. */
.code {
  background: var(--code-bg); color: var(--code-ink);
  border: 1px solid var(--code-line); border-radius: var(--radius-md);
  overflow: hidden; font-family: var(--font-mono);
  font-size: var(--fs-code); line-height: 1.7;
  box-shadow: 0 2px 4px color-mix(in oklab, var(--fg) 8%, transparent),
              0 18px 48px color-mix(in oklab, var(--fg) 14%, transparent);
}
.code-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 11px var(--space-5); border-bottom: 1px solid var(--code-line);
  background: var(--code-bg2); color: var(--code-ink3);
  font-size: var(--fs-label); letter-spacing: 0.05em;
}
.code-head .dots { display: flex; gap: 5px; }
.code-head .dots i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in oklab, var(--surface) 22%, var(--fg)); }
.code-head .dots i:first-child { background: color-mix(in oklab, var(--accent) 62%, var(--surface)); }
.code pre { margin: 0; padding: var(--space-5); overflow-x: auto; }
.code code { font-family: inherit; white-space: pre; letter-spacing: -0.004em; }
.code .k { color: color-mix(in oklab, var(--accent) 58%, var(--surface)); }
.code .s { color: var(--ok-lit); }
.code .c { color: var(--code-ink3); font-style: italic; }
.code .n { color: var(--warn-lit); }
.code .fn { color: var(--code-ink); }
.code .p { color: var(--code-ink2); }

.inline-code {
  font-family: var(--font-mono); font-size: 0.86em; padding: 3px 7px;
  border-radius: 6px; background: color-mix(in oklab, var(--fg) 5%, var(--surface));
  color: var(--ink); border: 1px solid var(--line-soft); white-space: nowrap;
  letter-spacing: -0.008em;
}

/* ═══ Tables ════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--panel); }
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 560px; }
.ds-table th, .ds-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-2); }
.ds-table th {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.06em;
  color: var(--ink-muted); font-weight: 500; border-bottom-color: var(--line);
  background: color-mix(in oklab, var(--fg) 2.5%, transparent);
  padding-block: 15px;
}
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table .num-col { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--ink); }
.ds-table tbody tr { transition: background var(--motion-fast) var(--ease-standard); }
.ds-table tbody tr:hover { background: color-mix(in oklab, var(--accent) 5%, transparent); }

/* ═══ Forms ═════════════════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: var(--text-sm); color: var(--ink); font-weight: 500; letter-spacing: -0.008em; }
.field .hint { font-size: var(--fs-label); font-family: var(--font-mono); color: var(--ink-faint); }
.input, .textarea, select.input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: var(--text-sm);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color var(--motion-fast) var(--ease-standard),
              box-shadow var(--motion-fast) var(--ease-standard),
              background var(--motion-fast) var(--ease-standard);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:hover, .textarea:hover { border-color: var(--ink-ghost); }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
  background: var(--surface);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.7; font-family: var(--font-mono); font-size: var(--fs-code); }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.search-wrap .input { padding-left: 40px; }

/* ═══ Callout ═══════════════════════════════════════════════════════ */
.callout {
  display: flex; gap: var(--space-3); padding: var(--space-5);
  border: 1px solid var(--line-soft); border-left: 2px solid var(--ink-ghost);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--panel); font-size: var(--text-sm); line-height: 1.62; color: var(--ink-2);
}
.callout--note { border-left-color: var(--accent); }
.callout--warn { border-left-color: var(--warn); }
.callout svg { flex: none; margin-top: 3px; color: var(--ink-muted); }
.callout--note svg { color: var(--accent-lit); }
.callout--warn svg { color: var(--warn-lit); }
.callout strong { font-weight: 600; color: var(--ink); }

/* ═══ Sidebar nav (docs) ════════════════════════════════════════════ */
.sidenav { position: sticky; top: calc(var(--topnav-h) + var(--space-6)); }
.sidenav-group + .sidenav-group { margin-top: var(--space-6); }
.sidenav-group h4 {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.06em;
  color: var(--ink-faint); font-weight: 500; margin-bottom: var(--space-3);
}
.sidenav-group a {
  display: block; padding: 7px 12px; margin-left: -12px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--ink-muted); text-decoration: none;
  border-left: 2px solid transparent;
  transition: color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}
.sidenav-group a:hover { color: var(--ink); background: color-mix(in oklab, var(--fg) 4%, transparent); text-decoration: none; }
.sidenav-group a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
/* pronunciation note pinned at the top of the docs nav — the name is a
   portmanteau, so anyone scanning the sidebar gets the reading for free */
.sidenav-note {
  margin: 0; padding: 10px 12px; margin-left: -12px;
  border-left: 2px solid var(--accent);
  font-size: var(--fs-meta); line-height: 1.7; color: var(--ink-muted);
}
.sidenav-note strong { color: var(--ink); font-weight: 600; }
.sidenav-note .inline-code { display: inline-block; margin-block: 2px; font-size: 0.88em; white-space: nowrap; letter-spacing: 0.005em; }

.legend {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start;
}
@media (max-width: 1023px) {
  .sidenav {
    position: static; display: flex; flex-wrap: wrap; gap: var(--space-2);
    /* `display: contents` on the groups promotes all 13 nav chips to
       direct flex items. Without `flex-wrap: wrap` they laid out on a
       single 1282px line and forced the whole docs page to 574px wide
       in a 390px viewport. Wrapping is the actual fix; the horizontal
       scroll below is only a fallback for very long labels. */
    max-width: 100%;
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--line-soft);
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .sidenav-group { display: contents; }
  .sidenav-group + .sidenav-group { margin-top: 0; }
  .sidenav-group h4 { display: none; }
  .sidenav-group a {
    display: inline-flex; margin-left: 0; white-space: nowrap;
    border: 1px solid var(--line); border-radius: var(--radius-pill);
    padding: 6px 14px; background: color-mix(in oklab, var(--fg) 5%, transparent); color: var(--ink-2);
    max-width: 100%;
  }
  .sidenav-group a.is-active { border-color: var(--accent-edge); color: var(--accent-lit); background: var(--accent-haze); }
  .sidenav-group .legend { display: none; }
}

/* ═══ Changelog ═════════════════════════════════════════════════════ */
.log-row {
  display: grid; grid-template-columns: 104px minmax(0, 1fr) 92px;
  gap: var(--space-6); padding: var(--space-5) 0; border-top: 1px solid var(--line-soft);
  align-items: baseline;
}
.log-row:last-child { border-bottom: 1px solid var(--line-soft); }
.log-row .pull { text-align: right; }
.log-row .ver { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--ink); }
@media (max-width: 700px) {
  .log-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .log-row .pull { text-align: left; }
}
.release { border-top: 1px solid var(--line); padding-top: var(--space-8); }
.release + .release { margin-top: var(--space-12); }
.release-head { display: flex; align-items: baseline; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.release-ver { font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.change-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.change-list li { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: var(--space-4); align-items: start; font-size: var(--text-sm); color: var(--ink-2); }
@media (max-width: 600px) { .change-list li { grid-template-columns: 1fr; gap: 4px; } }

/* ═══ Install — instrument panel ═══════════════════════════════════
 * The install steps are the only place on the page where the visitor
 * has to *do* something, so they get real structure: a contained
 * panel, hairline-separated rows, mono step numerals aligned to a
 * fixed rail, and the shell command in a copyable chip. Previously
 * this was a bare <ol> floating in the right column — which is what
 * read as an unfinished form. */
.panel {
  border: 1px solid var(--line-soft); border-radius: var(--radius-md);
  background: var(--surface); overflow: hidden;
  box-shadow: 0 1px 2px color-mix(in oklab, var(--fg) 4%, transparent),
              0 12px 32px color-mix(in oklab, var(--fg) 5%, transparent);
}
.panel-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 12px var(--space-5);
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--fg) 2.5%, var(--surface));
}
.panel-head .id {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.06em; color: var(--ink-muted);
}

.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: flex; flex-direction: column;
}
.steps > li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: var(--space-4); align-items: start; counter-increment: step;
  padding: var(--space-5);
  transition: background var(--motion-fast) var(--ease-standard);
}
.steps > li + li { border-top: 1px solid var(--line-soft); }
.steps > li:hover { background: color-mix(in oklab, var(--accent) 3%, transparent); }
/* the numeral rail — fixed width so every step's text aligns */
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--fg) 2%, var(--surface));
  transition: color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}
.steps > li:hover::before { color: var(--accent-lit); border-color: var(--accent-edge); }
.steps h4 { margin-bottom: 5px; }
.steps p { font-size: var(--text-sm); line-height: 1.6; color: var(--ink-muted); }
.steps .step-note {
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--ink-faint);
  align-self: center; white-space: nowrap;
}
@media (max-width: 700px) {
  .steps > li { grid-template-columns: 34px minmax(0, 1fr); padding: var(--space-4); }
  .steps > li::before { width: 34px; height: 34px; }
  .steps .step-note { display: none; }
}

/* ═══ Protocol console ══════════════════════════════════════════════
 * The one decisive flourish: a live-looking transcript of the tool
 * protocol, in a dark terminal island on the light page. Rows arrive
 * on a stagger, the verdict line lights up, a state chip tracks
 * read → validate → commit. It loops. It stops on
 * prefers-reduced-motion (rows render complete, nothing blinks). */
.console {
  background: var(--code-bg);
  border: 1px solid var(--code-line); border-radius: var(--radius-md);
  overflow: hidden; font-family: var(--font-mono); font-size: var(--fs-code);
  color: var(--code-ink);
  box-shadow: 0 2px 4px color-mix(in oklab, var(--fg) 8%, transparent),
              0 22px 60px color-mix(in oklab, var(--fg) 16%, transparent);
}
.console-bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--code-line);
  background: var(--code-bg2);
}
.console-bar .id { color: var(--code-ink3); font-size: var(--fs-label); letter-spacing: 0.05em; }
.console-bar .dots { display: flex; gap: 5px; margin-left: auto; }
.console-bar .dots i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in oklab, var(--surface) 22%, var(--fg)); }
.console-bar .dots i:first-child { background: color-mix(in oklab, var(--accent) 62%, var(--surface)); }

.console-body { padding: var(--space-4) 0; min-height: 268px; }
.console-line {
  display: grid; grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-3); padding: 5px var(--space-5);
  opacity: 0; transform: translateY(5px);
}
.console-line .ln { color: color-mix(in oklab, var(--surface) 22%, var(--fg)); font-size: var(--fs-label); text-align: right; padding-top: 2px; user-select: none; font-variant-numeric: tabular-nums; }
.console-line .tx { color: var(--code-ink2); word-break: break-word; }
.console-line .tx .k { color: color-mix(in oklab, var(--accent) 58%, var(--surface)); }
.console-line .tx .s { color: var(--ok-lit); }
.console-line .tx .n { color: var(--warn-lit); }
.console-line .tx .c { color: var(--code-ink3); }
.is-running .console-line { animation: cam-line 280ms var(--ease-standard) forwards; animation-delay: calc(var(--i, 0) * 170ms); }
.console-line--dim .tx { color: var(--code-ink3); }
.console-line--verdict {
  margin-top: 6px; border-top: 1px solid var(--line-soft); padding-top: 12px;
}
.console-line--verdict .tx { color: var(--ok-lit); }
@keyframes cam-line { to { opacity: 1; transform: none; } }
/* fail-open: if JS never adds .is-running, show everything */
.console:not(.is-running) .console-line { opacity: 1; transform: none; }

.console-foot {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: 12px var(--space-5); border-top: 1px solid var(--code-line);
  font-size: var(--fs-label); color: var(--code-ink3);
}
.state-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--code-line); background: transparent;
  font-size: var(--fs-label); letter-spacing: 0.02em; color: var(--code-ink3);
  transition: color var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard), background var(--motion-base) var(--ease-standard);
}
.state-chip .dot { background: currentColor; opacity: 0.5; transition: opacity var(--motion-base) var(--ease-standard); }
.state-chip[data-state="read"]  { color: color-mix(in oklab, var(--accent) 62%, var(--surface)); border-color: color-mix(in oklab, var(--accent) 52%, transparent); background: color-mix(in oklab, var(--accent) 16%, transparent); }
.state-chip[data-state="read"] .dot { opacity: 1; }
.state-chip[data-state="valid"] { color: var(--warn-lit); border-color: color-mix(in oklab, var(--warn) 46%, transparent); background: color-mix(in oklab, var(--warn) 14%, transparent); }
.state-chip[data-state="valid"] .dot { opacity: 1; }
.state-chip[data-state="commit"] { color: var(--ok-lit); border-color: color-mix(in oklab, var(--success) 46%, transparent); background: color-mix(in oklab, var(--success) 14%, transparent); }
.state-chip[data-state="commit"] .dot { opacity: 1; box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 20%, transparent); }

/* ═══ Hero — centred mist composition ═══════════════════════════════
 * Composition follows the reference: one small dark pill, oversized
 * centred display type with a single accent break, a muted subhead,
 * one dark primary + one outlined secondary, then a faded provider
 * strip. The mist is the only ornament — three overlapping blurred
 * radial washes in the accent hue, clipped to the section. */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: clamp(56px, 8vw, 112px);
  padding-bottom: clamp(40px, 5vw, 64px);
  overflow: hidden;
}
.hero-mist {
  position: absolute; inset: -30% -20% auto; height: 130%; z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 44% at 22% 30%, var(--mist-1), transparent 66%),
    radial-gradient(34% 40% at 78% 24%, var(--mist-2), transparent 68%),
    radial-gradient(48% 46% at 50% 58%, var(--mist-3), transparent 72%);
  filter: blur(46px);
  opacity: 0.7;
}
@media (max-width: 639px) { .hero-mist { filter: blur(30px); opacity: 0.58; } }

.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 14px; border-radius: var(--radius-pill);
  background: var(--fg); color: color-mix(in oklab, var(--bg) 92%, var(--fg));
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.035em;
  font-weight: 500; line-height: 1.3;
  box-shadow: 0 5px 18px color-mix(in oklab, var(--fg) 20%, transparent);
}
.hero-badge svg { opacity: 0.7; }
/* the logo is deep navy→violet, so on the dark pill it needs lifting rather
 * than the dimming an inherited monochrome icon would get */
.hero-badge-mark { filter: brightness(1.55) saturate(1.15); }

.hero-title {
  margin: var(--space-8) 0 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-display); line-height: 1.06; letter-spacing: -0.045em;
  color: var(--fg); max-width: 20ch; text-wrap: balance;
}
/* the single accent break in the headline — the one lit type on screen */
.hero-accent {
  color: var(--accent);
  /* a very shallow underline in the accent's own hue — reads as an
     annotation mark rather than decoration */
  background-image: linear-gradient(to top, var(--accent-haze) 0.18em, transparent 0.18em);
  background-repeat: no-repeat;
}

.hero-sub {
  margin: var(--space-6) 0 0; max-width: 54ch;
  font-size: var(--fs-lead); line-height: 1.6; letter-spacing: -0.012em; color: var(--muted);
}

.hero-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  justify-content: center; margin-top: var(--space-8);
}

.hero-fineprint {
  margin: var(--space-5) 0 0;
  font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--ink-faint);
  letter-spacing: -0.004em;
}

/* faded provider strip — anchors the hero, reads as quiet fact */
.hero-providers {
  margin-top: clamp(48px, 6vw, 84px);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6);
}
.hero-providers-label {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.05em;
  color: var(--ink-faint); flex: none;
}
.hero-providers-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: clamp(20px, 4vw, 56px); flex: 1 1 auto;
}
.plogo {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  letter-spacing: -0.014em; color: var(--ink-ghost);
  transition: color var(--motion-base) var(--ease-standard);
}
.plogo svg { width: 19px; height: 19px; flex: none; }
.plogo:hover { color: var(--ink-2); }

@media (max-width: 639px) {
  .hero-providers { margin-top: var(--space-12); }
  .hero-providers-row { gap: 14px 20px; }
  .plogo { font-size: 14px; }
  .plogo svg { width: 17px; height: 17px; }
  /* the badge is a nowrap mono string — at 360–430px it is the widest
     fixed element on the page, so let it wrap instead of pushing the
     document past the viewport. */
  .hero-badge { white-space: normal; max-width: 100%; text-align: left; line-height: 1.45; }
  .hero-title { letter-spacing: -0.032em; }
  /* full-width buttons read as a real mobile CTA rather than two
     chips fighting for the same 390px. */
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ── Download block ────────────────────────────────────────────────
 * The primary install entry point. Sits in the left column of the
 * install split, opposite the step-by-step panel. Deliberately not a
 * card — it is a spec sheet: version, date, actions, then a mono
 * metadata row, so the download reads as a fact rather than a pitch. */
.dl {
  border-top: 1px solid var(--ink);
  padding-top: var(--space-5);
  max-width: 46ch;
}
.dl-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.dl-ver {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.dl-when {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--ink-muted);
  letter-spacing: 0.005em;
}
.dl-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-5);
}
.dl-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: var(--space-6) 0 0;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dl-meta > div {
  background: var(--panel);
  padding: var(--space-3) var(--space-4);
}
.dl-meta dt {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.dl-meta dd {
  margin: 3px 0 0;
  font-size: var(--text-sm);
  color: var(--ink);
}
.dl-meta dd.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
@media (max-width: 479px) {
  .dl-meta { grid-template-columns: minmax(0, 1fr); }
}

/* ═══ Spec band ═════════════════════════════════════════════════════
 * Sits directly under the hero and reads as an instrument readout:
 * hairline rules top and bottom, mono figures, no card chrome. */
.specband {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}
.specband .spec { padding: var(--space-6) var(--space-5); border-left: 1px solid var(--line-soft); }
.specband .spec:first-child { border-left: 0; padding-left: 0; }
.specband .v {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(28px, 2.9vw, 40px); line-height: 1; letter-spacing: -0.036em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.specband .k { font-size: var(--text-sm); line-height: 1.5; color: var(--ink-muted); max-width: 22ch; margin-top: 8px; }
@media (max-width: 860px) {
  .specband { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specband .spec { padding: var(--space-5) var(--space-4); }
  .specband .spec:nth-child(odd) { border-left: 0; padding-left: 0; }
  .specband .spec:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 520px) {
  .specband { grid-template-columns: 1fr; }
  .specband .spec { border-left: 0; padding-left: 0; padding-inline: 0; }
  .specband .spec + .spec { border-top: 1px solid var(--line-soft); }
}

/* ═══ Checklist (can / cannot) ══════════════════════════════════════ */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.checklist li { display: flex; align-items: flex-start; gap: 10px; }
.checklist svg { flex: none; margin-top: 4px; }

/* ═══ Closing CTA panel ═════════════════════════════════════════════ */
.cta-panel {
  position: relative; overflow: hidden;
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(32px, 5vw, 64px);
  max-width: 720px; margin-inline: auto; text-align: center;
  box-shadow: 0 2px 4px color-mix(in oklab, var(--fg) 5%, transparent),
              0 20px 50px color-mix(in oklab, var(--fg) 8%, transparent);
}
.cta-panel::before {
  content: ""; position: absolute; left: 50%; top: -160px; transform: translateX(-50%);
  width: 520px; height: 320px; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, var(--mist-2), transparent 72%);
  filter: blur(24px);
}
.cta-panel > * { position: relative; }

/* ═══ Protocol flow (3 nodes) ═══════════════════════════════════════ */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: var(--space-3); align-items: stretch; }
.flow-node {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-md);
  padding: var(--space-5); display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), transform var(--motion-base) var(--ease-standard);
}
.flow-node:hover { border-color: var(--accent-edge); transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in oklab, var(--fg) 6%, transparent); }
.flow-node .k { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.05em; color: var(--ink-faint); }
.flow-node .v { font-size: var(--text-sm); line-height: 1.6; color: var(--ink-2); }
.flow-arrow { display: grid; place-items: center; color: var(--ink-ghost); font-family: var(--font-mono); font-size: var(--text-base); }
@media (max-width: 860px) {
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); padding-block: var(--space-1); }
}

/* ═══ Spec / stat cell ══════════════════════════════════════════════ */
.spec { display: flex; flex-direction: column; gap: 7px; }
.spec .v {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600;
  color: var(--ink); letter-spacing: -0.022em; line-height: 1.2;
}
.spec .k { font-size: var(--text-sm); line-height: 1.55; color: var(--ink-muted); max-width: 24ch; }
/* numeral variant — the big mono figures in the spec band */
.spec--num .v {
  font-family: var(--font-mono); font-weight: 500; font-size: clamp(26px, 2.6vw, 36px);
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1;
}

/* ═══ Footer ════════════════════════════════════════════════════════ */
.pagefoot { border-top: 1px solid var(--line-soft); padding-block: var(--space-12) var(--space-8); background: color-mix(in oklab, var(--accent) 4%, var(--bg)); }
.pagefoot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--space-8); }
@media (max-width: 1023px) { .pagefoot-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .pagefoot-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-6); } }
@media (max-width: 520px) { .pagefoot-grid { grid-template-columns: 1fr; } }
.pagefoot h4 { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 500; margin-bottom: var(--space-3); }
.pagefoot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.pagefoot ul a { font-size: var(--text-sm); color: var(--ink-2); text-decoration: none; }
.pagefoot ul a:hover { color: var(--accent-lit); text-decoration: none; }
.pagefoot-bottom {
  margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--ink-faint); font-family: var(--font-mono);
}

/* ═══ Reveal-on-scroll ══════════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-standard), transform 700ms var(--ease-standard); }
.no-js .reveal { opacity: 1; transform: none; }

/* ═══ Utilities ═════════════════════════════════════════════════════ */
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.max-60 { max-width: 60ch; }
.max-72 { max-width: 72ch; }
.rule { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }
.mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); } .mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.hide-mobile { display: initial; }
@media (max-width: 700px) { .hide-mobile { display: none; } }
