/* The teaser stands on a dark band, the ground. After it,
   sections alternate between paper and stone in one article column, with figures in white cards. Walnut brown is the
   brand color and caramel its accent on dark; green and red only mark what agrees or disagrees
   with the screen. The two agents and the handwritten notes come from the figures of the paper.
   Phones, tablets, desktops and wide displays each get their own layout. */

@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 600 700; font-display: swap; src: url(../fonts/caveat-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/inter-greek.woff2) format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(../fonts/jetbrainsmono-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400 600; font-display: swap; src: url(../fonts/newsreader-latin-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/newsreader-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #fbf9f6;
  --stone: #f3efe9;
  --surface: #ffffff;
  --sunk: #ece6dd;
  --ink: #221813;
  --ink-2: #46392f;
  --muted: #7b6e62;
  --line: #e4ddd3;
  --line-2: #cfc5b8;

  --espresso: #2a1c14;
  --primary: #5e3a26;
  --primary-soft: #b08d6f;
  --tint: #f1e6d8;
  --caramel: #c98b52;
  --cream: #f3ebe0;

  --ok: #1d7a63;
  --ok-ink: #135a48;
  --ok-tint: #e7f3ee;
  --bad: #bf4a2a;
  --bad-ink: #98371b;
  --bad-tint: #fbebe4;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-card: 12px;
  --r: 7px;
  --wrap: 860px;
  --gutter: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.62 var(--sans);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
sub, sup { line-height: 0; }
b { font-weight: 650; }

:focus-visible { outline: 2px solid var(--caramel); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }

.sym { font-family: "KaTeX_Math", "Times New Roman", serif; font-style: italic; font-size: 1.08em; }
.sym sub, .sym sup { font-size: 0.72em; font-style: normal; }
.k { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.cap { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.cap i { font-family: "KaTeX_Math", "Times New Roman", serif; font-size: 1.06em; }

/* The agent of the paper figures */

.face { width: 44px; height: 44px; flex: none; color: var(--primary); --fill: var(--tint); }
.face .f { fill: var(--fill); stroke: currentColor; stroke-width: 1.2; }
.face .s { fill: currentColor; }
.face .p { fill: #fff; }
.face .m { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.face.base { color: var(--bad); --fill: var(--bad-tint); }
.face.ours { color: var(--ok); --fill: var(--ok-tint); }

/* Title */

.hero { text-align: center; }
.hero > .wrap { max-width: calc(1280px + 2 * var(--gutter)); padding-top: 118px; padding-bottom: 44px; }
h1 { display: grid; gap: 6px; }
h1 .t1 { font-family: var(--serif); font-size: clamp(40px, 6.6vw, 78px); font-weight: 500; line-height: 1.04; letter-spacing: -0.022em; color: var(--ink); }
h1 em { position: relative; font-style: italic; font-weight: 500; color: var(--primary); white-space: nowrap; }
h1 em svg { position: absolute; left: -1%; right: -1%; bottom: -0.06em; width: 102%; height: 0.17em; overflow: visible; }
h1 em svg { transform-origin: left center; animation: draw 0.8s 0.3s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
h1 em path { fill: none; stroke: var(--caramel); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
h1 .t2 { font-family: var(--serif); font-size: clamp(22px, 3.1vw, 36px); font-weight: 400; font-style: italic; line-height: 1.2; color: var(--ink-2); }

.authors { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 24px; font-size: 16.5px; font-weight: 550; color: var(--ink); }
.authors sup, .affil sup { font-size: 0.66em; margin-left: 1px; font-weight: 500; color: var(--primary); }
.affil { margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; font-size: 14.5px; color: var(--muted); }
.affil sup { margin-right: 2px; }
.affil.notes { margin-top: 5px; gap: 1px 16px; font-size: 12.5px; }

.links { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 19px 0 10px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--cream);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.btn .ico { display: grid; place-items: center; flex: none; width: 30px; }
.btn svg { display: block; }
.sprite { position: absolute; }
.btn[href]:hover { background: var(--espresso); transform: translateY(-1px); }
.btn[href]:active { transform: none; }
.btn[data-pending] { cursor: default; }
.btn[data-pending]::after { content: "soon"; margin-left: 1px; font-family: var(--hand); font-size: 17px; font-weight: 700; line-height: 1; color: #ecc296; }

.lede { margin: 70px auto 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.lede span { display: block; text-wrap: balance; }
.lede b { color: var(--ink); }

/* The ground: the teaser stands half on it. It shows what the figure of the paper shows, in
   three parts, laid out for the page and wider than the text column. */

/* The ground is dark from a little above the lower edge of the teaser card down to its end.
   --below is the distance from that edge to the end of the ground, and the script keeps it exact. */
.ground { --pad: 54px; --below: 202px; --band: calc(var(--below) + 14px); --fade: 180px; background: linear-gradient(to bottom, var(--paper) calc(100% - var(--band) - var(--fade) * 1.0), #f3ebdf calc(100% - var(--band) - var(--fade) * 0.857), #e4d2bb calc(100% - var(--band) - var(--fade) * 0.714), #c9a988 calc(100% - var(--band) - var(--fade) * 0.571), #9d7151 calc(100% - var(--band) - var(--fade) * 0.429), #6c4530 calc(100% - var(--band) - var(--fade) * 0.286), #432b1e calc(100% - var(--band) - var(--fade) * 0.143), var(--espresso) calc(100% - var(--band) - var(--fade) * 0.0)); padding-bottom: var(--pad); text-align: left; }
.wrap.wide { max-width: calc(1280px + 2 * var(--gutter)); }
.hand { font-family: var(--hand); font-size: 20px; font-weight: 700; line-height: 1.1; color: var(--primary); }
.hand.bad { color: var(--bad); white-space: nowrap; }

.tz { display: grid; grid-template-columns: minmax(0, 0.54fr) minmax(0, 1fr) minmax(0, 0.54fr); border-color: var(--line-2); box-shadow: 0 24px 60px -28px rgba(42, 28, 20, 0.55); overflow: hidden; }
.tz-panel { position: relative; display: flex; flex-direction: column; padding: 20px 20px 22px; min-width: 0; transition: opacity 0.25s; }
.tz-panel + .tz-panel { border-left: 1px solid var(--line); }
.tz-panel > h3 { font-size: 23px; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; text-align: center; padding-block: 4px 2px; }
.tz-panel > h4 { display: flex; align-items: center; gap: 12px; margin: 34px 0 14px; font-size: 15.5px; font-weight: 700; color: var(--primary); }
.tz-panel > h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tz-panel > h3 + h4 { margin-top: 20px; }
.tz-panel > .chart { flex: 1 1 0; }
#tz-corr { min-height: 130px; }
#tz-osw-qwen, #tz-osw-venus, #tz-ssi { min-height: 100px; }
.tz-lead { margin-top: 22px; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-align: center; text-wrap: balance; }
.teaser[data-part] .tz-panel { opacity: 0.32; }
.teaser[data-part="bench"] .tz-bench, .teaser[data-part="gpl"] .tz-gpl, .teaser[data-part="results"] .tz-res { opacity: 1; }

.tz .ok { --c: var(--ok); --t: var(--ok-tint); }
.tz .bad { --c: var(--bad); --t: var(--bad-tint); }
.tz-shot { position: relative; border: 1px solid var(--line-2); border-radius: 5px; overflow: hidden; background: var(--sunk); }
.tz-shot img { width: 100%; }
.ring { position: absolute; border: 2px solid var(--c); border-radius: 4px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9), 0 0 0 999px rgba(34, 24, 19, 0.16); }
.ring::after { content: "✓"; position: absolute; right: -9px; bottom: -9px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font: 700 12px/1 var(--sans); font-style: normal; box-shadow: 0 0 0 1.5px #fff; }
.ring.bad::after { content: "✗"; }

.tz-traj { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.tz-prev { position: relative; flex: none; width: 92px; padding-bottom: 12px; }
.tz-prev img { width: 80%; border: 1px solid var(--line-2); border-radius: 3px; box-shadow: 0 1px 3px rgba(42, 28, 20, 0.16); }
.tz-prev img + img { position: absolute; left: 10%; top: 6px; }
.tz-prev img:last-child { left: 20%; top: 12px; }
.tz-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; margin-top: 12px; }
.tz-pair figcaption { display: grid; justify-items: center; gap: 2px; margin-top: 8px; font-size: 12.5px; font-weight: 650; color: var(--c); }
.tz-pair figcaption > span { position: relative; font-size: 17px; font-weight: 400; color: var(--ink); }
.tz-sim { position: relative; align-self: end; padding-bottom: 1px; font-size: 18px; }
.tz-stat { margin-top: 4px; font-size: 13px; color: var(--ink-2); text-align: center; }
.tz-stat i { font-family: "KaTeX_Math", "Times New Roman", serif; font-size: 1.08em; }

.tz-task { display: flex; gap: 10px; align-items: baseline; margin-bottom: 12px; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.tz-task .k { flex: none; }
.tz mark { background: none; color: var(--bad-ink); font-weight: 650; }
.tz-scene { display: grid; grid-template-columns: minmax(0, 0.66fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.tz-screen { container-type: inline-size; }
.tz-screen .hand { position: absolute; right: 4%; top: 16%; max-width: 6.2em; transform: rotate(-3deg); font-size: clamp(14px, 8.4cqw, 21px); color: var(--bad); text-align: center; }
.tz-agent { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.tz-agent .face { width: 42px; height: 42px; margin-top: 4px; }
.face.plain { color: var(--ink-2); --fill: #fff; }
.tz-agent .bubble { border: 1.5px solid var(--ink-2); border-radius: 10px; padding: 10px 14px 11px; }
.tz-agent .bubble::before { right: -17px; border-left-color: var(--ink-2); top: 14px; }
.tz-agent .bubble::after { right: -14px; border-left-color: var(--surface); top: 14px; }
.tz-agent .k { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--ink); margin-bottom: 1px; }
.tz-agent { container-type: inline-size; }
.tz-agent p, .tz-plan li { font-size: clamp(10px, 3.45cqw, 12px); line-height: 1.5; color: var(--ink-2); }
.tz-plan { margin-bottom: 9px; }
.tz-plan li { position: relative; padding-left: 20px; }
.tz-plan li::before { content: "→"; position: absolute; left: 0; color: var(--muted); }
.tz-plan li.done::before { content: "✓"; color: var(--ink); font-weight: 700; }
.tz mark.wrong { position: relative; text-decoration: underline wavy var(--bad); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tz-note { position: absolute; left: 40%; bottom: calc(100% + 3px); padding-left: 24px; font-size: 16.5px; white-space: nowrap; font-weight: 700; line-height: 1; transform: rotate(-2deg); transform-origin: left bottom; }
.tz-note svg { position: absolute; left: -3px; top: 5px; width: 24px; height: 17px; fill: none; stroke: var(--bad); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tz-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tz-cf { container-type: inline-size; }
.tz-cf-h { margin-bottom: 8px; font-size: 14px; font-weight: 650; color: var(--ink); text-align: center; }
.tz-claims { margin-top: 10px; display: grid; gap: 4px; }
.tz-claims li { position: relative; padding: 4px 4px 4px 21px; border-radius: 5px; font-size: clamp(9px, 3.72cqw, 13px); line-height: 1.45; letter-spacing: -0.005em; color: var(--ink-2); white-space: nowrap; }
.tz-claims li::before { content: "✓"; position: absolute; left: 4px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; display: grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font-size: 9px; font-weight: 700; }
.tz-claims li.bad { background: var(--bad-tint); color: var(--bad-ink); font-weight: 550; }
.tz-claims li.bad::before { content: "✗"; }

.mname { white-space: nowrap; }
.mlogo { display: inline-block; width: 1.2em; height: 1.2em; margin-right: 0.42em; vertical-align: -0.24em; }
.tz-model { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 14px 0 2px; font-size: 14px; font-weight: 650; }
.tz-panel > h4 + .tz-model { margin-top: 0; }
.tz-model > span:last-child { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tz-model i { display: inline-block; width: 14px; height: 1.5px; margin: 0 2px 4px; background: var(--caramel); vertical-align: middle; }
.tz-model b { font-size: 20px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; color: var(--primary); }

.teaser-cols { display: grid; grid-template-columns: minmax(0, 0.54fr) minmax(0, 1fr) minmax(0, 0.54fr); margin-top: 22px; }
.teaser-col { position: relative; isolation: isolate; display: block; padding: 14px 20px 14px; border-top: 1px solid rgba(243, 235, 224, 0.22); text-decoration: none; transition: border-color 0.2s; }
.teaser-col::before { content: ""; position: absolute; z-index: -1; inset: 0 0 calc(-1 * var(--pad)); background: rgba(243, 235, 224, 0.07); opacity: 0; transition: opacity 0.2s; }
.teaser-col h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.25; color: var(--cream); }
.teaser-col h3::after { content: "→"; font-family: var(--sans); font-size: 16px; margin-left: 8px; color: var(--caramel); opacity: 0.55; transition: opacity 0.2s, margin 0.2s; }
.teaser-col p { margin-top: 6px; font-size: 14px; line-height: 1.55; color: color-mix(in srgb, var(--cream) 72%, transparent); }
.teaser-col:hover, .teaser-col:focus-visible, .teaser[data-part="bench"] .teaser-col[data-part="bench"], .teaser[data-part="gpl"] .teaser-col[data-part="gpl"], .teaser[data-part="results"] .teaser-col[data-part="results"] { border-top-color: var(--caramel); }
.teaser-col:hover::before, .teaser-col:focus-visible::before, .teaser[data-part="bench"] .teaser-col[data-part="bench"]::before, .teaser[data-part="gpl"] .teaser-col[data-part="gpl"]::before, .teaser[data-part="results"] .teaser-col[data-part="results"]::before { opacity: 1; }
.teaser-col:hover h3::after, .teaser-col:focus-visible h3::after { opacity: 1; margin-left: 12px; }

/* Sections: text and figures share one article column, and only the teaser is wider */

.sec { padding-block: 76px 84px; }
.band { background: var(--stone); --halo: var(--stone); }
.card { --halo: #fff; }
.sec-head { margin-bottom: 28px; }
h2 { font-family: var(--serif); font-size: clamp(30px, 3.5vw, 40px); font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; color: var(--ink); }
.sec-head p { margin-top: 12px; font-size: 17px; color: var(--ink-2); text-wrap: pretty; }
h3 { font-size: 16.5px; font-weight: 650; line-height: 1.3; }
.rule-h { display: flex; align-items: center; gap: 14px; margin: 46px 0 16px; font-size: 17px; font-weight: 700; letter-spacing: -0.005em; color: var(--primary); }
.rule-h::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* Method: three panels like the teaser, with arrows drawn across them */

.flow { position: relative; overflow: hidden; }
.flow-grid { display: grid; grid-template-columns: minmax(0, 0.43fr) minmax(0, 1fr) minmax(0, 0.42fr); grid-template-rows: auto auto auto; }
.fl-h { padding: 20px 16px 2px; font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -0.012em; text-align: center; color: var(--ink); }
.fl-cell { position: relative; min-width: 0; padding: 14px 18px 20px; }
.c1 { grid-column: 1; }
.c2 { grid-column: 2; border-left: 1px solid var(--line); }
.c3 { grid-column: 3; border-left: 1px solid var(--line); }
.fl-traj, .fl-img { grid-row: 2; }
.fl-descs, .fl-txt { grid-row: 3; padding-top: 6px; }
.fl-terms { grid-row: 2 / 4; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding-bottom: 22px; }
.fl-cell.fl-traj, .fl-cell.fl-descs { display: flex; flex-direction: column; }
.fl-sub { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; font-weight: 700; color: var(--primary); }
.fl-sub::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fl-cap { margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.fl-list { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.fl-list li { padding: 2px 7px; border-radius: 999px; background: var(--stone); font-size: 11px; font-weight: 550; color: var(--ink-2); }

.fl-steps { display: grid; grid-template-columns: minmax(0, 0.84fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 48px; align-items: center; }
.fl-item { display: grid; gap: 7px; justify-items: center; min-width: 0; }
.fl-item > .desc, .fl-item > .win, .fl-item > .bank { width: 100%; }
.fl-lab { font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ink-2); white-space: nowrap; }
.fl-note { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.fl-symb { position: relative; font-size: 15px; line-height: 1.15; color: var(--ok-ink); }
.fl-symb.neg { color: var(--bad-ink); }
#w-dprev + .fl-symb { color: var(--ink-2); }

.win { --c: var(--line-2); position: relative; aspect-ratio: 1.5; border: 1.5px solid var(--c); border-radius: 6px; background: #fff; overflow: hidden; }
.win.cur { --c: var(--ok); }
.win.neg { --c: var(--bad); }
.win-bar { position: absolute; inset: 0 0 auto 0; height: 14%; background: var(--stone); border-bottom: 1px solid var(--line); }
.win-bar::before { content: ""; position: absolute; left: 6%; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--line-2); box-shadow: 7px 0 0 var(--line-2), 14px 0 0 var(--line-2); }
.win-side { position: absolute; left: 0; top: 14%; bottom: 0; width: 20%; border-right: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 22%, var(--line) 22% 30%) 30% 20% / 40% 80% no-repeat; }
.win-main { position: absolute; left: 20%; right: 0; top: 14%; bottom: 0; background: linear-gradient(var(--line), var(--line)) 12% 14% / 40% 6% no-repeat, linear-gradient(var(--line), var(--line)) 12% 88% / 62% 6% no-repeat; }
.el { position: absolute; left: 12%; top: 30%; width: 76%; height: 40%; display: flex; align-items: center; justify-content: space-between; gap: 8%; padding: 0 9%; border: 1.5px solid var(--line-2); border-radius: 4px; background: #fff; }
.el u { flex: 1; height: 16%; min-height: 3px; border-radius: 2px; background: var(--line-2); }
.tg { position: relative; flex: none; width: 34%; aspect-ratio: 1.9; border-radius: 999px; background: var(--line-2); }
.tg::after { content: ""; position: absolute; left: 10%; top: 14%; height: 72%; aspect-ratio: 1; border-radius: 50%; background: #fff; }
.tg.on { background: var(--ok); }
.tg.on::after { left: auto; right: 10%; }
.el.slot { border: 1.5px dashed var(--ok); background: var(--ok-tint); }
.el.alt { border-color: var(--bad); background: var(--bad-tint); }
.el.alt u { background: color-mix(in srgb, var(--bad) 45%, var(--line-2)); }
.el.alt .tg { background: var(--bad); }

.fl-stack { position: relative; width: 74%; margin: 0 auto; padding: 0 0 16% 0; }
.fl-stack > * { position: absolute; width: 100%; }
.fl-stack > :nth-child(1) { position: relative; opacity: 0.5; }
.fl-stack > :nth-child(2) { left: 9%; top: 9%; opacity: 0.78; }
.fl-stack > :nth-child(3) { left: 18%; top: 18%; }
.fl-stack.d { width: 80%; padding-bottom: 14%; margin-top: 2px; }
.fl-stack.d > :nth-child(2) { top: 7%; }
.fl-stack.d > :nth-child(3) { top: 14%; }
.fl-traj .fl-stack { margin-block: auto; }
.fl-cell.fl-traj { padding-bottom: 46px; }
.fl-descs .fl-cap { margin-top: auto; padding-top: 14px; }

.desc { --c: var(--line-2); display: grid; gap: 3px; padding: 6px; border: 1.5px solid var(--c); border-radius: 6px; background: #fff; }
.desc.cur { --c: var(--ok); }
.desc.neg { --c: var(--bad); }
.desc li { position: relative; display: grid; grid-template-columns: 2.7em minmax(0, 1fr); gap: 5px; align-items: center; min-height: 19px; padding: 2px 5px; border-radius: 3px; background: var(--stone); font-size: 10px; line-height: 1.3; color: var(--ink-2); }
.desc li > span { position: relative; }
.desc li i { grid-column: 2; height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--line-2) 0 62%, transparent 62% 70%, var(--line-2) 70%); }
.desc li em { grid-column: 2; font-style: normal; font-weight: 650; white-space: nowrap; letter-spacing: -0.01em; }
.desc li.from { background: var(--tint); box-shadow: inset 0 0 0 1.5px var(--caramel); color: var(--primary); }
.desc li.slot { background: var(--ok-tint); box-shadow: inset 0 0 0 1.5px var(--ok); color: var(--ok-ink); }
.desc li.slot { box-shadow: none; outline: 1.5px dashed var(--ok); outline-offset: -1.5px; }
.desc li.bad { background: var(--bad-tint); box-shadow: inset 0 0 0 1.5px var(--bad); color: var(--bad-ink); }
.desc li.act { background: none; border-top: 1px solid var(--line); border-radius: 0; margin-top: 2px; padding-top: 5px; }
.desc li.act b { grid-column: 2; font-size: 10.5px; font-weight: 500; color: var(--muted); }

.bank { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.bank i { position: relative; aspect-ratio: 1.45; border: 1.5px solid var(--line-2); border-radius: 4px; background: #fff; }
.bank .b1 { background: linear-gradient(var(--line-2), var(--line-2)) 18% 28% / 54% 11% no-repeat, linear-gradient(var(--line), var(--line)) 18% 52% / 64% 11% no-repeat, linear-gradient(var(--line), var(--line)) 18% 76% / 40% 11% no-repeat, #fff; }
.bank .b3 { background: linear-gradient(var(--line), var(--line)) 50% 30% / 64% 34% no-repeat, linear-gradient(var(--line-2), var(--line-2)) 82% 80% / 26% 14% no-repeat, #fff; }
.bank .b4 { background: radial-gradient(circle at 26% 36%, var(--line-2) 0 14%, transparent 15%), radial-gradient(circle at 26% 68%, var(--line-2) 0 14%, transparent 15%), linear-gradient(var(--line), var(--line)) 76% 34% / 42% 10% no-repeat, linear-gradient(var(--line), var(--line)) 76% 68% / 42% 10% no-repeat, #fff; }
.bank .pick { display: grid; place-items: center; border-color: var(--caramel); background: var(--tint); }
.bank .pick .tg { width: 56%; background: var(--caramel); }

.term { display: grid; justify-items: center; gap: 3px; padding: 10px 6px 12px; border-radius: 8px; background: var(--stone); }
.term > b { margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--ink); }
.pill { position: relative; padding: 4px 9px 3px; border-radius: 6px; background: #fff; font-size: 17.5px; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.pill.ok { background: var(--ok-tint); }
.pill.bad { background: var(--bad-tint); }
.term .rel { font: 700 16px/1 var(--sans); font-style: normal; color: var(--ink-2); }
.plus { align-self: center; font: 500 20px/1 var(--sans); font-style: normal; color: var(--muted); }

.fl-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wire { --wc: #b5a797; }
.wire.src { --wc: var(--caramel); }
.wire.neg { --wc: var(--bad); }
.wire path { fill: none; stroke: var(--wc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wire .line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.55s ease calc(var(--i) * 130ms + 150ms); }
.wire .head, .wire text { opacity: 0; transition: opacity 0.25s ease calc(var(--i) * 130ms + 620ms); }
.flow.in .wire .line { stroke-dashoffset: 0; }
.flow.in .wire .head, .flow.in .wire text { opacity: 1; }
svg .wire-lab { font-family: var(--hand); font-size: 15.5px; font-weight: 700; fill: var(--wc); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }

/* A wall of counterfactuals from the training data */

.cf-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.cf-half { display: flex; flex-direction: column; min-width: 0; }
.cf-imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cf-tile { --w: 100%; position: relative; aspect-ratio: 1.6; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: var(--sunk); }
.cf-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cf-tile img + img { clip-path: inset(0 0 0 var(--w)); }
.cf-tile i { position: absolute; top: 0; bottom: 0; left: var(--w); width: 2px; margin-left: -1px; background: var(--bad); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7); opacity: var(--lo, 0); }
.cf-tile b { position: absolute; right: 5px; top: 5px; width: 17px; height: 17px; border-radius: 50%; background: var(--ok); color: #fff; font: 700 10px/17px var(--sans); text-align: center; box-shadow: 0 0 0 1.5px #fff; transition: background 0.3s; }
.cf-tile.up i { background: var(--ok); }
.cf-tile.neg b { background: var(--bad); }

.cf-texts { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(27px, auto); align-content: space-between; gap: 5px; }
.cf-texts li { position: relative; display: grid; align-items: center; min-height: 27px; padding: 2px 10px 2px 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 12.5px; line-height: 1.45; color: var(--ink-2); transition: background 0.4s, border-color 0.4s; }
.cf-texts li::before { content: "✓"; position: absolute; left: 8px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; border-radius: 50%; background: var(--ok); color: #fff; font: 700 9.5px/15px var(--sans); text-align: center; transition: background 0.4s, transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); }
.cf-texts li.neg { background: var(--bad-tint); border-color: color-mix(in srgb, var(--bad) 32%, var(--line)); }
.cf-texts li.neg::before { content: "✗"; background: var(--bad); transform: rotate(180deg) scaleY(-1) scaleX(-1); }
.swap { display: inline-grid; overflow: hidden; vertical-align: bottom; white-space: nowrap; font-weight: 650; transition: width 0.5s cubic-bezier(0.3, 0.7, 0.2, 1); }
.swap > span { grid-area: 1 / 1; justify-self: start; transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.35s; }
.swap .a { color: var(--ok-ink); }
.swap .b { color: var(--bad-ink); transform: translateY(105%); opacity: 0; }
.cf-texts li.neg .swap .a { transform: translateY(-105%); opacity: 0; }
.cf-texts li.neg .swap .b { transform: none; opacity: 1; }
.cf-cap { margin-top: 14px; }

/* CUASense */

.sun { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 28px 56px; align-items: center; }
#sunburst svg { margin-inline: auto; }
.sun-key { margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.sun-key p { margin-bottom: 8px; text-align: center; }
.sun-key .ramp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; max-width: 330px; }
.sun-key .ramp i { height: 9px; }
.sun-key .ramp i:first-child { border-radius: 3px 0 0 3px; }
.sun-key .ramp i:nth-child(6) { border-radius: 0 3px 3px 0; }
.sun-key .ramp + .ramp { margin-top: 2px; }
.sun-key .ramp span { margin-top: 4px; font-size: 11.5px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ssi-def .rule-h { margin-top: 0; }
.ssi-eq { margin: 6px 0 18px; font-size: clamp(15px, 4.6vw, 19px); }
.ssi-eq .katex-display { margin: 0; }
.ssi-def p { font-size: 15.5px; color: var(--ink-2); text-wrap: pretty; }
.ssi-def p > span { position: relative; }

.lab { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.86fr); gap: 20px 40px; align-items: center; }
.lab-states { display: grid; gap: 8px; }
.lab-states button { appearance: none; display: block; width: 100%; padding: 10px 14px 11px; border: 1px solid var(--line); border-radius: 9px; background: transparent; text-align: left; cursor: pointer; transition: background 0.25s, border-color 0.25s, box-shadow 0.25s; }
.lab-states button b { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 650; color: var(--ink-2); }
.lab-states button b::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-2); transition: background 0.25s, border-color 0.25s; }
.lab-states button > span { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.lab-states button > span > span { overflow: hidden; padding-left: 17px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.lab-states button[aria-selected="true"] { background: var(--surface); border-color: var(--primary); box-shadow: 0 8px 20px -14px rgba(42, 28, 20, 0.5); }
.lab-states button[aria-selected="true"] b { color: var(--ink); }
.lab-states button[aria-selected="true"] b::before { background: var(--primary); border-color: var(--primary); }
.lab-states button[aria-selected="true"] > span { grid-template-rows: 1fr; }
.lab-states button[aria-selected="true"] > span > span { padding-top: 4px; }

.lab-mx { display: grid; grid-template-columns: auto auto; gap: 7px 6px; justify-content: center; }
.mx-top { grid-column: 2; padding-left: 30px; font-size: 12px; color: var(--muted); text-align: center; }
.mx-left { grid-column: 1; grid-row: 2; writing-mode: vertical-rl; transform: rotate(180deg); padding-bottom: 30px; font-size: 12px; color: var(--muted); text-align: center; }
.mx { --s: 26px; grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(9, var(--s)); grid-auto-rows: var(--s); gap: 3px; }
.chip { display: grid; place-items: center; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface); font: 600 12px/1 var(--mono); color: var(--ink); transition: background 0.3s, border-color 0.3s, color 0.3s; }
.chip[data-a="0"] { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }
.chip[data-a="1"] { background: var(--caramel); border-color: var(--caramel); color: #fff; }
.chip[data-a="2"] { background: #e2cfb8; border-color: #e2cfb8; }
.chip[data-a="3"] { background: var(--sunk); border-color: var(--line-2); }
.cell { border-radius: 4px; background: var(--sunk); transform: scale(0.82); transition: background 0.35s ease var(--d, 0ms), transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) var(--d, 0ms); }
.cell.eq { background: var(--primary); transform: none; }

.lab-gauge { display: grid; justify-items: center; }
.gauge { width: 100%; max-width: 220px; }
.gauge svg { display: block; width: 100%; height: auto; overflow: visible; }
.gauge .track { fill: none; stroke: var(--sunk); stroke-width: 14; stroke-linecap: round; }
.gauge .val { fill: none; stroke: var(--primary); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 0 2; transition: stroke-dasharray 0.9s cubic-bezier(0.3, 0.9, 0.3, 1); }
.gauge .needle { transform-origin: 110px 112px; transform: rotate(-90deg); transition: transform 0.9s cubic-bezier(0.3, 1.35, 0.5, 1); }
.gauge .needle line { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.gauge .needle circle { fill: var(--ink); }
.gauge .tick { stroke: var(--line-2); stroke-width: 1.5; }
.g-num { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.g-num b { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -0.01em; color: var(--primary); font-variant-numeric: tabular-nums; }
.g-num span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.g-sub { margin-top: 10px; font-size: 12.5px; line-height: 1.6; color: var(--muted); text-align: center; }
.g-sub b { font: 600 12.5px/1 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lab-cap { margin-top: 18px; }

/* Results */

.res-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.res-col { display: flex; flex-direction: column; min-width: 0; }
.sec-head + .res-row .rule-h { margin-top: 6px; }
.res-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 18px; min-height: 28px; margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); }
.res-bar.keys { gap: 4px 16px; }
.res-bar .key { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.res-bar .key i { width: 11px; height: 11px; border-radius: 3px; }
.res { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 18px 20px 18px; }
.res .cap { margin-top: auto; padding-top: 12px; text-wrap: pretty; }
.seg { display: flex; gap: 30px; }
.seg button { position: relative; appearance: none; padding: 1px 0 6px; border: 0; background: none; font-size: 13.5px; font-weight: 600; line-height: 1.25; color: var(--muted); cursor: pointer; transition: color 0.15s; }
.seg button::after { content: ""; position: absolute; left: -8px; right: -8px; bottom: 0; height: 2px; border-radius: 1px; background: var(--primary); transform: scaleX(0); transition: transform 0.22s cubic-bezier(0.3, 0.8, 0.3, 1); }
.seg button:hover { color: var(--primary); }
.seg button[aria-selected="true"] { color: var(--ink); }
.seg button[aria-selected="true"]::after { transform: scaleX(1); }
.osw { display: grid; gap: 14px; }
.osw-name { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 650; margin-bottom: 2px; }
.osw-name > span:last-child { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.osw-name > span:last-child b { font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.osw-name > span:last-child b.up { font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1; color: var(--primary); }
.chart svg { display: block; overflow: visible; max-width: 100%; }
#corr-chart { max-width: 660px; margin-inline: auto; }
.corr-cap { margin-top: 10px; }

svg text { font-family: var(--sans); fill: var(--ink-2); }
svg .t-axis { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
svg .t-lab { font-size: 13px; fill: var(--ink-2); }
svg .t-name { font-size: 13.5px; fill: var(--ink); font-weight: 600; }
svg .t-sub { font-size: 12.5px; fill: var(--muted); }
svg .t-val { font-size: 13px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
svg .t-base { font-size: 12px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
svg .t-gain { font-size: 12.5px; font-weight: 700; fill: var(--primary); font-variant-numeric: tabular-nums; }
svg .t-loss { font-size: 12.5px; font-weight: 700; fill: var(--bad-ink); font-variant-numeric: tabular-nums; }
svg .grid { stroke: var(--line); stroke-width: 1; }
.band svg .grid { stroke: var(--line-2); }
.band .card svg .grid { stroke: var(--line); }
svg .axis { stroke: var(--line-2); stroke-width: 1; }
svg .hit { fill: transparent; cursor: default; }
svg .halo { paint-order: stroke; stroke: var(--halo, #fff); stroke-width: 4px; stroke-linejoin: round; }
svg .part { transition: opacity 0.2s; }
svg .part.dim { opacity: 0.24; }
svg .col .tot, svg .col .bs { opacity: 0; transition: opacity 0.18s; }
svg .col .gn { transition: opacity 0.18s; }
svg .col.on .tot, svg .col.on .bs { opacity: 1; }
svg .col.on .gn { opacity: 0; }

.tip { position: fixed; z-index: 40; pointer-events: none; padding: 8px 11px; border-radius: 6px; background: var(--espresso); color: var(--cream); font-size: 12.5px; line-height: 1.45; max-width: 250px; box-shadow: 0 6px 20px rgba(42, 28, 20, 0.3); }
.tip b { display: block; font-weight: 650; margin-bottom: 2px; color: #fff; }
.tip span { font-variant-numeric: tabular-nums; }

/* Examples: the two agents answer in speech bubbles. A pointer marks a click, and a box with a
   handwritten note marks what the screen shows. */

.shot { position: relative; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--sunk); }
.shot { aspect-ratio: 1.6; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.18s; }
.shot img.on { opacity: 1; }
.screen figcaption { display: flex; gap: 10px; align-items: baseline; margin-top: 9px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.screen figcaption .sym { flex: none; color: var(--ink); min-width: 1.9em; }

.player { padding: 2px 22px 22px; }
.task { display: flex; gap: 12px; align-items: baseline; padding: 16px 0 14px; font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.task .k { flex: none; }
.stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.ptr { --ring: #2f9cff; position: absolute; width: 0; height: 0; pointer-events: none; }
.ptr svg { position: absolute; left: -2px; top: -2px; width: 19px; height: 26px; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.ptr svg path { fill: var(--ink); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.ptr::before, .ptr::after { content: ""; position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ring); }
.ptr::before { background: color-mix(in srgb, var(--ring) 22%, transparent); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.ptr::after { opacity: 0; }
.ptr.go::after { animation: ping 1.2s cubic-bezier(0.2, 0.6, 0.3, 1) 2 both; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(2.4); opacity: 0; } }
.ptr-key { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ptr-key svg { width: 10px; height: 14px; }
.ptr-key svg path { fill: var(--ink); }

/* Each agent has a layer over the screenshot. A line wipes between the two, as in the wall of counterfactuals:
   the model with GPL to the left of the line, the base model to the right. */
.overlay { --w: 0%; position: absolute; inset: 0; pointer-events: none; }
.ov-layer { --c: var(--bad); position: absolute; inset: 0; clip-path: inset(0 0 0 var(--w)); }
.ov-layer[data-who="ours"] { --c: var(--ok); clip-path: inset(0 calc(100% - var(--w)) 0 0); }
.ov-layer .ptr { --ring: var(--c); }
.ov-line { position: absolute; top: 0; bottom: 0; left: var(--w); width: 2px; margin-left: -1px; background: var(--bad); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7); opacity: var(--lo, 0); }
.overlay.up .ov-line { background: var(--ok); }
.ov-box { position: absolute; border: 2px dashed var(--c); border-radius: 4px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.92); }
.ov-label { position: absolute; transform: translate(0, 4px); font-family: var(--hand); font-size: 22px; font-weight: 700; line-height: 1; color: var(--c); white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 7px #fff, 0 0 10px #fff; }
.ov-label.right { transform: translate(-100%, 4px); }
.ov-label i { font-style: normal; font-family: var(--sans); font-size: 15px; margin-right: 4px; }

.replies { display: grid; gap: 16px; margin-top: 22px; }
.reply { --c: var(--bad); --c-ink: var(--bad-ink); --c-tint: var(--bad-tint); display: grid; grid-template-columns: auto minmax(0, 1fr) var(--notes, 190px); grid-template-areas: "agent bubble notes"; gap: 0 12px; align-items: start; }
.reply.ours { --c: var(--ok); --c-ink: var(--ok-ink); --c-tint: var(--ok-tint); grid-template-columns: var(--notes, 190px) minmax(0, 1fr) auto; grid-template-areas: "notes bubble agent"; }
.agent { grid-area: agent; display: grid; justify-items: center; gap: 2px; padding-top: 8px; width: 52px; }
.agent span { font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; color: var(--c-ink); }
.bubble { position: relative; border: 1.5px solid var(--c); border-radius: 10px; padding: 12px 15px 14px; background: var(--surface); transition: background 0.2s, box-shadow 0.2s; }
.reply .bubble { grid-area: bubble; }
.bubble::before, .bubble::after { content: ""; position: absolute; top: 22px; border: 8px solid transparent; }
.reply.base .bubble::before { left: -17px; border-right-color: var(--c); }
.reply.base .bubble::after { left: -14px; border-right-color: var(--surface); }
.reply.ours .bubble::before { right: -17px; border-left-color: var(--c); }
.reply.ours .bubble::after { right: -14px; border-left-color: var(--surface); }
.reply.on .bubble { box-shadow: 0 0 0 3px var(--c-tint); }
.reply .k { display: block; margin: 10px 0 2px; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); }
.reply .k:first-child { margin-top: 0; }
.reply p { font-size: 13.8px; line-height: 1.58; color: var(--ink-2); }
.reply mark { background: none; color: var(--c-ink); font-weight: 650; text-decoration: underline wavy var(--c); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.reply.ours mark { text-decoration-style: solid; text-decoration-color: color-mix(in srgb, var(--c) 55%, transparent); }

/* The responses come in one after the other, each followed by its notes. */
.replies.wait .agent, .replies.wait .bubble, .replies.wait .note { opacity: 0; }
.replies.play .agent, .replies.play .bubble, .replies.play .note { animation: rise 0.45s cubic-bezier(0.25, 0.8, 0.3, 1) both; animation-delay: var(--d, 0ms); }
.reply.ours { --d: 460ms; }
.reply.base .note:nth-child(1) { --d: 200ms; }
.reply.base .note:nth-child(2) { --d: 320ms; }
.reply.ours .note:nth-child(1) { --d: 660ms; }
.reply.ours .note:nth-child(2) { --d: 780ms; }
@keyframes rise { from { opacity: 0; translate: 0 9px; } }

/* Notes on a response are written in the margin, level with the phrase they are about. */
.notes { grid-area: notes; position: relative; align-self: stretch; }
.note { position: absolute; left: 0; max-width: 100%; display: flex; align-items: center; gap: 5px; font-family: var(--hand); font-size: 20px; font-weight: 700; line-height: 0.95; color: var(--c); transform: rotate(-2deg); transform-origin: left center; }
.note svg { flex: none; width: 27px; height: 17px; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.note i { font-style: normal; font-family: var(--sans); font-size: 14px; margin-right: 4px; }
.reply.ours .note { left: auto; right: 0; flex-direction: row-reverse; text-align: right; transform: rotate(2deg); transform-origin: right center; }
.reply.ours .note svg { transform: scaleX(-1); }

/* Citation */

#cite .sec-head { margin-bottom: 18px; }
.bib { position: relative; }
.bib pre { padding: 22px 26px; overflow-x: auto; font: 500 13.5px/1.7 var(--mono); color: var(--ink-2); }
.copy { position: absolute; top: 12px; right: 12px; display: inline-flex; flex-direction: row-reverse; align-items: center; padding: 6px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 650; cursor: pointer; transition: background 0.18s; }
.copy:hover { background: rgba(34, 24, 19, 0.07); }
.copy svg { flex: none; width: 18px; height: 18px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* On a copy the icon sinks in, and a check comes out in its place with the word beside it. Whatever
   leaves goes first and quickly; whatever arrives follows and settles. */
.copy .i-copy, .copy .i-ok { transform-box: view-box; transform-origin: center; }
.copy .i-copy, .copy.done .i-ok { transition: opacity 0.26s 0.14s ease-out, transform 0.32s 0.14s cubic-bezier(0.2, 0.8, 0.3, 1); }
.copy .i-ok, .copy.done .i-copy { opacity: 0; transform: scale(0.8); transition: opacity 0.15s ease-in, transform 0.15s ease-in; }
.copy.done .i-ok { opacity: 1; transform: none; }
.copy span { max-width: 0; margin-right: 0; overflow: hidden; white-space: nowrap; opacity: 0; transform: translateX(5px); transition: opacity 0.15s ease-in, transform 0.15s ease-in, max-width 0.3s 0.1s, margin-right 0.3s 0.1s; }
.copy.done span { max-width: 76px; margin-right: 7px; margin-left: 3px; opacity: 1; transform: none; transition: max-width 0.3s cubic-bezier(0.2, 0.8, 0.3, 1), margin-right 0.3s, opacity 0.26s 0.14s ease-out, transform 0.32s 0.14s cubic-bezier(0.2, 0.8, 0.3, 1); }

.credit { margin-top: 34px; padding-inline: 10px; font-size: 12px; text-align: right; color: var(--muted); }

/* Placeholders while images and scripted parts are on their way */

@keyframes sheen { to { background-position: -200% 0; } }
img:not(.ok):not(.mlogo), .shot:not(:has(img.ok)), .chart:empty, #cf-imgs:empty, #cf-texts:empty, .lab-states:empty, .mx:empty, .gauge:empty, #sun-key:empty, #case-tabs:empty, .reply-body:empty, [data-tex]:empty {
  background: linear-gradient(100deg, var(--sunk) 30%, #f8f4ee 50%, var(--sunk) 70%) 0 0 / 200% 100%;
  animation: sheen 1.4s linear infinite;
}
.chart:empty, #cf-imgs:empty, #cf-texts:empty, .lab-states:empty, .mx:empty, .gauge:empty, #sun-key:empty, #case-tabs:empty { border-radius: 8px; }
.tz-panel > .chart:empty { min-height: 110px; }
#osw-qwen:empty, #osw-venus:empty { height: 226px; }
#ssi-chart:empty { height: 525px; }
#corr-chart:empty { aspect-ratio: 1 / 0.6; max-height: 400px; }
#sunburst:empty { aspect-ratio: 1; max-width: 340px; border-radius: 50%; }
#sun-key:empty { height: 72px; }
#cf-imgs:empty { aspect-ratio: 0.95; }
#cf-texts:empty { min-height: 430px; }
.lab-states:empty { min-height: 190px; }
.mx:empty { width: 270px; max-width: 100%; aspect-ratio: 1; }
.gauge:empty { aspect-ratio: 220 / 140; }
#case-tabs:empty { width: 320px; max-width: 100%; height: 22px; }
.reply-body:empty { min-height: 150px; }
[data-tex]:empty { display: inline-block; width: 2.4em; height: 1.05em; vertical-align: -0.2em; border-radius: 4px; }
.ssi-eq:empty { display: block; width: 270px; max-width: 100%; height: 64px; margin-inline: auto; }

/* Wide displays */

@media (min-width: 1500px) {
  :root { --wrap: 920px; }
  body { font-size: 17px; }
  .sec { padding-block: 92px 100px; }
}

/* Tablets */

@media (max-width: 1023px) {
  :root { --gutter: 24px; }
  .ground { --below: 290px; }
  .tz { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tz-gpl { grid-column: 1 / -1; grid-row: 1; border-left: 0 !important; border-bottom: 1px solid var(--line); }
  .tz-bench, .tz-res { grid-row: 2; }
  .teaser-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .teaser-col { padding-inline: 14px; }
  .teaser-col h3 { font-size: 19px; }
  .teaser-col p { font-size: 13.5px; }
}

@media (max-width: 860px) {
  .fl-steps { gap: 0 36px; }
  .fl-cell { padding-inline: 14px; }
  .pill { font-size: 16px; padding-inline: 6px; }
  .lab { gap: 20px 28px; }
  .mx { --s: 24px; }
}

@media (max-width: 779px) {
  .flow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .fl-h { grid-column: 1 / -1; }
  .fl-h.c2, .fl-h.c3 { border-left: 0; border-top: 1px solid var(--line); margin-top: 4px; }
  .fl-cell { grid-row: auto; }
  .fl-h.c1 { order: 1; }
  .fl-traj { order: 2; grid-column: 1; }
  .fl-descs { order: 2; grid-column: 2; padding-top: 14px; }
  .fl-h.c2 { order: 3; }
  .fl-img, .fl-txt { order: 4; grid-column: 1 / -1; border-left: 0; }
  .fl-txt { padding-top: 0; }
  .fl-h.c3 { order: 5; }
  .fl-terms { order: 6; grid-column: 1 / -1; border-left: 0; flex-direction: row; align-items: stretch; justify-content: center; }
  .fl-terms .term { flex: 1 1 0; }
  .fl-steps { gap: 0 44px; }
  .res-row { grid-template-columns: minmax(0, 1fr); }
  .res-col + .res-col .rule-h { margin-top: 34px; }
  .sun { grid-template-columns: minmax(0, 1fr); }
  .sun-chart { max-width: 330px; margin-inline: auto; }
  .cf-row { grid-template-columns: minmax(0, 1fr); }
  .cf-half + .cf-half .rule-h { margin-top: 30px; }
  .lab { grid-template-columns: auto minmax(0, 1fr); }
  .lab-states { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .cf-imgs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .fl-cell.fl-traj { padding-bottom: 20px; }
  .reply { --notes: 158px; }
  .note { font-size: 18.5px; }
}

/* Phones */

@media (max-width: 639px) {
  :root { --gutter: 16px; --r-card: 10px; }
  body { font-size: 15.5px; }
  .hero > .wrap { padding-top: 62px; padding-bottom: 30px; }
  .authors { font-size: 15.5px; gap: 2px 16px; margin-top: 22px; }
  .affil { font-size: 14px; }
  .affil.notes { font-size: 12px; }
  .links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 340px; margin-inline: auto; }
  .btn { height: 40px; font-size: 14px; padding: 0 10px 0 7px; }
  .lede { font-size: 15px; margin-top: 48px; }

  .ground { --pad: 34px; --below: 380px; --fade: 160px; }
  .ground > .wrap { padding-inline: 0; }
  .tz { display: flex; gap: 12px; padding: 4px var(--gutter) 10px; border: 0; background: none; box-shadow: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .tz::-webkit-scrollbar { display: none; }
  .tz-panel { flex: none; width: 88%; scroll-snap-align: center; padding: 18px 16px 20px; background: var(--surface); border: 1px solid var(--line-2) !important; border-radius: var(--r-card); box-shadow: 0 18px 40px -24px rgba(42, 28, 20, 0.6); }
  .tz-gpl { order: -1; }
  .teaser[data-part] .tz-panel { opacity: 1; }
  .tz-scene { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tz-methods { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .tz-note { left: 18%; font-size: 15.5px; }
  .tz-panel > .chart { flex: none; }
  .teaser-cols { grid-template-columns: minmax(0, 1fr); margin-top: 14px; padding-inline: var(--gutter); }
  .teaser-col { padding: 12px 0; }
  .teaser-col::before { inset: 0 calc(-1 * var(--gutter)); }
  .teaser-col:last-child::before { bottom: calc(-1 * var(--pad)); }

  .sec { padding-block: 54px 58px; }
  .sec-head p { font-size: 15.5px; }
  .rule-h { margin-top: 36px; font-size: 16px; }

  .fl-h { font-size: 17px; }
  .fl-cell { padding: 12px 12px 16px; }
  .fl-steps { gap: 0 38px; }
  .fl-lab { font-size: 11px; }
  .desc { padding: 4px; }
  .desc li { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 2px 4px; font-size: 9px; }
  .desc li > span { display: none; }
  .desc li i, .desc li em, .desc li.act b { grid-column: 1; }
  .fl-stack.d .desc li > span { display: none; }
  .fl-terms { gap: 3px; }
  .term { padding: 8px 2px 10px; }
  .term > b { font-size: 12px; }
  .pill { font-size: 12.5px; padding: 3px 4px 2px; }
  .plus { font-size: 15px; }
  svg .wire-lab { font-size: 14px; }

  .cf-imgs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cf-texts li:nth-child(n + 11) { display: none; }
  .lab { grid-template-columns: minmax(0, 1fr); }
  .lab-states { grid-template-columns: minmax(0, 1fr); }
  .mx { --s: clamp(22px, 7.4vw, 28px); }
  .res { padding: 16px 14px 16px; }

  .player { padding: 0 14px 16px; }
  .seg { gap: 24px; }
  .seg .x { display: none; }
  .task { flex-direction: column; gap: 4px; font-size: 15px; }
  .stage { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .agent { width: 46px; }
  .agent .face { width: 38px; height: 38px; }
  .bubble { padding: 10px 12px 12px; }
  .reply { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "agent bubble" ". notes"; }
  .reply.ours { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "bubble agent" "notes ."; }
  .notes { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
  .reply.ours .notes { justify-content: flex-end; }
  .note, .reply.ours .note { position: static; transform: none; flex-direction: row; }
  .note svg { display: none; }
  .ov-label { font-size: 20px; }
  .bib pre { padding: 50px 14px 16px; font-size: 12px; }
}

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