/* Detecting the Unseen.
   An eye emerging from fog carries a continuous focus motif through the research journal.
   Magenta is reserved for the manipulator (the fake wall, the spoofer's genuine order),
   for marked findings and for the title word. Detector colours live only in figures. */

:root {
  color-scheme: light;
  --paper: #f6f7f9;
  --paper-2: #eceef2;
  --paper-3: #e1e4ea;
  --ink: #14171f;
  --ink-2: #434a58;
  --ink-3: #5f6675;
  --line: #d3d7df;
  --mark: #c42a68;
  --mark-ink: #a81f57;
  --mark-wash: #f6d7e3;
  --bid: #46505f;
  --ask: #858d9b;
  --det-rule: #2a78d6;
  --det-pca: #eb6834;
  --det-iforest: #1baf7a;
  --det-lstm: #14171f;
  --sky-top: #dbe4ef;
  --sky-horizon: #eef1f5;
  --terrain-low: #eef1f5;
  --shadow: 0 1px 2px rgb(20 23 31 / 0.06), 0 12px 32px -14px rgb(20 23 31 / 0.22);

  --font-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-text: "STIX Two Text", "Cambria", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --radius: 10px;
  --gutter: clamp(16px, 4vw, 48px);
  --col: 42rem;
  --margin-col: 15rem;
  --margin-gap: 2.5rem;
  --wide: calc(var(--col) + var(--margin-gap) + var(--margin-col));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f1217; --paper-2: #171b22; --paper-3: #20252e;
    --ink: #e8eaee; --ink-2: #bcc2cc; --ink-3: #8f97a5; --line: #2a2f39;
    --mark: #ee5f95; --mark-ink: #f483ad; --mark-wash: rgb(238 95 149 / 0.2);
    --bid: #a3abbb; --ask: #5d6678;
    --det-rule: #3987e5; --det-pca: #d95926; --det-iforest: #199e70; --det-lstm: #e8eaee;
    --sky-top: #0b0e13; --sky-horizon: #161b24; --terrain-low: #1b212b;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 14px 34px -14px rgb(0 0 0 / 0.65);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1217; --paper-2: #171b22; --paper-3: #20252e;
  --ink: #e8eaee; --ink-2: #bcc2cc; --ink-3: #8f97a5; --line: #2a2f39;
  --mark: #ee5f95; --mark-ink: #f483ad; --mark-wash: rgb(238 95 149 / 0.2);
  --bid: #a3abbb; --ask: #5d6678;
  --det-rule: #3987e5; --det-pca: #d95926; --det-iforest: #199e70; --det-lstm: #e8eaee;
  --sky-top: #0b0e13; --sky-horizon: #161b24; --terrain-low: #1b212b;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 14px 34px -14px rgb(0 0 0 / 0.65);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: 1.125rem; line-height: 1.62;
  font-kerning: normal; font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility; caret-color: var(--mark);
  scrollbar-color: var(--ink-3) var(--paper);
}
::selection { background: var(--mark-wash); color: var(--ink); }
img, svg, canvas { display: block; max-width: 100%; }
a {
  color: inherit; text-decoration-line: underline; text-decoration-color: var(--ink-3);
  text-decoration-thickness: 1px; text-underline-offset: 0.2em;
  transition: text-decoration-color 150ms ease, text-decoration-thickness 150ms ease;
}
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; } }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; border-radius: 6px;
  font-family: var(--font-display); font-size: 0.9rem; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ph { font-size: 1.05em; line-height: 1; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: 64px;
  transition: background-color 250ms ease, border-color 250ms ease;
  border-bottom: 1px solid transparent;
}
.topbar.is-solid {
  background: color-mix(in srgb, var(--paper) 92%, transparent); border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
}
.topbar__inner {
  height: 100%; max-width: 88rem; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
}
.wordmark {
  justify-self: start; display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none;
  font-family: var(--font-display); font-weight: 760; font-stretch: 118%; font-size: 0.98rem; letter-spacing: -0.01em; white-space: nowrap;
}
.wordmark__glyph { display: inline-grid; gap: 2px; }
.wordmark__glyph span { display: block; height: 3px; border-radius: 2px; background: var(--ask); }
.wordmark__glyph span:nth-child(1) { width: 12px; }
.wordmark__glyph span:nth-child(2) { width: 18px; background: var(--mark); }
.wordmark__glyph span:nth-child(3) { width: 9px; background: var(--bid); }
.topnav ul {
  display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0.25rem; border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}
.topnav a {
  display: block; padding: 0.42rem 0.95rem; border-radius: 999px; text-decoration: none;
  font-family: var(--font-display); font-size: 0.88rem; font-weight: 550; color: var(--ink-2);
  transition: background-color 180ms ease, color 180ms ease;
}
@media (hover: hover) and (pointer: fine) { .topnav a:hover { color: var(--ink); background: var(--paper-2); } }
.topnav a[aria-current="true"] { color: var(--ink); background: var(--paper-2); }
.topbar__actions { justify-self: end; display: flex; align-items: center; gap: 0.5rem; }
.icon-button {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--paper) 70%, transparent); color: var(--ink);
  cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease;
}
.icon-button:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .icon-button:hover { background: var(--paper-2); } }
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; text-decoration: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; padding: 0.6rem 1.05rem; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.pill:active { transform: scale(0.97); }
.pill--quiet { background: color-mix(in srgb, var(--paper) 70%, transparent); color: var(--ink); border-color: var(--line); }
@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: var(--ink-2); border-color: var(--ink-2); text-decoration: none; }
  .pill--quiet:hover { background: var(--paper-2); border-color: var(--ink-3); }
}
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-dark { display: block; }
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
}
@media (max-width: 820px) {
  .topnav { display: none; }
  .topbar__inner { grid-template-columns: 1fr auto; }
}

