/* Exposure Race — styles.
 *
 * Theme model: the complete palette is defined on :root (light). Dark is a
 * token-only override, applied both by preference and by explicit data-theme,
 * so nothing is ever defined *only* inside a media query.
 *
 * Type model: three families, one job each. A serif carries the argument, a
 * grotesque carries the prose, and the monospace carries every measurement.
 * The split is the thesis in miniature — an opinionated voice making claims,
 * resting on instrumentation that is conspicuously not trying to persuade.
 */

:root {
  /* Paper rather than white: the ground carries the same green cast as the
   * rest of the system, so a card reads as a raised sheet on a treated
   * surface rather than as white-on-white. */
  --ink:   #F6F8F7;  --panel: #FFFFFF;  --sunk:  #E9EFED;
  --rule:  #D3DFDB;  --rule2: #7F9490;
  --txt:   #0A1514;  --mut:   #536B67;  --dim:   #5C726E;
  --att:   #C4400F;  --def:   #0A7A69;  --bad:   #C11834;
  --zero:  #7029CC;  --warn:  #8A6008;
  --shadow: 0 1px 2px rgba(10,21,20,.05), 0 10px 30px -14px rgba(10,21,20,.20);
  --track: #CBD8D5;

  /* Binds the UA surfaces we do not draw — scrollbars, form controls — to the
   * theme the page actually chose, not to the OS. Without this an explicit
   * toggle that disagrees with prefers-color-scheme leaves a light scrollbar
   * on a near-black page. */
  color-scheme: light;

  --disp: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --body: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink:   #07100F;  --panel: #101D1B;  --sunk:  #0B1615;
    --rule:  #253A37;  --rule2: #486E69;
    --txt:   #E4EFEC;  --mut:   #93ABA7;  --dim:   #7B9591;
    --att:   #FF6B4A;  --def:   #4FD5C2;  --bad:   #FF4A67;
    --zero:  #BE6BFF;  --warn:  #FFC24D;
    --shadow: none;
    --track: #24403D;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink:   #07100F;  --panel: #101D1B;  --sunk:  #0B1615;
  --rule:  #253A37;  --rule2: #486E69;
  --txt:   #E4EFEC;  --mut:   #93ABA7;  --dim:   #7B9591;
  --att:   #FF6B4A;  --def:   #4FD5C2;  --bad:   #FF4A67;
  --zero:  #BE6BFF;  --warn:  #FFC24D;
  --shadow: none;
  --track: #24403D;
}

/* ── base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--txt);
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; padding-bottom: 76px;
}
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--def); outline-offset: 2px; border-radius: 3px; }
/* The selection colour ships from the browser and belongs to no palette. Take
 * it from the one accent that already means "measured", so highlighting a
 * figure to check it looks like part of the instrument. */
::selection { background: var(--def); color: var(--ink); }

/* Anchored sections must clear the docked readout, which is fixed to the top
 * of the viewport and would otherwise cover the heading you just jumped to. */
[id^="p-"] { scroll-margin-top: 74px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 420px) { .wrap { padding: 0 16px; } }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--panel); color: var(--txt); border: 1px solid var(--rule2);
  border-radius: 7px; padding: 9px 14px; font-size: 13px;
  transition: top .16s var(--ease);
}
.skip:focus { top: 12px; }

/* Available to a screen reader, absent from the page. Used for the results
 * landmark heading and for the state the dashed "derived" border carries
 * visually. */
.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; white-space: nowrap;
  clip-path: inset(50%);
}
/* display:none rather than .vh alone: the string must leave the accessible
 * name entirely when the posture is not a derived match. */
.presets .near-note { display: none; }
.presets button.near .near-note { display: inline; }
/* The results column takes focus from the skip link and should not draw a
 * ring around the whole page for it. */
.results:focus { outline: none; }
.results:focus-visible { outline: 2px solid var(--def); outline-offset: 6px; }

/* ── masthead ───────────────────────────────────────────────────────────── */
header { border-bottom: 1px solid var(--rule); padding: 30px 0 30px; margin-bottom: 26px; }
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--mut);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--rule); min-width: 20px; }

/* The masthead runs two columns so the headline is not left with half a
 * screen of empty paper beside it: the argument sits left, the three measured
 * figures it rests on sit right. Below 900px the figures fall underneath and
 * become a horizontal strip. */
.mast {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 20px 44px; align-items: end; margin-top: 20px;
}
@media (max-width: 900px) { .mast { grid-template-columns: 1fr; align-items: start; } }

h1 {
  font-family: var(--disp); font-weight: 500;
  font-size: clamp(33px, 5.1vw, 60px); line-height: 1.02; letter-spacing: -.016em;
  margin: 0; max-width: 17ch; text-wrap: balance;
}
/* The clause where the argument turns. Italic does the work a colour cannot:
 * it survives greyscale, print and colour-blindness. */
h1 em { font-style: italic; color: var(--att); }
.sub { color: var(--mut); max-width: 66ch; margin: 16px 0 0; font-size: 15px; }
.sub b { color: var(--txt); font-weight: 600; }

