/* ============================================================
   HALFLIFE — decay instrumentation
   Visual system: nuclear-era control panel. Graphite substrate,
   amber phosphor readouts, hazard orange for decay.
   Monospace for data, grotesk for voice.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Graphite substrate — the panel itself */
  --ink-900: #0a0b0c;
  --ink-850: #101214;
  --ink-800: #16191c;
  --ink-700: #1e2226;
  --ink-600: #2a2f35;
  /* ink-400/500 carry small muted text (labels, captions, meta). They are
     pinned to values that clear WCAG AA 4.5:1 on the ink-800/850/900
     substrates rather than to what merely looked subtle. ink-600 and below
     are for borders and fills only — never for text. */
  --ink-500: #7d8693;
  --ink-400: #939ba6;
  --ink-300: #aeb6c0;
  --ink-200: #ccd3da;
  --ink-100: #e9edf1;
  --ink-000: #f7f9fa;

  /* Phosphor amber — live readouts, the "on" state */
  --amber:      #ffb01f;
  --amber-dim:  #a8730f;
  --amber-glow: rgba(255, 176, 31, 0.18);

  /* Hazard — decay, warnings, the thing you must act on */
  --hazard:     #ff4d1c;
  --hazard-dim: #9c3413;

  /* Safe — verified, fresh, in-sync */
  --safe:       #3ddc97;
  --safe-dim:   #1c7a52;

  /* Etched lines on metal */
  --rule:        rgba(255, 255, 255, 0.09);
  --rule-strong: rgba(255, 255, 255, 0.16);

  --bg: var(--ink-900);
  --fg: var(--ink-100);

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Rhythm */
  --gut: clamp(1.25rem, 4vw, 3.5rem);
  --band: clamp(4.5rem, 11vh, 9rem);
  --maxw: 1360px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-mech: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Light mode: the same panel under bright lab light. Colour ROLES
   are preserved — amber still reads "live", hazard still reads
   "decaying" — but the substrate inverts to paper stock. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink-900: #f2f0ec;
    --ink-850: #eae7e1;
    --ink-800: #e2ded7;
    --ink-700: #d4cfc6;
    --ink-600: #bdb6aa;
    /* Same rule as dark: 400/500 carry small text, so they clear 4.5:1
       against the paper substrates. */
    --ink-500: #655f55;
    --ink-400: #555047;
    --ink-300: #423e37;
    --ink-200: #2e2b26;
    --ink-100: #16150f;
    --ink-000: #000000;
    --amber:      #8f5100;
    --amber-dim:  #b07c1c;
    --amber-glow: rgba(143, 81, 0, 0.14);
    --hazard:     #b52a06;
    --hazard-dim: #d9552c;
    --safe:       #0b6b42;
    --safe-dim:   #3a9c73;
    --rule:        rgba(0, 0, 0, 0.13);
    --rule-strong: rgba(0, 0, 0, 0.24);
  }
}

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets must clear the 60px sticky nav, or in-page links
     land with the section heading hidden behind it. */
  scroll-padding-top: 76px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Panel grain — fine scanline over the whole substrate */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.015) 0px,
    rgba(255,255,255,0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body::before { opacity: 0.35; }
}

img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }

::selection { background: var(--amber); color: var(--ink-900); }

/* ---------- 3. FOCUS ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Hidden via transform, not left:-9999px — an off-screen negative
   offset widens the document box and causes horizontal overflow on
   narrow viewports. */
.skip-link {
  position: fixed;
  left: 0.5rem;
  top: 0.5rem;
  transform: translateY(-200%);
  z-index: 10000;
  background: var(--amber);
  color: var(--ink-900);
  padding: 0.85rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 4. TYPE ---------- */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "zero" 1;
}

.label {
  font-family: var(--font-mono);
  font-size: clamp(0.66rem, 0.9vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.rubric {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--rule);
}
.rubric__idx {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
  flex: none;
}
.rubric__name {
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 0.95vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-300);
}
.rubric__meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--ink-500);
  text-align: right;
}
@media (max-width: 600px) { .rubric__meta { display: none; } }

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.98;
  margin: 0;
  text-wrap: balance;
}