/* ---------- Hero: the order book as a landscape ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: max(700px, min(100svh, 1040px));
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-horizon) 58%, var(--paper) 100%);
  display: grid; align-items: center;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: 0; transition: opacity 900ms ease; }
.hero.terrain-ready canvas { opacity: 1; }
.hero::after {
  /* A soft wash of sky behind the text column so the landscape never fights the words. */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 14% 46%, color-mix(in srgb, var(--sky-horizon) 88%, transparent), transparent 72%),
    linear-gradient(90deg, color-mix(in srgb, var(--sky-horizon) 70%, transparent) 0%, transparent 48%);
}
.hero__inner { width: 100%; max-width: 88rem; margin: 0 auto; padding: 110px var(--gutter) 130px; }
.hero__text { max-width: 35rem; }
.hero__title {
  font-family: var(--font-display); font-weight: 780; font-stretch: 122%;
  font-size: clamp(3rem, 6.4vw, 6rem); line-height: 0.95; letter-spacing: -0.04em;
  margin: 0 0 1.4rem; text-wrap: balance;
}
.hero__title em { font-style: normal; color: var(--mark); }
.hero__dek { font-size: clamp(1.2rem, 1.7vw, 1.45rem); line-height: 1.45; color: var(--ink-2); margin: 0 0 1.5rem; max-width: 30ch; text-wrap: pretty; }
.byline { font-family: var(--font-display); font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 1.9rem; }
.byline strong { color: var(--ink); font-weight: 650; }
.hero__foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 22px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
}
.hero__legend {
  max-width: 36rem; margin: 0; display: flex; gap: 0.6rem; align-items: flex-start;
  font-family: var(--font-display); font-size: 0.78rem; line-height: 1.45; color: var(--ink-2);
}
.hero__legend i { flex: none; width: 14px; height: 9px; border-radius: 2px; background: var(--mark); margin-top: 0.3em; }
.hero__pause { flex: none; font-size: 0.8rem; padding: 0.5rem 0.85rem; }
.hero.no-terrain .hero__legend, .hero.no-terrain .hero__pause { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(14px); filter: blur(4px); animation: rise 900ms var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 90ms + 150ms); }
  @keyframes rise { to { opacity: 1; transform: none; filter: none; } }
}
@media (max-width: 899px) {
  .hero { min-height: max(760px, 100svh); align-items: start; }
  .hero__inner { padding-top: 104px; padding-bottom: 210px; }
  .hero__title { font-size: clamp(3rem, 8vw, 5rem); }
  .hero__foot { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .hero__title { font-size: 3rem; }
}

/* ---------- Shared layout ---------- */
.page {
  display: grid; max-width: 88rem; margin: 0 auto; padding: 0 var(--gutter);
  grid-template-columns: minmax(9.5rem, 1fr) minmax(0, var(--wide)) minmax(0, 1fr); column-gap: 2.5rem;
}
.toc {
  grid-column: 1; justify-self: end; align-self: start; position: sticky; top: 96px; width: 9.5rem;
  font-family: var(--font-display); font-size: 0.84rem; margin-top: 0.4rem;
}
.toc p { margin: 0 0 0.6rem; font-weight: 700; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; border-left: 1px solid var(--line); }
.toc a {
  display: block; padding: 0.28rem 0 0.28rem 0.9rem; margin-left: -1px; border-left: 2px solid transparent;
  text-decoration: none; color: var(--ink-3); transition: color 150ms ease, border-color 150ms ease;
}
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .toc a:hover { color: var(--ink); } }
.article { grid-column: 2; min-width: 0; }
.article > section > * { max-width: var(--col); }
.article > section > .figure, .article > section > .pullquote,
.article > section > .schedule, .article > section > .table-wrap--wide { max-width: var(--wide); }
@media (max-width: 1300px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .article { grid-column: 1; justify-self: center; width: min(100%, var(--wide)); }
}
@media (max-width: 1080px) { .article { width: min(100%, var(--col)); } }

/* ---------- The short answer ---------- */
.answer { max-width: 88rem; margin: 0 auto; padding: clamp(4rem, 9vw, 7.5rem) var(--gutter) clamp(3rem, 6vw, 5rem); }
.answer__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.answer__lead {
  font-family: var(--font-display); font-weight: 760; font-stretch: 115%;
  font-size: clamp(2.2rem, 4.6vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 1.6rem; text-wrap: balance;
}
.answer__abstract { font-size: 1.16rem; line-height: 1.62; margin: 0; max-width: 40rem; }
.findings { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.findings li { padding: 1rem 0 1.05rem; border-bottom: 1px solid var(--line); font-size: 1.02rem; line-height: 1.5; }
.findings b {
  font-family: var(--font-display); font-weight: 750; font-stretch: 110%; font-size: 1.55rem; letter-spacing: -0.02em;
  display: block; line-height: 1.1; margin-bottom: 0.25rem; font-variant-numeric: lining-nums tabular-nums;
}
@media (max-width: 900px) { .answer__grid { grid-template-columns: 1fr; } }

/* ---------- Scroll-driven replay ---------- */
.story { position: relative; padding: clamp(2rem, 5vw, 4rem) 0 1rem; border-top: 1px solid var(--line); }
.story__head { max-width: 88rem; margin: 0 auto; padding: 0 var(--gutter); }
.story__head h2 {
  font-family: var(--font-display); font-weight: 780; font-stretch: 116%; font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 0.6rem;
}
.story__head p { margin: 0; max-width: 40rem; color: var(--ink-2); }
.story__grid {
  max-width: 88rem; margin: 0 auto; padding: 0 var(--gutter); display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem);
}
.story__steps { padding: 14vh 0 26vh; }
.step { min-height: 64vh; display: flex; align-items: center; }
.step__card { padding: 1.1rem 0 0; border-top: 2px solid var(--line); opacity: 0.4; max-width: 30rem; transition: border-color 300ms ease, opacity 300ms ease; }
.step.is-active .step__card { border-top-color: var(--ink); opacity: 1; }
.step__card h3 { font-family: var(--font-display); font-weight: 720; font-stretch: 108%; font-size: 1.3rem; margin: 0 0 0.4rem; }
.step__card p { margin: 0; font-size: 1.04rem; }
.story__sticky { position: sticky; top: 84px; align-self: start; height: calc(100svh - 104px); display: flex; align-items: center; }
@media (max-width: 900px) {
  .story__grid { grid-template-columns: 1fr; gap: 0; }
  .story__sticky { order: -1; top: 64px; height: auto; z-index: 2; background: var(--paper); padding: 0.75rem 0; }
  .story__steps { padding: 4vh 0 16vh; }
  .step { min-height: 52vh; }
}

.replay { width: 100%; margin: 0; background: var(--paper-2); border-radius: 18px; padding: clamp(14px, 2vw, 22px); box-shadow: var(--shadow); }
.replay__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.6rem 1rem; margin-bottom: 0.8rem; }
.fig-label { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin: 0; }
.fig-label span { color: var(--ink-3); font-weight: 500; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--paper-3); position: relative; }
.segmented button {
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; border: 0; background: transparent; color: var(--ink-2);
  cursor: pointer; padding: 0.38rem 0.85rem; border-radius: 999px; position: relative; z-index: 1;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}
