/* Senior Dev Kit — landing page.
   Hand-maintained; `scripts/gen-site.ts` copies this verbatim into site/dist/.
   No build step, no dependencies, no external requests, no JavaScript.

   Art direction: a technical specification document, not a marketing page. Numbered
   sections, monospace labels, hairline rules, an engineering-blueprint grid behind the
   hero, and one saturated cobalt that carries the product — with amber reserved
   exclusively for the guarded surfaces, so colour means something instead of decorating.

   Written against the kit's own `rules/100-web.md`: semantic tokens only, 8px grid,
   1.333 type scale, display+body pairing, 4.5:1 body contrast, 24px targets, motion
   inside the stated ceilings, reduced-motion honoured. A shopfront that violates the
   rules it sells is the self-contradiction class this repo keeps closing.

   Two constraints worth stating:
   - The display face is monospace: the only genuinely distinct second family present on
     every OS without shipping a webfont, and on-brand for a kit that configures a
     terminal coding agent.
   - Scroll-driven work uses `animation-timeline: view()`, guarded by `@supports`.
     Browsers without it get the finished state immediately. Nothing on this page is
     hidden behind an effect that might not run. */

:root {
  color-scheme: dark light;

  --color-surface: #08090c;
  --color-surface-raised: #0e1014;
  --color-surface-sunken: #050608;
  --color-border: #191d24;
  --color-border-strong: #29303a;
  --color-fg: #f2f4f7;
  --color-muted: #98a2b3;
  --color-faint: #79838f;
  --color-primary: #6e93ff;
  --color-primary-hover: #8fabff;
  --color-primary-deep: #4f7cff;
  --color-on-primary: #05070d;
  --color-signal: #f5a524;
  --color-danger: #ff6b6b;
  --color-glow: 79 124 255;

  --font-display: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: var(--font-display);

  /* Perfect Fourth (1.333) from a 1rem base, extended upward for the hero. */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.333rem;
  --text-lg: 1.777rem;
  --text-xl: 2.369rem;
  --text-2xl: clamp(2.6rem, 1.6rem + 4.6vw, 5rem);

  /* 8px grid — 4 · 8 · 16 · 24 · 32 · 48 · 64 · 96 only. */
  --space-05: 0.25rem;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 6rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 999px;

  --transition-fast: 100ms;
  --transition-base: 200ms;
  --transition-slow: 300ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 24px 64px -24px rgb(0 0 0 / 0.7);

  --measure: 66ch;
  --wrap: 1180px;
  --rule: 1px solid var(--color-border);
}

@media (prefers-color-scheme: light) {
  :root {
    --color-surface: #f6f5f3;
    --color-surface-raised: #ffffff;
    --color-surface-sunken: #eceae6;
    --color-border: #e0ddd8;
    --color-border-strong: #c8c4bd;
    --color-fg: #0b0d11;
    --color-muted: #4e5765;
    --color-faint: #66707d;
    --color-primary: #2c55e0;
    --color-primary-hover: #1f43c4;
    --color-primary-deep: #2c55e0;
    --color-on-primary: #ffffff;
    --color-signal: #9a5b00;
    --color-danger: #b42318;
    --color-glow: 44 85 224;

    --shadow-sm: 0 1px 2px rgb(11 13 17 / 0.07);
    --shadow-lg: 0 24px 64px -28px rgb(11 13 17 / 0.22);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Every animation on this page is decorative — the layout is complete without any of them. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { width: min(100% - 2 * var(--space-3), var(--wrap)); margin-inline: auto; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--color-primary); }

:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }

code {
  background: var(--color-surface-sunken);
  border: var(--rule);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

pre {
  position: relative;
  background: var(--color-surface-sunken);
  border: var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  overflow-x: auto;
  line-height: 1.9;
  margin: 0;
  font-size: var(--text-sm);
}

/* One accent hairline across the top of every code block, so the install steps read as
   the thing to act on. */
pre::before {
  content: "";
  position: absolute;
  inset-inline: var(--space-3);
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary-deep), transparent);
}

pre code { background: none; padding: 0; border: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--space-3); top: var(--space-3); z-index: 20;
  background: var(--color-primary-deep); color: #fff;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-md);
}

