:root {
  --bg: #faf7ef;
  --bg-card: #f2ecdf;
  --bg-card-deep: #ece5d8;
  --bg-tint: #eef4f0;
  --ink: #17211f;
  --ink-soft: #46534f;
  --ink-faint: #646b67;
  --line: #cec7b8;
  --line-strong: #aaa69c;
  --teal: #24c7b5;
  --teal-dark: #06675d;
  --teal-pale: #bfeee6;
  --orange: #ee8f43;
  --orange-dark: #914c18;
  --orange-pale: #f7d7b9;
  --red: #e45e52;
  --red-dark: #9e2f2a;
  --training: #3e88a6;
  --serving: #bd6d37;
  --white: #fffdf7;
  --shadow: 0 16px 46px rgb(23 33 31 / 8%);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --content: min(1200px, calc(100vw - 48px));
  --measure: 660px;
  --toc-width: 216px;
  --sidenote-width: 250px;
  --gutter: 40px;
  --right-rail-span: calc(var(--sidenote-width) + var(--gutter));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

button,
select,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

code {
  padding: 0.08em 0.28em;
  border-radius: 0.2em;
  background: rgb(23 33 31 / 7%);
  font-family: var(--mono);
  font-size: 0.82em;
}

button,
a,
select,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

/* Short definitions stay beside the sentence that needs them. Mouse, keyboard,
 * and touch all use the same popover; the prose remains readable without JS. */
.term-definition {
  color: inherit;
  font-style: normal;
  text-decoration: underline dotted var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: help;
}

.term-definition:hover,
.term-definition:focus {
  color: var(--teal-dark);
  text-decoration-style: solid;
}

.term-popover {
  position: fixed;
  z-index: 80;
  width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--teal-dark);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--shadow);
}

.term-popover[hidden] {
  display: none;
}

::selection {
  color: var(--white);
  background: var(--teal-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: var(--white);
  background: var(--teal-dark);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.reading-progress {
  position: fixed;
  z-index: 900;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal-dark), var(--orange-dark));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.publication-warning {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 24px;
  color: #ffecea;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  background: #7f2926;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: center;
}

.warning-mark {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentcolor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

/* ---------------------------------------------------------------------------
 * Masthead — a title block, not a full-viewport hero. One read, no scroll cue.
 * ------------------------------------------------------------------------- */

.masthead {
  width: var(--measure);
  max-width: calc(100vw - 48px);
  margin: 0 auto;
  padding: clamp(40px, 7vh, 74px) 0 8px;
}

.masthead > .grpo-runs-figure {
  width: min(940px, calc(100vw - 48px));
  margin: 32px 0 24px 50%;
  translate: -50% 0;
}

.eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--teal-dark);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 34px;
  height: 1px;
  background: currentcolor;
  content: "";
}

.masthead h1 {
  max-width: 760px;
  margin: 20px 0 6px;
  font-family: var(--serif);
  font-size: clamp(42px, 6.4vw, 64px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

.masthead h1.masthead-title {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.2em;
  row-gap: 0.09em;
  max-width: none;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.02;
}

.masthead-title-line {
  display: contents;
}

.masthead-title-prefix {
  text-align: right;
  white-space: nowrap;
}

.masthead-title-core {
  white-space: nowrap;
}

.masthead-title-anchor {
  color: var(--teal-dark);
  font: inherit;
}

.masthead-title-anchor-zero {
  position: relative;
  display: inline-block;
}

.masthead-title-anchor-zero::after {
  position: absolute;
  top: 0.08em;
  left: 50%;
  width: 0.055em;
  height: 0.88em;
  border-radius: 999px;
  background: currentcolor;
  content: "";
  pointer-events: none;
  transform: translateX(-50%) rotate(27deg);
  transform-origin: center;
}

.masthead h1 em {
  color: var(--teal-dark);
  font-style: italic;
}

.masthead-deck {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.5;
}

.publication-meta {
  margin: 0 0 16px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lede p {
  max-width: 620px;
  margin: 0 0 1.3rem;
  font-size: 18px;
  line-height: 1.65;
}

.headline-result {
  margin: 30px 0 18px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--teal-dark);
  background: var(--bg-card);
}

.headline-result > p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 13px;
}

.headline-result > p span {
  color: var(--ink-faint);
  white-space: nowrap;
}

.headline-result dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.headline-result dl div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.headline-result dt,
.headline-result dd {
  margin: 0;
}

.headline-result dt {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.headline-result dd {
  margin-top: 4px;
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
}

.source-link {
  display: inline-block;
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.post-content .implementation-pr-reference {
  clear: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  max-width: 640px;
  margin: -2px 0 18px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.implementation-pr-reference .implementation-pr {
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  text-transform: none;
}

/* ---------------------------------------------------------------------------
 * Three-column layout: TOC gutter · article · sidenote gutter.
 * Collapses to one column under --measure + both gutters.
 * ------------------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure)) minmax(0, 1fr);
  column-gap: var(--gutter);
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

#toc {
  grid-column: 1;
  justify-self: end;
  align-self: start;
  position: sticky;
  top: 28px;
  width: var(--toc-width);
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding-right: 4px;
  font-family: var(--sans);
  /* The rail scrolls itself to follow the reading position, so it hides its
   * scrollbar instead of showing a full-height thumb beside the contents. */
  scrollbar-width: none;
}

#toc::-webkit-scrollbar {
  display: none;
}

#toc-title {
  margin: 0 0 10px;
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#toc ul ul {
  margin-left: 14px;
}

#toc a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease;
}

#toc ul ul a {
  color: var(--ink-faint);
  font-size: 12px;
}

#toc a:hover {
  color: var(--ink);
}

#toc a.is-active {
  border-left-color: var(--teal-dark);
  color: var(--teal-dark);
  font-weight: 700;
}

#main-content {
  grid-column: 2;
  min-width: 0;
}