.h-mega {
  font-size: clamp(3rem, 11.5vw, 10.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.84;
}

/* The hero headline is sized against the LEFT COLUMN, not the viewport.
   The column is ~55vw at desktop, so vw-based sizing overflows it and
   pushes the hook below the fold. cqw against the column is exact. */
.hero__left { container-type: inline-size; }
.hero__title {
  font-size: clamp(2.6rem, 17cqw, 8.2rem);
  line-height: 0.86;
}
@media (max-width: 1080px) {
  .hero__title { font-size: clamp(2.6rem, 15cqw, 7rem); }
}
.h-lg { font-size: clamp(2rem, 5.2vw, 4.2rem); line-height: 0.96; }
.h-md { font-size: clamp(1.4rem, 2.6vw, 2.2rem); line-height: 1.05; letter-spacing: -0.02em; }
.h-sm { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; }

.prose {
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.62;
  color: var(--ink-200);
  max-width: 62ch;
  text-wrap: pretty;
}
.prose--tight { max-width: 48ch; }
.prose strong { color: var(--fg); font-weight: 700; }

/* ---------- 5. SHELL ---------- */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}
section { position: relative; }
.band {
  padding-block: var(--band);
  border-top: 1px solid var(--rule);
}

/* ---------- 6. NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 500;
  background: color-mix(in srgb, var(--ink-900) 84%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--rule);
}
.nav__in {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--gut);
  height: 60px;
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 2.5rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex: none;
}
.brand__mark { width: 22px; height: 22px; flex: none; }
.brand__word {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--fg);
}

.nav__links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
  list-style: none;
  padding: 0;
  margin-block: 0;
}
.nav__link {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-300);
  text-decoration: none;
  padding: 0.4rem 0;
  position: relative;
  transition: color 0.18s var(--ease-out);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease-out);
}
.nav__link:hover, .nav__link:focus-visible { color: var(--fg); }
.nav__link:hover::after, .nav__link:focus-visible::after { transform: scaleX(1); }

.nav__meter {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-400);
  white-space: nowrap;
  margin-left: 2rem;
}
.nav__cta { margin-left: auto; }

@media (max-width: 980px) {
  .nav__links { display: none; }
  .nav__meter { margin-left: auto; }
}
@media (max-width: 620px) {
  .nav__meter { display: none; }
  .nav__cta { margin-left: auto; }
  .nav__cta .btn { padding: 0.7rem 1rem; font-size: 0.7rem; }
}

.pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--safe);
  flex: none;
  animation: pulse 2.4s var(--ease-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(61,220,151,0.5); }
  50%      { opacity: 0.5; box-shadow: 0 0 0 5px rgba(61,220,151,0); }
}
@media (prefers-reduced-motion: reduce) { .pip { animation: none; } }

/* ---------- 7. BUTTONS ---------- */
.btn {
  --btn-bg: var(--amber);
  --btn-fg: #14100a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.5rem;
  border: 1px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s var(--ease-mech),
              box-shadow 0.22s var(--ease-out),
              background-color 0.16s linear,
              border-color 0.16s linear;
  box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset,
              0 6px 18px -8px rgba(0,0,0,0.9);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.42) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease-out);
  pointer-events: none;
}
.btn:hover::after, .btn:focus-visible::after { transform: translateX(120%); }
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset,
              0 12px 26px -10px rgba(0,0,0,1),
              0 0 0 4px var(--amber-glow);
}
.btn:active { transform: translateY(0); transition-duration: 0.05s; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink-100);
  border-color: var(--rule-strong);
  box-shadow: none;
}
.btn--ghost:hover {
  border-color: var(--ink-300);
  background: color-mix(in srgb, var(--ink-100) 6%, transparent);
  box-shadow: 0 8px 22px -12px rgba(0,0,0,0.9);
}
.btn--lg { padding: 1.15rem 1.9rem; font-size: 0.84rem; }