.segmented button:active { transform: scale(0.97); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { color: var(--ink); }
.segmented__pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 999px; background: var(--paper);
  box-shadow: 0 1px 3px rgb(20 23 31 / 0.14); transition: transform 260ms var(--ease-out);
}
.ladder__cols {
  display: grid; grid-template-columns: 1fr 3.6rem 1fr; gap: 0 0.5rem; font-family: var(--font-display);
  font-size: 0.72rem; font-weight: 600; color: var(--ink-3); margin-bottom: 0.35rem;
}
.ladder__cols span:first-child { text-align: right; }
.ladder__cols span:nth-child(2) { text-align: center; }
.ladder__rows { display: grid; gap: 2px; }
.lrow { display: grid; grid-template-columns: 1fr 3.6rem 1fr; gap: 0 0.5rem; height: 20px; align-items: center; }
.lside { position: relative; height: 100%; }
.lside .bar, .lside .seg {
  position: absolute; top: 2px; bottom: 2px; width: 100%; border-radius: 3px; transform: scaleX(0);
  will-change: transform; transition: transform 160ms var(--ease-out);
}
.lbid .bar, .lbid .seg { right: 0; transform-origin: right center; }
.lask .bar, .lask .seg { left: 0; transform-origin: left center; }
.lbid .bar { background: var(--bid); }
.lask .bar { background: var(--ask); }
.lside .seg--wall { background: var(--mark); }
.lside .seg--genuine { background: transparent; box-shadow: inset 0 0 0 2px var(--mark); }
.lqty { position: absolute; top: 50%; translate: 0 -50%; font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-3); white-space: nowrap; }
.lbid .lqty { right: var(--q-pos, 0%); padding-right: 6px; }
.lask .lqty { left: var(--q-pos, 0%); padding-left: 6px; }
.lqty.is-wall { color: var(--mark-ink); font-weight: 500; }
.lpx { text-align: center; font-family: var(--font-mono); font-size: 0.72rem; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.lrow.is-best .lpx { color: var(--ink); font-weight: 500; }
.lrow.is-best-bid .lpx::before, .lrow.is-best-ask .lpx::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; background: currentColor;
}
.ladder__legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-top: 0.7rem; font-family: var(--font-display); font-size: 0.74rem; color: var(--ink-2); }
.swatch { display: inline-block; width: 14px; height: 9px; border-radius: 2px; margin-right: 0.4rem; vertical-align: -0.5px; }
.swatch--bid { background: var(--bid); }
.swatch--ask { background: var(--ask); }
.swatch--wall { background: var(--mark); }
.swatch--genuine { box-shadow: inset 0 0 0 2px var(--mark); }
.transport { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 0.6rem; margin-top: 0.9rem; }
.transport .icon-button { width: 34px; height: 34px; background: var(--paper); }
.timeline { position: relative; height: 38px; }
.timeline svg { width: 100%; height: 22px; overflow: visible; }
.timeline input[type="range"] {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; height: 18px; cursor: pointer;
}
.timeline input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--line); border-radius: 2px; }
.timeline input[type="range"]::-moz-range-track { height: 2px; background: var(--line); border-radius: 2px; }
.timeline input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--ink); border: 2px solid var(--paper);
}
.timeline input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid var(--paper); }
.step-readout { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-2); min-width: 5.6rem; text-align: right; }
.lamps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; margin-top: 0.85rem; }
.lamp {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.65rem; border-radius: var(--radius); background: var(--paper);
  font-family: var(--font-display); font-size: 0.76rem; line-height: 1.35;
}
.lamp__dot {
  flex: none; width: 12px; height: 12px; box-shadow: inset 0 0 0 2px var(--line); border-radius: 50%;
  transition: background-color 220ms ease, box-shadow 220ms ease, transform 220ms var(--ease-out);
}
.lamp[data-shape="square"] .lamp__dot { border-radius: 3px; }
.lamp__name { font-weight: 600; color: var(--ink); display: block; }
.lamp__state { color: var(--ink-3); }
.lamp.is-alert .lamp__dot { background: var(--lamp); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lamp) 22%, transparent); transform: scale(1.08); }
.lamp.is-alert .lamp__state { color: var(--ink); font-weight: 600; }
.replay__caption { margin: 0.85rem 0 0; min-height: 3.2em; font-size: 0.98rem; line-height: 1.5; color: var(--ink-2); }
.replay__caption strong { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) {
  .replay { padding: 12px; border-radius: 14px; }
  .lrow { height: 14px; }
  .lqty, .lpx { font-size: 0.6875rem; }
  .ladder__legend, .replay__caption, .transport .step-readout { display: none; }
  .transport { grid-template-columns: auto auto 1fr; margin-top: 0.6rem; }
  .lamps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 0.6rem; }
  .lamp { flex-direction: column; align-items: flex-start; gap: 0.25rem; padding: 0.35rem 0.4rem; font-size: 0.7rem; }
  .lamp__state { display: none; }
}