/* --- motion primitives ----------------------------------------------------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }
@keyframes blink { 0%, 45% { opacity: 1; } 55%, 100% { opacity: 0; } }

/* --- header ---------------------------------------------------------------- */

header.site {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--color-surface) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.6);
  transition: border-color var(--transition-base) var(--ease);
}

@supports (animation-timeline: scroll()) {
  header.site { animation: header-settle linear both; animation-timeline: scroll(); animation-range: 0 var(--space-6); }
  @keyframes header-settle { to { border-bottom-color: var(--color-border); } }
}
@supports not (animation-timeline: scroll()) {
  header.site { border-bottom-color: var(--color-border); }
}

header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding-block: var(--space-1); flex-wrap: wrap;
}

.brand {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600;
  letter-spacing: -0.01em; text-decoration: none; padding-block: var(--space-05);
}
.brand svg { width: 22px; height: 22px; display: block; border-radius: var(--radius-sm); }

.nav {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-sm); color: var(--color-muted);
}

/* WCAG 2.5.8 — every target clears 24px, including the inline nav links. */
.nav a {
  position: relative; text-decoration: none;
  display: inline-flex; align-items: center; gap: var(--space-05); min-height: 24px;
  transition: color var(--transition-base) var(--ease);
}
.nav a .idx { font-family: var(--font-display); font-size: 0.75rem; color: var(--color-faint); transition: color var(--transition-base) var(--ease); }
.nav a:not(.lang)::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px;
  background: var(--color-primary);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition-base) var(--ease);
}
.nav a:hover { color: var(--color-fg); }
.nav a:hover .idx { color: var(--color-primary); }
.nav a:not(.lang):hover::after { transform: scaleX(1); }

.lang {
  font-family: var(--font-display);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full);
  padding-inline: var(--space-1); color: var(--color-muted);
  transition: color var(--transition-base) var(--ease), border-color var(--transition-base) var(--ease);
}
.lang:hover { color: var(--color-fg); border-color: var(--color-primary); }

/* --- hero ------------------------------------------------------------------ */

.hero { position: relative; padding-block: var(--space-7) var(--space-6); border-bottom: var(--rule); overflow: hidden; }

/* Engineering-blueprint grid, faded out radially so it never competes with the type. */
.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--color-border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 80% at 20% 0%, #000 0%, transparent 72%);
  opacity: 0.7;
  animation: fade 600ms var(--ease) backwards;
}

.hero > .wrap { position: relative; z-index: 1; }

/* Copy and transcript side by side, collapsing to one column before the terminal
   would have to shrink its monospace lines below legibility. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
}
.hero-copy { min-width: 0; }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* Entrance choreography — 50ms apart, four items, inside the 8-item ceiling. */
.hero .eyebrow, .hero h1, .hero .lede, .hero .cta { animation: rise var(--transition-slow) var(--ease) backwards; }
.hero .eyebrow { animation-delay: 0ms; }
.hero h1 { animation-delay: 50ms; }
.hero .lede { animation-delay: 100ms; }
.hero .cta { animation-delay: 150ms; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-family: var(--font-display); font-size: var(--text-sm);
  color: var(--color-muted); margin: 0 0 var(--space-3);
  border: var(--rule); border-radius: var(--radius-full);
  padding: var(--space-05) var(--space-2);
  background: color-mix(in srgb, var(--color-surface-raised) 70%, transparent);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: var(--radius-full);
  background: var(--color-primary);
  box-shadow: 0 0 10px rgb(var(--color-glow) / 0.9);
  animation: pulse 2.4s var(--ease) infinite;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 0 0 var(--space-3);
  font-weight: 600;
  text-wrap: balance;
}

.grad { color: var(--color-primary); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad {
    background: linear-gradient(96deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 55%, var(--color-fg)));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}

.lede {
  font-size: var(--text-md); line-height: 1.5; color: var(--color-muted);
  max-width: var(--measure); margin: 0 0 var(--space-4); text-wrap: pretty;
}

