/* the inline head style hides <body> until this sheet has applied */
body { visibility: visible; }
@font-face {
  font-family: "Alliance No.2";
  src: url("../fonts/AllianceNo2-Regular.woff2") format("woff2"), url("../fonts/AllianceNo2-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

/* Essays: a lighter, editorial voice than the product deep dives. Cool paper, one
   blue accent, a serif italic for maths. Values taken from the Figma frames. */
:root {
  --paper: #f2f4f6;
  --panel: #e6eaf2;
  --card: #fafbfc;
  --rule: #ced3dd;
  --ink: #1b2240;
  --muted: #626b7d;
  --accent: #4458ca;
  --dark: #1b2240;
  --dark-cell: #263354;
  --dark-line: #46506b;
  --dark-text: #f2f4fa;
  --dark-muted: #b6bed1;
  --red: #e10600;

  --sans: "Alliance No.2", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Lora", Georgia, "Times New Roman", serif;

  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 40px; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
::selection { background: var(--accent); color: #fff; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 50; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }

/* ---------- top bar ---------- */

.bar { display: flex; justify-content: space-between; align-items: center; padding: clamp(20px, 2.6vw, 36px) var(--pad); }
.bar__logo { display: inline-flex; align-items: baseline; font-size: clamp(20px, 1.5vw, 26px); letter-spacing: -0.01em; }
.bar__cursor { display: inline-block; width: 0.42em; height: 0.1em; margin-left: 0.12em; background: var(--red); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.15; } }
.bar__back { font-size: 14px; color: var(--accent); transition: transform 0.6s var(--ease); }
.bar__back:hover { transform: translateX(-3px); }

/* ---------- introduction ---------- */

.intro { margin: 0 var(--pad); padding: 40px 0 64px; border-top: 1px solid var(--rule); }
.intro__context { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.intro__title { max-width: 15.5em; margin-top: 24px; font-size: clamp(40px, 5vw, 72px); font-weight: 400; line-height: 1.08; letter-spacing: -0.02em; }
.intro__open { display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 1fr); gap: clamp(32px, 6.7vw, 96px); align-items: center; margin-top: 40px; }
.intro__deck { font-size: clamp(18px, 1.6vw, 23px); line-height: 1.5; color: var(--muted); }

.motif { display: grid; place-items: center; height: 136px; background: var(--panel); }
.motif-math { font-family: var(--serif); font-style: italic; font-size: 52px; color: var(--ink); }
.motif-ranges { display: grid; gap: 18px; justify-items: center; width: 230px; }
.motif-ranges span { position: relative; display: block; width: var(--w); height: 1px; background: var(--muted); }
.motif-ranges span::after { content: ""; position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--accent); }
.motif-decide { display: flex; align-items: center; gap: 20px; }
.motif-decide__q { font-family: var(--serif); font-style: italic; font-size: 54px; color: var(--muted); }
.motif-decide__line { width: 64px; height: 1px; background: var(--rule); }
.motif-decide__node { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--accent); border-radius: 50%; font-size: 24px; color: var(--accent); }

/* ---------- reading area ---------- */

.read {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 64px;
  padding: 56px var(--pad) 80px;
  border-top: 1px solid var(--rule);
}

.guide { position: sticky; top: 40px; align-self: start; padding-top: 8px; }
.guide__list { display: grid; gap: 18px; margin-top: 28px; }
.guide__list a { display: grid; grid-template-columns: 28px 1fr; font-size: 14px; line-height: 1.5; color: var(--muted); transition: color 0.4s; }
.guide__list a span { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 2px; }
.guide__list a:hover, .guide__list a.is-active { color: var(--ink); }
.guide__list a.is-active span { color: var(--red); }
.guide__note { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.65; color: var(--muted); }

.body { display: grid; gap: 56px; min-width: 0; }
.es { display: grid; gap: 24px; }
.es__n { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.es h2 { margin-top: -12px; font-size: clamp(24px, 2.1vw, 30px); font-weight: 400; line-height: 1.25; letter-spacing: -0.01em; }
.es p:not([class]) { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.8; }

/* ---------- figures (built in HTML, not images) ---------- */

.fig-panel, .fig-dark { display: grid; gap: 24px; padding: 32px; }
.fig-panel { background: var(--panel); }
.fig-dark { background: var(--dark); color: var(--dark-text); border-radius: 8px; }
.fig-label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); }
.fig-dark .fig-label { color: var(--dark-muted); }
.fig-note { font-size: 14px; line-height: 1.6; color: var(--muted); }
.fig-dark .fig-note { color: var(--dark-muted); }

