:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --line: #e3e0d6;
  --line-2: #cfcbbf;
  --text: #141413;
  --muted: #55524b;
  --faint: #8d897f;
  --native: #3a6a96;
  --native-soft: rgba(58, 106, 150, 0.1);
  --other: #c15f3c;
  --other-soft: rgba(193, 95, 60, 0.12);
  --mid: #e6e2d8;
  --goal: #141413;
  --pass: #3f7a55;
  --fail: #b4453a;
  --warn: #6f5aa0;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --text-w: 740px;
  --wide-w: 1080px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.62 var(--sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--other); }
em { font-style: italic; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

.col { width: min(var(--text-w), 100% - 40px); margin: 0 auto; }
.wide { width: min(var(--wide-w), 100% - 32px); margin: 0 auto; }

/* ---------- top bar ---------- */
.nav { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.nav .wide { display: flex; align-items: center; height: 52px; gap: 24px; }
.brand { font: 500 13px/1 var(--mono); text-decoration: none; letter-spacing: 0.01em; }
.brand b { color: var(--other); font-weight: 500; }
.nav-links { margin-left: auto; display: flex; gap: 22px; font: 13px/1 var(--mono); color: var(--muted); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 720px) { .nav-links .opt { display: none; } }

/* ---------- header ---------- */
header.paper { padding: 72px 0 12px; }
.kicker { font: 13px/1 var(--mono); color: var(--faint); letter-spacing: 0.02em; }
h1.title { font: 400 clamp(44px, 6.4vw, 64px)/1.08 var(--serif); letter-spacing: -0.015em; margin: 18px 0 14px; }
h1.title em { color: var(--other); }
.subtitle { font: 400 clamp(20px, 2.4vw, 24px)/1.4 var(--serif); color: var(--muted); margin: 0 0 26px; }
.byline { font-size: 16px; color: var(--muted); margin-bottom: 22px; }
.byline a { color: var(--text); }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-flex; align-items: center; gap: 8px; font: 13px/1 var(--mono); text-decoration: none; color: var(--text); border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 15px; background: var(--surface); }
.button:hover { border-color: var(--text); }
.button svg { width: 14px; height: 14px; }

.tldr { margin: 40px 0 8px; padding: 2px 0 2px 20px; border-left: 2px solid var(--other); }
.tldr .label { font: 12px/1 var(--mono); color: var(--faint); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 10px; }
.tldr p { margin: 0; font: 400 22px/1.45 var(--serif); }

/* ---------- body copy ---------- */
section { padding: 56px 0 8px; }
section .col > p, header .col > p.lede { margin: 0 0 18px; }
.lede { color: var(--text); }
h2 { font: 400 34px/1.15 var(--serif); letter-spacing: -0.01em; margin: 0 0 18px; }
h2 .num { font: 14px/1 var(--mono); color: var(--faint); vertical-align: 0.45em; margin-right: 14px; letter-spacing: 0; }
h2 em { color: var(--other); }
p strong { font-weight: 600; }
.note { font-size: 16px; color: var(--muted); }

figure { margin: 30px auto 34px; }
figcaption { width: min(var(--text-w), 100%); margin: 14px auto 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
figcaption b { color: var(--text); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.panel-pad { padding: 22px 24px; }

/* ---------- key numbers ---------- */
.claims { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--text); margin: 44px 0 0; }
.claim { padding: 16px 18px 4px 0; }
.claim + .claim { padding-left: 18px; border-left: 1px solid var(--line); }
.claim .k { font: 12px/1 var(--mono); color: var(--faint); letter-spacing: 0.03em; text-transform: uppercase; }
.claim .v { font: 400 34px/1.1 var(--serif); margin: 12px 0 8px; }
.claim .d { font-size: 15px; line-height: 1.45; color: var(--muted); }
@media (max-width: 900px) { .claims { grid-template-columns: 1fr 1fr; } .claim:nth-child(3) { border-left: none; padding-left: 0; } }
@media (max-width: 520px) { .claims { grid-template-columns: 1fr; } .claim + .claim { border-left: none; padding-left: 0; border-top: 1px solid var(--line); } }

/* ---------- player ---------- */
.player { padding: 20px; }
.player-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { all: unset; cursor: pointer; font: 12.5px/1 var(--mono); padding: 8px 11px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--text); background: var(--surface-2); }
.chip { font: 12px/1 var(--mono); padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; background: var(--surface); }
.chip.pass { color: var(--pass); border-color: color-mix(in srgb, var(--pass) 45%, transparent); }
.chip.fail { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 45%, transparent); }
.chip.none { color: var(--faint); }
.spacer { flex: 1; }
select.pick { font: 12.5px/1 var(--mono); background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; }