.toc-group-label {
  display: block;
  margin: 10px 0 3px 12px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-contents {
  display: none;
}

article.post-content {
  display: flow-root;
  grid-column: 2;
  width: 100%;
  min-width: 0;
}

/* ---------------------------------------------------------------------------
 * Prose and headings.
 * ------------------------------------------------------------------------- */

article.post-content > section {
  padding-top: 56px;
  scroll-margin-top: 20px;
}

article.post-content > section + section {
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 0.5em;
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h3 {
  margin: 2.1em 0 0.6em;
  font-family: var(--serif);
  font-size: clamp(20px, 2.1vw, 23px);
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

h4 {
  margin: 1.8em 0 0.55em;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
}

h5 {
  margin: 1.65em 0 0.5em;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}

h3:first-child {
  margin-top: 0;
}

.post-content p {
  max-width: 640px;
  margin: 0 0 1.3rem;
  font-size: 17px;
  line-height: 1.68;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.post-content strong {
  color: var(--ink);
}

.post-content a:not(.source-link) {
  text-decoration: underline;
  text-decoration-color: rgb(23 33 31 / 30%);
  transition: text-decoration-color 160ms ease;
}

.post-content a:not(.source-link):hover {
  text-decoration-color: var(--ink);
}

/* ---------------------------------------------------------------------------
 * Sidenotes — Tufte pattern. Floated into the right gutter on wide screens
 * (no JS needed); tap-to-reveal via a hidden checkbox everywhere narrower.
 * ------------------------------------------------------------------------- */

body {
  counter-reset: sidenote;
}

input.margin-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sidenote-number {
  counter-increment: sidenote;
}

label.sidenote-number {
  color: var(--teal-dark);
  cursor: pointer;
  font-family: var(--mono);
}

label.sidenote-number::after {
  content: counter(sidenote);
  vertical-align: super;
  font-size: 0.62em;
  margin-left: 0.05em;
}

.ref-mark.sidenote-number::after {
  content: counter(sidenote);
}

.sidenote {
  display: none;
  clear: both;
  margin: 10px 0 18px;
  padding: 10px 16px;
  border-left: 2px solid var(--teal-dark);
  background: var(--bg-card);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.5;
}

.sidenote::before {
  content: counter(sidenote) " · ";
  color: var(--teal-dark);
  font-family: var(--mono);
  font-weight: 700;
}

.margin-toggle:checked + .sidenote {
  display: block;
}

/* ---------------------------------------------------------------------------
 * Figures break out past the text measure on the right only — prose stays
 * narrow for reading, but the interactive diagrams get more of the width
 * their labels actually need. Right-only (not centered) because the sticky
 * TOC sits flush against the left gutter with almost no slack (as little as
 * ~20px at the 1301px breakpoint) — breaking out left would run under it.
 * The right gutter only ever holds occasional floated sidenotes, so there's
 * real room there even at the narrow end of this range.
 * ------------------------------------------------------------------------- */
@media (min-width: 1201px) {
  article.post-content .fig-shell,
  article.post-content .roadmap-figure,
  article.post-content .frontier-panel,
  article.post-content .contract-map-table {
    clear: both;
    width: calc(100% + var(--right-rail-span));
    max-width: none;
    margin-right: calc(-1 * var(--right-rail-span));
  }
}

@media (min-width: 1201px) {
  label.sidenote-number {
    cursor: default;
    pointer-events: none;
  }

  .sidenote {
    display: block;
    float: right;
    clear: right;
    width: var(--sidenote-width);
    margin: 0.15em calc(-1 * (var(--sidenote-width) + var(--gutter))) 0.6em 0;
    padding: 0 0 0 14px;
    border-left: 1px solid var(--line-strong);
    background: none;
    font-size: 13px;
  }

  .sidenote::before {
    display: block;
    margin-bottom: 2px;
  }

  .masthead > .lede-problem {
    position: relative;
  }

  /* Keep the two opening citations aligned with the lines that introduce
     them, without letting their rail height space the two lede paragraphs
     apart. */
  .masthead > .lede-problem .sidenote {
    position: absolute;
    right: -330px;
    float: none;
    clear: none;
    width: 300px;
    margin: 0;
  }

  .masthead > .lede-problem .sidenote::before {
    display: inline;
    margin: 0 0.45em 0 0;
  }

  .masthead #sn-training-engines + .sidenote {
    top: 0;
  }

  .masthead #sn-inference-engines + .sidenote {
    top: 29.7px;
  }

}

/* ---------------------------------------------------------------------------
 * The estimator equation.
 * ------------------------------------------------------------------------- */

.contract-equation {
  margin: 28px 0 30px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.equation-label {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.equation-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 34px);
  margin: 20px 0;
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 28px);
}

.equation-body strong {
  color: var(--teal-dark);
  font-family: var(--sans);
  font-size: 0.45em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.equation-conditions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
}

.equation-conditions span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.equation-conditions i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-dark);
}

.equation-note {
  margin: 14px 0 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
}

.rules-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 20px;
  margin: 8px 0 4px;
  padding: 0;
}

.rules-list div {
  padding-top: 12px;
  border-top: 2px solid var(--teal-dark);
}

.rules-list dt {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 800;
}

.rules-list dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
}

/* ---------------------------------------------------------------------------
 * Kernel figures — the tabbed toggle component. Same shell everywhere,
 * resized to sit inline in the article column instead of full-bleed.
 * Motion is a class-toggled setTimeout chain (see app.js); no @keyframes.
 * ------------------------------------------------------------------------- */

.fig-shell {
  clear: both;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: transparent;
  box-shadow: 0 10px 34px rgb(23 33 31 / 5%);
}

.roadmap-figure,
.frontier-panel {
  clear: both;
}

.fig-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-strong);
}

.fig-tabs button {
  min-height: 44px;
  padding: 9px 16px;
  color: var(--ink-soft);
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.fig-tabs button[aria-selected="true"] {
  color: var(--white);
  background: var(--teal-dark);
}

.fig-tabs button code {
  background: none;
  font-size: 0.95em;
}

.fig-stage {
  padding: clamp(14px, 2.4vw, 26px);
}

.fig-svg {
  display: block;
  width: 100%;
  height: auto;
}

.fig-svg text {
  font-family: var(--mono);
}

.fig-svg .fl-key {
  font-size: 12px;
  font-weight: 700;
}

.fig-svg .fl-node {
  font-size: 12px;
}

.fig-svg .fl-note {
  font-size: 10.5px;
}

.fig-svg [data-step] {
  transition: opacity 500ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 580ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.has-js .fig-svg[data-seq="idle"] [data-step],
.has-js .fig-svg[data-seq="playing"] [data-step]:not(.is-active) {
  opacity: 0.24;
}

/* Procedural figures read as one causal sequence. Future steps should not
 * ghost through the current step and compete with its labels. */
.has-js .contract-map-figure .fig-svg[data-seq="idle"] [data-step],
.has-js .contract-map-figure .fig-svg[data-seq="playing"] [data-step]:not(.is-active),
.has-js #fig-norm-tlsum .fig-svg[data-seq="idle"] [data-step],
.has-js #fig-norm-tlsum .fig-svg[data-seq="playing"] [data-step]:not(.is-active) {
  opacity: 0;
}

.has-js .fig-svg [data-step].is-playing {
  opacity: 1;
}

.has-js .fig-svg [data-step].is-gone {
  opacity: 0;
}

.fig-svg [data-draw] {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 600ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 500ms ease;
}

.fig-svg [data-draw].is-active,
.fig-svg[data-seq="done"] [data-draw] {
  stroke-dashoffset: 0;
}

/* Kernel stories use the same state colors and typography as the hero. */
.kernel-story-figure {
  width: min(960px, calc(100vw - 277px));
  margin: 30px 0 38px;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 44%, rgb(255 253 247 / 88%), transparent 56%),
    transparent;
  box-shadow: none;
}