.topbar { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.eyebrow .topbar::after { content: none; }

/* ── the measured clock ─────────────────────────────────────────────────── */
.clock { border-top: 1px solid var(--rule2); padding-top: 12px; }
.clock-h {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--mut);
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.clock dl { margin: 0; }
.clock dl > div {
  display: flex; align-items: baseline; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
}
.clock dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.clock dt { flex: 1; font-size: 12.5px; color: var(--mut); line-height: 1.35; }
.clock dd {
  margin: 0; font-family: var(--mono); font-size: 17px; font-weight: 500;
  color: var(--def); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}

/* ── docked readout ─────────────────────────────────────────────────────── */
/* The instrument is long and the rail is sticky, so a reader adjusting a
 * slider two thousand pixels down had no sight of the number they were
 * moving. This carries it, and only appears once the real stat row is gone. */
.dock {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  background: var(--panel); border-bottom: 1px solid var(--rule);
  transform: translateY(-101%); transition: transform .26s var(--ease);
  box-shadow: var(--shadow);
}
.dock.up { transform: none; }
.dock-in {
  display: flex; align-items: baseline; gap: 14px;
  padding-top: 10px; padding-bottom: 10px;
  /* One line or nothing: wrapped, it broke "90% band 21% to 34%" across two
   * rows and doubled the height the sticky rail has to clear. */
  flex-wrap: nowrap; overflow: hidden;
}
/* The label yields, the answer does not. Nowrap with no shrink meant a 263px
 * label pushed the figure off the right edge below ~342px — at 320px, the
 * reflow width, what stayed on screen was the caption and what left was the
 * number. "The answer stays" has to survive its own narrowest case.
 *
 * It is also a 36-character sentence, so it takes the body face in sentence
 * case per The Long Label Rule — the same treatment .stat .k carries, because
 * this is that label in another position and a reader should not have to
 * learn it twice. That is what buys the room: caps plus .13em tracking
 * measured 263px against 197px set this way, so the 66px the rule gives back
 * is the same 66px the ellipsis below was spending. The truncation stays as a
 * backstop rather than as the thing keeping the number on screen. */
.dock-k {
  font-family: var(--body); font-size: 11.5px; letter-spacing: 0;
  color: var(--mut); white-space: nowrap;
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.dock-v {
  font-family: var(--mono); font-size: 19px; font-weight: 600; color: var(--bad);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  flex: none;
}
.dock-ci {
  font-family: var(--mono); font-size: 11px; color: var(--mut);
  white-space: nowrap;
}
.dock-est {
  font-size: 11.5px; color: var(--dim); margin-left: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 720px) { .dock-ci, .dock-est { display: none; } }

/* ── buttons ────────────────────────────────────────────────────────────── */
button {
  font: inherit; font-size: 12.5px; color: var(--txt);
  background: var(--panel); border: 1px solid var(--rule2); border-radius: 7px;
  padding: 6px 11px; cursor: pointer; line-height: 1.3;
  transition: background .14s var(--ease), border-color .14s var(--ease),
              color .14s var(--ease);
}
/* The accent is whichever the surrounding card sets — .card.def and .card.att
 * each declare --accent, and every other accented element already reads it.
 * These two did not, which was invisible for as long as the only selectable
 * buttons on the page sat in the defender card. The attention ladder put a
 * selectable button inside the attacker card for the first time, and a lit
 * chip rendered Defender Teal inside a Vermilion-headed card. */
button:hover { border-color: var(--accent, var(--def)); color: var(--accent, var(--def)); }
button.on {
  background: var(--accent, var(--def)); border-color: var(--accent, var(--def));
  color: var(--ink); font-weight: 600;
}
button.on:hover { color: var(--ink); }
button.ghost { background: transparent; }
.icon-btn {
  padding: 5px 9px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
}

/* A two-state metric switch reads as one control, not two loose buttons that
 * happen to be adjacent. The shared edge is drawn once. */
.switch { display: flex; }
.switch button { border-radius: 0; }
.switch button:first-child { border-radius: 7px 0 0 7px; }
.switch button:last-child { border-radius: 0 7px 7px 0; margin-left: -1px; }
.switch button.on { position: relative; z-index: 1; }

/* ── layout ─────────────────────────────────────────────────────────────── */
/* Three grid children — stats, rail, results — placed explicitly, because the
 * source order and the desktop order genuinely differ. The answer leads the
 * document: on one column it simply flows first, and on two the explicit
 * placement lifts the rail into the left margin beside it.
 *
 * The answer used to lead only in pixels, via `order`, which reaches neither
 * speech order nor reflow order — a screen reader met the whole console
 * before the number. Source order carries it now, so `order` is gone. The
 * stat bank holds nothing focusable, so leading costs the keyboard nothing. */
.grid { display: grid; grid-template-columns: 322px 1fr; gap: 18px 30px; align-items: start; }
.stats      { grid-column: 2; grid-row: 1; }
/* The scope statement takes a row of its own between the figures and the
 * document, because it qualifies the figures and is read before the document.
 * Placed explicitly for the same reason everything else in this grid is: the
 * rail spans the full height, so an auto-placed item lands in the one column
 * that is already occupied. */
.scope-note { grid-column: 2; grid-row: 2; }
.rail       { grid-column: 1; grid-row: 1 / span 3; }
.results    { grid-column: 2; grid-row: 3; min-width: 0; container-type: inline-size; }

@media (max-width: 1040px) {
  .grid { grid-template-columns: 1fr; }
  .stats, .scope-note, .rail, .results { grid-column: 1; grid-row: auto; }
}

/* Ranked by how often each part is used, not by topic. The threat card comes
 * first because it is the half operated *while reading*; the estate card is
 * set once, at the start, and follows. Ordering it by subject instead left
 * one slider of twelve visible at rest and put the compression control 536px
 * below the fold, with a trait selection pushing it a further 677px down. The
 * contents list, which is navigation rather than instrument, has left the
 * rail entirely — see .toc.
 *
 * Ranking is the whole of the answer here. A later pass tried to go further
 * and pin the threat card in a scroller of its own; what that cost is set out
 * against .card h2 below, and it is the reason this is one scroller again. */
.rail {
  position: sticky; top: 16px; max-height: calc(100vh - 32px);
  overflow-y: auto; padding-right: 6px;
  transition: top .26s var(--ease);
  /* Deliberately NOT scroll-behavior: smooth, and the jump links do not pass
   * behavior:"smooth" either. Measured: where the engine is not ticking a
   * scroll animation — a throttled renderer, a background tab, a headless
   * pane — a smooth programmatic scroll does not arrive late, it does not
   * arrive at all. Both forms were checked against this page: with smooth,
   * .rail.scrollTop was still 0 nine hundred milliseconds after being
   * assigned 300; with auto it was 300 immediately. A jump link that lands is
   * worth more than one that glides, and what tells the reader where they
   * landed is the outline on .ctrl.flash rather than the travel. */
}

/* One scroller, not two.
 *
 * The rail used to split at tall viewports: the threat card pinned inside its
 * own `overflow-y: auto` zone, above a second `overflow-y: auto` zone holding
 * the estate card. Measured at 1500x1080 that gave a 648px window onto 887px
 * of threat controls and a 400px window onto 1,365px of estate controls — two
 * scrollbars a few pixels apart in a 322px column, and a wheel gesture whose
 * effect depended on which pixel row the pointer happened to be over. Worse,
 * the seam between them was a card boundary, which is the one thing a scroll
 * boundary must not look like: nothing on screen said the lower half was a
 * separate 29%-of-content porthole rather than the end of the rail.
 *
 * The pin was answering a real question the wrong way round. Chapter 07 hands
 * the reader the compression slider by name, so that slider has to be
 * reachable from six thousand pixels down the document. But "reachable from
 * the prose" and "resident on screen forever" are different requirements, and
 * only the second one costs a second scroll container. The prose carries the
 * link now — see .ctl-link here and jumpToControl() in app.js — which answers
 * it at every viewport, including the narrow one, where a pin has never
 * existed at all and the reader was left to hunt.
 *
 * What replaces the pin as orientation is the card's own title: it sticks to
 * the top of the single scroller, so the column always says which half of the
 * model is under the pointer without spending a scrollbar to say it. */
.card h2 {
  position: sticky; top: 0; z-index: 2;
  /* Bled out to the card's border edge so that controls pass behind an opaque
   * band rather than behind the title's own glyphs; the padding then puts the
   * text back exactly where the card's own padding had it. The hairline is
   * unconditional rather than stuck-only. Detecting "stuck" needs either a
   * sentinel and an observer or a scroll timeline that two engines do not
   * have, and a rule under a card title is a device this page already owns —
   * .panel is separated by nothing else. */
  margin: -18px -18px 0; padding: 18px 18px 7px;
  background: var(--panel); border-radius: 13px 13px 0 0;
  border-bottom: 1px solid var(--rule);
}
.card h2 + .note { margin-top: 6px; }
/* The docked readout is fixed to the top of the viewport, so the sticky rail
 * has to step down out from under it rather than scroll behind it. Scoped to
 * the two-column grid: below 1041px the rail is static and full-height, and
 * clamping it there cut the control cards off at the viewport and painted the
 * remainder straight over the results column. */
@media (min-width: 1041px) {
  .dock.up ~ .grid .rail { top: 74px; max-height: calc(100vh - 90px); }
}
/* Once the rail stops being a rail it inherits the whole page width, which
 * gave a 20-character chip 730px to sit in and stretched a slider to 1,470px
 * — a drag target so long that a 5% change needs a 70px gesture. The console
 * splits in two instead.
 *
 * Intrinsic, not a breakpoint. A hard 700px floor put the widest slider of the
 * entire responsive range at 699px: 608px, against 275px one pixel wider. The
 * track now holds two columns for exactly as long as two columns are worth
 * having, and drops to one at ~630px, where a full-width control is the
 * expected idiom rather than an accident. */
@media (max-width: 1040px) {
  .rail {
    position: static; max-height: none; overflow: visible; padding-right: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0 22px; align-items: start;
  }
  /* The rail is not a scrollport here, so the nearest one is the document and
   * a sticky title would pin to the window instead of to its card — under the
   * docked readout, which is fixed there already. */
  .card h2 { position: static; margin: 0; padding: 0; border-bottom: 0; background: none; }
  .card h2 + .note { margin-top: 5px; }
}
/* The rail is its own scroll container, so the scrollbar has to be visible
 * enough that a wheel gesture landing on it is not read as a dead page. */
.rail {
  scrollbar-width: thin; scrollbar-color: var(--rule2) transparent;
}
.rail::-webkit-scrollbar { width: 10px; }
.rail::-webkit-scrollbar-thumb {
  background: var(--rule2); border-radius: 5px;
  border: 3px solid var(--ink); background-clip: padding-box;
}
.rail:hover::-webkit-scrollbar-thumb { background: var(--dim); background-clip: padding-box; }

/* ── cards & panels ─────────────────────────────────────────────────────── */
.card, .panel {
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: 14px; padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card h2 {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; margin: 0; font-weight: 600;
}
.card h2.d { color: var(--def); }
.card h2.a { color: var(--att); }
/* A card declares which side of the model it belongs to, and that choice
 * cascades to its slider fills, thumbs and values. */
.card.def { --accent: var(--def); }
.card.att { --accent: var(--att); }
.note { color: var(--mut); font-size: 12px; margin: 5px 0 14px; }

/* The results column is a document, not a stack of cards. The instrument —
 * the rail and the readout bank — keeps its surfaces because it is a thing
 * you operate; the argument is ruled rather than boxed, because it is a thing
 * you read and cite. Making the two halves different materials is what stops
 * a page with ten sections reading as a dashboard with ten widgets. */
.panel {
  background: none; border: 0; border-radius: 0; box-shadow: none;
  border-top: 1px solid var(--rule2);
  padding: 20px 0 0; margin: 0 0 42px;
}
.results > .panel:last-of-type { margin-bottom: 0; }
/* Ten chapters are not ten peers. They run in three movements — 01-06 the
 * race, 07-09 the defence of the method, 10 the provenance — and a single
 * uniform rule flattened the two places the argument changes register into
 * eight identical breaks. Marked the only ways this system marks anything
 * structural: more air, and a step up the neutral ramp on the ordinal. No new
 * rule weight, no accent, no added copy. */
/* 72, not 30. Adjacent chapter margins collapse, so a 30px top margin against
 * the previous chapter's 42px bottom margin resolved to 42 and the part break
 * measured exactly like every other break. The value has to clear 42 to be
 * seen at all. */
.panel.part { margin-top: 72px; padding-top: 32px; }
.panel.part .ord { color: var(--txt); }
.panel h3 {
  font-family: var(--disp); font-weight: 600; font-size: 21px;
  line-height: 1.22; letter-spacing: -.005em; margin: 0;
}
/* Cadence inside a chapter, not just between them. Every interval used to sit
 * within four pixels of every other — 6 / 16 / 12 / 14 — so the caption bound
 * no more tightly to its figure than the figure did to the lead, and proximity
 * expressed no grouping at all. Two groups now: the heading and its lead, then
 * the legend, the figure and its caption, with the wider interval between. */
.panel .lead { color: var(--mut); font-size: 13.5px; margin: 6px 0 18px; max-width: 74ch; }
.panel .lead b { color: var(--txt); font-weight: 600; }
.panel .lead.foot { margin: 8px 0 0; }
.panel .codified {
  margin: 14px 0 0; border-top: 1px solid var(--rule); padding-top: 14px;
}
/* The ordinal is a sibling of the heading, never a child: js/app.js reads the
 * h3's textContent for the exported PNG title, and a number folded into the
 * heading would end up in every exported image. */
.ord {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .14em;
  color: var(--dim); display: block; margin-bottom: 7px;
}
/* The title keeps a 260px basis and the row is allowed to wrap, so the tools
 * drop below the heading exactly when they would otherwise squeeze it. Held
 * inline, a 375px card gave "Why severity is not the prioritisation trigger"
 * 55% of the row and four wrapped lines; the widest toolbar took a two-word
 * title down to 19%. Intrinsic, so it needs no breakpoint of its own. */
.panel-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.panel-head > div:first-child { flex: 1 1 260px; min-width: 0; }
/* flex-shrink: 0 keeps the toolbar intact while there is room; max-width caps
 * it at the row so that when there is not, it wraps inside itself instead of
 * pushing the chapter wider than the page. */
.tools {
  display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start;
  flex-wrap: wrap; max-width: 100%; margin-bottom: 4px;
}

/* ── controls ───────────────────────────────────────────────────────────── */
/* Equal-width cells rather than flex-wrap. Ragged rows of differently sized
 * buttons read as an accident; a grid reads as a set of options. */
.presets { display: grid; gap: 6px; }
.chips { grid-template-columns: 1fr 1fr; }
/* Three rungs in one row: the labels are single words and the ladder reads as
 * an ordered axis, which a 2-plus-1 wrap would break. */
.ladder-3 { grid-template-columns: repeat(3, 1fr); }
.ladder-4 { grid-template-columns: repeat(3, 1fr); }
.ladder-5 { grid-template-columns: 1fr 1fr; }
.presets button {
  padding: 7px 9px; font-size: 12px; text-align: left; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}
/* BOD 26-04 is a mandated regime rather than a rung on the maturity ladder,
 * and the fifth detection posture completes a ladder of five — both take the
 * full width so neither row is left ragged. The attribute chips are three, so
 * the third takes the same treatment for the same reason. */
.ladder-4 button:last-child, .ladder-5 button:last-child { grid-column: 1 / -1; }
.chips button:last-child { grid-column: 1 / -1; }
/* The three-rung ladder is exactly one row, so it is the one ladder whose last
 * child must NOT span: doing so would push it onto a second row of its own. */
.ladder-3 button, .ladder-4 button, .ladder-5 button, .quad button { text-align: center; }
/* Four rungs in an even 2x2 rather than the 3-plus-1 the maturity ladder uses.
 * Its labels are single words that fit a third of the rail; "Opportunistic" is
 * one word wider than that cell, and a single unbreakable word cannot wrap, so
 * it ellipsised mid-word instead. Two columns give every rung room for its
 * own name. */
.quad { grid-template-columns: 1fr 1fr; }
/* The exposure rungs are an ordered axis rather than a set of alternatives, so
 * they stay left-aligned: a ladder read down a common left edge shows its order
 * in a way five centred labels do not. */
.ladder-5#sel-exposure button { text-align: left; }

.seg { margin-bottom: 16px; }
.seg-l {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--mut); margin-bottom: 7px;
}
.seg-d { color: var(--mut); font-size: 12px; line-height: 1.45; margin: 8px 0 0; }
/* The composed estate, reporting what all four controls above have produced.
 * Ruled off and set in the mono face because it is a readout rather than
 * another description — the one line on the card that is an answer. */
.estate {
  font-family: var(--mono); font-size: 11px; line-height: 1.55;
  color: var(--dim); border-top: 1px solid var(--rule);
  padding-top: 12px; margin-top: 16px;
}
/* 9px could not clear AA against the card in either theme; the border already
 * does the de-emphasis, so the type does not have to. */
.seg-hint {
  font-size: 11px; letter-spacing: .08em; color: var(--mut);
  border: 1px solid var(--rule2); border-radius: 3px; padding: 1px 4px; margin-left: 5px;
}
/* multi-select traits read as checkable chips, not as one-of-N */
#sel-profile button { position: relative; padding-left: 22px; }
/* Top-aligned rather than centred: a two-line chip with a vertically centred
 * marker reads as a bullet floating beside the text instead of a checkbox. */
#sel-profile button::before {
  content: ""; position: absolute; left: 8px; top: 10px;
  width: 9px; height: 9px; border: 1px solid var(--rule2); border-radius: 2px;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
#sel-profile button.on::before { background: currentColor; border-color: currentColor; }
/* The sliders used to follow the last .seg directly. The estate readout now
 * sits between them and carries the rule itself, so the sliders only draw
 * their own when nothing else has. */
/* The estate line (#desc-profile) now sits between the last .seg and #cd, so
 * the adjacent-sibling form this rule used to take could no longer match
 * anything. The rule is on #cd directly. */
#cd { border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 18px; }
.estate + #cd { padding-top: 0; margin-top: 18px; }

.ctrl { margin-bottom: 16px; }
.ctrl .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ctrl label { font-size: 13px; font-weight: 500; }
.ctrl .val {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  color: var(--accent, var(--def)); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hint { color: var(--mut); font-size: 12px; margin-top: 4px; line-height: 1.45; }

/* Chapter 07 argues three dials by name, and the dials are several thousand
 * pixels up the page in the rail. Naming a control in prose and then leaving
 * the reader to find it is the gap the pinned rail used to paper over, at the
 * cost of a second scrollbar; the name carries the reader to the control
 * instead, at every viewport rather than only on a tall desktop.
 *
 * A button, not a link. It moves a scroll position and takes focus; it does
 * not navigate, and nothing about it should offer a new tab or a copyable
 * address. Weight is inherited from the <b> these replaced, so the emphasis
 * the sentence was written with survives. The dashed rule is the affordance:
 * a solid underline in this document means a citation. */
.ctl-link {
  /* --txt, not inherit. These replaced <b> inside a lead paragraph set in
   * --mut, and inheriting made the three words the chapter is *about* dimmer
   * than the ordinary bold either side of them: 7.9:1 against 16.4:1 on the
   * same line. The emphasis has to survive becoming a control. */
  font: inherit; color: var(--txt); font-weight: 600;
  background: none; border: 0; border-radius: 2px;
  padding: 0; margin: 0; cursor: pointer;
  border-bottom: 1px dashed var(--rule2);
  transition: color .14s var(--ease), border-color .14s var(--ease);
}
.ctl-link:hover { color: var(--accent, var(--att)); border-bottom-color: currentColor; }

/* Arriving is not enough — the reader has to be told which of twelve sliders
 * the sentence meant. An outline rather than a wash, because the groove fill
 * already carries a background and a second one reads as a third state.
 *
 * `forwards` is what makes this work under reduced motion as well as with it.
 * The global reduce rule turns every animation off, which would leave the
 * static outline below holding indefinitely — so app.js removes the class on
 * a timer, and with motion the animation has already faded it by then. */
.ctrl.flash {
  border-radius: 6px;
  outline: 2px solid var(--accent, var(--rule2)); outline-offset: 6px;
  animation: ctl-flash 1.2s var(--ease) 1 forwards;
}
@keyframes ctl-flash {
  0%, 55% { outline-color: var(--accent, var(--rule2)); }
  100%    { outline-color: transparent; }
}

/* A slider that shows only a thumb makes the reader estimate where in the
 * range they are. Filling the groove to the thumb states it. --fill is
 * written by js/app.js on every input event. */
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%;
  /* 24px so the drag target clears the AA minimum; the thumb stays centred
   * because its offset is measured from the track, not the box. */
  height: 24px; background: transparent; margin: 6px 0 0; cursor: grab;
  --fill: 0%;
}
input[type=range]:active { cursor: grabbing; }
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg,
    var(--accent, var(--def)) 0 var(--fill), var(--track) var(--fill) 100%);
}
input[type=range]::-moz-range-track { height: 4px; background: var(--track); border-radius: 2px; }
input[type=range]::-moz-range-progress {
  height: 4px; background: var(--accent, var(--def)); border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5.5px;
  border-radius: 50%; background: var(--accent, var(--def)); border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent, var(--def));
  transition: transform .12s var(--ease);
}
input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent, var(--def)); border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent, var(--def));
}
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }

