/* Alem v2 — clean paper/benchmark launch site
   Design direction: Vercel/Apple-style white canvas, precise tables, restrained accent color. */

:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --paper: #ffffff;
  --paper-2: #fbfbfa;
  --ink: #111111;
  --muted: #5f625d;
  --faint: #898d87;
  --line: rgba(17, 17, 17, 0.10);
  --line-strong: rgba(17, 17, 17, 0.18);
  --green: #1f9d55;
  --blue: #0a72ef;
  --orange: #e88928;
  --red: #d84d45;
  --shadow: 0 0 0 1px rgba(17,17,17,.08), 0 12px 40px rgba(17,17,17,.06), 0 2px 4px rgba(17,17,17,.04);
  --shadow-soft: 0 0 0 1px rgba(17,17,17,.08), 0 2px 10px rgba(17,17,17,.04);
  --radius: 18px;
  --radius-sm: 11px;
  --max: 1200px;
  --sans: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(31,157,85,.10), transparent 36rem),
    linear-gradient(180deg, #fbfbf8 0%, var(--bg) 46rem, #f3f3ef 100%);
  background-repeat: no-repeat; /* keep the glow from tiling below short pages */
  background-color: #f3f3ef;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
p, h1, h2, h3 { margin: 0; }
button { font: inherit; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  background: rgba(251, 251, 248, .78);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; margin-right: auto; letter-spacing: -.02em; }
.brand img { width: 52px; height: 52px; }
.site-nav nav { display: flex; gap: 24px; }
.site-nav nav a { color: var(--muted); font-size: 14px; font-weight: 500; transition: color .16s; }
.site-nav nav a:hover { color: var(--ink); }
.nav-actions { display: flex; gap: 10px; }

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 550;
  transition: transform .16s, box-shadow .16s, background .16s;
  white-space: nowrap;
}
.button-dark { color: #fff; background: #111; box-shadow: 0 0 0 1px rgba(0,0,0,.95), 0 8px 18px rgba(0,0,0,.12); }
.button-light { color: var(--ink); background: rgba(255,255,255,.72); box-shadow: 0 0 0 1px rgba(17,17,17,.10); }
.button:hover { transform: translateY(-1px); }
.button-light:hover { background: #fff; box-shadow: var(--shadow-soft); }

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(52px, 7vw, 96px) 24px 42px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .78fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(31,157,85,.12); }
.hero h1 {
  max-width: 760px;
  margin-top: 18px;
  font-size: clamp(52px, 7.3vw, 92px);
  line-height: .92;
  letter-spacing: -.068em;
  font-weight: 700;
}
.hero-lede {
  max-width: 700px;
  margin-top: 28px;
  color: #40433f;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
  letter-spacing: -.018em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.authors { max-width: 720px; margin-top: 28px; color: var(--faint); font-size: 13px; }
.hero-card {
  background: var(--paper);
  border-radius: 28px;
  padding: 12px;
  box-shadow: var(--shadow);
  transform: rotate(.5deg);
}
.hero-media { border-radius: 20px; overflow: hidden; background: #111; aspect-ratio: 16 / 10; }
.hero-media video { width: 100%; height: 100%; object-fit: cover; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 12px; background: var(--line); border-radius: 16px; overflow: hidden; }
.hero-metrics div { background: var(--paper-2); padding: 16px 12px; }
.hero-metrics span { display: block; font-size: 28px; line-height: 1; font-weight: 700; letter-spacing: -.05em; }
.hero-metrics small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.strip {
  /* width is constrained instead of padded so the divider-colour background
     never shows as a grey band inside the rounded corners */
  width: calc(100% - 48px);
  max-width: calc(var(--max) - 48px);
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.strip-item { background: rgba(255,255,255,.78); padding: 22px; }
.strip-item span { display: block; margin-bottom: 8px; color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.strip-item strong { display: block; max-width: 310px; font-size: 17px; line-height: 1.28; letter-spacing: -.025em; }

.section { max-width: var(--max); margin: 0 auto; padding: clamp(54px, 7vw, 88px) 24px; }
.section-head { margin-bottom: 34px; }
.section-head h2 { font-size: clamp(36px, 5vw, 62px); line-height: .96; letter-spacing: -.058em; font-weight: 650; }
.section-head p { color: var(--muted); font-size: 18px; line-height: 1.55; letter-spacing: -.015em; }
.split-head { display: grid; grid-template-columns: .92fr .82fr; gap: 50px; align-items: end; }
.centered { max-width: 810px; margin-left: auto; margin-right: auto; text-align: center; }
.centered .eyebrow { justify-content: center; margin-bottom: 14px; }
.centered p { margin: 20px auto 0; max-width: 700px; }

.board-shell, .cite-box, .interface-card, .feature-card, .visual-card, .diff-card, .finding-card, .quote-card, .comparison-block, .achievements, .ablation-block, .hetero-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.board-shell { overflow: hidden; }
.leaderboard-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: -12px 0 16px; }
.leaderboard-summary article { background: rgba(255,255,255,.74); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-soft); }
.leaderboard-summary span { display: block; color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; margin-bottom: 12px; }
.leaderboard-summary strong { display: block; font-size: 22px; line-height: 1.08; letter-spacing: -.04em; }
.leaderboard-summary p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.board-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(251,251,250,.88);
  border-bottom: 1px solid var(--line);
}
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: #efefeb; box-shadow: inset 0 0 0 1px var(--line); }
.seg-btn { border: 0; cursor: pointer; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 550; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: #111; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.seg-view .seg-btn.is-active { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px rgba(17,17,17,.10); }
.board-limit-btn { border: 1px solid var(--line-strong); cursor: pointer; padding: 8px 13px; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.board-limit-btn span { display: none; }
.board-limit-btn:hover { border-color: rgba(17,17,17,.32); color: var(--ink); }
.board-limit-btn.is-active { border-color: rgba(31,157,85,.22); background: rgba(31,157,85,.10); color: #126b38; }
.board-limit-btn.is-active span { display: inline; }
.board-limit-btn:disabled { cursor: default; opacity: .4; }
.board-meta { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.board-table { width: 100%; min-width: 960px; border-collapse: collapse; }
.board-table thead th {
  padding: 13px 16px;
  color: var(--faint);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.board-table th.col-num { text-align: right; }
.board-table th.sortable { cursor: pointer; }
.board-table th.is-sorted { color: var(--orange); }
.board-table th.is-sorted::after { content: " ↓"; }
.board-table th.is-sorted.asc::after { content: " ↑"; }
.board-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board-table tbody tr:hover { background: #fafaf7; }
.board-table tbody tr.is-marl { background: rgba(10,114,239,.035); }
.board-table tbody tr.is-mixed { background: rgba(124,58,237,.035); }
.board-table .more-results-row:hover { background: var(--paper-2); }
.board-table .more-results-row td { padding: 0; background: var(--paper-2); }
.more-results-row button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border: 0; cursor: pointer; padding: 12px 18px; background: transparent; color: var(--muted); }
.more-results-row button:hover { color: var(--ink); }
.more-results-row button span { color: var(--faint); font-family: var(--mono); letter-spacing: .14em; }
.more-results-row button strong { font-size: 12px; font-weight: 600; }
.col-rank { color: var(--faint); font-family: var(--mono); font-size: 12px; width: 42px; }
.rank-1 .col-rank, .rank-2 .col-rank, .rank-3 .col-rank { color: var(--orange); font-weight: 600; }
.model-id { display: flex; align-items: center; gap: 11px; }
.model-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.model-name { font-weight: 620; letter-spacing: -.018em; }
.model-config { color: var(--faint); font-size: 12px; }
/* Provider brand marks: single-path SVGs masked so one brand colour applies. */
.model-logo { flex: 0 0 auto; width: 19px; height: 19px; display: inline-block; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.model-logo-none { background: none; }
.model-logo-img { object-fit: contain; }  /* official multicolour logos (Google) */
.logo-openai { background: #0d0d0d; -webkit-mask-image: url(../img/logos/openai.svg); mask-image: url(../img/logos/openai.svg); }
.logo-qwen   { background: #6236ff; -webkit-mask-image: url(../img/logos/qwen.svg);   mask-image: url(../img/logos/qwen.svg); }
.logo-meta   { background: #0866ff; -webkit-mask-image: url(../img/logos/meta.svg);   mask-image: url(../img/logos/meta.svg); }
.logo-marl   { background: var(--faint); -webkit-mask-image: url(../img/logos/marl.svg); mask-image: url(../img/logos/marl.svg); }
.type-pill { display: inline-flex; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 600; }
.type-proprietary { color: #8a5108; background: rgba(232,137,40,.14); }
.type-open-weight { color: #126b38; background: rgba(31,157,85,.12); }
.type-marl { color: #0757b8; background: rgba(10,114,239,.12); }
.type-mixed { color: #6d28c9; background: rgba(124,58,237,.12); }
.type-run { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 112px; }
.run-meta { display: flex; flex-direction: column; gap: 2px; color: var(--faint); font-family: var(--mono); font-size: 10.5px; line-height: 1.15; white-space: nowrap; }
.col-harness { white-space: nowrap; }
.harness-link { display: inline-flex; align-items: center; border-radius: 999px; color: #4e5b54; background: #eef1ec; padding: 5px 8px; box-shadow: inset 0 0 0 1px rgba(17,17,17,.05); font-family: var(--mono); font-size: 10.5px; line-height: 1; text-decoration: none; }
.harness-link:hover { color: #126b38; background: #e6f2ea; }
.harness-link.is-static { color: var(--faint); background: #f2f2ef; }
.num-cell { text-align: right; min-width: 132px; }
.num-val { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.num-ci { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.bar-track { position: relative; height: 5px; margin-top: 7px; border-radius: 999px; background: #e6e7e2; overflow: visible; }
.bar-ci { position: absolute; top: 0; height: 5px; border-radius: 999px; opacity: .45; }
.bar-dot { position: absolute; top: -2px; width: 9px; height: 9px; border-radius: 50%; transform: translateX(-50%); border: 2px solid #fff; }
.m-base .bar-ci, .m-base .bar-dot { background: var(--blue); }
.m-coord .bar-ci, .m-coord .bar-dot { background: var(--green); }
.m-total .bar-ci, .m-total .bar-dot { background: var(--orange); }
.note { margin-top: 15px; color: var(--muted); font-size: 13px; }
.note a { color: #126b38; font-weight: 600; }

.feature-grid { display: grid; gap: 16px; }
.feature-grid.four { grid-template-columns: repeat(4, 1fr); }
.feature-card { padding: 22px; min-height: 178px; }
.feature-card span { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.feature-card h3 { margin-top: 24px; font-size: 21px; line-height: 1.12; letter-spacing: -.035em; }
.feature-card p { margin-top: 10px; color: var(--muted); font-size: 14px; }
.visual-grid { display: grid; grid-template-columns: minmax(0, .98fr) minmax(360px, 1.02fr); gap: 18px; margin-top: 18px; align-items: stretch; }
.visual-card { overflow: hidden; }
.visual-card img { width: 100%; height: 520px; max-height: 58vw; object-fit: contain; object-position: center; background: #101311; padding: 10px; }
.visual-card figcaption, .diff-card p, .gallery-row figcaption, .figures-row figcaption, .ablation-grid figcaption { color: var(--muted); font-size: 13px; }
.visual-card figcaption { padding: 14px 16px; border-top: 1px solid var(--line); }
.difficulty-stack { display: grid; gap: 14px; }
.diff-card { display: grid; grid-template-columns: 168px 1fr; gap: 18px; overflow: hidden; align-items: center; min-height: 164px; }
.diff-card img { width: 168px; height: 132px; margin-left: 18px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px rgba(17,17,17,.08); }
.diff-card div { padding-right: 18px; }
.diff-card h3 { font-size: 19px; letter-spacing: -.025em; }
.diff-card h3 span { float: right; color: var(--faint); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.diff-easy { box-shadow: inset 4px 0 0 var(--green), var(--shadow-soft); }
.diff-medium { box-shadow: inset 4px 0 0 var(--blue), var(--shadow-soft); }
.diff-hard { box-shadow: inset 4px 0 0 var(--orange), var(--shadow-soft); }
.interface-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.interface-card { padding: 26px; }
.pill { display: inline-flex; margin-bottom: 16px; padding: 4px 10px; border-radius: 999px; font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.pill-blue { color: #0757b8; background: rgba(10,114,239,.10); }
.pill-green { color: #126b38; background: rgba(31,157,85,.12); }
.interface-card h3 { font-size: 24px; letter-spacing: -.04em; }
.interface-card ul { margin: 16px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.interface-card li + li { margin-top: 8px; }
.gallery-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.gallery-row figure, .figures-row figure, .ablation-grid figure { margin: 0; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-soft); }
.gallery-row img { aspect-ratio: 1.55 / 1; object-fit: cover; width: 100%; }
.gallery-row figcaption, .figures-row figcaption, .ablation-grid figcaption { padding: 10px 12px; border-top: 1px solid var(--line); }
.comparison-block { margin-top: 18px; padding: 18px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 18px; }
.achievements { padding: 26px; box-shadow: inset 0 0 0 1px var(--line); }
.achievements h3, .block-title { margin-bottom: 16px; font-size: 22px; letter-spacing: -.035em; }
.achievements div { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.achievements div:first-of-type { border-top: 0; }
.achievements span { font-weight: 600; }
.achievements strong { font-size: 30px; line-height: 1; letter-spacing: -.05em; }
.achievements small { grid-column: 1 / -1; color: var(--muted); }
.cmp-table { width: 100%; min-width: 520px; border-collapse: collapse; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.cmp-table th, .cmp-table td { padding: 11px 13px; text-align: center; border-bottom: 1px solid var(--line); font-size: 13px; }
.cmp-table th { color: var(--muted); font-size: 11px; font-weight: 500; background: var(--paper-2); }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; }
.cmp-table tr.is-alem { background: rgba(31,157,85,.08); }
.mark-yes { color: var(--green); font-weight: 700; }
.mark-no { color: var(--red); }
.mark-partial { color: var(--orange); }
.cmp-foot { margin-top: 10px; color: var(--faint); font-size: 12px; text-align: center; }

.results-head { margin-bottom: 34px; }
.result-chapter { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; margin-bottom: 18px; }
.result-chapter.reverse { grid-template-columns: .68fr 1.32fr; align-items: start; }
.chapter-copy { background: rgba(255,255,255,.76); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-soft); }
.chapter-copy h3 { margin-top: 16px; font-size: clamp(26px, 3.3vw, 40px); line-height: 1.02; letter-spacing: -.052em; }
.chapter-copy p { margin-top: 16px; color: var(--muted); font-size: 16px; }
.chapter-copy ul { margin: 18px 0 0; padding-left: 18px; color: var(--muted); }
.chapter-copy li + li { margin-top: 8px; }
.chapter-copy.compact h3 { font-size: clamp(24px, 2.5vw, 32px); }
.findings-headline { max-width: 880px; margin: 26px auto 6px; text-align: center; font-size: clamp(21px, 2.7vw, 30px); line-height: 1.26; letter-spacing: -.028em; font-weight: 500; color: var(--ink); text-wrap: balance; }
.findings-headline .fh-num { font-weight: 700; color: var(--red); white-space: nowrap; }
.findings-headline .fh-emph { font-weight: 700; color: var(--ink); box-shadow: inset 0 -0.32em 0 rgba(232,137,40,.22); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; align-items: start; }
.finding-layout { display: grid; grid-template-columns: 1.1fr .8fr .8fr; gap: 16px; }
.finding-card { min-height: 210px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; }
.finding-card span { color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.finding-card h3 { margin-top: 18px; font-size: 24px; line-height: 1.08; letter-spacing: -.045em; }
.finding-card p { margin-top: 10px; color: var(--muted); font-size: 14px; }
.finding-card.keynote { grid-row: span 2; min-height: 380px; color: #fff; background: linear-gradient(160deg, #161614 0%, #222620 62%, #263c2c 100%); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 18px 50px rgba(17,17,17,.20); }
.result-chapter .finding-card.keynote { grid-row: auto; min-height: 100%; }
.finding-card.keynote span, .finding-card.keynote p { color: rgba(255,255,255,.72); }
.finding-card.keynote h3 { font-size: clamp(30px, 4vw, 42px); }
.figures-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.diagnostic-row { margin-top: 0; }
.figures-row img { padding: 14px; background: #fff; width: 270px; max-width: 100%; height: 245px; object-fit: contain; margin: 0 auto; }
.ablation-block { margin-top: 18px; padding: 24px; }
.ablation-block h3 { font-size: 26px; letter-spacing: -.04em; }
.ablation-block p { color: var(--muted); }
.ablation-block > figure { margin: 18px 0 10px; }
.ablation-copy { max-width: 760px; }
.ablation-copy .eyebrow { margin-bottom: 12px; }
.ablation-block > figure img { height: 28px; width: auto; }
.ablation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ablation-grid img { width: 100%; height: 520px; max-height: 52vw; object-fit: contain; padding: 18px; background: #fff; }
.hetero-wrap { margin-top: 26px; }
.detailed-hetero { display: grid; grid-template-columns: .55fr 1.45fr; gap: 18px; align-items: stretch; }
.hetero-wrap h3 { font-size: 24px; letter-spacing: -.035em; margin-bottom: 14px; }
.hetero-wrap h3 span { color: var(--muted); font-weight: 400; }
.hetero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hetero-card { padding: 24px; }
.hetero-card h4 { margin: 0 0 3px; font-size: 18px; letter-spacing: -.03em; }
.hetero-kind { color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; margin-bottom: 18px; }
.hbar { margin-bottom: 13px; }
.hbar-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.hbar-val { font-family: var(--mono); color: var(--ink); }
.hbar-track { height: 8px; margin-top: 5px; background: #e5e6e1; border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; background: #9aa19a; }
.hbar.is-team .hbar-fill { background: var(--orange); }
.hetero-delta { margin-top: 10px; font-size: 13px; font-weight: 600; }
.delta-pos { color: var(--green); } .delta-neg { color: var(--red); }

.cog-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quote-card { padding: 22px; min-height: 220px; display: flex; flex-direction: column; }
.quote-card span { color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.quote-card p { margin-top: 16px; font-size: 17px; line-height: 1.38; letter-spacing: -.025em; flex: 1; }
.quote-card strong { background: linear-gradient(transparent 58%, rgba(31,157,85,.18) 0); font-weight: 650; }
.quote-card small { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.cite-box { position: relative; overflow: hidden; }
.cite-box pre { margin: 0; padding: 26px; overflow-x: auto; }
.cite-box code { font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.copy-btn { position: absolute; top: 14px; right: 14px; border: 0; border-radius: 999px; background: #111; color: #fff; padding: 7px 13px; cursor: pointer; font-size: 12px; }
.copy-btn.copied { background: var(--green); }
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px max(24px, calc((100vw - var(--max)) / 2)); display: flex; justify-content: space-between; gap: 24px; color: var(--muted); }
.footer div { display: flex; align-items: center; gap: 10px; }
.footer img { width: 28px; }
.footer strong { color: var(--ink); }
.footer nav { display: flex; gap: 20px; }
.footer a:hover { color: var(--ink); }

@media (max-width: 980px) {
  .site-nav nav { display: none; }
  .hero, .split-head, .visual-grid, .comparison-block, .result-chapter, .result-chapter.reverse, .detailed-hetero { grid-template-columns: 1fr; }
  .hero-card { transform: none; }
  .strip, .feature-grid.four, .gallery-row, .figures-row, .cog-grid, .leaderboard-summary, .result-grid { grid-template-columns: 1fr 1fr; }
  .result-grid.six { grid-template-columns: repeat(2, 1fr); }
  .finding-layout { grid-template-columns: 1fr 1fr; }
  .finding-card.keynote { grid-row: auto; min-height: 300px; grid-column: 1 / -1; }
  .interface-grid, .hetero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .site-nav { height: auto; min-height: 62px; padding: 10px 16px; }
  .brand img { width: 48px; height: 48px; }
  .nav-actions a:nth-child(2) { display: none; }
  .hero { padding: 52px 16px 36px; }
  .hero h1 { font-size: clamp(46px, 16vw, 72px); }
  .section { padding: 56px 16px; }
  .strip, .feature-grid.four, .gallery-row, .figures-row, .ablation-grid, .cog-grid, .finding-layout, .leaderboard-summary, .result-grid { grid-template-columns: 1fr; }
  .result-grid.six, .figures-row.two, .figures-row.two.hetero-figures { grid-template-columns: 1fr; }
  .board-meta { display: none; }
  .diff-card { grid-template-columns: 120px 1fr; }
  .diff-card img { width: 120px; height: 110px; }
  .footer { flex-direction: column; padding: 28px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ============================================================
   v3 additions — paper header, gallery/showcase, gif media
   ============================================================ */
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-subtitle {
  max-width: 720px; margin-top: 16px;
  font-size: clamp(18px, 2.2vw, 25px); font-weight: 550; letter-spacing: -.03em;
  color: var(--ink); line-height: 1.18;
}

/* showcase / gallery */
.showcase-stack { display: grid; gap: 18px; }
.showcase-figure {
  margin: 0; background: var(--paper); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-soft);
}
.showcase-figure img { width: 100%; display: block; background: #101311; }
.showcase-figure figcaption {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.show-tag {
  font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.show-tag.tag-rl { color: #0757b8; background: rgba(10,114,239,.10); }
.show-tag.tag-llm { color: #126b38; background: rgba(31,157,85,.12); }
.show-tag.tag-world { color: var(--ink); background: rgba(17,17,17,.06); }

/* ============================================================
   v3 refinements — difficulty clip, interfaces, coordination, findings
   ============================================================ */
.diff-figure { margin: 18px 0 0; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.diff-figure video { width: 100%; display: block; background: #101311; aspect-ratio: 16 / 9; }
.diff-figure figcaption { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

.center-title { text-align: center; margin: 50px 0 22px; }
.block-title.center-title { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; }
.muted-label { color: var(--muted); font-weight: 400; }

/* interfaces with real visuals */
.iface-shot { margin: 0 0 16px; border-radius: 12px; overflow: hidden; background: #101311; box-shadow: inset 0 0 0 1px var(--line); }
.iface-shot img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.iface-text {
  margin: 0 0 16px; padding: 16px; border-radius: 12px; background: #0f1311; color: #d7e0d8;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; overflow-x: auto; box-shadow: inset 0 0 0 1px var(--line);
}
.iface-text code { color: inherit; }

/* coordination demands */
.coord-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.coord-shot { margin: 0; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.coord-shot img { width: 100%; display: block; max-height: 460px; object-fit: contain; background: #101311; }
.coord-shot figcaption { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.coord-list { margin: 0; padding: 26px; list-style: none; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.coord-list li { padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.coord-list li:first-child { border-top: 0; padding-top: 0; }
.coord-list strong { color: var(--ink); font-weight: 600; }

/* scoring */
.scoring { margin-top: 18px; padding: 26px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.scoring h3 { margin-bottom: 16px; font-size: 22px; letter-spacing: -.035em; }
.scoring-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scoring-cols div { padding: 18px; border-radius: 12px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.scoring-cols span { display: block; color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.scoring-cols strong { display: block; margin: 8px 0 4px; font-size: 34px; line-height: 1; letter-spacing: -.05em; }
.scoring-cols small { color: var(--muted); font-size: 12.5px; }

/* findings — consistent sizing */
.result-grid.six { grid-template-columns: repeat(3, 1fr); }
.result-grid.six .finding-card { min-height: 200px; justify-content: flex-start; }
.figures-row.two { grid-template-columns: repeat(2, 1fr); max-width: 820px; margin-left: auto; margin-right: auto; }
.figures-row img { height: 240px; object-fit: contain; }
.ablation-legend { margin: 0 auto 12px; text-align: center; }
.ablation-legend img { height: 26px; width: auto; display: inline-block; }

@media (max-width: 980px) {
  .coord-feature { grid-template-columns: 1fr; }
  .scoring-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .scoring-cols { grid-template-columns: 1fr; }
}

/* clickable finding cards (details/summary) */
.result-hint { text-align: center; color: var(--faint); font-size: 13px; margin-bottom: 16px; }
.result-grid.six .finding-card { min-height: 0; padding: 0; display: block; justify-content: flex-start; }
.finding-card > summary { list-style: none; cursor: pointer; display: block; position: relative; padding: 22px 44px 22px 24px; min-height: 132px; transition: background .15s; }
.finding-card > summary::-webkit-details-marker { display: none; }
.finding-card > summary { padding-bottom: 44px; }
.finding-card > summary::after { content: "Read result  +"; position: absolute; bottom: 15px; right: 20px; color: #126b38; font-family: var(--mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.finding-card[open] > summary::after { content: "Hide  \2013"; color: var(--faint); }
.finding-card > summary:hover { background: var(--paper-2); }
.result-grid.six .finding-card { transition: transform .15s, box-shadow .15s; }
.result-grid.six .finding-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.finding-card > summary span { color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.finding-card > summary h3 { margin-top: 14px; font-size: 19px; line-height: 1.14; letter-spacing: -.035em; }
.finding-card > p { margin: 0; padding: 0 24px 24px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

/* full system prompt */
.prompt-details { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.prompt-details > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: #126b38; }
.prompt-details > summary::-webkit-details-marker { display: none; }
.prompt-details > summary::before { content: "\25B8\00a0"; }
.prompt-details[open] > summary::before { content: "\25BE\00a0"; }
.prompt-full {
  margin: 12px 0 0; max-height: 360px; overflow: auto; padding: 16px; border-radius: 12px;
  background: #0f1311; color: #d7e0d8; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap;
}
.prompt-full code { color: inherit; }

/* secondary board spacing */
.secondary-board { padding-top: 0; }

/* coordination demands — balanced layout */
.coord-hero { margin: 0 auto; max-width: 540px; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.coord-hero img { width: 100%; display: block; image-rendering: pixelated; }
.coord-hero figcaption { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.coord-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.coord-card { padding: 22px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.coord-card h4 { margin: 0 0 8px; font-size: 16px; letter-spacing: -.02em; }
.coord-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* clickable figure cards (diagnostics + ablations) */
.fig-card { margin: 0; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-soft); }
.fig-card > summary { list-style: none; cursor: pointer; display: block; }
.fig-card > summary::-webkit-details-marker { display: none; }
.fig-card > summary img { width: 100%; height: 240px; object-fit: contain; padding: 14px; background: #fff; display: block; }
.fig-card .fig-cap { display: block; padding: 11px 14px; border-top: 1px solid var(--line); color: #51605c; font-size: 12.5px; }
.fig-card .fig-more::after { content: "Read more +"; color: #126b38; font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; }
.fig-card[open] .fig-more::after { content: "Show less \2013"; }
.fig-card > p { margin: 0; padding: 14px; border-top: 1px solid var(--line); background: #fbfbfa; color: var(--muted); font-size: 13px; line-height: 1.55; }

.hetero-legend { margin: 10px auto 12px; display: flex; justify-content: center; }
.hetero-legend img { height: 34px; width: auto; max-width: 100%; padding: 0; background: transparent; }
.figures-row.two.hetero-figures { max-width: 900px; align-items: stretch; }
.hetero-figures .fig-card { display: flex; flex-direction: column; }
.hetero-figures .fig-card > img { width: 100%; height: 360px; object-fit: contain; padding: 18px 18px 10px; background: #fff; }
.hetero-figures figcaption { margin-top: auto; padding: 11px 14px; border-top: 1px solid var(--line); color: #51605c; font-size: 12.5px; }

@media (max-width: 980px) {
  .coord-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .coord-grid { grid-template-columns: 1fr; }
}

/* per-model gallery: gameplay clip + verbatim quote */
.model-gallery { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 0 16px; -webkit-overflow-scrolling: touch; }
.model-gallery::-webkit-scrollbar { height: 8px; }
.model-gallery::-webkit-scrollbar-track { background: transparent; }
.model-gallery::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.model-card { flex: 0 0 min(90vw, 500px); scroll-snap-align: start; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; cursor: pointer; transition: transform .18s, box-shadow .18s; }
.model-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.model-card video { width: 100%; display: block; background: #101311; aspect-ratio: 640 / 286; }
.model-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.model-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-card-name { font-weight: 640; font-size: 17px; letter-spacing: -.02em; }
.model-quote { margin: 0; font-size: 16px; line-height: 1.46; letter-spacing: -.01em; color: var(--ink); flex: 1; }
.model-quote-meta { color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .02em; }
.model-card-body::after { content: "▶ Open full reasoning trace"; align-self: flex-start; color: #126b38; background: rgba(31,157,85,.10); font-family: var(--mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 6px 11px; border-radius: 999px; }
.model-card:hover .model-card-body::after { background: rgba(31,157,85,.18); }

/* trajectory viewer modal */
.trace-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.trace-modal[hidden] { display: none; }
.trace-backdrop { position: absolute; inset: 0; background: rgba(10,12,16,.55); backdrop-filter: blur(3px); }
.trace-dialog { position: relative; width: min(980px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); display: flex; flex-direction: column; background: var(--paper); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.4); overflow: hidden; }
.trace-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.trace-model { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.trace-sub { color: var(--faint); font-family: var(--mono); font-size: 12px; margin-left: 8px; }
.trace-close { border: 0; background: #efefeb; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; color: var(--ink); }
.trace-close:hover { background: #e3e3de; }
.trace-controls { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--paper-2); }
.trace-controls button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 13px; }
.trace-controls button:hover { background: #f3f3ef; }
.trace-controls input[type=range] { flex: 1 1 220px; min-width: 0; accent-color: var(--green); }
.trace-step { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 120px; }
.trace-agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; padding: 14px 16px 18px; overflow-y: auto; overflow-x: hidden; }
.trace-agent { min-width: 0; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px; overflow: hidden; }
.trace-agent-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 650; font-size: 13px; margin-bottom: 8px; }
.trace-act { font-family: var(--mono); font-size: 11px; color: #fff; background: #2b3140; padding: 2px 8px; border-radius: 6px; }
.trace-field { min-width: 0; font-size: 12.5px; line-height: 1.5; margin-top: 10px; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.trace-tag { display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin-bottom: 3px; }
.trace-msg { color: #126b38; white-space: pre-wrap; }
.trace-pad { white-space: pre-wrap; }
.trace-think { color: var(--muted); white-space: pre-wrap; max-height: 230px; overflow-y: auto; }
.trace-obs { margin-top: 10px; }
.trace-obs > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--paper-2); transition: background .15s; }
.trace-obs > summary:hover { background: #f0f0eb; }
.trace-obs > summary::-webkit-details-marker { display: none; }
.trace-obs-sum .trace-tag { margin: 0; color: var(--blue); }
.trace-obs-preview { flex: 1; min-width: 0; color: var(--faint); font-family: var(--mono); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trace-obs-toggle { color: #126b38; font-weight: 600; font-size: 11px; white-space: nowrap; visibility: hidden; }
.trace-obs-toggle::before { content: "Show full ▾"; visibility: visible; }
.trace-obs[open] .trace-obs-toggle::before { content: "Hide ▴"; }
.trace-obs[open] .trace-obs-preview { display: none; }
.trace-obs pre { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: #0f1311; color: #c8d2c9; font-family: var(--mono); font-size: 11px; line-height: 1.5; white-space: pre-wrap; max-height: 260px; overflow-y: auto; }

/* clickable leaderboard rows → model detail */
.board-table tbody tr.is-clickable { cursor: pointer; }
.board-table tbody tr.is-clickable:hover { background: #f3f6f2; }
.board-table tbody tr.is-clickable:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.score-cell { cursor: pointer; }
.score-cell:hover .num-val { color: #126b38; }
.md-dialog { width: min(920px, 94vw); }
.md-body { padding: 18px 22px 22px; overflow-y: auto; }
.md-metas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.md-meta { background: var(--paper-2); padding: 12px 14px; }
.md-meta span { display: block; color: var(--faint); font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; margin-bottom: 4px; }
.md-meta strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.md-meta a { color: #126b38; font-weight: 600; }
.md-h { font-size: 14px; margin: 0 0 12px; letter-spacing: -.02em; }
.md-h span { color: var(--faint); font-weight: 400; font-size: 12px; }
.md-table { width: 100%; border-collapse: collapse; }
.md-table th, .md-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.md-table th { color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; font-weight: 500; }
.md-table td.md-total { font-weight: 600; }
.md-table .md-ci { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.md-note { margin-top: 14px; color: var(--muted); font-size: 13px; }
.md-note a { color: #126b38; font-weight: 600; }
.md-config-loading { margin-top: 14px; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.md-json { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.md-json > summary { cursor: pointer; list-style: none; padding: 12px 14px; font-weight: 650; border-bottom: 1px solid var(--line); }
.md-json > summary::-webkit-details-marker { display: none; }
.md-json > summary span { color: var(--faint); font-family: var(--mono); font-size: 11px; font-weight: 500; margin-left: 8px; text-transform: uppercase; }
.md-json-tools { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); color: var(--faint); font-family: var(--mono); font-size: 11px; }
.md-json-tools a { color: #126b38; font-weight: 600; text-decoration: none; }
.md-json pre { margin: 0; max-height: 360px; overflow: auto; padding: 14px; background: #101310; color: #d8ded8; font-family: var(--mono); font-size: 11px; line-height: 1.45; }
.trace-empty { color: var(--faint); font-size: 12.5px; }
@media (max-width: 820px) { .trace-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); } .trace-agents { grid-template-columns: 1fr; padding: 12px; } .trace-head { align-items: flex-start; } .trace-head-actions { flex-shrink: 0; } }

/* three interfaces + pixel pill */
.interface-grid.three { grid-template-columns: repeat(3, 1fr); }
.pill-amber { color: #8a5108; background: rgba(232,137,40,.14); }
@media (max-width: 900px) { .interface-grid.three { grid-template-columns: 1fr; } }

/* prominent trace CTA */
.trace-cta-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 22px; }
.trace-cta { display: inline-flex; align-items: center; border: 0; background: #111; color: #fff; border-radius: 999px; padding: 12px 22px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px rgba(0,0,0,.16); transition: transform .15s; }
.trace-cta:hover { transform: translateY(-2px); }
.trace-cta-hint { color: var(--faint); font-size: 12.5px; }

/* hero thesis line */
.hero-thesis { margin-top: 14px; font-size: clamp(16px, 1.9vw, 20px); color: var(--muted); letter-spacing: -.01em; }
.hero-thesis strong { color: var(--ink); font-weight: 650; }

/* showcase video (replaces heavy gif) */
.showcase-figure video { width: 100%; display: block; background: #101311; aspect-ratio: 1076 / 480; }

/* compact MARL reference head */
.marl-head { max-width: 820px; margin-bottom: 18px; }
.marl-head .eyebrow { margin-bottom: 8px; }
.marl-head p { color: var(--muted); font-size: 15px; }
.marl-head strong { color: var(--ink); font-weight: 600; }

/* gallery fade edges (horizontal-scroll affordance) */
.model-gallery {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
}
.model-gallery.is-collapsed { overflow: hidden; -webkit-mask-image: none; mask-image: none; }
.model-gallery.is-collapsed .model-card:nth-child(n+3) { display: none; }
.gallery-expand { display: flex; align-items: center; justify-content: center; gap: 9px; width: fit-content; min-width: 210px; margin: 14px auto 18px; border: 0; cursor: pointer; padding: 11px 18px 11px 12px; border-radius: 999px; background: #111; color: #fff; box-shadow: 0 8px 20px rgba(17,17,17,.14); font-size: 13px; font-weight: 650; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.gallery-expand:hover { background: #292929; box-shadow: 0 10px 24px rgba(17,17,17,.18); transform: translateY(-1px); }
.gallery-expand:focus-visible { outline: 3px solid rgba(31,157,85,.30); outline-offset: 3px; }
.gallery-expand span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; font-weight: 400; line-height: 1; }

/* figure lightbox (enlarge charts) */
.fig-card summary img { cursor: zoom-in; }
.img-lightbox { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center; background: rgba(10,12,16,.82); padding: 24px; }
.img-lightbox[hidden] { display: none; }
.img-lightbox img { max-width: 95vw; max-height: 90vh; background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-close { position: absolute; top: 18px; right: 22px; border: 0; background: rgba(255,255,255,.92); border-radius: 999px; width: 38px; height: 38px; font-size: 16px; cursor: pointer; }

/* trace synced-replay video stage */
.trace-stage { background: #0d1017; }
#trace-video { width: 100%; max-height: 42vh; object-fit: contain; display: block; background: #101311; }
.trace-agents { flex: 1 1 auto; min-height: 0; }
.trace-head-actions { display: flex; align-items: center; gap: 12px; }
.trace-fulllog { font-size: 12.5px; font-weight: 600; color: #0f6b34; white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: rgba(31,157,85,.12); box-shadow: inset 0 0 0 1px rgba(31,157,85,.32); }
.trace-fulllog:hover { background: rgba(31,157,85,.20); }
.trace-fulllog-size { color: var(--faint); font-weight: 500; font-family: var(--mono); font-size: 10.5px; }
/* Keep the link visible on mobile (it's the whole point) — just drop the size badge on tiny screens. */
@media (max-width: 560px) { .trace-fulllog { font-size: 12px; padding: 7px 12px; } .trace-fulllog-size { display: none; } }

/* Live sample of one full debug log, in the Models/cognition section */
.trace-lead { margin-top: 24px; color: var(--muted); font-size: 14.5px; line-height: 1.6; max-width: 820px; }
.trace-lead a { color: #126b38; font-weight: 600; white-space: nowrap; }
.trace-sample { margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.trace-sample-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(31,157,85,.05); }
.trace-sample-label { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.trace-sample-title { font-weight: 700; font-size: 13px; }
.trace-sample-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.trace-sample-open { font-size: 12.5px; font-weight: 600; color: #0f6b34; white-space: nowrap; }
.trace-sample-frame { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; }
.trace-sample-loading { color: var(--muted); font-size: 13px; font-family: var(--mono); padding: 120px 0; }
.trace-sample-iframe { width: 100%; height: 560px; border: 0; display: block; background: #0e0e10; }
@media (max-width: 560px) { .trace-sample-iframe { height: clamp(620px, 76dvh, 780px); } }

/* traces index page */
.trace-index { width: 100%; border-collapse: collapse; }
.trace-index th, .trace-index td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.trace-index th { color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; font-weight: 500; background: var(--paper-2); }
.trace-index td.num { text-align: right; font-family: var(--mono); color: var(--muted); }
.trace-index a { color: #126b38; font-weight: 600; white-space: nowrap; }
.trace-index tr:hover td { background: #fafaf7; }

/* MARL secondary table toggle */
.rl-toggle > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: #efefeb; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 600; color: var(--ink); }
.rl-toggle > summary::-webkit-details-marker { display: none; }
.rl-toggle > summary::before { content: "\25B8\00a0"; color: var(--faint); }
.rl-toggle[open] > summary::before { content: "\25BE\00a0"; }
.rl-toggle > summary:hover { background: #e7e7e2; }
.rl-toggle .board-shell { margin-top: 16px; }
.rl-toggle .note { margin-top: 12px; }

/* Mobile results tables and interactive sections */
@media (max-width: 720px) {
  .board-shell {
    overflow: visible;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
  }

  .table-scroll {
    overflow: visible;
    padding-bottom: 0;
  }

  #board-table,
  #rl-table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
  }

  #board-table thead,
  #rl-table thead {
    display: none;
  }

  #board-table tbody,
  #rl-table tbody {
    display: grid;
    gap: 12px;
  }

  #board-table tbody tr,
  #rl-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
  }

  #board-table tbody tr.more-results-row {
    display: block;
    border-style: dashed;
    box-shadow: none;
  }

  #board-table .more-results-row td {
    display: block;
    padding: 0;
    border: 0;
  }

  #board-table .more-results-row td::before { display: none; }

  #board-table tbody tr:hover,
  #rl-table tbody tr:hover,
  #board-table tbody tr.is-marl,
  #board-table tbody tr.is-mixed {
    background: var(--paper);
  }

  #board-table td,
  #rl-table td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: auto;
    min-width: 0;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
  }

  #board-table td:last-child,
  #rl-table td:last-child {
    border-bottom: 0;
  }

  #board-table td::before,
  #rl-table td::before {
    content: attr(data-label);
    color: var(--faint);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
  }

  #board-table td[data-label="Model"],
  #rl-table td[data-label="Algorithm"] {
    grid-template-columns: 1fr;
    padding-top: 14px;
  }

  #board-table td[data-label="Model"]::before,
  #rl-table td[data-label="Algorithm"]::before {
    display: none;
  }

  #board-table .col-rank,
  #rl-table .col-rank {
    width: auto;
    text-align: left;
    color: var(--orange);
  }

  #board-table .model-cell,
  #rl-table .model-cell {
    min-width: 0;
  }

  #board-table .model-name,
  #rl-table .model-name {
    font-size: 15.5px;
    line-height: 1.2;
  }

  #board-table .model-config,
  #rl-table .model-config,
  #board-table .run-meta {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #board-table .type-run {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  #board-table .harness-link {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #board-table .num-cell,
  #rl-table .num-cell {
    min-width: 0;
  }

  #board-table .num-val,
  #rl-table .num-val {
    font-size: 13.5px;
  }

  #board-table .num-ci,
  #rl-table .num-ci {
    display: block;
    white-space: normal;
    line-height: 1.25;
  }

  #board-table .bar-track,
  #rl-table .bar-track {
    width: 100%;
    max-width: 190px;
  }

  .board-controls {
    display: grid;
    gap: 10px;
  }

  .seg,
  .seg-view {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .seg-btn {
    flex: 1 0 auto;
    min-width: max-content;
  }

  .board-meta {
    display: block;
    width: 100%;
    margin: 0;
    white-space: normal;
    line-height: 1.4;
  }

  .note {
    overflow-wrap: anywhere;
  }

  .rl-toggle > summary {
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .result-grid,
  .result-grid.six,
  .finding-layout,
  .figures-row,
  .figures-row.two,
  .figures-row.two.hetero-figures,
  .ablation-grid,
  .interface-grid,
  .interface-grid.three,
  .showcase-stack,
  .comparison-block,
  .visual-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    max-width: 100%;
  }

  .result-grid.six {
    gap: 12px;
  }

  .result-grid.six .finding-card,
  .finding-card,
  .fig-card,
  .static-fig,
  .interface-card,
  .showcase-figure,
  .visual-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .finding-card > summary {
    min-height: 0;
    padding: 18px 40px 42px 18px;
  }

  .finding-card > summary h3 {
    font-size: 18px;
  }

  .finding-card > p {
    padding: 0 18px 18px;
    font-size: 14px;
  }

  .fig-card > summary img,
  .figures-row img,
  .hetero-figures .fig-card > img,
  .ablation-grid img,
  .visual-card img {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    object-fit: contain;
    padding: 10px;
  }

  .ablation-legend img,
  .hetero-legend img {
    max-width: 100%;
    height: auto;
  }

  .model-gallery {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    scroll-snap-type: none;
    gap: 14px;
  }

  .model-gallery::after {
    content: none !important;
  }

  .model-card {
    width: 100%;
    max-width: 100%;
    flex: none;
    scroll-snap-align: none;
  }

  .model-card video,
  .showcase-figure video,
  .diff-figure video {
    width: 100%;
    height: auto;
  }

  .trace-cta {
    width: 100%;
    justify-content: center;
    border-radius: 16px;
    text-align: center;
  }

  .trace-cta-hint {
    text-align: center;
    line-height: 1.35;
  }
}

@media (max-width: 620px) {
  .trace-modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .trace-dialog,
  .md-dialog {
    width: 100vw !important;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .trace-head {
    padding: 12px 14px;
    align-items: flex-start;
  }

  .trace-model {
    display: block;
    font-size: 16px;
    line-height: 1.2;
  }

  .trace-sub {
    display: block;
    margin: 4px 0 0;
    white-space: normal;
    line-height: 1.3;
  }

  .trace-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
  }

  .trace-controls input[type=range],
  .trace-step {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .trace-controls button {
    width: 100%;
    padding: 8px 10px;
  }

  .trace-agents {
    grid-template-columns: 1fr !important;
    padding: 10px;
    gap: 10px;
  }

  .trace-agent {
    padding: 11px;
  }

  .trace-think {
    max-height: 170px;
  }

  .trace-obs pre {
    max-height: min(56dvh, 520px);
    font-size: 11px;
  }

  .md-json pre {
    max-height: 240px;
    font-size: 10.5px;
  }

  .md-body {
    padding: 14px;
  }

  .md-metas {
    grid-template-columns: 1fr;
  }

  .md-table,
  .md-table thead,
  .md-table tbody,
  .md-table tr,
  .md-table td,
  .md-table th {
    display: block;
    width: 100%;
  }

  .md-table thead {
    display: none;
  }

  .md-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
  }

  .md-table td {
    border-bottom: 1px solid var(--line);
  }

  .md-json-tools {
    flex-direction: column;
    gap: 6px;
  }
}

/* ============================================================
   v4 - motion & micro-interaction polish
   Progressive enhancement only: reveal/draw states engage under
   html.js-anim, which app.js sets when JS is available AND the
   user has not asked for reduced motion. No-JS and reduced-motion
   visitors get the complete static page.
   ============================================================ */
:root { --ease-out: cubic-bezier(.22, 1, .36, 1); }

::selection { background: rgba(31, 157, 85, .16); }

a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.button:active, .seg-btn:active, .trace-cta:active, .copy-btn:active { transform: translateY(0) scale(.98); }

/* inline links inside section intros were unmarked; give them the site link colour */
.section-head p a, .marl-head p a { color: #126b38; font-weight: 600; }
.section-head p a:hover, .marl-head p a:hover, .note a:hover, .trace-lead a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* nav: scrolled elevation, sliding underline, current-section marker */
.site-nav { transition: box-shadow .25s var(--ease-out), background .25s; }
.site-nav.is-scrolled { background: rgba(251, 251, 248, .9); box-shadow: 0 6px 24px rgba(17, 17, 17, .05); }
.site-nav nav a { position: relative; }
.site-nav nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px;
  border-radius: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .22s var(--ease-out);
}
.site-nav nav a:hover::after, .site-nav nav a.is-current::after { transform: scaleX(1); }
.site-nav nav a.is-current { color: var(--ink); }
.brand img { transition: transform .3s var(--ease-out); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }

/* hero eyebrow: the three agents as pulsing role dots (forager / miner / warrior) */
.dots { display: inline-flex; align-items: center; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }
.dots i:nth-child(1) { background: var(--green); }
.dots i:nth-child(2) { background: var(--blue); }
.dots i:nth-child(3) { background: var(--orange); }

/* clickable figure cards lift like the finding cards they sit beside */
.fig-card { transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.fig-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---------- page-load sequence (CSS only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise-in .7s var(--ease-out) backwards; }
  .hero-copy > :nth-child(1) { animation-delay: .03s; }
  .hero-copy > :nth-child(2) { animation-delay: .1s; }
  .hero-copy > :nth-child(3) { animation-delay: .18s; }
  .hero-copy > :nth-child(4) { animation-delay: .26s; }
  .hero-copy > :nth-child(5) { animation-delay: .34s; }
  .hero-copy > :nth-child(6) { animation-delay: .44s; }
  .hero-card { animation: card-in .9s var(--ease-out) .22s backwards; }
  .dots i { animation: dot-pulse 2.8s ease-in-out infinite; }
  .dots i:nth-child(2) { animation-delay: .35s; }
  .dots i:nth-child(3) { animation-delay: .7s; }
  .dot { animation: dot-breathe 3s ease-in-out infinite; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes card-in { from { opacity: 0; transform: rotate(1.4deg) translateY(24px); } }
@keyframes dot-pulse { 0%, 55%, 100% { transform: none; opacity: 1; } 12% { transform: scale(1.45); opacity: .72; } }
@keyframes dot-breathe { 50% { box-shadow: 0 0 0 9px rgba(31, 157, 85, .06); } }

/* ---------- scroll reveals (classes assigned by app.js) ---------- */
html.js-anim .reveal { opacity: 0; transform: translateY(14px); }
html.js-anim .reveal.in {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}

/* leaderboard CI bars draw themselves the first time the table is seen;
   columns sweep left to right (base, then coord, then total) */
html.js-anim .board-shell .bar-ci { transform-origin: 0 50%; transition: transform .6s var(--ease-out); }
html.js-anim .board-shell .bar-dot { transition: transform .5s var(--ease-out); }
html.js-anim .board-shell .m-base .bar-ci { transition-delay: .05s; }
html.js-anim .board-shell .m-base .bar-dot { transition-delay: .2s; }
html.js-anim .board-shell .m-coord .bar-ci { transition-delay: .17s; }
html.js-anim .board-shell .m-coord .bar-dot { transition-delay: .32s; }
html.js-anim .board-shell .m-total .bar-ci { transition-delay: .29s; }
html.js-anim .board-shell .m-total .bar-dot { transition-delay: .44s; }
html.js-anim .board-shell:not(.bars-live) .bar-ci { transform: scaleX(0); }
html.js-anim .board-shell:not(.bars-live) .bar-dot { transform: translateX(-50%) scale(0); }

/* heterogeneous member bars fill on reveal (leaderboard page) */
html.js-anim #hetero-grid .hbar-fill { transform-origin: 0 50%; transition: transform .6s var(--ease-out) .15s; }
html.js-anim #hetero-grid.reveal:not(.in) .hbar-fill { transform: scaleX(0); }

/* findings headline: the orange highlight sweeps in when the line appears */
html.js-anim .fh-emph { box-shadow: none; position: relative; }
html.js-anim .fh-emph::after {
  content: ""; position: absolute; left: -.04em; right: -.04em; bottom: .02em; height: .32em;
  background: rgba(232, 137, 40, .22); z-index: -1;
  transform: scaleX(1); transform-origin: 0 50%;
  transition: transform .8s var(--ease-out) .3s;
}
html.js-anim .reveal:not(.in) .fh-emph::after { transform: scaleX(0); transition: none; }

/* ---------- worldline: ambient coordination vignette ----------
   Three agents step across a faint grid, converge on a dashed
   target cell (the paper's coordination marker), act together,
   and disperse. Decorative; hidden on small screens and killed
   by the global reduced-motion rule. */
.worldline { max-width: var(--max); margin: -8px auto 6px; padding: 0 24px; }
.wl-stage {
  position: relative; height: 72px; overflow: hidden;
  background-image:
    linear-gradient(rgba(17, 17, 17, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, .05) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: calc(50% - 12px) 0;
  -webkit-mask-image: radial-gradient(120% 130% at 50% 50%, #000 52%, transparent 97%);
  mask-image: radial-gradient(120% 130% at 50% 50%, #000 52%, transparent 97%);
}
.wl-target {
  position: absolute; left: 50%; top: 24px; width: 24px; height: 24px;
  margin-left: -12px; box-sizing: border-box;
  border: 1.5px dashed rgba(17, 17, 17, .38); border-radius: 5px;
  opacity: 0;
  animation: wl-target 18s ease-in-out infinite;
}
.wl-target::after {
  content: ""; position: absolute; inset: -2px; border-radius: 7px;
  opacity: 0;
  animation: wl-ring 18s ease-out infinite;
}
.wl-agent {
  position: absolute; left: 50%; top: 30px; width: 12px; height: 12px;
  margin-left: -6px; border-radius: 3px; background: currentColor;
  animation-duration: 18s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}
.wl-a { color: var(--green); animation-name: wl-a; }
.wl-b { color: var(--blue); animation-name: wl-b; }
.wl-c { color: var(--orange); animation-name: wl-c; }

/* forager: in from the upper left, sits west of the target */
@keyframes wl-a {
  0%   { transform: translate(-168px, -24px); }
  4.5% { transform: translate(-144px, -24px); }
  9%   { transform: translate(-120px, -24px); }
  13.5%{ transform: translate(-96px, -24px); }
  18%  { transform: translate(-96px, 0); }
  22.5%{ transform: translate(-72px, 0); }
  27%  { transform: translate(-48px, 0); }
  32%  { transform: translate(-24px, 0); }
  62%  { transform: translate(-24px, 0); }
  66%  { transform: translate(-48px, 0); }
  70%  { transform: translate(-72px, 0); }
  74%  { transform: translate(-96px, 0); }
  78%  { transform: translate(-96px, -24px); }
  82%  { transform: translate(-120px, -24px); }
  86%  { transform: translate(-144px, -24px); }
  91%, 100% { transform: translate(-168px, -24px); }
}
/* miner: in from the lower right, sits east of the target */
@keyframes wl-b {
  0%  { transform: translate(144px, 24px); }
  6%  { transform: translate(120px, 24px); }
  12% { transform: translate(96px, 24px); }
  18% { transform: translate(72px, 24px); }
  24% { transform: translate(72px, 0); }
  29% { transform: translate(48px, 0); }
  34% { transform: translate(24px, 0); }
  63% { transform: translate(24px, 0); }
  68% { transform: translate(48px, 0); }
  73% { transform: translate(72px, 0); }
  78% { transform: translate(72px, 24px); }
  84% { transform: translate(96px, 24px); }
  90% { transform: translate(120px, 24px); }
  96%, 100% { transform: translate(144px, 24px); }
}
/* warrior: arrives last along the lower row, sits south of the target */
@keyframes wl-c {
  0%  { transform: translate(-120px, 24px); }
  7%  { transform: translate(-96px, 24px); }
  14% { transform: translate(-72px, 24px); }
  21% { transform: translate(-48px, 24px); }
  28% { transform: translate(-24px, 24px); }
  38% { transform: translate(0, 24px); }
  60% { transform: translate(0, 24px); }
  65% { transform: translate(-24px, 24px); }
  71% { transform: translate(-48px, 24px); }
  77% { transform: translate(-72px, 24px); }
  84% { transform: translate(-96px, 24px); }
  92%, 100% { transform: translate(-120px, 24px); }
}
/* the dashed target appears as agents close in, then releases them */
@keyframes wl-target {
  0%, 20% { opacity: 0; }
  30%, 60% { opacity: .8; }
  70%, 100% { opacity: 0; }
}
/* one shared pulse when all three are in position: the synchronous act */
@keyframes wl-ring {
  0%, 44% { box-shadow: 0 0 0 0 rgba(31, 157, 85, .38); opacity: 0; }
  46% { box-shadow: 0 0 0 0 rgba(31, 157, 85, .38); opacity: 1; }
  56% { box-shadow: 0 0 0 16px rgba(31, 157, 85, 0); opacity: 0; }
  100% { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); opacity: 0; }
}
@media (max-width: 720px) { .worldline { display: none; } }
@media (prefers-reduced-motion: reduce) { .worldline { display: none; } }