/* ---------- Article typography ---------- */
.article section { padding-top: 0.5rem; margin-bottom: 4.5rem; }
.section-title {
  font-family: var(--font-display); font-weight: 780; font-stretch: 116%; font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.06; letter-spacing: -0.025em; margin: 0 0 1.2rem; text-wrap: balance;
}
.article h3 { font-family: var(--font-display); font-weight: 680; font-stretch: 105%; font-size: 1.3rem; line-height: 1.3; margin: 2.4rem 0 0.6rem; }
.article p { margin: 0 0 1.15rem; text-wrap: pretty; hyphens: auto; }
.lede::first-line { font-variant-caps: all-small-caps; letter-spacing: 0.04em; }
mark { background: linear-gradient(transparent 52%, var(--mark-wash) 52%, var(--mark-wash) 92%, transparent 92%); color: inherit; padding: 0 0.08em; }
.pullquote { margin: 3rem 0; padding: 1.4rem 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.pullquote p {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-stretch: 112%; font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; hyphens: none;
}
.pullquote span { color: var(--ink-3); font-weight: 500; }

/* Margin notes: in the margin on wide screens, opened on tap on narrow ones. */
.sn-ref {
  font-family: var(--font-display); font-size: 0.68em; font-weight: 700; color: var(--ink-2); vertical-align: super; line-height: 1;
  min-width: 24px; min-height: 24px;
  margin-left: 0.08em; border: 0; background: none; padding: 0 0.1em; cursor: default; color: inherit;
}
.topbar__actions [data-repo-link] { flex-shrink: 0; }
@media (max-width: 480px) {
  .topbar__inner { gap: 0.5rem; }
  .wordmark { font-size: 0.78rem; gap: 0.4rem; }
  .topbar__actions [data-repo-link] { padding: 0.6rem 0.7rem; }
  .topbar__actions .repo-label { display: none; }
}
.sidenote {
  float: right; clear: right; width: var(--margin-col); margin-right: calc(-1 * (var(--margin-col) + var(--margin-gap)));
  margin-top: 0.25rem; margin-bottom: 1rem; font-family: var(--font-display); font-size: 0.8rem; line-height: 1.45; color: var(--ink-2);
}
.sidenote b { color: var(--ink); font-weight: 650; }
.sidenote .sn-num { color: var(--ink); font-weight: 700; margin-right: 0.3rem; }
@media (max-width: 1080px) {
  .sn-ref { cursor: pointer; text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 0.15em; }
  .sidenote { display: none; float: none; width: auto; margin: 0.5rem 0 0.8rem; padding: 0.7rem 0.9rem; background: var(--paper-2); border-radius: var(--radius); }
  .sidenote.is-open { display: block; }
}

/* Tables: booktabs */
.table-wrap { overflow-x: auto; margin: 1.8rem 0 2.2rem; }
table.booktabs { width: 100%; border-collapse: collapse; font-family: var(--font-display); font-size: 0.86rem; font-variant-numeric: tabular-nums lining-nums; line-height: 1.45; }
table.booktabs caption { caption-side: top; text-align: left; font-size: 0.86rem; color: var(--ink-2); padding-bottom: 0.6rem; }
table.booktabs caption b { color: var(--ink); }
table.booktabs thead th { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); font-weight: 650; vertical-align: bottom; }
table.booktabs th, table.booktabs td { text-align: left; padding: 0.55rem 0.9rem 0.55rem 0; vertical-align: top; }
table.booktabs tbody tr:last-child td, table.booktabs tbody tr:last-child th { border-bottom: 2px solid var(--ink); }
table.booktabs .num { text-align: right; }
table.booktabs .yes { font-weight: 700; }
table.booktabs .fails { color: var(--mark-ink); font-weight: 650; }