details.more { margin-top: 6px; border-top: 1px solid var(--rule); padding-top: 12px; }
details.more > summary {
  cursor: pointer; font-size: 12px; color: var(--mut); list-style: none;
  font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 0; user-select: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; color: var(--def); }
details.more[open] > summary::before { content: "− "; }
details.more > summary:hover { color: var(--txt); }
details.more > div { padding-top: 14px; }
details.more[open] > div { animation: rise .28s var(--ease) both; }

/* ── contents ───────────────────────────────────────────────────────────── */
/* Front matter, in the document, not a widget in the console. It never had a
 * panel, a radius or a fill, so it was always document material — it was just
 * living inside the instrument, 739px below the sticky rail's fold and 2,529px
 * down a phone. Two columns because the results column is wide and a ten-item
 * single file would be a 328px block ahead of the argument. */
.toc { margin: 0 0 42px; }
.toc ol {
  list-style: none; margin: 0; padding: 0; counter-reset: toc;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px;
}
@media (max-width: 860px) { .toc ol { grid-template-columns: 1fr; } }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 0; font-size: 12.5px; color: var(--mut); text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color .14s var(--ease);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  letter-spacing: .06em; flex: none;
}
.toc a:hover { color: var(--txt); }
/* Weight as well as colour: the current chapter must be distinguishable
 * without seeing the difference between teal and grey. */