/* Compact mismatch/repair stories share one shell so the reader can compare
 * both completed states without switching tabs. The individual panels keep
 * their own accessible descriptions and animation timelines. */
.kernel-story-pair {
  width: min(960px, calc(100vw - 277px));
  margin: 30px 0 38px;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 44%, rgb(255 253 247 / 88%), transparent 56%),
    transparent;
  box-shadow: none;
}

article.post-content .kernel-story-pair > .kernel-story-pair-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.kernel-story-pair-panel + .kernel-story-pair-panel {
  border-top: 2px solid var(--line-strong);
}

.contract-map-figure {
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

/* This figure is a cumulative procedure. Future stages should be absent, not
 * ghosted: the generic 24% preview made later steps look disabled and turned
 * the old composition into three competing panels. */
.has-js .contract-map-figure .fig-svg[data-seq="idle"] [data-step],
.has-js .contract-map-figure .fig-svg[data-seq="playing"] [data-step]:not(.is-active) {
  opacity: 0;
  transform: translateY(4px);
}

.contract-map-figure .fig-svg [data-step] {
  transform-box: fill-box;
  transform-origin: center;
}

.fig-shell > .fig-reading-guide,
.kernel-story-figure .fig-reading-guide {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 16px;
  align-items: baseline;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px 16px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  background: rgb(255 253 247 / 48%);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.48;
}

.fig-reading-guide-label {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.fig-reading-guide b {
  color: var(--ink);
  font-weight: 750;
}

.kernel-story-figure .fig-stage {
  padding: 0;
}

.kernel-story-pane {
  transition: opacity 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kernel-story-motion {
  opacity: 0.14;
  transform: translateY(9px);
  transition:
    opacity 580ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--story-delay, 0ms),
    transform 680ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--story-delay, 0ms);
}

.kernel-story-pane.is-active .kernel-story-motion {
  opacity: 1;
  transform: translateY(0);
}

.kernel-story-pane:not(.is-active) .kernel-story-motion {
  transition-delay: 0ms;
}

.kernel-story-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 920ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--story-delay, 0ms);
}

.kernel-story-pane.is-active .kernel-story-path {
  stroke-dashoffset: 0;
}

.kernel-story-pane:not(.is-active) .kernel-story-path {
  transition-delay: 0ms;
}

/* Arrowheads live on a coincident terminal layer because an SVG marker is
 * otherwise visible while its dashed path is still drawing. */
.kernel-story-arrowhead {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1ms linear calc(var(--story-delay, 0ms) + 920ms);
}

.kernel-story-pane.is-active .kernel-story-arrowhead {
  opacity: 1;
}

.kernel-story-pane:not(.is-active) .kernel-story-arrowhead {
  transition-delay: 0ms;
}

.kernel-story-dashed-path {
  opacity: 0;
  transition: opacity 680ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--story-delay, 0ms);
}

.kernel-story-pane.is-active .kernel-story-dashed-path {
  opacity: 1;
}

.kernel-story-pane:not(.is-active) .kernel-story-dashed-path {
  transition-delay: 0ms;
}

.kernel-story-pane.is-resetting .kernel-story-motion,
.kernel-story-pane.is-resetting .kernel-story-path,
.kernel-story-pane.is-resetting .kernel-story-arrowhead,
.kernel-story-pane.is-resetting .kernel-story-dashed-path {
  transition: none;
}