.btn[aria-disabled="true"], .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__text { opacity: 0.35; }
.btn.is-loading::before {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--ink-900);
  transform-origin: left;
  animation: load-bar 1.1s var(--ease-mech) infinite;
}
@keyframes load-bar {
  0%   { transform: scaleX(0); opacity: 1; }
  70%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

.arrow { width: 0.85em; height: 0.85em; flex: none; transition: transform 0.24s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn::after, .arrow { transition: none; }
  .btn:hover { transform: none; }
}

/* ============================================================
   8. HERO — asymmetric split. Type on the left runs to the
   viewport edge; the right is a live instrument panel.
   Deliberately NOT centered.
   ============================================================ */
.hero {
  position: relative;
  min-height: min(92svh, 900px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
}

.hero__left {
  padding: clamp(2.5rem, 6vw, 5.5rem) clamp(1.25rem, 4vw, 3.5rem)
           clamp(2.5rem, 6vw, 4.5rem) max(var(--gut), calc((100vw - var(--maxw)) / 2 + var(--gut)));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  position: relative;
  z-index: 2;
}

.hero__stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-300);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.45rem 0.8rem;
  align-self: flex-start;
  background: color-mix(in srgb, var(--ink-100) 3%, transparent);
}
.hero__stamp b { color: var(--hazard); font-weight: 700; }

/* The headline. "HALF" sits solid; "LIFE" is eroded by a
   clip-path animation on load — the word itself decays. */
.hero__title { position: relative; }
.hero__title .line { display: block; }

/* The word depletes from the top down: hazard orange is the "decayed"
   portion, amber the remainder, with the boundary sweeping downward like
   a level falling in a vessel. A horizontal boundary reads as depletion;
   the earlier vertical wipe read as a rendering glitch. */
.decay-word {
  position: relative;
  display: inline-block;
  color: var(--amber);
}
.decay-word::before {
  content: attr(data-word);
  position: absolute;
  inset: 0;
  color: var(--hazard);
  clip-path: inset(0 0 55% 0);
  animation: deplete 6s var(--ease-mech) infinite alternate;
  pointer-events: none;
}
@keyframes deplete {
  0%   { clip-path: inset(0 0 88% 0); }
  100% { clip-path: inset(0 0 34% 0); }
}
@media (prefers-reduced-motion: reduce) {
  .decay-word::before { animation: none; clip-path: inset(0 0 55% 0); }
}

.hero__deck {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-200);
  max-width: 46ch;
  text-wrap: pretty;
}
.hero__deck strong { color: var(--fg); font-weight: 700; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.hero__note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-400);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Right: the instrument --- */
.hero__right {
  position: relative;
  border-left: 1px solid var(--rule);
  background:
    radial-gradient(120% 90% at 80% 15%, var(--amber-glow) 0%, transparent 55%),
    var(--ink-850);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (max-width: 1080px) {
  .hero__right { border-left: none; border-top: 1px solid var(--rule); }
}

.gauge {
  padding: clamp(1.25rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}
.gauge__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
}
.gauge__title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-200);
  font-weight: 700;
}
.gauge__live {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--safe);
}

.curve-wrap {
  position: relative;
  flex: 1;
  min-height: 190px;
  display: flex;
}
/* The SVG fills the panel. preserveAspectRatio keeps the exponential
   shape honest, so the wrapper — not the curve — absorbs slack space. */
.curve {
  width: 100%;
  height: 100%;
  min-height: 190px;
  display: block;
  overflow: visible;
}