.cta { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: var(--space-1);
  background: var(--color-primary-deep); color: #fff;
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-md);
  text-decoration: none; font-weight: 600; font-size: var(--text-sm);
  border: 1px solid transparent;
  box-shadow: 0 0 0 0 rgb(var(--color-glow) / 0.5);
  transition: box-shadow var(--transition-base) var(--ease),
              transform var(--transition-fast) var(--ease),
              background var(--transition-base) var(--ease);
}
.btn:hover { background: var(--color-primary-hover); box-shadow: 0 12px 32px -10px rgb(var(--color-glow) / 0.65); }
.btn:active { transform: scale(0.97); }
.btn .arr { transition: transform var(--transition-base) var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

.btn-ghost {
  background: none; color: var(--color-fg);
  border-color: var(--color-border-strong); box-shadow: none;
}
.btn-ghost:hover { background: var(--color-surface-raised); border-color: var(--color-primary); box-shadow: var(--shadow-sm); }

/* --- terminal --------------------------------------------------------------- */

.term {
  margin: 0;
  border: var(--rule);
  border-radius: var(--radius-lg);
  background: var(--color-surface-sunken);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-width: 0;
}

.term-bar {
  display: flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-bottom: var(--rule);
  background: var(--color-surface-raised);
  font-family: var(--font-display); font-size: 0.75rem; color: var(--color-faint);
  letter-spacing: 0.04em;
}
.term-dots {
  display: inline-block; width: 34px; height: 8px; flex: none;
  background-image: radial-gradient(circle 4px at 4px 4px, var(--color-border-strong) 98%, transparent),
                    radial-gradient(circle 4px at 17px 4px, var(--color-border-strong) 98%, transparent),
                    radial-gradient(circle 4px at 30px 4px, var(--color-border-strong) 98%, transparent);
}

.term-body {
  margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  padding: var(--space-2) var(--space-3) var(--space-3);
  font-size: 0.8125rem; line-height: 1.85;
}
.term-body::before { content: none; }

/* Each line is its own element so the transcript can play itself in. */
.ln { display: block; color: var(--color-muted); white-space: pre-wrap; }
.ln.sp { min-height: 0.6em; }
.ln.pr { color: var(--color-fg); }
.ln.pr::before { content: "› "; color: var(--color-primary); }
.ln.guard { color: var(--color-signal); }
.ln.bad { color: var(--color-danger); }
.ln.ok { color: var(--color-primary); }
.ln.dim { color: var(--color-faint); }

.caret {
  display: inline-block; width: 0.55em; height: 1.05em; margin-left: 0.2em;
  vertical-align: -0.18em; background: currentColor;
  animation: blink 1.1s steps(1, end) infinite;
}

.term-foot {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  padding: var(--space-1) var(--space-3) var(--space-2);
  border-top: var(--rule);
  font-family: var(--font-display); font-size: 0.75rem; color: var(--color-faint);
}
.term-foot b { color: var(--color-fg); font-variant-numeric: tabular-nums; }

/* Transcript playback — one line at a time, capped so the sequence never outlasts
   a glance. Reduced motion collapses every delay to zero via the global block. */
@media (prefers-reduced-motion: no-preference) {
  .term--hero .ln, .pane .ln { animation: rise 240ms var(--ease) backwards; }
  .term--hero .ln:nth-child(1), .pane .ln:nth-child(1) { animation-delay: 120ms; }
  .term--hero .ln:nth-child(2), .pane .ln:nth-child(2) { animation-delay: 200ms; }
  .term--hero .ln:nth-child(3), .pane .ln:nth-child(3) { animation-delay: 280ms; }
  .term--hero .ln:nth-child(4), .pane .ln:nth-child(4) { animation-delay: 360ms; }
  .term--hero .ln:nth-child(5), .pane .ln:nth-child(5) { animation-delay: 440ms; }
  .term--hero .ln:nth-child(6), .pane .ln:nth-child(6) { animation-delay: 520ms; }
  .term--hero .ln:nth-child(n+7), .pane .ln:nth-child(n+7) { animation-delay: 600ms; }
}

/* --- side-by-side comparison ------------------------------------------------- */
/* A real radio group, not a script: keyboard-operable, announced as a group, and
   functional with JavaScript disabled. The panes cross-fade in place so the two
   transcripts are read against the same frame rather than side by side, where the
   eye compares layout instead of content. */

.compare { margin-top: var(--space-4); }

.compare-switch {
  display: inline-flex; gap: var(--space-05); padding: var(--space-05);
  border: var(--rule); border-radius: var(--radius-full);
  background: var(--color-surface-raised); margin-bottom: var(--space-3);
}
.compare-switch label {
  display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: 32px; padding-inline: var(--space-2);
  border-radius: var(--radius-full); cursor: pointer;
  font-family: var(--font-display); font-size: var(--text-sm);
  color: var(--color-muted);
  transition: color var(--transition-base) var(--ease), background var(--transition-base) var(--ease);
}
.compare-switch label:hover { color: var(--color-fg); }
.sw-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: currentColor; opacity: 0.5; }