.closing-line {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.measurement-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 22px 0 12px !important;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.measurement-line span {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-line {
  max-width: none !important;
  margin: 0 0 12px !important;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11px !important;
  text-align: center;
}

.accessible-fallback {
  margin-top: 16px;
}

figure {
  margin: 0;
}

.foundation-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.foundation-stats div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.foundation-stats dt {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.foundation-stats dd {
  margin: 5px 0 0;
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 12.5px;
}

.foundation-stats .stat-crit dd {
  color: var(--red-dark);
}

details.deeper {
  margin: 22px 0 0;
  border-top: 1px solid var(--line);
}

/* The numerical primer is a separate, optional reading path. Its summary is
 * always visible; the complete explanation remains one native click away with
 * or without JavaScript. */
.optional-background {
  width: min(880px, calc(100vw - 48px));
  margin: 8px 0 40px;
  translate: -50% 0;
  margin-left: 50%;
}

details.background-primer {
  margin: 0;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--bg-card);
}

details.background-primer > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 2px 20px;
  align-items: center;
  padding: 22px 0;
  cursor: pointer;
  list-style: none;
}

details.background-primer > summary::-webkit-details-marker {
  display: none;
}

details.background-primer > summary::after {
  grid-column: 2;
  grid-row: 1 / span 3;
  content: "+";
  color: var(--teal-dark);
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

details.background-primer[open] > summary::after {
  content: "−";
}

details.background-primer[open] > summary {
  border-bottom: 1px solid var(--line);
}

.background-summary-kicker,
.background-summary-deck {
  grid-column: 1;
  font-family: var(--sans);
}

.background-summary-kicker {
  color: var(--teal-dark);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

details.background-primer > summary strong {
  grid-column: 1;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(20px, 2.7vw, 27px);
  font-weight: 600;
  line-height: 1.2;
}

.background-summary-deck {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.background-primer-body {
  padding: 24px 0 28px;
}

.background-primer-body > p,
.background-primer-body > h3 {
  max-width: 700px;
}

.background-lede {
  margin: 0 0 26px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
}

.numerical-axes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 36px;
  margin: 0 0 34px;
}

.numerical-axes article {
  padding-top: 13px;
  border-top: 2px solid var(--line-strong);
}

.numerical-axes article.axis-association,
.numerical-axes article.axis-determinism {
  grid-column: 1 / -1;
}

.axis-association > .axis-glyph,
.axis-determinism > .axis-glyph {
  max-width: 480px;
  margin-right: auto;
  margin-left: auto;
}

.numerical-axes article:nth-child(1),
.numerical-axes article:nth-child(4) {
  border-color: var(--red);
}

.numerical-axes article:nth-child(2) {
  border-color: var(--orange);
}

.numerical-axes article:nth-child(3) {
  border-color: var(--teal-dark);
}

.axis-glyph {
  display: block;
  width: 100%;
  height: auto;
  margin: 4px 0 14px;
  overflow: visible;
  color: var(--red);
}

.numerical-axes article:nth-child(2) .axis-glyph {
  color: var(--orange-dark);
}

.numerical-axes article:nth-child(3) .axis-glyph {
  color: var(--teal-dark);
}

.numerical-axes article:nth-child(4) .axis-glyph {
  color: var(--red-dark);
}

.axis-glyph text {
  fill: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.02em;
  dominant-baseline: middle;
}

.axis-glyph text.axis-glyph-invert {
  fill: var(--white);
  font-size: 6px;
  font-weight: 800;
}

.axis-glyph .axis-glyph-node-text text {
  fill: var(--white);
  font-size: 7px;
  font-weight: 850;
}

.axis-glyph .axis-glyph-leaves {
  fill: currentColor;
}

.axis-glyph .axis-glyph-row-marks {
  fill: var(--white);
}

.axis-glyph text.axis-glyph-step {
  fill: currentColor;
  font-size: 7.2px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.axis-glyph text.axis-glyph-emphasis {
  fill: currentColor;
  font-weight: 800;
}

.axis-glyph .axis-glyph-run-labels text {
  fill: currentColor;
  font-size: 7px;
  font-weight: 800;
}

.axis-glyph text.axis-glyph-value {
  fill: currentColor;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.axis-glyph text.axis-glyph-result {
  fill: currentColor;
  font-size: 12.5px;
  font-weight: 850;
  letter-spacing: 0;
}

.axis-glyph .axis-glyph-exponent {
  font-size: 9.5px;
  font-weight: 850;
}

.axis-glyph text.axis-glyph-inequality {
  fill: currentColor;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.axis-number {
  margin: 0 0 4px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.numerical-axes h4 {
  margin: 0 0 9px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.25;
}

.numerical-axes article > p:not(.axis-number) {
  margin: 0 0 11px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.62;
}

.numerical-axes .axis-contract {
  color: var(--ink) !important;
  font-family: var(--sans);
  font-size: 12.5px !important;
}

.background-primer-body > p:not(.background-lede, .background-source) {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.62;
}

.background-primer .contract-equation {
  background: var(--white);
  box-shadow: none;
}

.background-source {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.55;
}

.toc-optional {
  color: var(--ink-faint);
  font-size: 0.78em;
  font-weight: 500;
}

details.deeper > summary {
  padding: 12px 0;
  color: var(--teal-dark);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

details.deeper > *:not(summary) {
  font-size: 14.5px;
  color: var(--ink-soft);
}

details.deeper p {
  max-width: 100%;
  margin: 0 0 1rem;
  line-height: 1.6;
}

.deeper-code {
  overflow-x: auto;
  padding: 14px 16px;
  border-left: 2px solid var(--teal-dark);
  background: rgb(23 33 31 / 4%);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.deeper-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 4px 0 16px;
  padding: 0;
}

.deeper-list dt {
  color: var(--ink);
  font-weight: 750;
}

.deeper-list dd {
  margin: 5px 0 0;
}

.callout {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--orange);
  background: rgb(238 143 67 / 8%);
}

.callout strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.callout p {
  margin: 0;
  max-width: 100%;
}

.lifetime-list {
  margin: 6px 0 20px;
  padding-left: 20px;
}

.lifetime-list li {
  margin: 6px 0;
}

.deeper-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 11px;
}

.gemm-table .pinned-cell {
  color: var(--teal-dark);
  font-weight: 800;
}

.codegen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.codegen-cell {
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  border-radius: 4px;
}

.codegen-emit {
  border-color: var(--teal-dark);
  background: var(--bg-tint);
}

.codegen-case {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.codegen-cell pre {
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink);
}

.codegen-cell pre.ir {
  padding: 10px 12px;
  border-left: 2px solid var(--teal-dark);
  background: rgb(23 33 31 / 4%);
  font-size: 11px;
  color: var(--ink-soft);
}

.codegen-cell pre.ir b {
  color: var(--orange-dark);
  font-weight: 800;
}

.codegen-punch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.codegen-punch div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.codegen-punch strong {
  font-family: var(--serif);
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--orange-dark);
}

.codegen-punch span {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
}

@media (min-width: 620px) {
  .codegen-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

html:not(.has-js) .codegen-strip {
  display: none;
}

/* ---------------------------------------------------------------------------
 * Stat tiles (families-v2 vs stock) and mini figures.
 * ------------------------------------------------------------------------- */

.v2-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 18px 0 8px;
  padding: 0;
  list-style: none;
}

.v2-tiles li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.v2-tiles small {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.v2-tiles strong {
  font-family: var(--mono);
  font-size: 19px;
  color: var(--teal-dark);
}

.v2-tiles em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 10px;
  color: var(--ink-faint);
}
/* The worst measured cell is published, so it is also marked. A grid where
 * every tile looks alike invites the reader to average it. */
.v2-tiles li.tile-worst {
  border-color: var(--red-dark);
  background: rgba(228, 94, 82, 0.08);
}
.v2-tiles li.tile-worst strong {
  color: var(--red-dark);
}

/* Citations: a superscript mark at the point of use, and the bibliography. */
.ref-mark {
  font-family: var(--sans);
  font-size: 0.62em;
  font-weight: 700;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
  padding: 0 2px;
  color: var(--teal-dark);
  text-decoration: none;
  border-bottom: 0;
}
.ref-mark:hover,
.ref-mark:focus-visible {
  text-decoration: underline;
}
.reference-list {
  margin: 20px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 14px;
}
.reference-list li {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft, var(--ink-faint));
}
.reference-list li:target {
  background: rgba(36, 199, 181, 0.12);
  border-radius: 4px;
  box-shadow: 0 0 0 6px rgba(36, 199, 181, 0.12);
}

.v2-source {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  margin: 0 0 26px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
}

.roadmap-figure {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 16px;
  margin: 20px 0;
}

.roadmap-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.roadmap-figure text {
  font-family: var(--mono);
}

/* ---------------------------------------------------------------------------
 * Results — frontier chart, tables, coverage matrix.
 * ------------------------------------------------------------------------- */

.frontier-panel {
  margin: 20px 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
}

.frontier-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-right: 20px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--sans);
}

.frontier-tabs {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
}

.frontier-tabs button {
  min-height: 42px;
  padding: 8px 16px;
  color: var(--ink-soft);
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.frontier-tabs button[aria-selected="true"] {
  color: var(--white);
  background: var(--teal-dark);
}

.frontier-controls label {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.frontier-controls select {
  min-width: 170px;
  min-height: 34px;
  padding: 5px 8px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg);
  font-size: 12px;
}

.frontier-chart-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  min-height: 340px;
  padding: 22px;
}

#frontier-chart {
  width: 100%;
  min-width: 0;
  color: var(--ink-soft);
  overflow: visible;
}

#frontier-chart text {
  fill: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
}