.toc a.cur { color: var(--def); font-weight: 600; }
.toc a.cur::before { color: var(--def); }

/* ── readout bank ───────────────────────────────────────────────────────── */
/* One plate divided by rules rather than four floating tiles: four separate
 * cards read as a KPI row, which is the register the argument is trying to
 * out-rank. Divided, they read as one instrument with four dials. */
/* Not four equal cells. The first two are the answer and are a pair — the
 * page's second finding is that detection changes nothing about being
 * compromised and everything about whether it matters, so compromise and
 * incident have to be read against each other. The last two are supporting
 * counts, and they take a smaller share of the plate and a smaller figure.
 * Four equal-weight cells with a grey label and a big coloured number is the
 * KPI row this design exists to avoid. */
.stats {
  display: grid; grid-template-columns: 1.14fr 1.14fr .86fr .86fr;
  /* Label, figure, interval, rail. Declared on the plate rather than left to
   * each cell so the cells can adopt them as a subgrid: the four figures then
   * sit on one line across the bank instead of landing wherever their own
   * trailing content leaves them. Measured before: 510 / 510 / 481 / 529, a
   * 48px spread, because the third cell's caption runs three lines against
   * one and only the first two carry an interval rail. This is one plate
   * divided by hairlines, not four tiles, and a plate whose numerals do not
   * line up is read as four tiles however it is drawn. */
  grid-template-rows: auto auto auto auto;
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
  margin-bottom: 12px;
}

