@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-full.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --mist: #f1f4f9;
  --ink: #0e1a3a;
  --muted: #56617b;
  --line: #d7dde8;
  --blue: #2443d0;
  --violet: #6a55b8;
  --teal: #17806f;
  --grey: #9aa3b5;
  --on-ink: #e6eaf5;
  --on-ink-muted: #a3aecb;
  --sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --w: 1120px;
  --pad: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 700; max-width: 20ch; margin-bottom: 24px; }
h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 650; letter-spacing: -0.015em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: calc(var(--w) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 28px; height: 56px; }
.brand { display: block; flex: none; }
.brand img { height: 36px; width: auto; max-width: none; }
.nav nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav nav::-webkit-scrollbar { display: none; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; padding: 4px 0; }
.nav nav a:hover, .nav nav a.on { color: var(--ink); }
.nav nav a.on { box-shadow: inset 0 -2px 0 var(--blue); }
.nav-paper { font-size: 15px; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.nav-paper:hover { text-decoration: underline; }

/* hero */
.hero { padding: clamp(36px, 5vw, 64px) 0 clamp(36px, 4.5vw, 56px); }
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(16px, 5vw, 72px); align-items: start; }
.hero-title { font-size: clamp(30px, 3.5vw, 46px); font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; margin-bottom: 16px; max-width: 18ch; }
.hero-by { color: var(--muted); margin: 0; }
.hero-lede { max-width: 58ch; margin-bottom: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; font: inherit; font-size: 16px; font-weight: 600; line-height: 1;
  padding: 13px 18px; border-radius: 6px; border: 1.5px solid var(--ink); color: var(--ink);
  background: transparent; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn-solid { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-solid:hover { background: #1a33a8; border-color: #1a33a8; }

/* video wall */
.wall { background: var(--ink); color: var(--on-ink); padding-bottom: 22px; }
.wall-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.tile { position: relative; display: block; padding: 0; margin: 0; border: 0; background: #0a1330; cursor: pointer; overflow: hidden; aspect-ratio: 16 / 11; color: inherit; font: inherit; text-align: left; }
.tile video { position: absolute; left: 0; top: 0; width: 100%; height: 107%; object-fit: cover; object-position: 50% 0; }
.tile::after { content: ""; position: absolute; inset: 45% 0 0 0; background: linear-gradient(to bottom, rgba(14, 26, 58, 0), rgba(14, 26, 58, 0.86)); pointer-events: none; }
.tile-label { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 11px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: #fff; }
.tile-name { font-weight: 650; font-size: clamp(14px, 1.45vw, 19px); letter-spacing: -0.01em; line-height: 1.15; }
.tile-rate { font-family: var(--mono); font-size: clamp(12px, 1.1vw, 15px); font-weight: 500; white-space: nowrap; }
.tile:hover .tile-name, .tile:focus-visible .tile-name { text-decoration: underline; text-underline-offset: 4px; }
.tile:focus-visible { outline-offset: -3px; outline-color: #fff; }
.wall-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-top: 16px; }
.wall-foot p { margin: 0; font-size: 14.5px; color: var(--on-ink-muted); max-width: 86ch; }
.wall-toggle { font: inherit; font-size: 14px; color: var(--on-ink); background: transparent; border: 1px solid #47557d; border-radius: 5px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.wall-toggle:hover { border-color: var(--on-ink); }
.wall-toggle:focus-visible { outline-color: #fff; }

/* sections */
.sec { padding: clamp(64px, 9vw, 112px) 0; }
.sec-mist { background: var(--mist); }
.lede { font-size: clamp(18px, 1.7vw, 20.5px); line-height: 1.5; max-width: 66ch; margin-bottom: 36px; }
.two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.abstract { max-width: 66ch; font-size: 18px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px); max-width: 1000px; }
.cols p { max-width: 58ch; }
.aside { font-size: 14.5px; color: var(--muted); max-width: 86ch; margin-top: 10px; }

.facts h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 6px; }
.facts dl { margin: 0; }
.facts dl > div { padding: 12px 0; border-top: 1px solid var(--line); }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 550; line-height: 1.35; }

/* figures */
.fig { margin: 0; }
.fig img { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.fig figcaption, .chart-cap { font-size: 14.5px; color: var(--muted); margin-top: 10px; max-width: 90ch; }
.fig-wide { margin: 40px 0 0; }
#recipe .fig-wide { max-width: 860px; }

/* strands (recipe sub-sections) */
.strand { margin-top: clamp(56px, 8vw, 96px); --tone: var(--ink); }
.strand-demo { --tone: var(--violet); }
.strand-sim { --tone: var(--teal); }
.strand-head { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: clamp(16px, 4vw, 56px); padding-top: 20px; border-top: 3px solid var(--tone); margin-bottom: 28px; }
.strand-head p { max-width: 66ch; margin: 0; }

.log { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: clamp(18px, 3vw, 34px); }
.log-title { font-weight: 650; font-size: 19px; letter-spacing: -0.01em; margin-bottom: 4px; }
.log-note { font-size: 14.5px; color: var(--muted); max-width: 86ch; margin-bottom: 22px; }
.thread { list-style: none; margin: 0; padding: 0; }
.thread > li { position: relative; padding: 0 0 26px 30px; }
.thread > li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -8px; width: 1px; background: var(--line); }
.thread > li:last-child { padding-bottom: 0; }
.thread > li:last-child::before { display: none; }
.thread > li::after { content: ""; position: absolute; left: 0; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--dot, var(--ink)); box-shadow: 0 0 0 3px var(--paper); }
.thread > li:has(.who-agent) { --dot: var(--ink); }
.thread > li:has(.who-human) { --dot: var(--violet); }
.thread > li:has(.who-sim) { --dot: var(--teal); }
.thread > li:has(.who-robot) { --dot: var(--blue); }
.thread > li:has(.who-code) { --dot: var(--ink); }
.who { display: block; font-weight: 650; font-size: 15.5px; margin-bottom: 6px; }
.thread p { max-width: 74ch; margin-bottom: 0.6em; }
.thread blockquote { margin: 0; padding: 12px 16px; background: var(--mist); border-radius: 6px; max-width: 78ch; font-size: 16px; line-height: 1.55; }
.thread blockquote.en { font-family: var(--mono); font-size: 14px; line-height: 1.6; }
.thread .aside { margin-top: 8px; }

.frames { display: grid; gap: 10px; margin: 4px 0 14px; }
.frames-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.frames-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
.frames figure { margin: 0; }
.frames img { width: 100%; border-radius: 5px; background: var(--mist); }
.frames figcaption { font-size: 13.5px; color: var(--muted); line-height: 1.35; margin-top: 6px; }
.twin { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: start; }
.twin .frames { margin: 0; }
.twin p { font-size: 16px; margin: 0; }

/* code */
.code { margin: 0; background: var(--ink); color: var(--on-ink); border-radius: 8px; padding: 18px 20px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.65; tab-size: 4; font-variant-ligatures: none; }
.code code { font-family: inherit; }
.code-tall { max-height: 520px; overflow-y: auto; }
.code .c { color: #8fa0c8; }
.code .s { color: #a5e3d2; }
.code .k { color: #c0b1ff; }
.code .n { color: #ffd9a0; }

/* charts */
.chart { margin-top: 18px; max-width: 860px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); fill: var(--muted); font-size: 12.5px; }
.chart .lab { fill: var(--ink); font-weight: 600; font-size: 13px; }
.chart .phase { fill: var(--ink); font-size: 12.5px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4; padding: 7px 10px; border-radius: 5px; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; transition: opacity 0.1s; z-index: 5; }
.tip.on { opacity: 1; }
.tip b { font-family: var(--mono); font-weight: 500; }

/* task explorer */
.picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.picker button { font: inherit; font-size: 15.5px; font-weight: 550; line-height: 1.2; text-align: left; padding: 11px 14px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.picker button:hover { border-color: var(--ink); }
.picker button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.task-video { background: var(--ink); border-radius: 8px; overflow: hidden; }
.task-video video { width: 100%; height: auto; }
.task-video.single { display: grid; justify-items: center; }
.task-video.single video { max-width: 640px; }
.task-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(20px, 4vw, 56px); margin-top: 22px; align-items: start; }
.task-text h3 { margin-bottom: 6px; }
.task-text p { margin-bottom: 4px; max-width: 46ch; }
.task-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.task-stats > div { padding: 12px 16px 0 0; }
.task-stats dt { font-size: 14px; color: var(--muted); }
.task-stats dd { margin: 2px 0 0; font-size: clamp(22px, 2.4vw, 30px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.task-stats dd small { display: block; font-size: 14px; font-weight: 450; letter-spacing: 0; color: var(--muted); margin-top: 2px; }
.story { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 10px; margin-top: 26px; counter-reset: step; }
.story figure { margin: 0; counter-increment: step; }
.story img { width: 100%; border-radius: 5px; background: var(--mist); aspect-ratio: 3 / 2; object-fit: cover; }
.story figcaption { font-size: 14px; line-height: 1.35; margin-top: 6px; display: flex; gap: 7px; }
.story figcaption::before { content: counter(step); font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding-top: 1px; }
.platform { margin-top: clamp(48px, 7vw, 80px); }

/* results table chart */
.tablechart { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 6px clamp(14px, 2.4vw, 28px) 10px; overflow: hidden; }
.tc-row { display: grid; grid-template-columns: minmax(150px, 1.15fr) repeat(3, minmax(0, 1.3fr)); gap: clamp(14px, 2.5vw, 34px); align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.tc-head { border-top: 0; align-items: end; padding-bottom: 8px; }
.tc-head .tc-h { font-weight: 650; font-size: 15.5px; line-height: 1.25; }
.tc-head .tc-h small { display: block; font-weight: 450; font-size: 13px; color: var(--muted); }
.tc-axisrow + .tc-row { border-top: 0; }
.tc-task { font-weight: 600; line-height: 1.25; }
.tc-task small { display: block; font-weight: 400; font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.tc-cell { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 10px; align-items: center; }
.tc-cell::before { display: none; }
.tc-track { position: relative; height: 18px; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: 50% 100%; border-right: 1px solid var(--line); }
.tc-bar { position: absolute; left: 0; top: 4px; height: 10px; background: var(--blue); border-radius: 0 4px 4px 0; }
.tc-bar.tok { background: var(--ink); }
.tc-val { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.tc-val small { color: var(--muted); font-size: 12.5px; }
.tc-axis { position: relative; height: 16px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tc-axis span { position: absolute; top: 0; white-space: nowrap; }
.tc-axisrow { padding: 0 0 2px; border-top: 0; }
.tc-row.tc-data:hover { background: linear-gradient(to right, transparent, var(--mist) 6%, var(--mist) 94%, transparent); }
.tc-total { border-top: 2px solid var(--ink); }
.tc-total .tc-task { font-weight: 700; }
.cols-notes { margin-top: 32px; }

/* investigation */
.study { margin-top: clamp(48px, 6vw, 72px); padding-top: 22px; border-top: 1px solid var(--line); }
.study h3 { margin-bottom: 10px; }
.study > p { max-width: 68ch; margin-bottom: 22px; }
.study .fig { max-width: 980px; }
.conds { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: clamp(18px, 3vw, 40px); max-width: 980px; }
.conds li { border-top: 2px solid var(--ink); padding-top: 10px; }
.conds b { display: block; font-weight: 650; line-height: 1.25; }
.conds p { margin: 0; font-size: 15.5px; line-height: 1.5; max-width: 44ch; }
.conds .cond-num { font-family: var(--mono); font-size: 13.5px; color: var(--muted); margin: 4px 0 8px; }
.cond-num strong { font-family: var(--sans); font-size: clamp(26px, 2.8vw, 34px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); margin-right: 8px; }
.study-note { margin-top: 40px; }

/* authors */
#authors h2 { max-width: none; }
.team { margin: 0; max-width: 980px; }
.team > div { display: grid; grid-template-columns: minmax(150px, 0.3fr) minmax(0, 1fr); gap: clamp(12px, 3vw, 40px); padding: 16px 0; border-top: 1px solid var(--line); }
.team dt { font-weight: 650; }
.team dd { margin: 0; max-width: 74ch; }
.team sup { font-size: 0.68em; line-height: 0; color: var(--muted); margin-left: 1px; }
.team > div:last-child dd { font-size: 15.5px; color: var(--muted); }

/* cite */
.sec-cite { background: var(--ink); color: var(--on-ink); }
.bib { display: grid; gap: 16px; justify-items: start; }
.bib pre { margin: 0; font-family: var(--mono); font-size: 14px; line-height: 1.7; overflow-x: auto; max-width: 100%; color: var(--on-ink); }
.sec-cite .btn { border-color: var(--on-ink); color: var(--on-ink); }
.sec-cite .btn:hover { background: #fff; color: var(--ink); }
.sec-cite :focus-visible { outline-color: #fff; }

.foot { background: var(--ink); color: var(--on-ink-muted); border-top: 1px solid #2a3760; padding: 22px 0 28px; font-size: 14px; }
.foot p { margin: 0; max-width: 90ch; }

/* responsive */
@media (max-width: 900px) {
  .hero-row, .two, .strand-head, .task-body, .twin { grid-template-columns: minmax(0, 1fr); }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .team > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .frames-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wall-foot { flex-direction: column; gap: 12px; }
  .nav-in { gap: 16px; }
}
@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .wall-grid { grid-template-columns: repeat(2, 1fr); }
  .tile-name { font-size: 14px; }
  .tile-label { left: 10px; right: 10px; bottom: 8px; }
  .story { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-cell { grid-template-columns: 74px minmax(0, 1fr) 100px; }
  .task-stats dd { font-size: 21px; }
  .tc-head, .tc-axisrow { display: none; }
  .tc-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 0; }
  .tc-cell::before { display: block; content: attr(data-label); font-size: 12.5px; color: var(--muted); line-height: 1.2; }
  .conds { grid-template-columns: minmax(0, 1fr); }
  .thread > li { padding-left: 24px; }
  .fig { overflow-x: auto; }
  .fig img { min-width: 620px; }
  #teach-chart { overflow-x: auto; padding-top: 48px; }
  #teach-chart svg { min-width: 640px; }
  .code { font-size: 12px; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tip { transition: none; }
}