.chart-summary {
  display: grid;
  gap: 20px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.chart-summary span {
  display: block;
}

.chart-summary small,
.chart-summary strong {
  display: block;
  font-family: var(--sans);
}

.chart-summary small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chart-summary strong {
  margin-top: 4px;
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 24px;
}

.frontier-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10px;
}

.frontier-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.frontier-legend i {
  width: 14px;
  height: 6px;
}

.legend-stock {
  background: var(--ink-faint);
}

.legend-restricted {
  background: var(--orange);
}

.legend-contract {
  background: var(--teal-dark);
}

.table-scroll {
  position: relative;
  max-width: 100%;
  margin: 26px 0 0;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  scrollbar-color: var(--teal-dark) var(--bg-card);
}

.table-scroll:focus-visible {
  outline-offset: 4px;
}

.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: var(--ink-soft);
  background: var(--bg-card);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.data-table caption {
  padding: 14px 16px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 11px;
  text-align: left;
}

.data-table caption .source-link {
  margin-left: 10px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table thead th {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.data-table tbody th {
  color: var(--ink);
  font-weight: 500;
}

.data-table .table-group th {
  padding-block: 9px;
  color: var(--teal-dark);
  background: rgb(8 126 114 / 7%);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.data-table .contract-cell {
  color: var(--teal-dark);
  background: rgb(8 126 114 / 6%);
}

.data-table tfoot td {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10px;
  text-align: left;
  white-space: normal;
}

.contract-map-table .data-table {
  min-width: 720px;
  table-layout: fixed;
}

.contract-map-table .data-table th,
.contract-map-table .data-table td {
  vertical-align: top;
  text-align: left;
  white-space: normal;
}

.contract-map-table .data-table th:nth-child(1),
.contract-map-table .data-table td:nth-child(1) {
  width: 20%;
}

.contract-map-table .data-table th:nth-child(2),
.contract-map-table .data-table td:nth-child(2),
.contract-map-table .data-table th:nth-child(3),
.contract-map-table .data-table td:nth-child(3) {
  width: 40%;
}

.performance-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 11px;
}

.performance-table th,
.performance-table td {
  vertical-align: top;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.qwen-throughput-table .data-table th:first-child,
.qwen-throughput-table .data-table td:first-child {
  width: 40%;
}

.qwen-throughput-table .data-table th:nth-child(n + 2),
.qwen-throughput-table .data-table td:nth-child(n + 2) {
  width: 20%;
  text-align: right;
}

.step-time-table .data-table th:first-child,
.step-time-table .data-table td:first-child {
  width: 50%;
}

.overlap-modes-table .data-table th:first-child,
.overlap-modes-table .data-table td:first-child {
  width: 40%;
}

.overlap-modes-table .data-table th:nth-child(n + 2),
.overlap-modes-table .data-table td:nth-child(n + 2) {
  width: 20%;
  text-align: right;
}

.step-time-table .data-table th:nth-child(n + 2),
.step-time-table .data-table td:nth-child(n + 2) {
  width: 25%;
  text-align: right;
}

.rope-contract-comparison,
.head-design-comparison {
  min-width: 0;
  table-layout: fixed;
  font-size: 11px;
}

.rope-contract-comparison th,
.rope-contract-comparison td,
.head-design-comparison th,
.head-design-comparison td {
  padding: 10px 12px;
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.rope-contract-comparison th:first-child {
  width: 23%;
}

.rope-contract-comparison thead th:not(:first-child) {
  width: 38.5%;
}

.head-design-comparison th:first-child {
  width: 30%;
}

.head-design-comparison thead th:nth-child(2) {
  width: 27%;
}

.head-design-comparison thead th:nth-child(3) {
  width: 43%;
}

.rope-contract-table::before,
.head-design-table::before {
  display: none !important;
}

.strategy-list {
  margin: 14px 0 28px;
  padding: 0;
  list-style: none;
  counter-reset: strategy;
}

.strategy-list li {
  position: relative;
  margin: 0;
  padding: 14px 0 14px 42px;
  border-top: 1px solid var(--line);
  counter-increment: strategy;
}

.strategy-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.strategy-list li::before {
  position: absolute;
  top: 15px;
  left: 0;
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  content: "0" counter(strategy);
}

.trainer-table-wrap {
  margin-top: 18px;
}

.coverage-matrix td {
  font-family: var(--mono);
  font-size: 12px;
}

.coverage-matrix .cell-exact {
  color: var(--teal-dark);
  background: rgb(8 126 114 / 10%);
}

.coverage-matrix .cell-cost {
  color: var(--teal-dark);
  background: rgb(8 126 114 / 5%);
}

.coverage-matrix .cell-defer {
  color: var(--orange-dark);
  background: rgb(238 143 67 / 14%);
}

.coverage-matrix .cell-stop {
  color: var(--red-dark);
  background: rgb(228 94 82 / 12%);
}

.coverage-matrix .cell-none {
  color: var(--red-dark);
  background: rgb(228 94 82 / 6%);
  border-bottom: 1px dashed var(--red);
}

.coverage-matrix .cell-na {
  color: var(--ink-faint);
}

.methods-scope {
  margin: 10px 0 42px;
}

.artifact-list {
  columns: 2;
  column-gap: 30px;
  margin: 18px 0;
  padding-left: 20px;
}

.artifact-list li {
  break-inside: avoid;
  margin: 0 0 8px;
}

.release-ending {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 3px solid var(--teal-dark);
}

.release-ending > p:first-child {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.6;
}

.implementation-list {
  margin: 32px 0 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
  counter-reset: implementation;
}

.implementation-list > li {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: implementation;
  font-family: var(--sans);
  font-size: 13px;
}

.implementation-list > li::before {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  content: "0" counter(implementation);
}

.implementation-list a {
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.paired-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 14px;
}

/* ---------------------------------------------------------------------------
 * Closing note, sources, footer.
 * ------------------------------------------------------------------------- */

.closing-proof {
  margin: 36px 0;
  padding: 0;
}

.closing-proof blockquote {
  margin: 0;
  padding-left: 20px;
  border-left: 3px solid var(--teal-dark);
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 25px);
  font-style: italic;
  line-height: 1.4;
  color: var(--ink);
}

.sources ul {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.sources li {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) 1.3fr;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 12.5px;
}

.sources li a {
  color: var(--teal-dark);
  font-weight: 750;
}

.sources li span {
  color: var(--ink-faint);
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 44px 24px 70px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 12px;
}

.footer-mark {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.footer-mark span {
  color: var(--teal-dark);
}

.site-footer p {
  margin: 6px 0;
}

.site-footer a {
  color: var(--teal-dark);
}

[data-reveal] {
  opacity: 1;
  transform: none;
}

.has-js [data-reveal],
.has-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------------------
 * No-JS fallback: the JS-drawn layer and the tab chrome hide, panels stack.
 * ------------------------------------------------------------------------- */

html:not(.has-js) [data-js-layer],
html:not(.has-js) .fig-tabs {
  display: none;
}

html:not(.has-js) .fig-panel + .fig-panel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}

/* ---------------------------------------------------------------------------
 * Responsive.
 * ------------------------------------------------------------------------- */

@media (min-width: 900px) and (max-width: 1200px) {
  .layout {
    --gutter: 16px;
    --right-rail-span: calc(clamp(130px, calc((100vw - 720px) / 2), 220px) + var(--gutter));

    grid-template-columns: minmax(140px, 1fr) minmax(540px, 620px) minmax(140px, 1fr);
    column-gap: var(--gutter);
    max-width: 1200px;
    padding: 0 16px 64px;
  }

  #toc {
    display: block;
    width: min(190px, 100%);
  }

  #toc a {
    font-size: 11.5px;
  }

  #toc ul ul a {
    font-size: 11px;
  }

  label.sidenote-number {
    cursor: default;
    pointer-events: none;
  }

  .sidenote {
    --compact-sidenote-width: clamp(130px, calc((100vw - 720px) / 2), 220px);

    display: block;
    float: right;
    clear: right;
    width: var(--compact-sidenote-width);
    margin: 0.15em calc(-1 * (var(--compact-sidenote-width) + var(--gutter))) 0.6em 0;
    padding: 0 0 0 10px;
    border-left: 1px solid var(--line-strong);
    background: none;
    font-size: 12px;
  }

  .sidenote::before {
    display: block;
    margin-bottom: 2px;
  }

  article.post-content .fig-shell,
  article.post-content .roadmap-figure,
  article.post-content .frontier-panel,
  article.post-content .contract-map-table {
    clear: both;
    width: calc(100% + var(--right-rail-span));
    max-width: none;
    margin-right: calc(-1 * var(--right-rail-span));
  }
}