#cmp-off:checked ~ .compare-switch label[for="cmp-off"],
#cmp-on:checked ~ .compare-switch label[for="cmp-on"] {
  background: var(--color-surface-sunken); color: var(--color-fg);
}
#cmp-off:checked ~ .compare-switch label[for="cmp-off"] .sw-dot { background: var(--color-danger); opacity: 1; }
#cmp-on:checked ~ .compare-switch label[for="cmp-on"] .sw-dot { background: var(--color-primary); opacity: 1; }

#cmp-off:focus-visible ~ .compare-switch label[for="cmp-off"],
#cmp-on:focus-visible ~ .compare-switch label[for="cmp-on"] {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
}

.compare-panes { display: grid; }
.compare-panes > .pane {
  grid-area: 1 / 1;
  transition: opacity var(--transition-slow) var(--ease), transform var(--transition-slow) var(--ease);
}
/* `visibility` rather than `display` so the hidden pane stays out of the tab order
   without the grid collapsing to the height of whichever pane is shorter. */
#cmp-off:checked ~ .compare-panes .pane--on,
#cmp-on:checked ~ .compare-panes .pane--off {
  opacity: 0; visibility: hidden; transform: translateY(6px);
}
.pane--off { border-color: color-mix(in srgb, var(--color-danger) 40%, var(--color-border)); }
.pane--on { border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border)); }

/* --- routing diagram --------------------------------------------------------- */
/* Nodes are sized by their own text, so no string in any translation can overflow a
   box — the failure the hand-computed SVG version shipped. The elbows are borders on
   percentage-positioned boxes, which means they stay attached to the node centres at
   every width instead of being pinned to coordinates chosen at one viewport size. */

.figure { position: relative; z-index: 1; margin-block: var(--space-5) var(--space-6); }

.flowmap {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 0;
  font-family: var(--font-display);
}

.fm-node {
  border: var(--rule); border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm); line-height: 1.35; text-align: center;
  color: var(--color-fg);
  transition: border-color var(--transition-base) var(--ease), transform var(--transition-base) var(--ease);
}
.fm-node small { display: block; font-size: 0.6875rem; color: var(--color-faint); margin-top: 2px; }
.fm-node--gate { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface-raised)); }
.fm-node--guard { border-color: var(--color-signal); background: color-mix(in srgb, var(--color-signal) 8%, var(--color-surface-raised)); color: var(--color-signal); }
.fm-node--guard small { color: color-mix(in srgb, var(--color-signal) 70%, var(--color-faint)); }
.fm-node--verify { border-color: var(--color-primary); }

.fm-link { height: 1px; background: var(--color-border-strong); }

/* Two nodes stacked in equal rows, so their centres sit at exactly 25% and 75% of the
   column — which is what the elbows below are drawn against. No gap: spacing comes from
   the nodes' own margins, so the centres stay put. */
.fm-branch { display: grid; grid-template-rows: 1fr 1fr; align-self: stretch; }
.fm-row { display: grid; align-items: center; }
.fm-row .fm-node { margin-block: var(--space-1); }

