/* udpstp landing page. Palette D: graphite, blue signal, coral accent; dark
   by default, light when the reader's system asks for it. The token blocks
   are checked by `cargo xtask site contrast` (website/contrast.toml). */
@font-face {
  font-family: "udpstp Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/udpstp-display-bold.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/source-code-pro-500.woff2") format("woff2");
}

/* tokens: landing dark */
:root {
  --bg: #121214;
  --surface: #1c1c20;
  --surface-2: #26262b;
  --line: #2e2e33;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #fb7185;
  --accent-hover: #fda4af;
  --accent-text: #fb7185;
  --on-accent: #3b0712;
  --edge: #fb7185;
  --signal: #38bdf8;
  --signal-hover: #7dd3fc;
  --prompt: #38bdf8;
  --terminal-success: #4ade80;
  --glow: rgba(56, 189, 248, 0.18);
  --install-glow: rgba(251, 113, 133, 0.28);
  --table-row-bg: #121214;
  --table-row-alternate: #1c1c20;
  --trace: rgba(56, 189, 248, 0.22);
  --packet-pulse: rgba(251, 113, 133, 0.35);
  --headline-glow: rgba(56, 189, 248, 0.45);
}

@media (prefers-color-scheme: light) {
  /* tokens: landing light */
  :root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --line: #d4d4d8;
    --text: #18181b;
    --muted: #52525b;
    --accent: #e11d48;
    --accent-hover: #be123c;
    --accent-text: #be123c;
    --on-accent: #ffffff;
    --edge: #e11d48;
    --signal: #0369a1;
    --signal-hover: #075985;
    --prompt: #0369a1;
    --terminal-success: #166534;
    --glow: rgba(3, 105, 161, 0.14);
    --install-glow: rgba(225, 29, 72, 0.18);
    --table-row-bg: #fafafa;
    --table-row-alternate: #f0f0f2;
    --trace: rgba(3, 105, 161, 0.18);
    --packet-pulse: rgba(225, 29, 72, 0.22);
    --headline-glow: rgba(3, 105, 161, 0);
  }
}

:root {
  color-scheme: dark light;
  --display: "udpstp Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wide: 72rem;
}

* { box-sizing: border-box; }
/* Clip decorative overflow at both page boxes without adding a scroll container. */
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 var(--sans);
  padding-inline: clamp(16px, 4vw, 48px);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--signal); text-underline-offset: 3px; }
a:hover { color: var(--signal-hover); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--mono); font-size: 0.9em; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.08; }
img { max-width: 100%; }
main, section, aside, figure, .phase { min-width: 0; }
p { overflow-wrap: break-word; }

.skip {
  position: absolute; left: 12px; top: -100px; z-index: 10;
  background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--signal);
}
.skip:focus { top: 12px; }
main:focus { scroll-margin-top: 1rem; }

.nav, main, .footer { max-width: var(--wide); margin-inline: auto; }

/* Navigation */
.nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font: 600 1.25rem/1 var(--mono); letter-spacing: -0.02em;
}
.brand picture, .brand-mark { width: 24px; height: 24px; display: block; }
.nav nav { display: flex; flex-wrap: wrap; gap: 22px; font-size: 0.9375rem; }
.nav nav a { color: var(--muted); text-decoration: none; padding-block: 6px; }
.nav nav a:hover { color: var(--text); }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-block: 72px 80px; border-top: 0;
}
.hero { position: relative; isolation: isolate; }
.hero-copy { max-width: 42rem; }
/* The hero's backdrop: a breathing glow behind the headline and the trace of a
   capacity search, its sending rate rising to the plateau a Test finds. */
.hero-scene { position: absolute; inset: 0 calc(-1 * clamp(16px, 4vw, 48px)); z-index: -1; pointer-events: none; overflow: hidden; }
.hero-glow {
  position: absolute; left: -8%; top: -18%; width: min(760px, 80vw); aspect-ratio: 1.4; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent); opacity: 0.8;
}
.capacity-trace { position: absolute; left: 0; right: 0; bottom: 6px; width: 100%; height: clamp(48px, 6vw, 72px); overflow: visible; }
.capacity-trace path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.trace-base { stroke: var(--trace); stroke-dasharray: 2 6; }
.trace-live {
  stroke: var(--signal); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 0.12 1; stroke-dashoffset: 1.12; filter: drop-shadow(0 0 6px var(--signal));
}
h1 .word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.1em; margin-bottom: -0.1em; }
h1 [data-word] { display: inline-block; }
.glow-line { text-shadow: 0 0 28px var(--headline-glow); }
.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 16px; color: var(--signal);
  font: 500 0.8125rem/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
}
h1 { font-size: clamp(2.5rem, 5.3vw, 4.4rem); color: var(--signal); }
.lede { margin: 24px 0 16px; color: var(--muted); font-size: 1.18rem; max-width: 40rem; }
.lede strong { color: var(--text); font-weight: 600; }
.hero-context { margin: 0; color: var(--muted); font-size: 0.9375rem; max-width: 38rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 26px 0 0; list-style: none; font-size: 0.8125rem; color: var(--muted); }
.hero-facts li { padding-left: 12px; position: relative; }
.hero-facts li::before { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; left: 0; top: 0.7em; background: var(--signal); }