/* Set as document type, not as a warning: no panel, no fill, no icon. The
 * claim it carries is that the figures above are a lower bound, and a reader
 * who has been trained by every other page to skip a coloured callout has to
 * read this one. It earns attention from position — directly under the number
 * it qualifies — rather than from decoration. The rule above it is the same
 * weight the footer notes use, which is the register it belongs to. */
.scope-note {
  margin: 0 0 34px; padding: 11px 0 0; max-width: 78ch;
  border-top: 1px solid var(--rule2);
  color: var(--mut); font-size: 12.5px; line-height: 1.55;
}
.scope-note b { color: var(--txt); font-weight: 600; }
/* The divider between the pair and the counts is the one that means
 * something, so it is the only one drawn at control weight. */
.stat:nth-child(3) { border-left-color: var(--rule2); }
/* Labels wrap to different line counts, so the value is pushed to the bottom of
 * the cell rather than sitting under a guessed min-height. Grid stretches the
 * cells to equal height, so the numbers line up across the row either way. */
.stat {
  padding: 16px 18px 17px; border-left: 1px solid var(--rule);
  /* Spans the plate's four rows and inherits their sizing, so every cell
   * agrees on where the label ends and the figure begins. Every cell carries
   * the same padding, so the offset the padding introduces is the same in all
   * four and the alignment survives it. Cells with no interval rail simply
   * leave the fourth row empty. */
  display: grid; grid-template-rows: subgrid; grid-row: span 4;
  align-content: start;
  /* Without this a cell cannot shrink below the min-content width of its own
   * label, so the two supporting cells stopped being equal once the bank got
   * tight and the divider between the pair and the counts drifted off centre. */
  min-width: 0;
}
.stat:first-child { border-left: 0; }
@media (max-width: 1040px) { .stats { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 780px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(3) { border-left-color: var(--rule); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule2); }
}