.screens { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .screens { grid-template-columns: 1fr; } }
.pane-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.pane-head .tag { font: 11.5px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.pane-head .say { font: 400 21px/1.25 var(--serif); }
.say .obj-native { color: var(--native); font-style: italic; }
.say .obj-other { color: var(--other); font-style: italic; }
.screen { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #d9d6ce; }
.screen video, .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen .hud { position: absolute; left: 10px; top: 9px; font: 10.5px/1.5 var(--mono); color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.meter { margin-top: 12px; }
.pane-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.transport { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: var(--surface); }
.btn svg { width: 12px; height: 12px; }
input[type="range"].scrub { flex: 1; accent-color: var(--text); }
.clock { font: 12px/1 var(--mono); color: var(--muted); min-width: 96px; text-align: right; }

/* ---------- charts ---------- */
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.chart-title { font: 600 15px/1.3 var(--sans); margin-bottom: 1px; }
.chart-sub { font: 13px/1.3 var(--sans); color: var(--faint); margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font: 14px/1 var(--sans); color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-right: 7px; }
.tooltip { position: fixed; pointer-events: none; z-index: 50; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; font: 13px/1.5 var(--sans); color: var(--text); opacity: 0; transition: opacity .12s; box-shadow: 0 6px 24px rgba(20, 20, 19, 0.08); }

/* ---------- ladder ---------- */
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--text); }
.rung { padding: 16px 18px 6px 0; }
.rung + .rung { padding-left: 18px; border-left: 1px solid var(--line); }
.rung .n { font: 12px/1 var(--mono); color: var(--faint); letter-spacing: 0.03em; }
.rung h3 { font: 600 17px/1.2 var(--sans); margin: 10px 0 6px; }
.rung .big { font: 400 44px/1.05 var(--serif); letter-spacing: -0.01em; }
.rung .big.pass { color: var(--pass); } .rung .big.fail { color: var(--fail); } .rung .big.warn { color: var(--warn); }
.rung p { font-size: 15px; color: var(--muted); margin: 8px 0 12px; line-height: 1.45; }
.rung .audits { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 900px) { .ladder { grid-template-columns: 1fr 1fr; } .rung:nth-child(3) { border-left: none; padding-left: 0; } }
@media (max-width: 520px) { .ladder { grid-template-columns: 1fr; } .rung + .rung { border-left: none; padding-left: 0; border-top: 1px solid var(--line); } }

/* ---------- ledger ---------- */
.ledger { border-top: 1px solid var(--text); font-size: 15px; }
.row { display: grid; grid-template-columns: 44px 1.1fr 1.7fr 1.8fr 104px; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.row .s { font: 12px/1 var(--mono); color: var(--faint); }
.row .t { font-weight: 600; text-decoration: none; }
.row .t:hover { color: var(--other); }
.row .q { color: var(--muted); }
.decision { justify-self: end; font: 11.5px/1 var(--mono); text-transform: lowercase; }
.decision.positive { color: var(--pass); } .decision.negative { color: var(--fail); }
.decision.boundary { color: var(--other); } .decision.inconclusive, .decision.exploratory { color: var(--warn); }
.decision.stop { color: var(--muted); }
@media (max-width: 900px) { .row { grid-template-columns: 40px 1fr; } .row .q, .row .r, .decision { grid-column: 2; justify-self: start; } }

/* ---------- bibtex ---------- */
pre.bib { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; font: 13px/1.6 var(--mono); overflow-x: auto; color: var(--text); margin: 0; }
.copy { position: absolute; top: 10px; right: 10px; font: 12px/1 var(--mono); border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 6px 9px; cursor: pointer; }

footer { margin-top: 72px; padding: 28px 0 60px; border-top: 1px solid var(--line); font-size: 14px; color: var(--faint); }
footer .wide { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

/* ---------- static figure export ---------- */
body.figure { background: #ffffff; }
.fig { width: 1600px; background: #ffffff; }
.fig-pad { padding: 48px 56px 44px; }
.fig-title { font: 400 38px/1.12 var(--serif); margin: 0 0 8px; letter-spacing: -0.01em; }
.fig-title em { color: var(--other); }
.fig-sub { font: 19px/1.5 var(--sans); color: var(--muted); margin: 0 0 26px; max-width: 1260px; }
.fig-foot { font: 13px/1.5 var(--mono); color: var(--faint); margin-top: 16px; display: flex; justify-content: space-between; }
.claims + figure, .wide + figure.wide { margin-top: 44px; }