/* comparison table */
.cmp { display: grid; gap: 20px; overflow-x: auto; }
.cmp__row { display: grid; grid-template-columns: 88px repeat(5, minmax(64px, 104px)); gap: 16px; min-width: 520px; font-family: var(--mono); font-size: 17px; }
.cmp__row:not(.cmp__row--head) { padding-top: 20px; border-top: 1px solid var(--rule); }
.cmp__row--head { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.cmp .hi { color: var(--accent); }

/* safety gate */
.gate { display: grid; grid-template-columns: 208px auto 1fr; gap: 16px; align-items: center; }
.gate__box { display: grid; gap: 10px; padding: 20px; border: 1px solid var(--dark-line); }
.gate__box--fill { border-color: transparent; background: var(--dark-cell); }
.gate__t { font-size: 18px; }
.gate__d { font-size: 14px; line-height: 1.5; color: var(--dark-muted); }
.gate__math { font-family: var(--serif); font-style: italic; font-size: 26px; }
.gate__arrow { font-size: 24px; color: var(--dark-muted); }

/* Wilson fraction */
.frac { display: grid; gap: 20px; font-family: var(--serif); font-size: clamp(16px, 1.6vw, 22px); }
.frac__num { line-height: 1.5; padding-bottom: 20px; border-bottom: 1px solid var(--dark-line); text-align: center; }
.frac__den { text-align: center; }

/* interval chart */
.iv { display: grid; gap: 28px; }
.iv__row { display: grid; grid-template-columns: 108px minmax(0, 1fr) 56px; gap: 24px; align-items: center; font-family: var(--mono); font-size: 16px; }
.iv__row--head { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.iv__row--head .iv__val { color: var(--muted); }
.iv__plot { position: relative; height: 28px; }
.iv__plot::before { content: ""; position: absolute; left: 0; right: 0; top: 13.5px; height: 1px; background: var(--muted); }
.iv__band { position: absolute; right: 0; top: 12px; height: 3px; background: var(--accent); }
.iv__dot { position: absolute; top: 9px; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: var(--accent); }
.iv__tick { position: absolute; right: 0; top: 7px; width: 1px; height: 14px; background: var(--ink); }
.iv__val { color: var(--accent); }
.iv__plot--label { height: auto; }
.iv__plot--label::before, .iv__plot--axis::before { display: none; }
.iv__plot--axis { display: flex; justify-content: space-between; height: auto; font-size: 12px; color: var(--muted); }

/* review screen */
.review { display: grid; gap: 24px; padding: 28px; background: var(--card); border-radius: 8px; }
.review__status { display: flex; justify-content: space-between; gap: 16px; color: var(--accent); font-size: 14px; }
.review__status span:first-child { font-family: var(--mono); font-size: 12px; text-transform: uppercase; }
.review__title { font-size: 28px; }
.review__list { display: grid; gap: 16px; font-size: 14px; }
.review__list div { display: grid; grid-template-columns: 108px 1fr; gap: 16px; }
.review__list dt { color: var(--muted); }
.review__list dd { line-height: 1.5; }
.review__note { padding-top: 24px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.6; color: var(--muted); }
.review__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; font-size: 14px; }
.review__confirm { padding: 14px 20px; border-radius: 4px; background: var(--accent); color: var(--dark-text); }
.review__keep { color: var(--muted); }

/* consent stages */
.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stages li { display: grid; gap: 12px; padding: 16px; background: var(--dark-cell); }
.stages li.is-key { background: var(--accent); }
.stages__t { font-size: 18px; }
.stages__d { font-size: 12px; line-height: 1.5; }
.stages__rule { font-size: 16px; line-height: 1.6; }

/* takeaways */
.take { display: grid; gap: 24px; padding: 32px; background: var(--panel); }
.take__title { font-size: 28px; line-height: 1.25; }
.take__list { display: grid; gap: 24px; }
.take__list li { display: grid; grid-template-columns: 18px 1fr; gap: 16px; font-size: 16px; line-height: 1.65; }
.take__list li::before { content: "↳"; font-size: 18px; color: var(--accent); }

/* previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border-block: 1px solid var(--rule); }
.pager__item { display: grid; gap: 10px; padding: 24px 0; background: var(--paper); }
.pager__item--next { text-align: right; }
.pager__k { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--accent); }
.pager__t { font-size: 20px; line-height: 1.3; transition: color 0.4s; }
.pager__item:hover .pager__t { color: var(--accent); }
.pager__item--prev { padding-right: 24px; }
.pager__item--next { padding-left: 24px; }

.foot { display: flex; justify-content: space-between; align-items: center; margin: 0 var(--pad); padding: 28px 0 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .read { grid-template-columns: minmax(0, 1fr); }
  .guide { position: static; }
  .intro__open { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .gate { grid-template-columns: 1fr; }
  .gate__arrow { transform: rotate(90deg); justify-self: start; }
  .stages { grid-template-columns: 1fr 1fr; }
  .iv__row { grid-template-columns: 64px minmax(0, 1fr) 48px; gap: 12px; font-size: 14px; }
  .review__list div { grid-template-columns: 1fr; gap: 4px; }
  .pager { grid-template-columns: 1fr; }
  .pager__item--next { text-align: left; padding-left: 0; }
  .fig-panel, .fig-dark, .take { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- page transitions: the site behaves like one page ----------
   Cross-document view transitions (Chrome/Edge/Safari 18.2+). The logo and the
   menu button never leave the screen; cards grow into the pages they open
   (chapter covers, essay motifs, the meetfleet tile); everything else slides
   in the direction of travel: forward rises, back settles down. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 0.7s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
::view-transition-old(root) { animation: vt-out 0.38s cubic-bezier(0.4, 0, 0.2, 1) both; }
::view-transition-new(root) { animation: vt-in 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both; }
html:active-view-transition-type(back)::view-transition-old(root) { animation-name: vt-out-back; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: vt-in-back; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-28px) scale(0.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(44px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateY(28px) scale(0.985); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateY(-44px); } }
/* persistent chrome: no fade, it simply glides to its new place */
::view-transition-old(site-logo), ::view-transition-old(site-burger) { animation: none; opacity: 0; }
::view-transition-new(site-logo), ::view-transition-new(site-burger) { animation: none; }
/* shared artwork: crop, don't squash, while the frame changes shape */
::view-transition-image-pair(mf-stage), ::view-transition-image-pair(chapter-1), ::view-transition-image-pair(chapter-2), ::view-transition-image-pair(chapter-3) { overflow: hidden; border-radius: clamp(14px, 1.6vw, 28px); }
::view-transition-old(mf-stage), ::view-transition-new(mf-stage),
::view-transition-old(chapter-1), ::view-transition-new(chapter-1),
::view-transition-old(chapter-2), ::view-transition-new(chapter-2),
::view-transition-old(chapter-3), ::view-transition-new(chapter-3) { width: 100%; height: 100%; object-fit: cover; }

@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
/* browsers without view transitions get a short fade (set from JS) */
html.is-leaving body { opacity: 0; transition: opacity 0.18s ease-in; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.logo, .bar__logo { view-transition-name: site-logo; }
.burger { view-transition-name: site-burger; }
[data-essay="1"] .motif { view-transition-name: essay-1; }
[data-essay="2"] .motif { view-transition-name: essay-2; }
[data-essay="3"] .motif { view-transition-name: essay-3; }

/* ---------- living motifs: each drawing acts out its essay ----------
   a × b × c: the factors drift; every cycle the weak one (c) sinks and turns var(--accent).
   ranges: the intervals tighten in turn as evidence accumulates.
   ? → ✓: hesitation, a dot travels the line, the node fills and the tick draws. */
.motif-math { display: inline-flex; align-items: baseline; gap: 0.16em; }
.motif-math .mf, .motif-math .mx { display: inline-block; }
.motif-math .mf { animation: mf-float 3.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
.motif-math .mf--2 { animation-delay: 0.25s; }
.motif-math .mf--3 { animation: mf-float 3.6s cubic-bezier(0.45, 0, 0.55, 1) 0.5s infinite, mf-weak 6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.motif-math .mx { font-style: normal; opacity: 0.5; animation: mx-turn 6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.motif-math .mx ~ .mx { animation-delay: 0.35s; }
@keyframes mf-float { 50% { transform: translateY(-5px); } }
@keyframes mx-turn { 0%, 38% { transform: rotate(0); } 52%, 100% { transform: rotate(180deg); } }
@keyframes mf-weak {
  0%, 48%, 100% { color: var(--ink); opacity: 1; scale: 1; }
  60%, 82%      { color: var(--accent); opacity: 0.8; scale: 0.74; }
}

.motif-ranges > span { animation: rg-tighten 6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.motif-ranges > span:nth-child(2) { animation-delay: 0.3s; }
.motif-ranges > span:nth-child(3) { animation-delay: 0.6s; }
.motif-ranges > span::after { animation: rg-dot 6s cubic-bezier(0.65, 0, 0.35, 1) infinite; animation-delay: inherit; }
@keyframes rg-tighten { 0%, 100% { width: var(--w); } 42%, 62% { width: calc(var(--w) * 0.42); } }
@keyframes rg-dot { 0%, 30%, 74%, 100% { transform: scale(1); } 48% { transform: scale(1.7); } }

.motif-decide__q { display: inline-block; transform-origin: 50% 80%; animation: dc-q 6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
@keyframes dc-q {
  0%, 100% { transform: rotate(0); opacity: 1; }
  7% { transform: rotate(-14deg); } 13% { transform: rotate(9deg); } 19% { transform: rotate(0); }
  44%, 86% { opacity: 0.3; }
}
.motif-decide__line { position: relative; }
.motif-decide__line i {
  position: absolute; top: -3px; left: 0; width: 7px; height: 7px; margin-left: -3.5px;
  border-radius: 50%; background: var(--accent); opacity: 0;
  animation: dc-travel 6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes dc-travel {
  0%, 18% { left: 0; opacity: 0; }
  22% { left: 0; opacity: 1; }
  42% { left: 100%; opacity: 1; }
  46%, 100% { left: 100%; opacity: 0; }
}
.motif-decide__node { animation: dc-node 6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.motif-decide__node svg {
  width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: dc-check 6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes dc-node {
  0%, 42%   { background: transparent; color: var(--accent); transform: scale(1); }
  48%       { background: var(--accent); color: #fff; transform: scale(1.14); }
  55%, 86%  { background: var(--accent); color: #fff; transform: scale(1); }
  95%, 100% { background: transparent; color: var(--accent); transform: scale(1); }
}
@keyframes dc-check { 0%, 48% { stroke-dashoffset: 1; } 60%, 88% { stroke-dashoffset: 0; } 96%, 100% { stroke-dashoffset: 1; } }

@media (prefers-reduced-motion: reduce) {
  .motif-decide__node svg { stroke-dashoffset: 0; }
}

/* ---- motifs for the AI / quantum / Python essays ---- */
.m-evals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.m-evals i { width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 3px; opacity: 0.35; animation: ev-tick 4.8s cubic-bezier(0.65, 0, 0.35, 1) infinite; animation-delay: calc(var(--k) * 0.12s); }
.m-evals i.is-fail { color: #e10600; animation-name: ev-fail; }
@keyframes ev-tick { 0%, 8% { opacity: 0.25; background: transparent; } 22%, 82% { opacity: 1; background: currentColor; } 100% { opacity: 0.25; background: transparent; } }
@keyframes ev-fail { 0%, 8% { opacity: 0.25; background: transparent; transform: none; } 22%, 82% { opacity: 1; background: currentColor; transform: rotate(45deg) scale(0.8); } 100% { opacity: 0.25; background: transparent; transform: none; } }
.m-amps { display: flex; align-items: flex-end; gap: 7px; height: 64px; }
.m-amps i { width: 9px; height: 100%; background: currentColor; opacity: 0.45; border-radius: 1px; transform-origin: 50% 100%; animation: am-shrink 5s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.m-amps i.is-marked { color: #e10600; opacity: 1; animation-name: am-grow; }
@keyframes am-shrink { 0%, 12% { transform: scaleY(0.36); } 45%, 80% { transform: scaleY(0.08); } 100% { transform: scaleY(0.36); } }
@keyframes am-grow { 0%, 12% { transform: scaleY(0.36); } 45%, 80% { transform: scaleY(1); } 100% { transform: scaleY(0.36); } }
.m-stream { display: flex; align-items: center; gap: 6px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.m-stream b { font-weight: 400; font-size: 18px; opacity: 0.55; margin-inline-end: 4px; }
.m-stream i { display: block; width: var(--w); height: 9px; border-radius: 2px; background: currentColor; opacity: 0; animation: st-tok 4.2s steps(1, end) infinite; animation-delay: calc(var(--k) * 0.32s); }
.m-stream u { display: block; width: 2px; height: 20px; background: #e10600; animation: st-caret 0.9s steps(1, end) infinite; }
@keyframes st-tok { 0% { opacity: 0; } 4%, 86% { opacity: 0.85; } 100% { opacity: 0; } }
@keyframes st-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .m-evals i, .m-amps i, .m-stream i, .m-stream u { animation: none; opacity: 0.8; } .m-evals i { background: currentColor; } }
.motif .m-evals, .motif .m-amps, .motif .m-stream { color: var(--ink); }
.essay__motif .m-evals, .essay__motif .m-amps, .essay__motif .m-stream { color: var(--navy); }

/* code: a dark panel, quiet syntax colours */
.code { overflow-x: auto; margin: 0; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: var(--dark-text); tab-size: 4; }
.code code { font: inherit; white-space: pre; }
.c-k { color: #9fb0ff; }
.c-f { color: #ffffff; }
.c-d { color: #ffb4b4; }
.c-c { color: var(--dark-muted); font-style: italic; }

/* generic table */
.tbl { display: grid; gap: 16px; overflow-x: auto; }
.tbl__row { display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(72px, 1fr)); gap: 16px; min-width: 460px; font-size: 15px; }
.tbl--3 .tbl__row { grid-template-columns: minmax(170px, 1.5fr) minmax(130px, 1.1fr) minmax(130px, 1fr); }
.tbl__row:not(.tbl__row--head) { padding-top: 16px; border-top: 1px solid var(--rule); }
.tbl__row--head { font-size: 12px; color: var(--muted); }
.tbl__row--total { font-weight: 600; }
.tbl .hi { color: var(--red); }

/* Grover: probability bars per step */
.amps { display: grid; gap: 22px; }
.amps__row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 64px; gap: 20px; align-items: end; }
.amps__k { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); padding-bottom: 2px; }
.amps__bars { display: flex; align-items: flex-end; gap: 8px; height: 84px; border-bottom: 1px solid var(--rule); }
.amps__bars i { flex: 1; height: calc(var(--p) * 100%); min-height: 1px; background: var(--ink); opacity: 0.35; border-radius: 2px 2px 0 0; }
.amps__bars i.is-marked { background: var(--red); opacity: 1; }
.amps__v { font-family: var(--mono); font-size: 14px; color: var(--red); text-align: right; }

/* Mosca's inequality */
.mosca { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px 48px; align-items: center; }
.mosca__eq { font-family: var(--serif); font-style: italic; font-size: clamp(36px, 4vw, 56px); white-space: nowrap; }
.mosca__terms { display: grid; gap: 14px; }
.mosca__terms div { display: grid; grid-template-columns: 28px 1fr; gap: 12px; font-size: 15px; line-height: 1.5; }
.mosca__terms dt { font-family: var(--serif); font-style: italic; font-size: 20px; }
.mosca__terms dd { color: var(--dark-muted); }
.fig-dark .hi { color: #ff6b6e; }

/* latency waterfall, 5 seconds wide */
.wf { display: grid; gap: 18px; }
.wf__row, .wf__axis { display: grid; grid-template-columns: 150px minmax(0, 1fr) 56px; gap: 16px; align-items: center; }
.wf__k { font-size: 14px; color: var(--dark-muted); }
.wf__track { position: relative; height: 36px; border-radius: 4px; background: rgba(255, 255, 255, 0.04); }
.wf__seg { position: absolute; top: 4px; bottom: 4px; left: calc(var(--a) / 5 * 100%); width: calc((var(--b) - var(--a)) / 5 * 100%); padding: 0 6px; overflow: hidden; text-overflow: clip; white-space: nowrap; font-style: normal; font-size: 11.5px; line-height: 28px; color: var(--dark-text); background: var(--dark-line); border-radius: 3px; border-left: 1px solid var(--dark); }
.wf__seg--top { bottom: 50%; line-height: 14px; font-size: 10px; }
.wf__row:first-child .wf__seg:not(.wf__seg--model) { font-size: 10.5px; }
.wf__seg--alt { top: 50%; line-height: 14px; font-size: 10px; }
.wf__seg--model { background: #3a4a8f; }
.wf__mark { position: absolute; top: -6px; bottom: -6px; left: calc(var(--t) / 5 * 100%); width: 2px; background: #ff6b6e; }
.wf__v { font-family: var(--mono); font-size: 14px; text-align: right; }
.wf__ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--dark-muted); }

@media (max-width: 700px) {
  .mosca { grid-template-columns: 1fr; }
  .wf__row, .wf__axis { grid-template-columns: 1fr 48px; }
  .wf__k { grid-column: 1 / -1; }
  .wf__axis > span:first-child, .wf__axis > span:last-child { display: none; }
  .amps__row { grid-template-columns: 56px minmax(0, 1fr) 52px; gap: 12px; }
  .code { font-size: 12px; }
  .wf__seg:not(.wf__seg--model) { font-size: 0 !important; padding: 0; }
}