.curve__grid line { stroke: var(--rule); stroke-width: 1; }
.curve__axis  { stroke: var(--rule-strong); stroke-width: 1; }
.curve__tick  {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  fill: var(--ink-500);
}
.curve__path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--amber-glow));
}
.curve__area { fill: url(#decayFill); opacity: 0.55; }
.curve__marker { fill: var(--hazard); }
.curve__halo {
  fill: none;
  stroke: var(--hazard);
  stroke-width: 1;
  opacity: 0.55;
}
.curve__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  fill: var(--hazard);
}
.curve__thresh { stroke: var(--hazard); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.6; }

/* Readout strip beneath the curve */
.readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}
.readout__cell {
  padding: clamp(0.9rem, 2vw, 1.25rem);
  border-right: 1px solid var(--rule);
}
.readout__cell:last-child { border-right: none; }
.readout__k {
  font-family: var(--font-mono);
  font-size: 0.68rem; /* 0.6rem rendered at 9.6px — too small to read */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-400);
  display: block;
  margin-bottom: 0.4rem;
}
.readout__v {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.readout__v[data-tone="hazard"] { color: var(--hazard); }
.readout__v[data-tone="amber"]  { color: var(--amber); }
.readout__u { font-size: 0.62em; color: var(--ink-400); margin-left: 0.15em; }

/* ============================================================
   9. TICKER — proof band. Scrolls horizontally, pauses on hover.
   ============================================================ */
.ticker {
  border-bottom: 1px solid var(--rule);
  background: var(--ink-850);
  overflow: hidden;
  position: relative;
}
.ticker::before, .ticker::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: clamp(40px, 8vw, 120px);
  z-index: 2;
  pointer-events: none;
}
.ticker::before { left: 0;  background: linear-gradient(90deg, var(--ink-850), transparent); }
.ticker::after  { right: 0; background: linear-gradient(270deg, var(--ink-850), transparent); }

.ticker__track {
  display: flex;
  width: max-content;
  animation: marquee 44s linear infinite;
}
.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .ticker { overflow-x: auto; }
}

.ticker__item {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 1.05rem clamp(1.25rem, 3vw, 2.5rem);
  border-right: 1px solid var(--rule);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ink-300);
}
.ticker__item b {
  color: var(--fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ticker__item i {
  font-style: normal;
  color: var(--hazard);
  font-weight: 700;
}
.ticker__item em {
  font-style: normal;
  color: var(--safe);
  font-weight: 700;
}

/* ============================================================
   10. MECHANISM — the three-stage pipeline. Staggered vertical
   offsets, not a symmetric row of cards.
   ============================================================ */
.mech {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}
@media (max-width: 900px) {
  .mech { grid-template-columns: 1fr; gap: 0; }
}

.stage {
  position: relative;
  padding: clamp(1.5rem, 2.5vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 3px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ink-100) 3.5%, transparent), transparent 42%),
    var(--ink-850);
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
/* The deliberate asymmetry: each stage sits lower than the last,
   tracing the descent of the decay curve itself. */
.mech .stage:nth-child(2) { margin-top: clamp(2rem, 5vw, 4.5rem); }
.mech .stage:nth-child(3) { margin-top: clamp(4rem, 10vw, 9rem); }
@media (max-width: 900px) {
  .mech .stage { margin-top: 0 !important; border-radius: 0; }
  .mech .stage + .stage { border-top: none; }
}

.stage:hover {
  border-color: var(--rule-strong);
  transform: translateY(-3px);
}
@media (prefers-reduced-motion: reduce) { .stage:hover { transform: none; } }

.stage__no {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--amber);
  display: block;
  margin-bottom: 1.1rem;
}
.stage__title { margin-bottom: 0.75rem; }
.stage__body {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--ink-300);
  margin: 0 0 1.35rem;
}
.stage__body strong { color: var(--ink-100); font-weight: 600; }

/* Terminal fragment inside each stage — shows, doesn't claim */
.term {
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.75;
  overflow: hidden;
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  background: var(--ink-850);
  color: var(--ink-500);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.term__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-600); flex: none; }
/* min-width:0 lets this grid/flex descendant shrink below its content
   width; without it the pre-formatted lines below force the whole
   section wider than the viewport on narrow screens. */
.term__body {
  padding: 0.75rem 0.8rem;
  overflow-x: auto;
  min-width: 0;
  overscroll-behavior-x: contain;
}
.term__line {
  white-space: pre;
  color: var(--ink-300);
  margin: 0;
}
.term__line + .term__line { margin-top: 0.1rem; }
.c-dim  { color: var(--ink-500); }
.c-amb  { color: var(--amber); }
.c-haz  { color: var(--hazard); font-weight: 700; }
.c-safe { color: var(--safe); }
.c-fg   { color: var(--ink-100); }

/* ============================================================
   11. LEDGER — the depth section. A dense data table, not an
   icon grid. Rows expand on click to show the real detail.
   ============================================================ */