/* ---------- Figures: journal style, breaking into the margin ---------- */
.figure { margin: 2.6rem 0 3rem; width: 100%; }
.figure__top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem;
  padding-top: 0.7rem; border-top: 2px solid var(--ink); margin-bottom: 1rem;
}
.figure__top .fig-label { font-size: 1rem; }
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-display); }
.axis-label { fill: var(--ink-3); font-size: 11.5px; }
.tick-label { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.gridline { stroke: var(--line); stroke-width: 1; }
.baseline { stroke: var(--ink-3); stroke-width: 1; }
.ref-line { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 2 4; }
.ref-label { fill: var(--ink-2); font-size: 11px; }
.series path.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.series .err { stroke-width: 1; }
.series .pt { stroke-width: 2; }
.series { transition: opacity 200ms ease; }
.series.is-dim { opacity: 0.12; }
.hit { fill: transparent; cursor: crosshair; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.45rem; margin-top: 0.9rem; }
.legend-item {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-family: var(--font-display); font-size: 0.78rem; color: var(--ink-2);
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 0.3rem 0.7rem 0.3rem 0.55rem;
  transition: opacity 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out);
}
.legend-item:active { transform: scale(0.97); }
.legend-item[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.legend-item.is-dim { opacity: 0.45; }
.legend-key { width: 22px; height: 10px; flex: none; }
.chart-tooltip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 11rem; max-width: 16rem; background: var(--ink); color: var(--paper);
  border-radius: 8px; padding: 0.55rem 0.7rem; font-family: var(--font-display); font-size: 0.78rem; line-height: 1.4;
  opacity: 0; transform: translateY(4px); transition: opacity 120ms ease, transform 120ms var(--ease-out);
}
.chart-tooltip.is-on { opacity: 1; transform: none; }
.chart-tooltip .tt-sub { opacity: 0.75; display: block; margin-top: 0.15rem; }
.reading { margin: 1.4rem 0 0; font-size: 1.02rem; line-height: 1.5; color: var(--ink); max-width: var(--col); }
.figcaption {
  margin-top: 1.1rem; padding-top: 0.7rem; border-top: 1px solid var(--line); font-family: var(--font-display);
  font-size: 0.84rem; line-height: 1.5; color: var(--ink-2);
}
.figcaption b { color: var(--ink); }
details.data-table { margin-top: 0.6rem; font-family: var(--font-display); font-size: 0.84rem; }
details.data-table summary { cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0; list-style: none; }
details.data-table summary::-webkit-details-marker { display: none; }
details.data-table[open] summary { color: var(--ink); }
details.data-table .table-wrap { margin: 0.6rem 0 0; }
.chart.is-drawing path.line { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1100ms var(--ease-out) forwards; }
.chart.is-drawing .pt, .chart.is-drawing .err, .chart.is-drawing .dot { opacity: 0; animation: fadein 420ms ease forwards; animation-delay: 650ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

/* ---------- Contents on narrow screens ---------- */
.contents-inline { display: none; margin: 0 0 2.5rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 0.92rem; }
.contents-inline summary { cursor: pointer; padding: 0.8rem 0; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.contents-inline summary::-webkit-details-marker { display: none; }
.contents-inline ol { margin: 0; padding: 0 0 0.9rem 1.4rem; display: grid; gap: 0.35rem; }
@media (max-width: 1300px) { .contents-inline { display: block; } }

/* ---------- Conclusion ---------- */
.verdict__big {
  font-family: var(--font-display); font-weight: 760; font-stretch: 115%; font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.06; letter-spacing: -0.03em; margin: 0 0 1.4rem; text-wrap: balance;
}

/* ---------- Progress ---------- */
.status-line { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 2rem; }
.status-line b { color: var(--ink); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.schedule { margin: 0 0 2.75rem; font-family: var(--font-display); }
.schedule__axis, .schedule__row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 6rem; gap: 0 1rem; align-items: center; }
.schedule__axis { font-size: 0.72rem; color: var(--ink-3); margin-bottom: 0.4rem; }
.schedule__dates { position: relative; height: 1.1rem; }
.schedule__dates span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.schedule__dates span.is-first { transform: none; }
.schedule__dates span.is-last { transform: translateX(-100%); }
.schedule__rows { position: relative; }
.schedule__row { padding: 0.55rem 0; border-top: 1px solid var(--line); font-size: 0.86rem; }
.schedule__row:last-child { border-bottom: 1px solid var(--line); }
.schedule__label { color: var(--ink); line-height: 1.35; }
.schedule__track { position: relative; height: 14px; }
.schedule__span { position: absolute; top: 5px; height: 4px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.schedule__row[data-status="done"] .schedule__span { box-shadow: inset 0 0 0 1px var(--line); }
.schedule__row[data-status="now"] .schedule__span { background: var(--ink); box-shadow: none; }
.schedule__done { position: absolute; top: 1px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--ink); }
.schedule__status { font-size: 0.78rem; color: var(--ink-3); text-align: right; }
.schedule__row[data-status="done"] .schedule__status, .schedule__row[data-status="now"] .schedule__status { color: var(--ink); }
.schedule__row[data-status="now"] .schedule__status { font-weight: 650; }
.schedule__today { position: absolute; top: -0.2rem; bottom: -0.2rem; width: 0; border-left: 1.5px dashed var(--ink-3); pointer-events: none; }
@media (max-width: 640px) {
  .schedule__axis, .schedule__track, .schedule__today { display: none; }
  .schedule__row { grid-template-columns: minmax(0, 1fr) auto; }
}
.log { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.6rem; }
.log li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.2rem 1.2rem; }
.log time { font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; color: var(--ink-3); padding-top: 0.25rem; font-variant-numeric: lining-nums tabular-nums; }
.log h4 { font-family: var(--font-display); font-weight: 680; font-size: 1rem; margin: 0 0 0.25rem; }
.log p { margin: 0; font-size: 1rem; }
@media (max-width: 560px) { .log li { grid-template-columns: 1fr; } }
.plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2rem; margin: 0; }
.plan div { border-top: 1px solid var(--line); padding-top: 0.8rem; }
.plan dt { font-family: var(--font-display); font-weight: 680; font-size: 0.9rem; margin-bottom: 0.3rem; }
.plan dd { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 640px) { .plan { grid-template-columns: 1fr; } }

/* ---------- References & footer ---------- */
.references ol { padding-left: 1.4rem; margin: 0; display: grid; gap: 0.6rem; font-size: 0.98rem; line-height: 1.5; }
.references li::marker { font-family: var(--font-display); font-size: 0.8rem; color: var(--ink-3); }
.footer { border-top: 1px solid var(--line); margin-top: 3rem; }
.footer__inner {
  max-width: 88rem; margin: 0 auto; padding: 2rem var(--gutter) 3rem; display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 1rem 2rem; font-family: var(--font-display); font-size: 0.86rem; color: var(--ink-2);
}
.footer p { margin: 0; max-width: 46ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-delay: 0ms !important; }
  .rise { opacity: 1; transform: none; filter: none; }
  .chart.is-drawing path.line { stroke-dashoffset: 0; }
}

/* ---------- Part 2 ---------- */
.ladder-steps { counter-reset: rung -1; list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: grid; gap: 0.55rem; }
.ladder-steps li { counter-increment: rung; display: grid; grid-template-columns: 2rem 1fr; gap: 0.6rem; align-items: baseline; }
.ladder-steps li::before {
  content: counter(rung); font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 6px; text-align: center; padding: 0.05rem 0;
}
.figure__controls { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }

/* ---------- Summary page: all the results on one page ---------- */
.summary { position: relative; z-index: 1; max-width: 64rem; margin: 0 auto; padding: 112px var(--gutter) 3.5rem; }
.summary__intro { padding-bottom: clamp(2.5rem, 6vw, 3.75rem); border-bottom: 1px solid var(--line); }
.summary__kicker { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.02em; color: var(--ink-2); margin: 0 0 1rem; }
.summary__title {
  font-family: var(--font-display); font-weight: 760; font-stretch: 112%; font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.04; letter-spacing: -0.03em; margin: 0 0 1.1rem; max-width: 22ch; text-wrap: balance;
}
.summary__answer { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.2rem, 2.2vw, 1.55rem); line-height: 1.3; margin: 0 0 1.2rem; }
.summary__answer em { font-style: normal; color: var(--mark); }
.summary__lede { font-size: 1.1rem; line-height: 1.62; color: var(--ink-2); max-width: 44rem; margin: 0 0 1.6rem; text-wrap: pretty; }
.summary__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.summary__block { padding-top: clamp(2.5rem, 5vw, 3.5rem); }
.summary__note { color: var(--ink-2); font-size: 0.98rem; line-height: 1.55; max-width: 46rem; }
.summary__prose p { max-width: 44rem; }
.summary__limits { padding-left: 1.1rem; max-width: 44rem; }
.summary__limits li { margin-bottom: 0.55rem; }
.summary__links { font-family: var(--font-display); font-size: 0.92rem; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 0.35rem 0 0.25rem; }
.key--catch { background: var(--mark); }
.key--flag { background: var(--ink-2); }

.stat-grid {
  list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat-grid li { background: var(--paper); padding: 1.15rem 1.25rem 1.3rem; display: grid; gap: 0.5rem; align-content: start; }
.stat-grid li > b {
  font-family: var(--font-display); font-weight: 760; font-stretch: 112%; font-size: clamp(1.7rem, 3vw, 2.15rem);
  letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums;
}
.stat-grid li > span { font-family: var(--font-display); font-size: 0.88rem; line-height: 1.45; color: var(--ink-2); }

.scoreboard-wrap { margin-top: 1.2rem; }
.scoreboard { width: 100%; border-collapse: collapse; font-family: var(--font-display); font-size: 0.86rem; }
.scoreboard th, .scoreboard td { padding: 0.55rem 0.6rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.scoreboard thead th { font-size: 0.74rem; font-weight: 600; line-height: 1.3; color: var(--ink-2); vertical-align: bottom; }
.scoreboard__group th {
  padding-top: 1.15rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--line);
}
.scoreboard tbody th[scope="row"] { font-weight: 600; color: var(--ink); }
.scoreboard td { white-space: nowrap; }
.scoreboard tr.is-highlight { background: color-mix(in srgb, var(--mark) 9%, transparent); }
.meter { display: inline-block; width: 56px; height: 8px; margin-right: 0.5rem; border-radius: 4px; background: var(--paper-3); vertical-align: middle; overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; border-radius: 4px; transition: width 0.9s var(--ease-out); }
.meter--catch i { background: var(--mark); }
.meter--flag i { background: var(--ink-2); }
.scoreboard.is-in .meter i { width: var(--w); }
.meter__v { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  /* On a phone each detector becomes a small card. */
  .scoreboard thead { display: none; }
  .scoreboard, .scoreboard tbody, .scoreboard tr, .scoreboard th, .scoreboard td { display: block; }
  .scoreboard__group th { padding: 1.1rem 0 0.5rem; border: 0; }
  .scoreboard tr:not(.scoreboard__group) {
    margin-bottom: 0.6rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  }
  .scoreboard tr.is-highlight { background: color-mix(in srgb, var(--mark) 9%, var(--paper)); }
  .scoreboard tbody th[scope="row"] { padding: 0 0 0.45rem; border: 0; }
  .scoreboard td { display: grid; grid-template-columns: 1fr 72px 2.8rem; align-items: center; gap: 0.6rem; padding: 0.2rem 0; border: 0; }
  .scoreboard td::before { content: attr(data-label); color: var(--ink-2); font-size: 0.8rem; white-space: normal; }
  .meter { width: 72px; margin: 0; }
  .meter__v { text-align: right; }
}
@media (prefers-reduced-motion: reduce) { .meter i { transition: none; } }

.figure__img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fcfcfb; }