@media (max-width: 899px) {
  html {
    scroll-padding-top: 64px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: var(--measure);
    padding: 0 20px 64px;
  }

  #toc {
    display: none;
  }

  .mobile-contents {
    display: block;
    position: sticky;
    z-index: 60;
    top: 3px;
    grid-row: 1;
    align-self: start;
    width: 100%;
    margin: 0 0 18px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    box-shadow: 0 8px 22px rgb(23 33 31 / 8%);
    font-family: var(--sans);
  }

  .mobile-contents > summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 0 14px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    list-style: none;
    text-transform: uppercase;
  }

  .mobile-contents > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-contents > summary::after {
    margin-left: auto;
    content: "+";
    font-size: 18px;
  }

  .mobile-contents[open] > summary::after {
    content: "−";
  }

  .mobile-contents nav {
    max-height: calc(100vh - 70px);
    padding: 4px 14px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--line);
  }

  .mobile-contents ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobile-contents ul ul {
    margin: 2px 0 6px 14px;
  }

  .mobile-contents a,
  .mobile-contents li > span {
    display: block;
    padding: 7px 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
  }

  #main-content {
    grid-column: 1;
    grid-row: 2;
  }

  .kernel-story-figure,
  .kernel-story-pair {
    width: 100%;
  }

  .kernel-story-figure .fig-stage::before {
    display: block;
    position: sticky;
    left: 0;
    width: max-content;
    margin: 0 0 8px;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    content: "Swipe to inspect diagram →";
  }
}