/* The credible interval as a figure rather than only as a sentence, drawn on
 * a full 0-100% scale so a wide band looks wide. It moves only on a pass that
 * ran enough blocks for the interval to mean anything. */
.band {
  height: 3px; margin-top: 10px; border-radius: 2px;
  background: var(--track); position: relative;
}
.band::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: var(--lo, 0%); right: calc(100% - var(--hi, 0%));
  background: var(--bad); border-radius: 2px;
  transition: left .3s var(--ease), right .3s var(--ease);
}
/* These labels are 40-odd character sentences. Caps plus wide tracking is a
 * device for two-word labels; at this length it removes the word shapes you
 * read by, and wrapped to three lines on a phone. Sentence case, body face. */
.stat .k {
  font-family: var(--body); font-size: 12px; letter-spacing: 0;
  color: var(--mut); line-height: 1.35;
  /* No flex:1 here any more. Growing the label to push the figure down only
   * ever bottom-aligned the label; what sits under the figure differs cell to
   * cell, so the figure still landed at four different heights. The plate's
   * shared row does that job now, and does it across cells rather than within
   * one. */
  display: block;
}
/* The four figures resimulate on every parameter change: they are readouts,
 * not headlines, and they are set in the instrument's own face. Monospace
 * digits are tabular by construction, so the row cannot twitch sideways while
 * a slider is dragged. */
.stat .v {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(28px, 2.4vw, 34px);
  line-height: 1.08; letter-spacing: -.035em; margin-top: 8px; color: var(--bad);
  font-variant-numeric: tabular-nums;
}
.stat.plain .v { color: var(--txt); font-size: clamp(24px, 1.95vw, 28px); }
.stat .v .u {
  font-family: var(--body); font-size: 12px; font-weight: 500;
  color: var(--mut); letter-spacing: 0; margin-left: 5px;
}
.stat .ci {
  font-family: var(--mono); font-size: 11px; color: var(--mut); margin-top: 4px;
}

/* ── chart frames ───────────────────────────────────────────────────────── */
/* The 1240px page cap exists because past roughly 900px of column the sparse
 * charts go mostly empty plot area. Below 1040px the single column inherited
 * the whole page and broke that ceiling on a tablet — drawing survival, sweep
 * and volume at 977px, wider than they are ever drawn on a desktop. The
 * ceiling belongs to the figure, not to one breakpoint. Measured Width still
 * holds: the SVG's laid-out box is now 900, so 900 is what gets drawn. */
.chart { width: 100%; max-width: 900px; display: block; }

/* A panel whose numbers are being recomputed. The metric toggle is the only
 * control on the page with no fast pass behind it — see heavy() in js/app.js —
 * so this stands in for the sub-frame response every other control gives for
 * free. Dimmed rather than blanked: a reader who just switched metric is
 * comparing the two readings, and the previous one has to stay legible while
 * the new one computes. aria-busy on the panel is the semantic half of this;
 * the label is decorative reinforcement for readers who can see the dimming,
 * which is why it is generated content and carries nothing not already said. */
