/* MediaStormBench site. Black-and-white like the MediaStorm site; the footage and the charts carry the colour. */
:root {
  color-scheme: light;
  --ink: #0c0c0c;
  --paper: #ffffff;
  --mist: #f4f4f1;
  --line: #e2e2de;
  --axis: #c4c4be;
  --grey: #5d5d59;
  --muted: #85857f;
  --accent: #4b43c9;
  --bar: #2b2b2a;
  --bar-base: #a9a9a3;
  --sans: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --display: "Avenir Next", "Helvetica Neue", "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  --nav-h: 60px;
  --col-min: 26px;
  /* one colour per developer; the logo and the name under each bar carry the identity, colour only groups */
  --dev-anthropic: #eb6834; --dev-openai: #2b2b2a; --dev-google: #1baf7a; --dev-alibaba: #eda100;
  --dev-moonshot: #2a78d6; --dev-deepseek: #6250d6; --dev-none: #a9a9a3;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, dl, dd, table { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.muted { color: var(--muted); }

/* ---------- navigation ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--nav-h); display: flex; align-items: center; gap: 36px;
  padding: 0 28px; color: #fff; transition: background-color .2s, color .2s, box-shadow .2s; }
.nav.solid { background: rgba(255, 255, 255, .96); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: italic 800 19px/1 var(--display); letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; }
.nav nav { display: flex; gap: 28px; margin-left: auto; }
.nav nav a { text-decoration: none; font-size: 14.5px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav nav a:hover { border-bottom-color: currentColor; }
.lang-switch { flex: none; display: flex; border: 1.5px solid currentColor; border-radius: 99px; padding: 2px; }
.lang-switch button { font: 600 13px/1 var(--sans); color: inherit; background: none; border: 0; border-radius: 99px; padding: 5px 10px; cursor: pointer; opacity: .7; }
.lang-switch button:hover { opacity: 1; }
/* the current language is filled: white on the dark top of the page, ink once the nav turns solid */
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); opacity: 1; cursor: default; }
.nav.solid .lang-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
/* ---------- top of the page: name and introduction, then one benchmark question to try ---------- */
.top { background: var(--ink); color: #fff; padding: calc(var(--nav-h) + 40px) 28px 56px; }
.top-in { max-width: 1320px; margin: 0 auto; }
.top-head { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 64px; align-items: start; padding-bottom: 36px; border-bottom: 1px solid rgba(255, 255, 255, .18); }
.top h1 { font: italic 800 clamp(34px, 4.4vw, 62px)/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.top-text p { max-width: 40em; font-size: 16.5px; line-height: 1.55; color: rgba(255, 255, 255, .84); }
.top-text p + p { margin-top: 10px; }
.top-text b { color: #fff; font-weight: 700; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.link-btn { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; background: #fff; color: var(--ink); border-radius: 99px; padding: 8px 20px 8px 16px; font-size: 15px; font-weight: 600; }
.link-btn img { width: 18px; height: 18px; }
a.link-btn:hover { background: var(--mist); }
.link-btn.is-pending { font-weight: 400; }
.link-btn small { font-size: 12.5px; color: var(--muted); }

.game { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 52px; grid-template-areas: "frame title" "frame body"; grid-template-rows: auto 1fr; padding-top: 36px; }
.game h2 { grid-area: title; max-width: none; font: italic 800 clamp(26px, 3.2vw, 46px)/1.06 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.game-frame { grid-area: frame; display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #1c1c1c; align-self: start; }
.game-body { grid-area: body; }
.game-sub { margin-top: 16px; max-width: 34em; font-size: 16px; color: rgba(255, 255, 255, .82); }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.chip { cursor: pointer; background: none; color: #fff; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 99px; padding: 7px 15px; font-size: 15px; line-height: 1.2; white-space: nowrap; }
.chip:hover:not(:disabled) { background: #fff; color: var(--ink); border-color: #fff; }
.chip:disabled { cursor: default; opacity: .45; }
.chip.is-answer { opacity: 1; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.chip.is-answer::before { content: "✓ "; }
.chip.is-miss { opacity: .9; border-style: dashed; text-decoration: line-through; }
.verdict { min-height: 3.2em; margin-top: 18px; max-width: 34em; font-size: 16px; color: rgba(255, 255, 255, .9); }
.verdict b { color: #fff; font-weight: 700; }
.game-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.btn-ghost { cursor: pointer; text-decoration: none; background: none; color: #fff; border: 0; border-bottom: 1.5px solid rgba(255, 255, 255, .7); padding: 4px 0; margin-right: 18px; font-size: 15px; }
.btn-ghost:hover { border-bottom-color: #fff; }

/* ---------- sections ---------- */
.block { padding-top: 76px; padding-bottom: 20px; }
h2 { font: italic 800 clamp(26px, 3.4vw, 40px)/1.08 var(--display); letter-spacing: -.015em; max-width: 21em; text-wrap: balance; }
.lead { margin-top: 12px; max-width: 44em; color: var(--grey); }
.note { margin-top: 8px; font-size: 13.5px; color: var(--muted); max-width: 52em; }
.question { margin: 16px 0; padding: 14px 20px; max-width: 44em; border-left: 3px solid var(--ink); background: var(--mist); font-size: 17px; font-weight: 600; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 26px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills:empty { display: none; }
.pills button { cursor: pointer; background: var(--paper); border: 1.5px solid var(--axis); border-radius: 99px; padding: 5px 14px; font-size: 14px; }
.pills button:hover { border-color: var(--ink); }
.pills button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- leaderboard chart: one column per model, coloured by developer, logo and name underneath ---------- */
.card { margin-top: 28px; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px 20px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; }
.card-head h3 { font: 700 18px/1.3 var(--sans); }
/* the title block takes the room left of the score buttons and wraps its text there, so switching scores
   (whose descriptions differ in length) never moves the buttons; two lines are kept for the description */
.card-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.card-head > .pills { flex: 0 0 auto; }
.card-head .card-sub { min-height: calc(2 * 1.45em); line-height: 1.45; }
.card-sub { margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: 13px; color: var(--grey); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }
.vscroll { overflow-x: auto; margin-top: 14px; }
.vchart { position: relative; padding-left: 40px; min-width: calc(var(--col-min) * 12 + 40px); }
.vgrid { position: absolute; left: 40px; right: 0; top: 0; pointer-events: none; }
.hline { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.hline:first-child { background: var(--axis); }
.hline span { position: absolute; right: 100%; margin-right: 8px; transform: translateY(50%); bottom: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vcols { position: relative; display: flex; justify-content: space-around; gap: 2px; }
.vcol { flex: 1 1 0; min-width: var(--col-min); max-width: 84px; display: flex; flex-direction: column; align-items: center; border-radius: 6px; cursor: default; }
.vcol:hover, .vcol:focus-visible { background: var(--mist); }
.varea { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.vval { position: relative; z-index: 2; padding: 0 3px; border-radius: 3px; background: var(--paper); font-size: 12.5px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.vcol:hover .vval, .vcol:focus-visible .vval { background: var(--mist); }
.vbar { width: 28px; max-width: 70%; border-radius: 4px 4px 0 0; }
.vlogo { width: 18px; height: 18px; margin-top: 9px; }
.vname { margin: 8px 0 6px; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12.5px; line-height: 1.2; }
.vcol.is-baseline .vname { color: var(--muted); }
/* Chinese names stand upright when set vertically; only Latin names are rotated to read bottom-to-top. */
:lang(zh) .vname.is-cjk { transform: none; text-orientation: upright; letter-spacing: 1px; }
.ref-layer { z-index: 1; }
.ref { position: absolute; left: 0; right: 0; height: 0; }
.legend .legend-ref i { width: 18px; height: 0; border-radius: 0; }
.ref.ref-chance, .legend-ref.ref-chance i { border-top: 1.5px dashed rgba(12, 12, 12, .55); }
.ref.ref-always, .legend-ref.ref-always i { border-top: 2px dotted #c23b3b; }
/* phones held upright (app.js switches at 600px): one horizontal bar per model. The bars, grid and reference
   lines share one x axis: from the end of the name column to the room kept for the value label. */
.hchart { position: relative; --hname: 132px; --hval: 42px; padding: 4px 0 24px; }
.hrows { position: relative; margin: 0; padding: 0; list-style: none; }
.hrow { display: grid; grid-template-columns: var(--hname) minmax(0, 1fr); align-items: center; min-height: 30px; }
.hname { display: flex; align-items: center; gap: 7px; min-width: 0; padding-right: 8px; font-size: 12.5px; line-height: 1.2; }
.hname span:last-child { overflow-wrap: anywhere; }
.hrow.is-baseline .hname { color: var(--muted); }
.hlogo { flex: none; width: 16px; height: 16px; }
.htrack { display: flex; align-items: center; padding-right: var(--hval); }
.hbar { flex: none; min-width: 2px; height: 14px; border-radius: 0 3px 3px 0; }
.hval { margin-left: 5px; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hlayer { position: absolute; top: 0; bottom: 24px; left: var(--hname); right: var(--hval); pointer-events: none; }
.hrefs { z-index: 1; }
.hgrid .vline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.hgrid .vline:first-child { background: var(--axis); }
.hgrid .vline span { position: absolute; top: 100%; margin-top: 5px; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hrefs .ref { top: 0; bottom: 0; right: auto; width: 0; height: auto; border-top: 0; }
.hrefs .ref.ref-chance { border-left: 1.5px dashed rgba(12, 12, 12, .55); }
.hrefs .ref.ref-always { border-left: 2px dotted #c23b3b; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; margin-top: 28px; }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.grid th, table.grid td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid th:first-child, table.grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); }
table.grid thead th { vertical-align: bottom; font-weight: 600; border-bottom: 2px solid var(--ink); }
table.grid thead th button { cursor: pointer; background: none; border: 0; padding: 0; text-align: right; font-weight: inherit; line-height: 1.35; }
table.grid thead th button:hover { text-decoration: underline; }
table.grid th.is-on, table.grid td.is-on { background: var(--mist); }
table.grid td.is-best { font-weight: 700; }
table.grid tr.is-baseline td { color: var(--grey); }
table.grid td i { font-style: normal; color: var(--muted); font-size: 12.5px; margin-left: 8px; }
table.grid th:first-child, table.grid td.rk { width: 34px; text-align: left; color: var(--muted); position: static; }
table.grid th:nth-child(2), table.grid td:nth-child(2) { text-align: left; }
.tmodel { display: flex; align-items: center; gap: 10px; }
.tlogo { flex: none; width: 18px; height: 18px; }

/* ---------- samples ---------- */
h3 { font: 700 18px/1.3 var(--sans); margin-top: 44px; }
.card-head h3 { margin-top: 0; }
.folds { margin-top: 14px; border-top: 1px solid var(--line); }
.fold { border-bottom: 1px solid var(--line); }
.fold summary { display: flex; align-items: baseline; gap: 14px; padding: 13px 4px; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; margin-left: auto; font-size: 20px; line-height: 1; color: var(--grey); }
.fold[open] summary::after { content: "–"; }
.fold summary:hover { background: var(--mist); }
.fold summary b { font-size: 16px; font-weight: 600; }
.fold summary span { font-size: 13.5px; color: var(--muted); }
.sample-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px 14px; padding: 8px 4px 26px; }
.sample { margin: 0; }
.sample img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--mist); border-radius: 4px; }
.sample b { display: block; margin-top: 8px; font-size: 14.5px; font-weight: 600; }
.sample span { display: block; font-size: 13px; color: var(--muted); }

/* Chinese headings: CJK fonts have no italic, and a slanted 800 weight looks smeared */
:lang(zh) h2, :lang(zh) .game h2 { font-style: normal; letter-spacing: 0; word-break: keep-all; }

/* ---------- about, footer ---------- */
#contact a { color: var(--ink); font-weight: 600; }
.foot { margin-top: 96px; background: var(--mist); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 30px; padding-bottom: 30px; font-size: 14px; }

.tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; max-width: 280px; }
.tip b { display: block; font-size: 14px; }
.tip span { display: block; color: rgba(255, 255, 255, .7); margin-bottom: 4px; }
.tip table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tip td { padding: 0 12px 0 0; color: rgba(255, 255, 255, .8); }
.tip td:last-child { padding-right: 0; text-align: right; color: #fff; }

@media (max-width: 820px) {
  .nav { gap: 14px; padding: 0 16px; }
  /* the header text scrolls under the nav sooner on a phone: keep it dark until it turns solid white */
  .nav:not(.solid) { background: rgba(12, 12, 12, .94); }
  .nav nav { display: none; }
  .lang-switch { margin-left: auto; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top { padding: calc(var(--nav-h) + 20px) 16px 36px; }
  .top-head { grid-template-columns: minmax(0, 1fr); row-gap: 16px; padding-bottom: 26px; }
  .game { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "frame" "body"; row-gap: 16px; padding-top: 26px; }
  .chip { font-size: 14px; padding: 6px 12px; }
  .card { padding: 16px 14px; }
  .vval { font-size: 11px; background: none; padding: 0; }
  .vbar { width: 16px; }
  /* narrow screens: the score buttons go above the title, where description length cannot move them */
  .card-head > .pills { order: -1; flex: 1 1 100%; }
  .sample-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fold summary { flex-wrap: wrap; gap: 2px 12px; }
}
/* phones held upright: the chart turns horizontal (app.js), the table tightens until all three scores fit */
@media (max-width: 600px) {
  .vscroll { overflow-x: visible; }
  table.grid { font-size: 13px; }
  table.grid th, table.grid td { padding: 7px 5px; }
  table.grid thead th { white-space: normal; }
  :lang(zh) table.grid thead th { word-break: keep-all; }
  table.grid th:first-child, table.grid td.rk { width: 20px; }
  table.grid td:nth-child(2) { white-space: normal; }
  table.grid td i { display: none; } /* the logo already names the developer */
  .tmodel { gap: 8px; }
  .tlogo { width: 16px; height: 16px; }
}
/* the smallest phones (320–400px): the one-word title and the nav bar shrink so nothing runs off the side */
@media (max-width: 400px) {
  .top h1 { font-size: min(34px, 9.4vw); }
  .nav { gap: 10px; padding: 0 12px; }
  .brand { gap: 8px; font-size: 16px; }
  .brand svg { width: 26px; height: 26px; }
  .lang-switch button { padding: 5px 8px; }
  table.grid th, table.grid td { padding: 7px 3px; }
  .tmodel { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav { transition: none; }
}