@media (max-width: 1200px) {
  .kernel-story-figure .fig-stage::before,
  .contract-map-figure .fig-stage::before {
    display: block;
    position: sticky;
    left: 0;
    width: max-content;
    margin: 0 0 8px;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    content: "Scroll to inspect diagram →";
  }

  /* The SVG state title is centered on the full scrollable canvas and is not
   * visible at the initial narrow-screen scroll position. Repeat only that
   * state label in the sticky inspection cue so the comparison still has a
   * readable identity before the reader pans across it. */
  .kernel-story-figure[id$="-mismatch"] .fig-stage::before {
    content: "Mismatch · scroll to inspect diagram →";
  }

  .kernel-story-figure[id$="-exact"] .fig-stage::before {
    content: "Bitwise identical · scroll to inspect diagram →";
  }

  #fig-gdn-recompute .fig-stage::before {
    content: "Aligned recompute · scroll to inspect diagram →";
  }

  #fig-gdn-cached .fig-stage::before {
    content: "CUDA graph decode · scroll to inspect diagram →";
  }

  #fig-moe-combine-tree .fig-stage::before {
    content: "Bitwise identical · scroll to inspect diagram →";
  }

  .contract-map-figure .fig-stage::before {
    content: "Start at the output on the right · scroll to inspect →";
  }

  .kernel-story-figure .fig-stage,
  .kernel-story-figure .fig-panel,
  .contract-map-figure .fig-stage,
  #fig-norm-tlsum .fig-stage {
    overflow-x: auto;
    scrollbar-color: var(--teal-dark) var(--bg-card-deep);
  }

  .kernel-story-figure .fig-svg,
  .contract-map-figure .fig-svg {
    width: 860px;
    max-width: none;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16.5px;
  }

  .fig-shell > .fig-reading-guide,
  .kernel-story-figure .fig-reading-guide {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 13px 14px 14px;
  }

  .masthead {
    padding-top: 32px;
  }

  .masthead h1 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .masthead h1.masthead-title {
    font-size: clamp(22px, 6.8vw, 34px);
  }


  .headline-result > p {
    display: block;
  }

  .headline-result > p span {
    display: block;
    margin-top: 4px;
  }

  .headline-result dl {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .optional-background {
    width: calc(100vw - 32px);
  }

  details.background-primer {
    padding: 0 16px;
  }

  details.background-primer > summary {
    grid-template-columns: minmax(0, 1fr) 26px;
    gap: 3px 10px;
    padding: 18px 0;
  }

  details.background-primer > summary::after {
    font-size: 25px;
  }

  .numerical-axes {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .background-lede {
    font-size: 16.5px;
  }

  #toc ul {
    columns: 1;
  }

  .rules-list {
    grid-template-columns: 1fr;
  }

  .fig-stage {
    padding: 14px;
  }

  .fig-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-color: var(--teal-dark) var(--bg-card-deep);
    scrollbar-width: thin;
  }

  .fig-tabs button {
    flex: 0 0 auto;
  }

  .fig-panel {
    overflow-x: auto;
    scrollbar-color: var(--teal-dark) var(--bg-card-deep);
  }

  .kernel-story-figure .fig-stage,
  .contract-map-figure .fig-stage,
  .q35-performance-figure .fig-stage,
  #fig-norm-tlsum .fig-stage {
    overflow-x: auto;
    scrollbar-color: var(--teal-dark) var(--bg-card-deep);
  }

  .fig-panel::before {
    display: block;
    position: sticky;
    left: 0;
    margin: 0 0 8px;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    content: "Swipe to inspect diagram →";
  }

  .kernel-story-figure .fig-stage::before,
  .contract-map-figure .fig-stage::before,
  .q35-performance-figure .fig-stage::before,
  #fig-norm-tlsum .fig-stage::before {
    display: block;
    position: sticky;
    left: 0;
    width: max-content;
    margin: 0 0 8px;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    content: "Swipe to inspect diagram →";
  }

  .kernel-story-figure[id$="-mismatch"] .fig-stage::before {
    content: "Mismatch · swipe to inspect diagram →";
  }

  .kernel-story-figure[id$="-exact"] .fig-stage::before {
    content: "Bitwise identical · swipe to inspect diagram →";
  }

  .contract-map-figure .fig-stage::before {
    content: "Start at the output on the right · swipe to inspect →";
  }

  #fig-gdn-recompute .fig-stage::before {
    content: "Aligned recompute · swipe to inspect diagram →";
  }

  #fig-gdn-cached .fig-stage::before {
    content: "CUDA graph decode · swipe to inspect diagram →";
  }

  #fig-moe-combine-tree .fig-stage::before {
    content: "Bitwise identical · swipe to inspect diagram →";
  }

  .table-scroll::before {
    display: block;
    position: sticky;
    left: 0;
    width: max-content;
    padding: 6px 10px;
    color: var(--ink-faint);
    background: var(--bg-card);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    content: "Swipe to inspect table →";
  }

  .fig-svg {
    width: 720px;
    max-width: none;
  }

  .kernel-story-figure .fig-svg {
    width: 860px;
  }

  .contract-map-figure .fig-svg,
  #fig-norm-tlsum .fig-svg {
    width: 860px;
  }

  #kernels .fig-svg {
    width: 860px;
  }

  .table-scroll::before {
    display: block;
    position: sticky;
    left: 0;
    width: max-content;
    padding: 7px 10px;
    color: var(--ink-faint);
    background: var(--bg-card);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    content: "Scroll table horizontally →";
  }

  .qwen-throughput-table::before,
  .step-time-table::before,
  .overlap-modes-table::before {
    display: none;
  }

  .qwen-throughput-table .data-table th:first-child,
  .qwen-throughput-table .data-table td:first-child,
  .step-time-table .data-table th:first-child,
  .step-time-table .data-table td:first-child,
  .overlap-modes-table .data-table th:first-child,
  .overlap-modes-table .data-table td:first-child {
    position: static;
    box-shadow: none;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg-card);
    box-shadow: 1px 0 0 var(--line);
  }

  .frontier-chart-wrap {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 16px 10px 22px;
  }

  .chart-summary {
    grid-template-columns: 1fr 1fr;
    margin: 16px 6px 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .frontier-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0 0 14px;
  }

  .frontier-controls label,
  .frontier-controls select {
    margin: 0 14px;
  }

  .sources li {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .artifact-list {
    columns: 1;
  }

  .implementation-list > li {
    grid-template-columns: 28px 1fr;
  }

  .implementation-list > li > a,
  .paired-links {
    grid-column: 2;
    justify-content: flex-start;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .has-js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
 * Typeset algorithm equations. KaTeX and its fonts are bundled locally.
 * The source element keeps a readable text fallback when JavaScript is off.
 * ------------------------------------------------------------------------- */

.math-display {
  max-width: 100%;
  margin: 24px 0 26px;
  padding: 20px clamp(14px, 3vw, 26px);
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--teal-dark);
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgb(23 33 31 / 4%);
  scrollbar-width: thin;
}

.policy-q {
  color: var(--training);
}

.policy-mu {
  color: var(--serving);
}

.math-display .katex-display {
  margin: 0;
}

.math-display .katex {
  font-size: clamp(0.92rem, 1.8vw, 1.08rem);
}

.math-display-compact .katex {
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.math-display code {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
  white-space: normal;
}

.math-render-error {
  border-left-color: var(--red-dark);
}

@media print {
  :root {
    --measure: 100%;
  }

  @page {
    margin: 15mm;
  }

  body {
    color: #111;
    background: #fff;
    font-size: 10pt;
  }

  .publication-warning,
  .reading-progress,
  #toc,
  .mobile-contents,
  .frontier-controls {
    display: none !important;
  }

  .layout {
    display: block;
    max-width: 100%;
  }

  article.post-content .fig-shell,
  article.post-content .roadmap-figure,
  article.post-content .frontier-panel,
  article.post-content .contract-map-table {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
  }

  #kernels .fig-svg {
    width: 100%;
    max-width: 100%;
  }

  .sidenote {
    display: block !important;
    float: none;
    width: auto;
    margin: 8px 0;
  }

  .data-table,
  .closing-proof {
    color: #111;
    border-color: #888;
    box-shadow: none;
  }

  section,
  table {
    break-inside: avoid;
  }

  .has-js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .table-scroll {
    overflow: visible;
    border-color: #888;
  }

  .math-display {
    overflow: visible;
    border-color: #888;
    box-shadow: none;
  }

  .data-table {
    min-width: 0;
    color: #111;
  }

  .contract-map-table .data-table {
    min-width: 0;
  }

  .data-table th,
  .data-table td,
  .data-table caption {
    color: #111;
    border-color: #aaa;
  }

  a {
    text-decoration: none;
  }

  a[href]::after {
    color: #555;
    content: " (" attr(href) ")";
    font-family: var(--sans);
    font-size: 8pt;
    font-weight: 400;
  }
}

/* --------------------------------------------------------------------------
 * Three-run GRPO comparison figure.
 */

.grpo-runs-controls,
.branch-runs-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13.5px;
}

.grpo-runs-series,
.branch-runs-series {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  border: 0;
}

.grpo-runs-series legend,
.branch-runs-series legend {
  float: left;
  margin-right: 14px;
  padding: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.09em;
  line-height: 2.1;
  text-transform: uppercase;
}

.grpo-runs-series label,
.branch-runs-series label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--ink-soft);
  cursor: pointer;
}

.grpo-runs-series input,
.branch-runs-series input {
  accent-color: var(--ink);
}

.grpo-runs-legend,
.branch-runs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 0 auto;
  padding: 0;
  color: var(--ink-soft);
  list-style: none;
}

.grpo-runs-legend li,
.branch-runs-legend li {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  line-height: 1.15;
}

.grpo-legend-swatch,
.branch-legend-swatch {
  display: inline-block;
  width: 16px;
  height: 4px;
  border-radius: 2px;
}