/* No transition, in either direction, and that is the considered choice
 * rather than the lazy one. A 180ms fade IN never advanced: the settle seizes
 * the main thread within a frame of the class landing, and the transition was
 * measured still `running` with the element at full opacity 600ms after the
 * press — the same nothing the reader was already complaining about. A fade
 * OUT is worse, because it depends on frames this page cannot promise: with
 * the tab backgrounded requestAnimationFrame does not fire at all, and a
 * restore that never runs leaves a panel dimmed over numbers that are
 * finished. An instant mark answers an instant press, and an instant restore
 * cannot get stuck. */
.panel.pending .chart, .panel.pending .acts { opacity: .38; }
.panel.pending .tools::after {
  content: 'recomputing';
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--mut);
  align-self: center; margin-left: 2px; white-space: nowrap;
}
/* No font-family rule here on purpose. js/charts.js sets the family as an
 * attribute on every <text> node, because a chart is rasterised for PNG export
 * inside an <img> where no stylesheet applies. A CSS rule would win on screen
 * and lose in the export — which is exactly what happened: every mono chart
 * label rendered in the sans stack on the page and in the mono stack in the
 * image it was supposed to match. */
/* Row gap is a chapter boundary, not an inside-a-card gap. Once the pair
 * stacks, a single `gap: 22px` set chapters 05 and 06 twenty-two pixels apart
 * while every other chapter break was forty-two — so 06 read as a subsection
 * of 05 in exactly the two bands where they stack. */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 42px 22px; }
/* The width that matters is the results column, so ask the results column.
 * Two viewport ranges were standing in for one container measurement, and
 * they disagreed with it: widening 1040 -> 1041 shrank the main charts 977 ->
 * 626, and 1180 -> 1181 halved this pair 765 -> 380. Asking the container
 * directly makes the pair monotonic in the width it actually has. */
@container (max-width: 800px) {
  .two { grid-template-columns: 1fr; }
}
.two { margin-bottom: 42px; }
.two .panel { margin-bottom: 0; }

.legend {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px;
  color: var(--mut); margin-bottom: 8px;
}
/* Each detection posture reports the dwell time and coverage it writes. */
.presets .mtr {
  display: block; font-family: var(--mono); font-size: 11px;
  color: var(--dim); letter-spacing: .04em; margin-top: 3px;
}
.presets button.on .mtr { color: var(--ink); }
.presets button.near .mtr { color: var(--def); }

/* The description under each selector group changes length as the reader
 * picks, and without a floor the whole rail below it jumps on every click. */
.seg-d { min-height: 3.1em; }

/* Selected traits explain themselves in the rail rather than in a title
 * attribute no touch or keyboard user can reach. */
.trait-notes { margin-top: 10px; }
.trait-notes > div {
  font-size: 12px; line-height: 1.45; color: var(--mut);
  padding: 8px 0; border-top: 1px solid var(--rule);
}
.trait-notes b { color: var(--txt); font-weight: 600; }

/* A posture the sliders imply rather than one the reader picked. Drawn as a
 * match, not as a selection, so a derived value is never mistaken for a
 * decision somebody made. */
.presets button.near {
  border-color: var(--def); border-style: dashed; color: var(--def);
  background: transparent; font-weight: 500;
}
.legend i {
  width: 10px; height: 10px; border-radius: 2px; display: inline-block;
  margin-right: 6px; vertical-align: -1px;
}
.legend .sw-def  { background: var(--def); }
.legend .sw-att  { background: var(--att); }
.legend .sw-zero { background: var(--zero); }
/* The chart draws this region as a 48-degree hatch, not a solid fill. The
 * swatch states the encoding rather than approximating it, which is the only
 * reason a gradient is allowed to exist in this stylesheet at all. */
.legend .sw-hatch {
  background: repeating-linear-gradient(48deg,
    var(--bad) 0 1.5px, transparent 1.5px 4px);
  border: 1px solid var(--bad);
}

/* ── actions list ───────────────────────────────────────────────────────── */
ul.acts { list-style: none; margin: 0; padding: 0; }
ul.acts li {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
}
ul.acts li:last-child { border-bottom: 0; padding-bottom: 0; }
.a-t { flex: 1; min-width: 0; }
.a-t b { display: block; font-size: 13.5px; font-weight: 600; }
.a-t span { color: var(--mut); font-size: 12px; }
.a-d {
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  color: var(--def); white-space: nowrap; padding-top: 1px;
  font-variant-numeric: tabular-nums;
}