.installer {
  position: relative; isolation: isolate;
  padding: 28px; border: 1px solid var(--edge); border-radius: 16px; background: var(--surface);
}
/* A filled colour layer avoids the empty centre of a scaled outer shadow. */
.installer::before {
  content: ""; position: absolute; inset: -10px; z-index: -2; pointer-events: none;
  border-radius: inherit; opacity: 0.85;
  background: linear-gradient(135deg, var(--install-glow), var(--glow) 65%, var(--install-glow));
  filter: blur(22px);
}
.installer::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit; background: var(--surface);
}
.install-heading { display: flex; align-items: center; gap: 16px; }
.install-heading img { display: block; }
.install-heading .eyebrow { margin-bottom: 4px; }
.install-heading h2 { font-size: 2rem; }
.install-intro { margin: 20px 0; color: var(--muted); font-size: 0.875rem; }
.install-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.install-tabs[hidden], .copy[hidden] { display: none; }
.install-method { margin-bottom: 8px; font-size: 0.9375rem; }
.installer.enhanced .install-method { display: none; }
/* #panel-script matches the first tab selected by landing.js. Pending controls
   reserve their final space while remaining invisible and unfocusable. */
.landing-enhancing .installer:not(.enhanced) .install-method,
.landing-enhancing .installer:not(.enhanced) .install-panel:not(#panel-script) { display: none; }
.landing-enhancing .installer:not(.enhanced) .install-tabs[hidden] { display: flex; visibility: hidden; }
.landing-enhancing .installer:not(.enhanced) .copy[hidden] { display: block; visibility: hidden; }
.install-tabs [role="tab"] {
  flex: none; font: 500 0.875rem/1 var(--sans); color: var(--muted); background: none;
  border: 1px solid transparent; border-radius: 7px; padding: 9px 12px; cursor: pointer;
}
.install-tabs [role="tab"]:hover { color: var(--text); }
.install-tabs [role="tab"][aria-selected="true"] { color: var(--text); background: var(--bg); border-color: var(--signal); }
.install {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--signal); border-radius: 8px;
  padding: 6px 6px 6px 12px;
}
.install code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  font-size: 0.8125rem; padding-block: 8px; scrollbar-width: thin;
}
.install code::before { content: "$ "; color: var(--prompt); }
.copy {
  flex: none; font: 600 0.875rem/1 var(--sans); color: var(--on-accent);
  background: var(--accent); border: 0; border-radius: 7px; padding: 10px 14px; cursor: pointer;
  min-height: 36px;
}
.copy:hover { background: var(--accent-hover); }
.install-panel + .install-panel { margin-top: 12px; }
.install-panel[hidden] + .install-panel, .install-panel + .install-panel[hidden] { margin-top: 0; }
.install-note { margin: 10px 0 0; color: var(--muted); font-size: 0.875rem; }
.install-alt { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.875rem; }
.install-alt .source-build { display: inline-block; margin-top: 8px; color: var(--muted); }
.install-alt .source-build:hover { color: var(--text); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-block; padding: 11px 18px; border-radius: 9px;
  border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9375rem;
}
.button:hover { border-color: var(--muted); color: var(--text); }
.button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.button.accent-edge { border-color: var(--accent); }
.button.accent-edge:hover { border-color: var(--accent-hover); }