.fm-fork { position: relative; align-self: stretch; min-height: 96px; }
.fm-elbow { position: absolute; left: 0; right: 0; border-color: var(--color-border-strong); border-style: solid; border-width: 0; }
.fm-elbow--up { top: 25%; bottom: 50%; border-left-width: 1px; border-top-width: 1px; border-top-left-radius: 10px; }
.fm-elbow--down { top: 50%; bottom: 25%; border-left-width: 1px; border-bottom-width: 1px; border-bottom-left-radius: 10px; }
/* Mirrored on the join side: the vertical spine sits on the right and the stubs run back. */
.fm-fork--join .fm-elbow--up { border-left-width: 0; border-right-width: 1px; border-top-left-radius: 0; border-top-right-radius: 10px; }
.fm-fork--join .fm-elbow--down { border-left-width: 0; border-right-width: 1px; border-bottom-left-radius: 0; border-bottom-right-radius: 10px; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .fm-node { animation: rise linear both; animation-timeline: view(); animation-range: entry 5% entry 45%; }
    .fm-link, .fm-elbow { animation: fade linear both; animation-timeline: view(); animation-range: entry 10% entry 55%; }
  }
}

@media (max-width: 780px) {
  .flowmap { grid-template-columns: 1fr; justify-items: stretch; gap: var(--space-1); }
  .fm-link { height: var(--space-2); width: 1px; justify-self: center; }
  .fm-fork { display: none; }
  .fm-branch { grid-template-rows: auto auto; gap: var(--space-1); }
  .fm-row .fm-node { margin-block: 0; }
}

/* --- metrics ---------------------------------------------------------------- */

.metrics { padding-block: 0; border-bottom: var(--rule); }

.metric-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 0;
}
.metric {
  padding: var(--space-3) var(--space-2);
  border-left: var(--rule);
  transition: background var(--transition-base) var(--ease);
}
.metric:first-child { border-left: 0; }
.metric:hover { background: var(--color-surface-raised); }
.metric dt {
  font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-faint); margin-bottom: var(--space-05);
}
.metric dd {
  margin: 0; font-family: var(--font-display); font-size: var(--text-xl);
  line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  color: var(--color-fg);
}

/* --- sections --------------------------------------------------------------- */

section { padding-block: var(--space-7); }
section + section:not(.metrics) { border-top: var(--rule); }

.section-idx {
  font-family: var(--font-display); font-size: var(--text-sm);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-primary); margin: 0 0 var(--space-2);
}

h2 {
  font-family: var(--font-display); font-size: var(--text-xl);
  letter-spacing: -0.04em; line-height: 1.1; font-weight: 600;
  margin: 0 0 var(--space-2); max-width: 24ch; text-wrap: balance;
}

h3 { font-size: var(--text-base); line-height: 1.3; margin: 0 0 var(--space-1); font-weight: 650; }

.section-lede, section > .wrap > p {
  max-width: var(--measure); color: var(--color-muted); text-wrap: pretty;
}
.section-lede { font-size: var(--text-md); line-height: 1.5; margin-bottom: var(--space-5); }
.muted { color: var(--color-muted); }

/* --- flow ------------------------------------------------------------------- */

.flow { list-style: none; padding: 0; margin: 0 0 var(--space-6); display: grid; gap: 0; }
.flow > li {
  display: grid; grid-template-columns: minmax(72px, 8ch) 1fr; gap: var(--space-3);
  padding-block: var(--space-4); border-top: var(--rule);
  transition: background var(--transition-base) var(--ease);
}
.flow > li:last-child { border-bottom: var(--rule); }
.flow > li:hover { background: color-mix(in srgb, var(--color-surface-raised) 60%, transparent); }
.flow .num {
  font-family: var(--font-display); font-size: var(--text-lg); line-height: 1;
  letter-spacing: -0.04em; color: transparent;
  -webkit-text-stroke: 1px var(--color-border-strong);
  transition: -webkit-text-stroke-color var(--transition-base) var(--ease);
}
.flow > li:hover .num { -webkit-text-stroke-color: var(--color-primary); }
.flow p { margin: 0; color: var(--color-muted); max-width: var(--measure); text-wrap: pretty; }

/* --- routes table ----------------------------------------------------------- */