.ledger {
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--ink-850);
}
.ledger__head {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1fr 1.6fr 44px;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--ink-800);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-400);
}
@media (max-width: 860px) {
  .ledger__head { display: none; }
}

.row { border-bottom: 1px solid var(--rule); }
.row:last-child { border-bottom: none; }

.row__btn {
  width: 100%;
  display: grid;
  grid-template-columns: 2.4fr 1fr 1fr 1.6fr 44px;
  gap: 1rem;
  align-items: center;
  padding: clamp(0.9rem, 2vw, 1.15rem) clamp(1rem, 2vw, 1.5rem);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: background-color 0.2s var(--ease-out);
}
.row__btn:hover { background: color-mix(in srgb, var(--ink-100) 4%, transparent); }
.row__btn[aria-expanded="true"] { background: color-mix(in srgb, var(--ink-100) 5%, transparent); }

@media (max-width: 860px) {
  .row__btn {
    grid-template-columns: 1fr 44px;
    grid-template-areas:
      "name  chev"
      "half  chev"
      "drift chev"
      "pain  chev";
    row-gap: 0.5rem;
  }
  .row__name  { grid-area: name; }
  .row__half  { grid-area: half; }
  .row__drift { grid-area: drift; }
  .row__pain  { grid-area: pain; }
  .row__chev  { grid-area: chev; align-self: center; }
}

.row__name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
  min-width: 0;
}
.row__half, .row__drift {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-200);
}
.row__pain {
  font-size: 0.86rem;
  color: var(--ink-400);
  line-height: 1.4;
}
@media (max-width: 860px) {
  .row__half::before  { content: "HALF-LIFE / "; color: var(--ink-500); font-size: 0.7rem; letter-spacing: 0.1em; }
  .row__drift::before { content: "DRIFT / ";     color: var(--ink-500); font-size: 0.7rem; letter-spacing: 0.1em; }
}

/* Decay bar — the visual weight of each row.
   Must be block: it lives inside an inline .row__name span, and an
   inline box cannot take width or height. */
.bar {
  display: block;
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--ink-700);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.45rem;
  max-width: 140px;
}
.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 2px;
  background: var(--hazard);
  transition: width 1.1s var(--ease-out);
}
.bar__fill[data-tone="warn"] { background: var(--amber); }
.bar__fill[data-tone="ok"]   { background: var(--safe); }
@media (prefers-reduced-motion: reduce) { .bar__fill { transition: none; } }

.row__chev {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  color: var(--ink-300);
  transition: border-color 0.2s, color 0.2s;
  justify-self: end;
}
.row__btn:hover .row__chev { border-color: var(--ink-400); color: var(--fg); }
/* Rotate the glyph, not the box — rotating the bordered square turns it
   into a diamond, which reads as a rendering fault rather than a state. */
.row__chev svg { transition: transform 0.3s var(--ease-out); }
.row__btn[aria-expanded="true"] .row__chev {
  border-color: var(--amber);
  color: var(--amber);
}
.row__btn[aria-expanded="true"] .row__chev svg { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
  .row__chev, .row__chev svg { transition: none; }
}

.row__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s var(--ease-out);
}
.row__panel[data-open="true"] { grid-template-rows: 1fr; }
.row__panel > div { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .row__panel { transition: none; } }

.row__detail {
  padding: 0 clamp(1rem, 2vw, 1.5rem) clamp(1.35rem, 2.5vw, 1.75rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}
@media (max-width: 780px) {
  .row__detail { grid-template-columns: 1fr; }
}
.row__detail p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.62;
  color: var(--ink-300);
  max-width: 58ch;
}
.row__detail p strong { color: var(--ink-100); font-weight: 600; }

/* ============================================================
   12. TESTIMONY — one long-form quote set as an editorial
   pull-quote. Not a card. Not five stars. Not an avatar grid.
   ============================================================ */
.testimony {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.42fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
@media (max-width: 900px) { .testimony { grid-template-columns: 1fr; } }

.testimony__quote {
  margin: 0;
  font-size: clamp(1.35rem, 3.1vw, 2.5rem);
  line-height: 1.24;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--fg);
  text-wrap: pretty;
}
.testimony__quote span { color: var(--amber); }