/* Sections */
section { padding-block: 64px; border-top: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: 32px; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.section-head p { margin: 12px 0 0; color: var(--muted); }
.section-head .eyebrow { color: var(--signal); margin: 0 0 12px; }
.more { margin: 18px 0 0; }

/* Terminal */
.run { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.6fr); align-items: start; gap: 40px; }
.run-copy { margin: 0; }
.terminal { margin: 0; }
.terminal-bar, .terminal pre { background: var(--surface); }
.terminal-bar {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 18px; font: 500 0.75rem/1.5 var(--mono); color: var(--text);
  border: 1px solid var(--signal); border-bottom: 0; border-radius: 12px 12px 0 0;
}
.terminal-origin { color: var(--muted); }
.terminal pre {
  margin: 0; overflow-x: auto; scrollbar-width: thin;
  border: 1px solid var(--signal); border-radius: 0 0 12px 12px;
  box-shadow: 0 30px 80px -40px var(--glow);
}
.terminal code {
  display: block; padding: 18px 20px 22px; font-size: 0.8125rem; line-height: 1.7;
  color: var(--text); white-space: pre; width: max-content; min-width: 100%;
}
.terminal figcaption { margin-top: 10px; color: var(--muted); font-size: 0.875rem; }
.prompt { color: var(--prompt); }
.terminal .command { font-weight: 700; }
.terminal .info { color: var(--signal); }
.terminal .key { color: var(--terminal-success); font-weight: 600; }
.terminal .warning { color: var(--accent-text); }
.cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.2em; background: var(--signal); }