/* The opening figure carries the headline result, so its key is not a caption
   detail — it is what tells the three runs apart, and it has to carry across
   a room. It stays on the fieldset's row: dropping it to a row of its own
   buys another 6px of type but strands SHOW and its two checkboxes on an
   otherwise empty line, which reads as a layout accident. That row leaves the
   key 473px beside the 405px fieldset, which it fills at 25px — but Inter is
   not self-hosted, so most readers get a system fallback whose advance widths
   differ, and overrunning that budget drops the key to its own row on their
   machine. 23px plus a tighter bar gap keeps ~9% in hand for that. Below the
   breakpoint the bar itself narrows and can no longer hold both, so the key
   falls back to the compact size rather than wrapping. The in-article figures
   keep that compact key at every width: they are read in context, and their
   bars carry a third control. */
@media (min-width: 1000px) {
  #grpo-runs-controls {
    column-gap: 18px;
  }

  #fig-grpo-runs .grpo-runs-legend {
    gap: 8px 20px;
    color: var(--ink);
    font-size: 23px;
    line-height: 1.15;
  }

  #fig-grpo-runs .grpo-runs-legend li {
    gap: 12px;
    line-height: 1.15;
  }

  #fig-grpo-runs .grpo-legend-swatch {
    width: 28px;
    height: 5px;
    border-radius: 2.5px;
  }
}

.grpo-swatch-zerok3 {
  background: var(--teal);
}

.grpo-swatch-is {
  background: var(--orange);
}

.grpo-swatch-tinker {
  background: #57544b;
}

.grpo-swatch-replay {
  background: #3e88a6;
}

.grpo-swatch-river-r3 {
  background: #6d4aa8;
}

.grpo-swatch-xorl-navy {
  background: #1d4f6e;
}

.grpo-swatch-river-baseline {
  background: #a98fe0;
}

.grpo-swatch-pipeline {
  background: #055a52;
}

.grpo-swatch-shared-outer {
  background: #3e88a6;
}

.grpo-swatch-tinker-is {
  background: #6d4aa8;
}

.grpo-swatch-tinker-cispo {
  background: #a98fe0;
}

/* Legend entries are named in their run's own ink, set from the series config
 * in app.js so the chart and its key cannot drift apart. */

.grpo-swatch-xorl-deep {
  background: #b05a1a;
}

.grpo-runs-legend li[data-series],
.branch-runs-legend li[data-series] {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
}

.grpo-runs-legend li[data-series]:focus-visible,
.branch-runs-legend li[data-series]:focus-visible {
  outline: 2px solid #3e88a6;
  outline-offset: 2px;
}

.grpo-runs-legend li[data-series].series-off,
.branch-runs-legend li[data-series].series-off {
  opacity: 0.45;
}

.grpo-runs-legend li[data-series].series-off .grpo-legend-swatch,
.branch-runs-legend li[data-series].series-off .branch-legend-swatch {
  background: #b9b4a8;
}

.grpo-swatch-ppo {
  background: #9e2f2a;
}

.grpo-swatch-cispo {
  background: #055a52;
}

.grpo-runs-figure .fig-stage {
  padding: 10px 12px 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.grpo-runs-figure .fig-stage:focus-visible {
  outline: 2px solid var(--teal-dark);
  outline-offset: -2px;
}

.grpo-runs-figure figure {
  margin: 0;
}

.grpo-runs-figure .fig-svg {
  display: block;
  width: 100%;
  height: auto;
}

.grpo-runs-figure .fig-svg:focus-visible {
  outline: 2px solid var(--teal-dark);
  outline-offset: 2px;
}

.grpo-comparison-note {
  margin: 0;
  padding: 10px 16px 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .grpo-runs-figure .fig-stage::before {
    display: block;
    position: sticky;
    left: 0;
    z-index: 2;
    width: max-content;
    margin: 0 0 8px;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    content: "Swipe to inspect all runs and held-out results →";
  }

  .grpo-runs-figure .fig-svg {
    min-width: 700px;
  }
}

/* --------------------------------------------------------------------------
 * Three-run Tinker incident figure. Shares the opening comparison figure's
 * controls and legend component (see the selector lists above); only the
 * swatch colours and the scroll hint are its own.
 */

.branch-swatch-run1 {
  background: var(--red);
}

.branch-swatch-run2 {
  background: #57544b;
}

/* Run 3 traces Run 1 closely enough to disappear underneath it, so the chart
 * dashes that series and the swatch has to say so. */
.branch-swatch-run3 {
  background: repeating-linear-gradient(90deg, var(--orange) 0 6px, transparent 6px 10px);
}

.branch-runs-figure .fig-stage {
  padding: 10px 12px 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.branch-runs-figure .fig-stage:focus-visible {
  outline: 2px solid var(--teal-dark);
  outline-offset: -2px;
}

.branch-runs-figure figure {
  margin: 0;
}

.branch-runs-figure .fig-svg {
  display: block;
  width: 100%;
  height: auto;
}

.branch-runs-figure .fig-svg:focus-visible {
  outline: 2px solid var(--teal-dark);
  outline-offset: 2px;
}

.branch-runs-note {
  margin: 0;
  padding: 10px 16px 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .branch-runs-figure .fig-stage::before {
    display: block;
    position: sticky;
    left: 0;
    z-index: 2;
    width: max-content;
    margin: 0 0 8px;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    content: "Swipe to compare the three runs \2192";
  }

  .branch-runs-figure .fig-svg {
    min-width: 760px;
  }
}

/* ---------------------------------------------------------------------------
 * Parallelism axes loop.
 * The four frames stack and a keyframe window shows one at a time. The last
 * frame is the resting state, so a reader without animation, or with reduced
 * motion, sees the complete picture.
 * ------------------------------------------------------------------------- */

.axes-loop {
  position: relative;
  margin: 0;
}

.axes-loop .axes-frame {
  opacity: 0;
  animation: axes-frame-window 8s infinite;
}

.axes-loop .axes-frame + .axes-frame {
  position: absolute;
  top: 0;
  left: 0;
}

.axes-loop .axes-frame:nth-child(1) { animation-delay: 0s; }
.axes-loop .axes-frame:nth-child(2) { animation-delay: -6s; }
.axes-loop .axes-frame:nth-child(3) { animation-delay: -4s; }
.axes-loop .axes-frame:nth-child(4) { animation-delay: -2s; }

.axes-loop .axes-frame:last-child {
  opacity: 1;
}

@keyframes axes-frame-window {
  0% { opacity: 0; }
  2% { opacity: 1; }
  25% { opacity: 1; }
  27% { opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .axes-loop .axes-frame {
    animation: none;
  }
}

.slide-svg {
  display: block;
  width: 100%;
  height: auto;
}