.testimony__by {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--ink-400);
  border-left: 2px solid var(--amber);
  padding-left: 1rem;
  margin-top: clamp(1.5rem, 3vw, 2rem);
}
.testimony__by b {
  display: block;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stat-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
.stat { background: var(--ink-850); padding: clamp(1.1rem, 2.2vw, 1.5rem); }
.stat__v {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  display: block;
}
.stat__k {
  font-size: 0.82rem;
  color: var(--ink-400);
  margin-top: 0.5rem;
  line-height: 1.4;
  display: block;
}

/* ============================================================
   13. PRICING — two plans, deliberately unequal weight.
   ============================================================ */
.plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }

.plan {
  background: var(--ink-850);
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.plan--feature {
  background:
    radial-gradient(120% 80% at 100% 0%, var(--amber-glow), transparent 60%),
    var(--ink-800);
}
.plan__tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-400);
}
.plan--feature .plan__tag { color: var(--amber); }

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.plan__num {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--fg);
}
.plan__per { font-size: 0.8rem; color: var(--ink-400); letter-spacing: 0.06em; }

.plan__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}
.plan__list li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-200);
}
.plan__list svg { width: 14px; height: 14px; flex: none; margin-top: 0.28em; color: var(--safe); }
.plan__list li[data-off] { color: var(--ink-500); }
.plan__list li[data-off] svg { color: var(--ink-600); }

/* ============================================================
   14. FAQ — objection handling as flat disclosure rows.
   ============================================================ */
.faq { border-top: 1px solid var(--rule); }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.15rem, 2.5vw, 1.6rem) 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  transition: color 0.2s var(--ease-out);
}
.faq__q:hover { color: var(--amber); }
.faq__sign {
  flex: none;
  width: 20px;
  height: 20px;
  position: relative;
  color: var(--ink-400);
  transition: color 0.2s, transform 0.34s var(--ease-out);
}
.faq__q[aria-expanded="true"] .faq__sign { transform: rotate(135deg); color: var(--amber); }
.faq__sign::before, .faq__sign::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 1px;
}
.faq__sign::before { left: 50%; top: 2px; bottom: 2px; width: 1.5px; transform: translateX(-50%); }
.faq__sign::after  { top: 50%; left: 2px; right: 2px; height: 1.5px; transform: translateY(-50%); }

.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease-out);
}
.faq__a[data-open="true"] { grid-template-rows: 1fr; }
.faq__a > div { overflow: hidden; }
.faq__a p {
  margin: 0;
  padding-bottom: clamp(1.15rem, 2.5vw, 1.6rem);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-300);
  max-width: 70ch;
}
.faq__a p strong { color: var(--ink-100); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .faq__a { transition: none; }
  .faq__sign { transition: color 0.2s; }
}

/* ============================================================
   15. CLOSE — the terminal moment. Hazard-lit, full bleed.
   ============================================================ */
.close {
  position: relative;
  border-top: 1px solid var(--rule);
  background:
    radial-gradient(90% 130% at 50% 105%, color-mix(in srgb, var(--hazard) 22%, transparent) 0%, transparent 62%),
    var(--ink-850);
  overflow: hidden;
  text-align: center;
  padding-block: clamp(5rem, 13vh, 10rem);
}
.close__in {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin-inline: auto;
  padding-inline: var(--gut);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2rem);
}
.close__title {
  font-size: clamp(2.2rem, 7vw, 5.5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.close__title em { font-style: normal; color: var(--hazard); }

/* This page's own decay, running live. */
.countdown {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.1vw, 0.8rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.6rem 1rem;
  background: color-mix(in srgb, var(--ink-900) 55%, transparent);
}
.countdown b { color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 16. FOOTER ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--ink-900);
}
.foot__in {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  align-items: center;
  justify-content: space-between;
}
.foot__note {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ink-400);
  line-height: 1.7;
}
.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.foot__links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
  text-decoration: none;
  transition: color 0.18s;
}
.foot__links a:hover { color: var(--amber); }