/* ---------- Chapter pages ---------- */
.pagehead { position: relative; z-index: 1; max-width: 88rem; margin: 0 auto; padding: 120px var(--gutter) clamp(2rem, 5vw, 3.5rem); }
.pagehead__kicker { margin: 0 0 0.8rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mark-ink); }
.pagehead__title { margin: 0 0 1rem; font-family: var(--font-display); font-weight: 780; font-stretch: 116%; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 0.98; letter-spacing: -0.035em; max-width: 18ch; text-wrap: balance; }
.pagehead__dek { margin: 0; font-size: clamp(1.08rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 40rem; }
.chapter-nav { position: relative; z-index: 1; max-width: 88rem; margin: 2rem auto 0; padding: 0 var(--gutter) 4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.chapter-nav a { display: block; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 650; font-size: 1.05rem; transition: border-color 0.2s ease; }
.chapter-nav a small { display: block; font-weight: 500; font-size: 0.78rem; color: var(--ink-3); margin-bottom: 0.2rem; }
.chapter-nav__next { text-align: right; }
@media (hover: hover) and (pointer: fine) { .chapter-nav a:hover { border-color: var(--mark); } }
.footer__links { font-family: var(--font-display); font-size: 0.85rem; }
.footer__links a[aria-current] { color: var(--ink); font-weight: 650; }

/* ---------- Research Lab ---------- */
.lab { position: relative; z-index: 1; max-width: 88rem; margin: 0 auto; padding: 0 var(--gutter) 4rem; }
.lab__label { margin: 0 0 0.5rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.lab__chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.1rem; }
.lab-chip {
  font-family: var(--font-display); font-weight: 600; font-size: 0.88rem; padding: 0.55rem 0.95rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.lab-chip--alert { box-shadow: inset 4px 0 0 var(--mark); }
.lab-chip--quiet { box-shadow: inset 4px 0 0 var(--ink-3); }
.lab-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lab__size { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1.4rem; }
.lab__size .lab__label { margin: 0 0.4rem 0 0; }
.lab__size[hidden] { display: none; }
.lab__size button { font-family: var(--font-display); font-weight: 650; padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer; }
.lab__size button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lab__panel { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(1.2rem, 3vw, 2.5rem); padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: calc(var(--radius) * 2); background: var(--paper); box-shadow: var(--shadow); }
.lab-should { display: inline-block; margin: 0 0 0.9rem; padding: 0.35rem 0.7rem; border-radius: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.86rem; }
.lab-should--alert { background: var(--mark-wash); color: var(--mark-ink); }
.lab-should--quiet { background: var(--paper-2); color: var(--ink); }
.lab__text { margin: 0 0 1rem; font-size: 1.05rem; line-height: 1.6; }
.lab__verdict { margin: 0; padding-top: 0.9rem; border-top: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; line-height: 1.45; }
.lab__unit { margin: 0 0 0.6rem; font-family: var(--font-display); font-size: 0.82rem; color: var(--ink-2); }
.lab-group { margin: 0.9rem 0 0.3rem; font-family: var(--font-display); font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.lab-row { display: grid; grid-template-columns: minmax(9rem, 15rem) 1fr 5.4rem; gap: 0.8rem; align-items: center; padding: 0.3rem 0; font-family: var(--font-display); font-size: 0.88rem; }
.lab-track { height: 12px; border-radius: 6px; background: var(--paper-3); overflow: hidden; }
.lab-bar { display: block; height: 100%; width: 0; border-radius: 6px; transition: width 0.6s var(--ease-out); }
.lab-bar--alert { background: var(--mark); }
.lab-bar--quiet { background: var(--ink-2); }
.lab-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.lab-row.is-untested { color: var(--ink-3); }
.lab-row.is-untested .lab-val { font-weight: 400; font-size: 0.78rem; }
.lab__note { margin: 1rem 0 0; font-size: 0.9rem; color: var(--ink-2); max-width: 52rem; }
@media (max-width: 860px) {
  .lab__panel { grid-template-columns: 1fr; }
  .lab-row { grid-template-columns: 1fr 5rem; }
  .lab-track { grid-column: 1 / -1; order: 3; }
  .chapter-nav { grid-template-columns: 1fr; }
  .chapter-nav__next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .lab-bar { transition: none; } }

/* Summary page: the plain-English version (cards, steps, findings, links). */
.plain-cards { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.plain-cards li { background: var(--paper-2); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.4rem; position: relative; }
.plain-cards h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 0.5rem 0 0.45rem; }
.plain-cards p { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }
.plain-cards__num { font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1; color: var(--mark); }
.plain-steps { counter-reset: step; list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 0.9rem; max-width: 46rem; }
.plain-steps li { counter-increment: step; position: relative; padding: 0 0 0 3.2rem; font-size: 1.06rem; line-height: 1.6; }
.plain-steps li::before { content: counter(step); position: absolute; left: 0; top: 0.05rem; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; background: var(--ink); color: var(--paper); }
.found { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 0; }
.found li { display: grid; grid-template-columns: minmax(8.5rem, 12rem) 1fr; gap: 1.6rem; padding: 1.4rem 0; border-top: 1px solid var(--line); align-items: start; }
.found li:last-child { border-bottom: 1px solid var(--line); }
.found__num { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.05; color: var(--mark); font-variant-numeric: tabular-nums; }
.found h3 { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.35; margin: 0 0 0.4rem; }
.found p { margin: 0; color: var(--ink-2); line-height: 1.6; max-width: 40rem; }
.summary__big { font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.5; max-width: 46rem; }
.more-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin: 1.2rem 0 1.4rem; }
.more-links a { display: grid; gap: 0.25rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink);
  font-family: var(--font-display); transition: border-color 200ms ease, transform 200ms var(--ease-out), background-color 200ms ease; }
.more-links a:hover { border-color: var(--ink); background: var(--paper-2); transform: translateY(-2px); }
.more-links strong { font-size: 1rem; }
.more-links span { font-size: 0.86rem; color: var(--ink-2); }
.summary__board { margin-top: 0.4rem; }
[data-reveal] { transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
.reveal-ready [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(16px); }
@media (max-width: 760px) {
  .plain-cards, .more-links { grid-template-columns: 1fr; }
  .found li { grid-template-columns: 1fr; gap: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) { [data-reveal] { transition: none; } .reveal-ready [data-reveal]:not(.is-in) { opacity: 1; transform: none; } }

/* Finishing touches (October 2026) -------------------------------------------------------- */

/* Prompt 1A: cross-document view transitions */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.pagehead__title { view-transition-name: page-title; }
.pagehead__kicker { view-transition-name: page-kicker; }
::view-transition-old(root) { animation: vt-out 180ms cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in 340ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both; }
::view-transition-group(topbar) { animation: none; }
::view-transition-group(page-title), ::view-transition-group(page-kicker) { animation-duration: 420ms; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
::view-transition-old(page-title) { animation: vt-fade-out 170ms ease both; }
::view-transition-new(page-title) { animation: vt-fade-in 300ms ease 120ms both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Prompt 1B: sliding contents marker */
.toc ol { position: relative; }
.toc__marker { position: absolute; left: -1px; top: 0; width: 2px; height: var(--h, 0px); background: var(--ink); border-radius: 1px;
  transform: translateY(var(--y, 0px)); opacity: 0;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1), height 360ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease; }
.toc--js a[aria-current="true"] { border-left-color: transparent; }
@media (prefers-reduced-motion: reduce) { .toc__marker { transition: none; } }

/* Prompt 2: the Wayfinder footer */
.wayfinder { border-top: 1px solid var(--line); margin-top: 4rem; padding: clamp(3.5rem, 8vw, 6.5rem) 0 2.5rem; padding-bottom: 2.5rem !important; }
.wayfinder__inner { max-width: 88rem; margin: 0 auto; padding: 0 var(--gutter); }
.wayfinder__name { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: clamp(2.6rem, 9.2vw, 8rem); line-height: 0.9;
  letter-spacing: -0.045em; color: var(--ink); margin: 0 0 clamp(2.5rem, 5vw, 4rem); text-wrap: balance; }
.wayfinder__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.wayfinder__head { font: 650 0.8rem/1.3 var(--font-display); color: var(--ink-2); margin: 0 0 0.8rem; }
.wayfinder ol, .wayfinder ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.wayfinder__col a { display: inline-flex; gap: 0.6rem; align-items: baseline; padding: 0.3rem 0; font: 500 0.98rem/1.35 var(--font-display); color: var(--ink);
  text-decoration: none; background: linear-gradient(currentColor, currentColor) left bottom / 0% 1px no-repeat;
  transition: background-size 260ms cubic-bezier(0.16, 1, 0.3, 1), translate 220ms cubic-bezier(0.16, 1, 0.3, 1); }
.wayfinder__col a:hover, .wayfinder__col a:focus-visible { background-size: 100% 1px; translate: 4px 0; }
.wayfinder__col a[aria-current="page"] { background-size: 100% 2px; background-image: linear-gradient(var(--mark), var(--mark)); }
.wayfinder__col a:focus-visible, .wayfinder__top:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; border-radius: 2px; }
.wayfinder__num { font: 500 0.78rem/1 var(--font-mono); color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 1.6rem; }
.wayfinder__base { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.4rem; border-top: 1px solid var(--line); }
.wayfinder__notes p { margin: 0 0 0.4rem; max-width: 60ch; font-size: 0.9rem; color: var(--ink-2); }
.wayfinder__top { display: inline-flex; align-items: center; gap: 0.5rem; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink); font: 500 0.85rem/1 var(--font-display); cursor: pointer; flex: none;
  transition: border-color 200ms ease, background-color 200ms ease; }
.wayfinder__top svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: translate 200ms cubic-bezier(0.16, 1, 0.3, 1); }
.wayfinder__top:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.wayfinder__top:hover svg { translate: 0 -2px; }
.wayfinder--armed .wayfinder__name { clip-path: inset(-0.1em -0.1em 100% -0.1em); transform: translateY(0.35em); }
.wayfinder--in .wayfinder__name { clip-path: inset(-0.1em -0.1em -0.3em -0.1em); transform: none;
  transition: clip-path 900ms cubic-bezier(0.16, 1, 0.3, 1), transform 900ms cubic-bezier(0.16, 1, 0.3, 1); }
@media (max-width: 759px) {
  .wayfinder__grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .wayfinder__base { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .wayfinder__col a, .wayfinder__top, .wayfinder__top svg { transition: none; }
  .wayfinder--armed .wayfinder__name { clip-path: none; transform: none; }
}

/* Prompt 3: the learning chapter's verdict row */
.verdict { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.2rem 2.5rem; margin: 0 0 1.6rem; }
.verdict__row { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; }
.verdict__token { position: relative; display: grid; justify-items: center; gap: 0.45rem; outline: none; max-width: none !important; }
.verdict__dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; box-sizing: border-box;
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease; }
.verdict__token--honest .verdict__dot { border: 1.5px solid var(--ink); }
.verdict__token--honest .verdict__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); transition: opacity 200ms ease; }
.verdict__token--spoof .verdict__dot { background: var(--mark); border: 1.5px solid var(--mark); }
.verdict__token--other .verdict__dot { border: 1.5px dashed var(--ink-3); }
.verdict__label { font: 500 0.7rem/1.25 var(--font-display); color: var(--ink-2); white-space: nowrap; text-align: center; }
.verdict__token::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; translate: -50% 4px; width: max-content; max-width: 16rem;
  padding: 0.5rem 0.65rem; border-radius: 8px; background: var(--ink); color: var(--paper); font: 500 0.75rem/1.4 var(--font-display); opacity: 0; pointer-events: none;
  transition: opacity 140ms ease, translate 140ms cubic-bezier(0.16, 1, 0.3, 1); z-index: 5; }