/* ── evidence table ─────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 18px; }
.tbl th {
  text-align: right; font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--mut); font-weight: 600;
  padding: 0 0 9px; border-bottom: 1px solid var(--rule2);
}
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { padding: 9px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; text-align: right; }
.tbl td.n { font-family: var(--mono); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .hi { color: var(--bad); font-weight: 600; }
.band-range { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── anchors ────────────────────────────────────────────────────────────── */
.anchors { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media (max-width: 860px) { .anchors { grid-template-columns: 1fr; } }
.anchors > div { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.anchors dt { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.anchors dt b { font-weight: 700; }
.anchors dd { margin: 0; font-size: 12px; color: var(--mut); font-family: var(--mono); }
.anchors .measured { color: var(--def); }
.anchors .reported { color: var(--zero); }
.anchors .assumed  { color: var(--warn); }
.anchor-note { display: block; font-size: 11px; color: var(--dim); font-family: var(--body); margin-top: 3px; }

.tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap;
}
.tag.m { color: var(--def); }
.tag.r { color: var(--zero); }
.tag.a { color: var(--warn); }

/* ── export ─────────────────────────────────────────────────────────────── */
/* Two columns side by side because the choice is between two audiences, not
 * between two file formats — they produce the same kind of file, and a list
 * would have implied a default. Ruled rather than boxed: this is a chapter of
 * the argument, and DESIGN.md reserves the card for the instrument. */
.exports {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px 32px; margin-top: 22px;
}
.export {
  border-top: 1px solid var(--rule2); padding-top: 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.export p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--mut); max-width: 46ch; }
/* Pushes the button to a common baseline when the two descriptions run to
 * different lengths, so the pair reads as one choice rather than two. */
.export button { margin-top: auto; }
/* A build is a second or two of canvas work per slide. The button says so
 * rather than appearing dead, and goes disabled so a second click cannot start
 * a second build over the first. */
.export button[disabled] { opacity: .6; cursor: progress; }
.export-note {
  grid-column: 1 / -1; margin: 0; font-size: 13.5px; line-height: 1.5;
  color: var(--dim); max-width: 72ch;
}

/* ── footer ─────────────────────────────────────────────────────────────── */
footer {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--rule);
  color: var(--mut); font-size: 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px;
}
@media (max-width: 860px) { footer { grid-template-columns: 1fr; } }
.fnote p { margin: 0; max-width: 66ch; }
footer code {
  font-family: var(--mono); font-size: 11.5px;
  background: var(--sunk); padding: 1px 5px; border-radius: 4px;
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: var(--txt); color: var(--ink); font-size: 13px; font-weight: 500;
  padding: 10px 17px; border-radius: 9px; opacity: 0; pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease); z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══ motion ══════════════════════════════════════════════════════════════
 * Every animation here is one-shot and gated on the `anim` class, which
 * js/app.js sets only when the reader has not asked for reduced motion. The
 * page is fully legible with the class absent, so no content depends on an
 * animation having run.
 *
 * Nothing animates while a slider is being dragged: the model re-runs at up
 * to sixty passes a second there, and an entry animation replayed on each one
 * is a strobe, not a flourish. */
/* Each keyframe set states its own end point. Without an explicit `to`, the
 * synthesised final frame takes the element's underlying value — which is the
 * opacity: 0 that armed the reveal in the first place, so the animation would
 * run from hidden to hidden. */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bar-in {
  from { transform: scaleX(0); opacity: .35; }
  to   { transform: none; opacity: 1; }
}

.anim .panel, .anim .stats, .anim .clock, .anim .two { opacity: 0; }
.anim .panel.in, .anim .stats.in, .anim .clock.in, .anim .two.in {
  animation: rise .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.anim .two.in .panel { opacity: 1; animation: none; }

/* Chart interiors animate only on a chart's first appearance. The SVG
 * attributes always hold the final geometry, so an export taken mid-animation
 * still rasterises the finished chart. */
.chart .ch-bar { transform-box: fill-box; transform-origin: left center; }
.chart .ch-bar-r { transform-origin: right center; }
.anim .chart.fresh .ch-bar {
  animation: bar-in .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.anim .chart.fresh .ch-line:not(.ch-draw), .anim .chart.fresh .ch-area,
.anim .chart.fresh .ch-mark:not(.ch-late) {
  animation: fade .55s .1s var(--ease) both;
}

/* ── the race, run once ──────────────────────────────────────────────────
 * Chapter 01 is the thesis: the exploit curve is already high by the time it
 * reaches the patch line. On the chart's first appearance it is drawn rather
 * than faded in, so a reader watches the cumulative share climb and sees where
 * it stands when it crosses day zero.
 *
 * Constant rate, not an eased one. A race is run at a speed, and linear time
 * makes elapsed animation equal to elapsed distance — which is what lets the
 * day-zero marker be timed off `--zt`, the fraction of the drawing where the
 * patch line sits, rather than off a guess. An eased draw would need the
 * inverse of the easing curve to place it, which CSS cannot express.
 *
 * The dash lives here and never in an attribute: `toPNG` clones the SVG into a
 * context with no stylesheet, so an attribute-borne dash would export the
 * curve half-drawn. With `pathLength="1"` on the path, `stroke-dasharray: 1`
 * is one dash the full length of the curve — so if this animation is killed,
 * suppressed, or never runs, the curve is simply solid. */
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.anim .chart.fresh .ch-draw {
  stroke-dasharray: 1;
  animation: draw .7s linear 60ms both;
}
/* The marker and its readout are the claim the curve is making. They arrive as
 * the curve reaches them and not a frame earlier, so the number is read off a
 * line that is already there. */
.anim .chart.fresh .ch-late {
  animation: fade .3s var(--ease) both;
  animation-delay: calc(120ms + var(--zt, .6) * 700ms);
}

/* A row that is new to a rebuilt list, as opposed to one that moved within it.
 * The node is always freshly created, so the keyframe runs once on its own
 * without any restart. Movement within a list is handled in js/app.js, where
 * the distance is measurable. */
.anim .enter { animation: rise .3s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .anim .panel, .anim .stats, .anim .clock, .anim .two { opacity: 1; }
}

@media print {
  .rail, .tools, .topbar, .dock, .skip, .toc { display: none; }
  .grid { grid-template-columns: 1fr; }
  /* explicit placement would otherwise leave an empty first column */
  .stats, .scope-note, .results { grid-column: 1; grid-row: auto; }
  .panel, .card, .stat { break-inside: avoid; box-shadow: none; }
  /* Charts and readouts carry meaning in their fills; a browser dropping
   * backgrounds for print would print an empty axis and a grey number. */
  .chart, .stat .v, .band, .legend i { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .anim .panel, .anim .stats, .anim .clock, .anim .two { opacity: 1; }
}