/* ---------- 17. SCROLL REVEAL ---------- */
/* Not a blanket fade-up. Elements clip in from their own edge,
   like a readout being drawn on a scope. Applied selectively. */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.62s var(--ease-out), transform 0.62s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* clip-path also clips hit-testing, so an unfinished wipe would leave
   the whole element unclickable. .is-done (set on transitionend) removes
   the clip entirely once the reveal has played. */
[data-reveal="wipe"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.85s var(--ease-mech);
  transition-delay: var(--d, 0ms);
}
[data-reveal="wipe"].is-in { clip-path: inset(0 0 0 0); }
[data-reveal="wipe"].is-done { clip-path: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal="wipe"] {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }
}

/* ============================================================
   18. OVERFLOW CONTAINMENT
   Grid and flex items default to min-width:auto, which refuses to
   shrink below their content. The terminal blocks contain
   pre-formatted lines, so every ancestor between them and the page
   needs an explicit min-width:0 or the whole page scrolls sideways
   on narrow viewports.
   ============================================================ */
.mech, .stage, .term, .row__detail, .testimony, .plans, .plan {
  min-width: 0;
}
.stage > *, .row__detail > * { min-width: 0; }
.term { max-width: 100%; }

/* ============================================================
   19. NARROW-VIEWPORT TYPE FIXES
   ============================================================ */
/* The stamp and note put a decorative glyph beside wrapping text. When
   the text wraps, a baseline-aligned flex row leaves the glyph stranded
   mid-block; align it to the first line instead. */
.hero__stamp,
.hero__note {
  align-items: flex-start;
}
.hero__stamp > span[aria-hidden],
.hero__note > span[aria-hidden] {
  flex: none;
  line-height: inherit;
  position: relative;
  top: 0.1em;
}

@media (max-width: 620px) {
  /* Below this width the stamp reads better as two clean lines than as
     a cramped single row. */
  .hero__stamp {
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    line-height: 1.5;
  }
  .hero__note { line-height: 1.6; }

  /* Full-width CTAs on small screens — a 50%-width button next to
     whitespace reads as unfinished. */
  .hero__actions .btn { width: 100%; }
}

/* ============================================================
   20. LIGHT-MODE BUTTON FILL
   In light mode --amber darkens to #8f5100 so it stays legible as
   TEXT on paper. That same fill is too dark for the button's dark
   label (3.02:1), so the label flips to near-white instead.
   ============================================================ */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .btn {
    --btn-fg: #fffaf3;
  }
  /* The ghost button keeps its ink label — it has no amber fill. */
  :root:not([data-theme="dark"]) .btn--ghost {
    --btn-fg: var(--ink-100);
  }
  /* The sweep highlight is tuned for a light label on a dark fill;
     soften it so it does not wash the text out. */
  :root:not([data-theme="dark"]) .btn::after {
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.22) 50%, transparent 65%);
  }
}

/* ============================================================
   21. KINETIC LETTERS
   Per-character animation on the closing headline. The hero keeps
   its depletion effect (which encodes the product thesis); this is
   the page's other, louder motion moment — placed on the final CTA,
   the one spot where kinetic energy pushes toward action.
   ============================================================ */
.kl {
  display: inline;
  /* 3D space for the split-flap move */
  perspective: 900px;
}

.kl__ch {
  display: inline-block;
  /* Each letter animates on its own compositor layer. will-change is
     deliberately NOT set globally — it would promote every character
     permanently. The WAAPI transform promotes only while running. */
  transform-style: preserve-3d;
  backface-visibility: hidden;
  cursor: pointer;
  transition: color 0.18s var(--ease-out);
}

/* Letters start hidden and are revealed by the intro animation, so
   there is no flash of unstyled text before it runs. .is-set is added
   the moment the intro starts (or immediately under reduced motion). */
.kl:not(.is-set) .kl__ch { opacity: 0; }
.kl.is-set .kl__ch { opacity: 1; }

.kl__ch:hover { color: var(--amber); }

/* The whole heading is one focus target; letters are walked with arrow
   keys, and Enter/Space ripples the line. */
.kl-group:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 8px;
  border-radius: 3px;
}