/* Feature cards share one frame. */
.why-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--edge); border-radius: 12px; overflow: hidden;
}
.why-grid li { background: var(--surface); padding: 24px; }
.why-grid h3 { font-size: 1.05rem; margin-bottom: 8px; }
.why-grid p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.why-grid strong, .why-grid code { color: var(--text); }
.why-grid strong.figure { color: var(--signal); }
.why-grid .feature-index { margin-bottom: 20px; color: var(--signal); font: 500 0.8125rem/1 var(--mono); }
.figure { color: var(--signal); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Proof: the key figures and the coverage table. */
.proof-frame { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 24px; }
.figures div { display: flex; flex-direction: column-reverse; gap: 10px; padding-left: 16px; border-left: 2px solid var(--signal); }
.figures dt { color: var(--muted); font-size: 0.875rem; }
.figures dd { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.figures .figure { font: 700 clamp(2rem, 4vw, 2.8rem)/1 var(--display); margin-right: 4px; }
.table-scroll { overflow-x: auto; scrollbar-width: thin; border: 1px solid var(--edge); border-radius: 12px; background: var(--bg); }
.coverage caption, .compare caption { padding: 12px 16px; text-align: left; color: var(--muted); font-size: 0.875rem; border-bottom: 1px solid var(--line); }
.coverage { width: 100%; border-collapse: collapse; font-size: 0.90625rem; font-variant-numeric: tabular-nums; }
.coverage th, .coverage td { padding: 10px 14px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.coverage thead th { border-top: 0; color: var(--muted); font: 500 0.78125rem/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.coverage th[scope="row"], .coverage thead th:first-child { text-align: left; font-weight: 600; }
.coverage th[scope="row"] .topic { color: var(--muted); font-weight: 400; margin-left: 6px; white-space: normal; }
.table-note { margin: 0 0 20px; color: var(--muted); font-size: 0.875rem; }
.record-heading { margin-top: 28px; }
.record-heading h3 { font-size: 1.125rem; }
.record-heading p { margin: 6px 0 18px; color: var(--muted); font-size: 0.875rem; }
.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; }
.record-grid dt { font-weight: 600; font-size: 0.9375rem; }
.record-grid dd { margin: 8px 0 0; color: var(--muted); font-size: 0.875rem; }
.record-grid .figure { font-size: 1.125rem; }

/* Comparison */
.compare { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 0.9375rem; }
.compare th, .compare td { padding: 18px 20px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { background: var(--surface); color: var(--muted); font: 500 0.78125rem/1.5 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; border-top: 0; }
.compare th[scope="row"] { width: 22%; font-weight: 600; }
.compare td { width: 39%; }
.compare td:first-of-type { color: var(--muted); }
.coverage tbody tr > *, .compare tbody tr > * { background: var(--table-row-bg); }
.coverage tbody tr:nth-child(even) > *, .compare tbody tr:nth-child(even) > * { background: var(--table-row-alternate); }
.compare-label { display: none; }

/* How a Test works */
.test-illustration { margin: 0; }
.phase-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr); gap: 24px; }
.phase { padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.phase-number { margin: 0 0 10px; color: var(--signal); font: 500 0.8125rem/1 var(--mono); }
.phase h3 { font: 700 1.7rem/1.2 var(--display); }
.phase > p:not(.phase-number) { font-size: 0.9375rem; color: var(--muted); }
.control-steps { padding: 0; margin: 28px 0; list-style: none; counter-reset: exchanges; }
.control-steps li { position: relative; padding: 0 0 22px 38px; border-left: 1px solid var(--line); margin-left: 12px; counter-increment: exchanges; }
.control-steps li:last-child { padding-bottom: 0; border-left-color: transparent; }
.control-steps li::before { content: counter(exchanges); position: absolute; left: -13px; top: 0; width: 26px; height: 26px; text-align: center; border: 1px solid var(--signal); border-radius: 50%; background: var(--surface); color: var(--signal); font: 500 0.75rem/24px var(--mono); }
.control-steps strong { display: block; font-size: 0.9375rem; }
.control-steps span { display: block; margin-top: 6px; font-size: 0.875rem; color: var(--muted); }
.phase .phase-end { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.phase-end span { color: var(--signal); }
.endpoints { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; }
.endpoints p { margin: 0; }
.endpoints p:last-child { text-align: right; }
.endpoints strong { display: block; font-size: 1.0625rem; }
.endpoints span { display: block; color: var(--muted); font-size: 0.8125rem; }
.pdu-route { margin-top: 22px; }
.pdu-route p { margin: 0; text-align: center; }
.pdu-route strong { display: block; font-size: 0.9375rem; color: var(--signal); }
.pdu-route p span { display: block; font-size: 0.8125rem; color: var(--muted); }
.route-line { display: block; position: relative; height: 2px; margin-top: 12px; background: var(--signal); }
/* Packets travel only while landing.js animates them; otherwise they're invisible. */
.packet {
  position: absolute; top: -4px; left: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 3px;
  background: var(--signal); box-shadow: 0 0 10px var(--signal); opacity: 0;
}
.packet.status { background: var(--accent); box-shadow: 0 0 10px var(--accent); border-radius: 50%; }
.route-line::before { content: ""; position: absolute; top: -4px; width: 10px; height: 10px; border-top: 2px solid var(--signal); border-right: 2px solid var(--signal); }
.to-client .route-line::before { left: 0; transform: rotate(-135deg); }
.to-server .route-line::before { right: 0; transform: rotate(45deg); }
.algorithm { margin: 26px 0 0 auto; border: 1px solid var(--edge); border-radius: 8px; padding: 16px 18px; max-width: 24rem; background: var(--bg); }
.algorithm-location { margin: 0 0 6px; color: var(--accent-text); font: 500 0.75rem/1.4 var(--mono); }
.algorithm h4 { margin: 0; font-size: 0.9375rem; line-height: 1.4; }
.algorithm > p:not(.algorithm-location) { margin: 8px 0 0; color: var(--muted); font-size: 0.875rem; }
.algorithm .feedback-return { color: var(--signal); }
.feedback-return span { margin-right: 4px; font-size: 1.125rem; }
.test-illustration figcaption { margin-top: 18px; max-width: 60rem; font-size: 0.875rem; color: var(--muted); }
.exchange-details { margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.exchange-details summary { padding: 18px 22px; color: var(--signal); cursor: pointer; }
.diagram { margin: 0; background: var(--surface); border-radius: 12px; padding: 20px; }
.diagram-scroll { overflow-x: auto; scrollbar-width: thin; }
.diagram img { display: block; width: 100%; min-width: 620px; max-width: 820px; height: auto; margin: 0 auto; }
.diagram figcaption { margin: 16px auto 0; max-width: 60rem; color: var(--muted); font-size: 0.875rem; }

/* The final invitation gives the next action a home after the technical detail. */
.adoption-frame {
  padding: clamp(28px, 5vw, 52px); border: 1px solid var(--edge); border-radius: 16px;
  background: linear-gradient(135deg, var(--surface), var(--bg));
}
.adoption h2 { max-width: 42rem; font-size: clamp(2rem, 4.2vw, 3.25rem); }
.adoption-frame > p:not(.eyebrow) { max-width: 42rem; margin: 20px 0 0; color: var(--muted); }
.adoption-frame > .adoption-note { margin-top: 24px; font-size: 0.875rem; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: 32px 48px; color: var(--muted); font-size: 0.875rem; }
.footer p { margin: 6px 0; }
.footer a { color: var(--text); }
.footer .author { margin-top: 14px; }
.footer .profiles { margin-left: 10px; }
.footer .profiles a, .footer .sibling a { color: var(--muted); }
.motion-toggle {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 5;
  font: 600 0.8125rem/1 var(--sans); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; cursor: pointer;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}
.motion-toggle:hover { border-color: var(--signal); }
.motion-toggle[hidden] { display: none; }
.motion-toggle:disabled { color: var(--muted); cursor: default; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Tablets and narrow windows */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 48rem; }
  .installer { max-width: 42rem; }
  .run { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phase-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Phones */
@media (max-width: 640px) {
  body { font-size: 1rem; padding-inline: 16px; }
  .hero { padding-block: 36px 48px; gap: 32px; }
  h1 { font-size: clamp(2.5rem, 9vw, 3.5rem); }
  .lede { font-size: 1.08rem; }
  .installer { padding: 20px; }
  .install-heading h2 { font-size: 1.8rem; }
  .install-tabs [role="tab"] { padding-inline: 8px; font-size: 0.8125rem; }
  .nav nav { gap: 16px; font-size: 0.875rem; }
  .nav nav a:nth-child(2) { display: none; }
  .install code { font-size: 0.8125rem; }
  section { padding-block: 48px; }
  .why-grid, .figures, .record-grid { grid-template-columns: minmax(0, 1fr); }
  .why-grid .feature-index { margin-bottom: 12px; }
  .proof-frame { padding: 16px; }
  .figures { gap: 24px; }
  .phase { padding: 22px; }
  .algorithm { padding: 14px; }
  .pdu-route p span { font-size: 0.875rem; }
  .endpoints span { font-size: 0.875rem; }
  .terminal code { font-size: 0.75rem; }
  /* Keep all three cell meanings when the comparison becomes one column. */
  .compare { min-width: 0; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .compare tbody { display: block; }
  .compare tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); }
  .compare th[scope="row"], .compare td { display: block; width: auto; padding: 10px 16px; border-top: 0; }
  .compare th[scope="row"] { border-top: 1px solid var(--line); padding-top: 18px; }
  .compare td:last-child { padding-bottom: 18px; }
  .compare-label { display: block; margin-bottom: 4px; font-weight: 600; color: var(--text); }
}

@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight; }
  a, a:hover { color: LinkText; }
  .button, .copy, .install-tabs [role="tab"], .installer, .install,
  .terminal-bar, .terminal pre, .phase, .algorithm, .proof-frame, .table-scroll,
  .exchange-details, .adoption-frame {
    border-color: CanvasText;
  }
  .installer::before, .installer::after, .hero-scene, .packet { display: none; }
  .motion-toggle { border-color: CanvasText; }
  .terminal .prompt, .terminal .info, .terminal .key, .terminal .warning { color: inherit; }
  .adoption-frame { background: Canvas; }
  .install-tabs [role="tab"][aria-selected="true"] { border: 2px solid Highlight; }
  .route-line, .route-line::before { background: CanvasText; border-color: CanvasText; }
  .coverage tbody tr:nth-child(even) > *, .compare tbody tr:nth-child(even) > * {
    border-bottom-style: dashed;
  }
}
/* Motion (landing.js). The markup is the settled result: entrances hide
   content only once the script has prepared them, and loops start only while
   visible. Reduced motion and print show everything still. */
[data-entrances-ready] [data-reveal]:not([data-revealed]) { opacity: 0; }
[data-entrances-ready] [data-word]:not([data-revealed]) { transform: translateY(105%); }
@media (prefers-reduced-motion: no-preference) {
  .installer.enhanced .install-panel:not([hidden]) { animation: landing-panel 260ms ease-out; }
  .button, .copy, .install-tabs [role="tab"], .motion-toggle { transition: transform 120ms ease-out, border-color 120ms ease-out; }
  .button:active, .copy:active, .install-tabs [role="tab"]:active, .motion-toggle:active { transform: scale(0.98); }
}
@keyframes landing-panel { from { transform: translateY(3px); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .trace-live, .packet { display: none; }
}

@media print {
  html, body { overflow-x: visible; }
  [data-reveal], [data-word] { opacity: 1 !important; transform: none !important; }
  .hero-scene, .motion-toggle, .packet { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .installer::before, .installer::after { display: none; }
  .terminal-bar, .terminal pre, .adoption-frame { border-color: #888888; box-shadow: none; }
  .terminal-bar, .terminal pre { background: #ffffff; color: #18181b; }
  .terminal code { color: #18181b; }
  .terminal .prompt, .terminal .info, .terminal .key, .terminal .warning { color: inherit; }
  .adoption-frame { background: none; }
  .table-scroll { overflow: visible; border-color: #888888; }
  .coverage, .compare { min-width: 0; font-size: 10pt; color: #18181b; }
  .coverage th, .coverage td { white-space: normal; padding: 5pt; }
  .compare th, .compare td { padding: 5pt; }
  .coverage thead th, .compare thead th { color: #18181b; background: #ededed; }
  .coverage tbody tr > *, .compare tbody tr > * { background: #ffffff; }
  .coverage tbody tr:nth-child(even) > *, .compare tbody tr:nth-child(even) > * { background: #f0f0f0; }
  .coverage, .compare { print-color-adjust: exact; }
  .coverage a, .coverage .topic, .compare td:first-of-type { color: inherit; }
  .compare-label { color: inherit; }
}