.verdict__token::before { display: none; }   /* off the page until wanted, so it never widens a phone screen */
.verdict__token:hover::before, .verdict__token:focus-visible::before { display: block; opacity: 1; translate: -50% 0; }
.verdict__token:focus-visible .verdict__dot { outline: 2px solid var(--mark); outline-offset: 3px; }
.verdict__count { margin: 0 !important; font: 800 clamp(1.4rem, 3.4vw, 2.2rem)/1 var(--font-display); letter-spacing: -0.03em; color: var(--ink); }
.verdict__n { font-variant-numeric: tabular-nums; transition: opacity 300ms ease; }
.verdict__n--hit { color: var(--mark); }
.verdict__token.is-armed .verdict__dot { transform: translateX(var(--from-x, 0px)) scale(0.18); background: var(--line) !important; border-color: transparent !important; }
.verdict__token.is-armed .verdict__dot::after { opacity: 0; }
.verdict--armed .verdict__n { opacity: 0; }
.verdict__token.is-landing .verdict__dot { transition: transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 200ms ease 500ms, border-color 200ms ease 500ms; }
.verdict__token.is-landing .verdict__dot::after { transition: opacity 200ms ease 520ms; }
@media (max-width: 559px) {
  .verdict { display: block; }
  .verdict__row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 100% !important; margin-bottom: 1rem; }
  .verdict__dot { width: 36px; height: 36px; }
  .verdict__label { font-size: 0.6rem; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .verdict__dot, .verdict__n, .verdict__token::before { transition: none !important; } }