/* The visual layer is inline so letters flow and wrap as normal text.
   Words are kept whole: inline-block letters would otherwise each be a
   break opportunity, splitting words mid-way across lines. */
.kl__vis { display: inline; }
.kl__word { display: inline-block; white-space: nowrap; }

/* The closing headline sets em on the hazard word; keep that colour
   when the letters are split into spans. */
.close__title em .kl__ch { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .kl__ch { cursor: default; transition: none; }
  .kl:not(.is-set) .kl__ch { opacity: 1; }
}

/* Touch devices get the tap interaction but no hover tint, which
   would otherwise stick after the tap. */
@media (hover: none) {
  .kl__ch:hover { color: inherit; }
}

/* ============================================================
   22. CORPUS — the decay map
   A full-bleed section break made from the product's own output
   rather than photography: one cell per document, coloured by how
   far past its half-life it is. Inline SVG, so it costs no network
   request and stays crisp at any size.
   ============================================================ */
.corpus {
  padding-block: var(--band);
  border-top: 1px solid var(--rule);
  background:
    radial-gradient(120% 100% at 15% 0%, color-mix(in srgb, var(--hazard) 8%, transparent), transparent 55%),
    var(--ink-850);
  overflow: hidden;
}

.corpus__fig { margin: 0; }

/* The map is intentionally wider than most viewports: a year of weeks
   does not compress honestly. It scrolls on its own axis rather than
   squashing, and never pushes the page sideways. */
.corpus__scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-inline: var(--gut);
  padding-block: clamp(1rem, 2.5vw, 1.75rem);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-600) transparent;
}
.corpus__scroll::-webkit-scrollbar { height: 6px; }
.corpus__scroll::-webkit-scrollbar-track { background: transparent; }
.corpus__scroll::-webkit-scrollbar-thumb {
  background: var(--ink-600);
  border-radius: 3px;
}

.corpus__map {
  display: block;
  width: 100%;
  min-width: 720px; /* below this the cells stop being readable */
  height: auto;
  max-width: 1180px;
  margin-inline: auto;
}

/* Semantic cell colours. Healthy documents deliberately RECEDE — they
   are drawn as cool graphite, not bright green. A saturated green grid
   reads as a contribution graph and puts the visual emphasis on the
   good news; here the decayed cells are the story, so amber and hazard
   are the only fully saturated values on the map. */
.hm { transition: opacity 0.2s var(--ease-out); }
.hm0 { fill: var(--ink-600); }                     /* accurate — recedes */
.hm1 { fill: var(--safe); opacity: 0.55; }         /* aging — faint signal */
.hm2 { fill: var(--amber); }                       /* past half-life */
.hm3 { fill: var(--hazard); }                      /* critical */

/* Hovering the map dims everything except the decayed cells, so the
   scale of the problem reads instantly. */
.corpus__map:hover .hm0 { opacity: 0.25; }
.corpus__map:hover .hm1 { opacity: 0.18; }
.corpus__map:hover .hm2 { opacity: 0.85; }
.corpus__map:hover .hm3 { opacity: 1; }

@media (hover: none) {
  .corpus__map:hover .hm0 { opacity: 1; }
  .corpus__map:hover .hm1 { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .hm { transition: none; }
}

.corpus__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.6rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem) var(--gut) 0;
}
.corpus__key {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
  white-space: nowrap;
}
.corpus__key b {
  color: var(--fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hm-sw {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
  display: inline-block;
}
/* The legend swatches are <i> elements, so they need background rather
   than the SVG fill the map cells use. */
.hm-sw.hm0 { background: var(--ink-600); }
.hm-sw.hm1 { background: var(--safe); opacity: 0.55; }
.hm-sw.hm2 { background: var(--amber); }
.hm-sw.hm3 { background: var(--hazard); }

.corpus__note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  flex-basis: 100%;
  line-height: 1.6;
}

/* ============================================================
   23. CLOSE — decaying field backdrop
   The closing section gets a field of overlapping decay curves
   behind the headline: hundreds of documents falling at once.
   Drawn in CSS/SVG rather than photographed.
   ============================================================ */
.close__field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}
.close__field path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="light"]) .close__field { opacity: 0.28; }
}