.routes { width: 100%; border-collapse: collapse; font-size: var(--text-sm); display: block; overflow-x: auto; }
.routes th, .routes td {
  text-align: left; padding: var(--space-2); border-bottom: var(--rule);
  vertical-align: top; white-space: nowrap;
}
.routes thead th {
  font-family: var(--font-display); color: var(--color-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem;
  border-bottom-color: var(--color-border-strong);
}
.routes tbody tr { transition: background var(--transition-base) var(--ease); }
.routes tbody tr:hover { background: var(--color-surface-raised); }
.routes td:first-child { white-space: normal; color: var(--color-muted); font-family: var(--font-body); }
.routes td em { color: var(--color-faint); font-style: normal; }
.routes code { white-space: nowrap; }

/* --- install ---------------------------------------------------------------- */

.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--space-5); }
.install-grid h3 { margin-bottom: var(--space-1); }
.install-grid .muted { margin: 0 0 var(--space-2); font-size: var(--text-sm); }

.note {
  border-left: 2px solid var(--color-border-strong);
  padding-left: var(--space-2); margin-top: var(--space-3);
  color: var(--color-muted); max-width: var(--measure); font-size: var(--text-sm);
  text-wrap: pretty;
}

/* --- cards ------------------------------------------------------------------ */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--space-2); }

.card {
  position: relative; overflow: hidden;
  border: var(--rule); border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3) var(--space-3);
  background: var(--color-surface-raised);
  transition: transform var(--transition-base) var(--ease),
              border-color var(--transition-base) var(--ease),
              box-shadow var(--transition-base) var(--ease);
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: var(--color-primary);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition-slow) var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: var(--color-border-strong); box-shadow: var(--shadow-lg); }
.card:hover::before { transform: scaleX(1); }
.card--signal::before { background: var(--color-signal); }
.card--signal .tag { color: var(--color-signal); }
.card p { color: var(--color-muted); margin: 0; text-wrap: pretty; font-size: var(--text-sm); }
.card .tag {
  font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-primary);
  margin: 0 0 var(--space-2); font-weight: 600;
}

/* --- preset ticker ----------------------------------------------------------- */

.presets { padding-block: var(--space-5); overflow: hidden; }
.presets .section-idx { color: var(--color-faint); }

.ticker { margin-top: var(--space-3); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-row {
  display: flex; width: max-content; gap: var(--space-1);
  animation: marquee 60s linear infinite;
}
.presets:hover .ticker-row { animation-play-state: paused; }
.ticker-row span {
  font-family: var(--font-display); font-size: var(--text-sm); color: var(--color-muted);
  border: var(--rule); border-radius: var(--radius-full);
  padding: var(--space-05) var(--space-2); white-space: nowrap;
  background: var(--color-surface-raised);
}

/* --- footer ------------------------------------------------------------------ */

footer.site { border-top: var(--rule); padding-block: var(--space-6); }
footer.site .wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; }

.wordmark {
  font-family: var(--font-display); font-size: var(--text-2xl); line-height: 0.95;
  letter-spacing: -0.05em; margin: 0; font-weight: 600;
  color: transparent; -webkit-text-stroke: 1px var(--color-border-strong);
}

.foot-meta { font-family: var(--font-display); font-size: var(--text-sm); color: var(--color-faint); text-align: right; }
.foot-meta p { margin: 0 0 var(--space-05); }

.credit { color: var(--color-muted); }
.credit a { color: var(--color-fg); text-decoration-color: var(--color-border-strong); }
.credit a:hover { text-decoration-color: var(--color-primary); }
.heart {
  display: inline-block; color: var(--color-danger);
  animation: heartbeat 2.4s var(--ease) infinite;
}
@keyframes heartbeat {
  0%, 70%, 100% { transform: scale(1); }
  12% { transform: scale(1.22); }
  24% { transform: scale(1); }
  36% { transform: scale(1.16); }
}

/* --- scroll-driven reveals ---------------------------------------------------- */
/* Guarded twice: `@supports` so unsupported browsers render the finished state, and
   `prefers-reduced-motion` so the reveal never runs for anyone who opted out. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section-idx, h2, .section-lede, .metric, .card, .flow > li, .routes, .install-grid > *, section > .wrap > p, .wordmark {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
  }
}

@media (max-width: 640px) {
  :root { --space-7: 4rem; }
  .foot-meta { text-align: left; }
  footer.site .wrap { align-items: flex-start; }
}
