/* crbench — cyberpunk neon theme (dark slate, magenta + cyan glow). Vanilla CSS, no build step.
   Neon lives in borders, rules and washes — not behind glyphs. A 0-offset text-shadow lights up the
   gaps between strokes, which is the contrast the eye actually reads by; a contrast checker only
   compares text to page and never sees it. See the two display exceptions below. */
:root {
  --bg: #0a0e16;
  --bg2: #070a11;
  --panel: #0f1420;
  --panel2: #161d2e;      /* zebra band — ΔL* 4.5 from --panel, enough to track a row by */
  --row-hover: #1f2a3f;   /* stays clear of the zebra band and of every text colour's AA floor */
  --fg: #c2cfe0;
  --muted: #8b9bb4;       /* 6.85:1 on --bg, 6.52:1 on --panel */
  --line: #2b3a52;
  --neon: #ff2d8f;        /* magenta primary — borders, rules, gradients */
  --neon-text: #ff5ba7;   /* magenta at text sizes: 6.40:1 on --panel, 5.00:1 on --row-hover */
  --neon-dim: #b51e68;
  --cyan: #19e6e6;        /* secondary */
  --cyan-dim: #0f9aa0;
  --add: #15c08a;         /* diff additions */
  --add-bg: #0c2a22;
  --del: #ff4d6d;         /* diff removals — borders and backgrounds */
  --del-text: #ff6b85;    /* red at text sizes, safe on the hover band */
  --del-bg: #2a0f17;
  --crit: #ff5ba7;
  --high: #ff8a3d;
  --med: #19e6e6;
  --low: #8b9bb4;
  --display: "Share Tech Mono", ui-monospace, monospace;   /* ≥20px only */
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(255,45,143,.10), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(25,230,230,.07), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255,255,255,.012) 2px 3px),
    var(--bg);
  color: var(--fg);
  font: 17px/1.65 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--neon-text); }
a.ext { font-size: .82em; color: var(--muted); }
a.ext:hover { color: var(--cyan); }

/* Cyan and the body colour are both ~12:1 on this ground, so they are 1.02:1 against *each other*:
   hue is the only thing telling a link from a sentence. No hex fixes that — prose links get a rule. */
main p a, main li a, .tagline a, .body a, footer a {
  text-decoration: underline;
  text-underline-offset: .18em;
  text-decoration-thickness: .07em;
}

a:focus-visible, summary:focus-visible, .pill-btn:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px 80px; }

/* Header / nav */
header.top {
  border-bottom: 1px solid var(--line);
  /* opaque: content used to scroll visibly behind the nav text */
  background: linear-gradient(180deg, rgba(255,45,143,.06), transparent), var(--bg);
  position: sticky; top: 0; z-index: 5;
}
header.top .wrap { padding: 14px 20px; display: flex; align-items: center; gap: 24px; }
.brand {
  font-family: var(--display);
  font-size: 25px; letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 .12em rgba(255,45,143,.35);   /* display-scale strokes survive a trace of glow */
}
.brand b { color: var(--neon); }
nav.main { display: flex; gap: 20px; margin-left: auto; font-family: var(--mono); letter-spacing: .5px; text-transform: uppercase; font-size: 14px; }

h1, h2, h3 { font-family: var(--display); letter-spacing: 1px; color: #eaf2ff; }
h1 { font-size: 34px; text-shadow: 0 0 .12em rgba(25,230,230,.35); margin: 28px 0 6px; }
h2 { font-size: 22px; color: var(--cyan); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 36px; }
h3 { font-size: 20px; color: var(--neon-text); }
main p, .body, .tagline { max-width: 72ch; text-wrap: pretty; }
.tagline { color: var(--muted); margin-top: 0; }
/* Primary explanatory copy — the text that says what the benchmark measures is not metadata. */
.legend { color: var(--fg); }

/* Cards / stat tiles */
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0; }
.stat {
  flex: 1 1 140px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 16px; box-shadow: 0 0 0 1px rgba(25,230,230,.04), 0 8px 30px rgba(0,0,0,.4);
}
.stat .n { font-family: var(--display); font-size: 34px; color: #fff; }
.stat .l { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.stat .sub { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .3px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 14px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
caption { caption-side: top; text-align: left; padding: 0 2px 8px; font-size: 13.5px; max-width: 72ch; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }   /* right-alignment only helps if digits share a width */
th:nth-child(2), td:nth-child(2), th.l, td.l { text-align: left; white-space: normal; }
/* prose-heavy tables (e.g. methodology) wrap freely; numeric leaderboard cells stay nowrap */
td.l { word-break: break-word; }
thead th { font-family: var(--mono); font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--cyan); background: var(--bg2); }
thead th a { color: inherit; border-bottom: 1px dotted var(--cyan-dim); }
thead th a:hover { color: #fff; border-bottom-color: #fff; }
/* Row banding does the row-tracking work that a 1.6:1 hairline cannot on a near-black ground. */
tbody tr:nth-child(even) { background: var(--panel2); }
tbody tr:hover { background: var(--row-hover); }
td.bot a { font-weight: 600; }
.rank { color: var(--muted); }
.lead td { color: #fff; }
/* The winner's rating stays magenta — it is the one number the board exists to point at. Dropping
   the same-hue glow is what buys the legibility here: magenta-on-magenta read at 4.39:1 local,
   the flat magenta reads at 6.40:1. */
.lead .score { color: var(--neon-text); font-weight: 700; }
.score { font-family: var(--mono); }
.ci { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .2px; white-space: nowrap; }
.muted { color: var(--muted); }

/* Severity pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .5px; border: 1px solid; }
/* a flat wash, not an inset glow — the glow sat directly behind 12px glyphs */
.sev-critical { color: var(--crit); border-color: var(--neon); background: rgba(255,45,143,.12); }
.sev-high { color: var(--high); border-color: var(--high); }
.sev-medium { color: var(--med); border-color: var(--med); }
.sev-low { color: var(--low); border-color: var(--low); }
.verdict-valid { color: var(--add); border: 1px solid var(--add); }
.verdict-invalid { color: var(--del-text); border: 1px solid var(--del); }
.verdict-minor, .verdict-uncertain { color: var(--muted); border: 1px solid var(--muted); }
.found-yes { color: var(--add); } .found-no { color: var(--del-text); }
/* Per-case leaderboard — difficulty + per-bot result pills */
.diff-easy { color: var(--add); border-color: var(--add); }
.diff-medium { color: var(--med); border-color: var(--med); }
.diff-hard { color: var(--crit); border-color: var(--neon); background: rgba(255,45,143,.12); }
.res-solved { color: var(--add); border: 1px solid var(--add); }
.res-partial { color: var(--med); border: 1px solid var(--med); }
.res-miss { color: var(--del-text); border: 1px solid var(--del); }
.xf { color: var(--cyan); border: 1px solid var(--cyan); }
.sec { color: var(--crit); border: 1px solid var(--crit); }
/* Pill-buttons (head-to-head links on bot pages, bot links on h2h pages) */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 24px; }
.pill-btn {
  display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--cyan); font-size: 13px;
  font-family: var(--mono); letter-spacing: .3px;
  transition: border-color .15s, box-shadow .15s, color .15s;
}
.pill-btn:hover {
  border-color: var(--cyan); color: var(--cyan);
  box-shadow: 0 0 .6em rgba(25,230,230,.25) inset;
}
/* Coverage-by-severity: each row shows the rate and expands to the missed defects */
details.sev-cov { border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; background: var(--panel); }
details.sev-cov > summary { cursor: pointer; padding: 10px 14px; display: flex; align-items: center; gap: 14px; list-style: none; }
details.sev-cov > summary::-webkit-details-marker { display: none; }
details.sev-cov > summary::before { content: "\25B8"; color: var(--cyan); font-size: 13px; transition: transform .15s ease; }
details.sev-cov[open] > summary::before { transform: rotate(90deg); }
details.sev-cov .cov-score { font-family: var(--mono); color: #fff; min-width: 120px; }
details.sev-cov .bar { flex: 1; max-width: 280px; }
/* the "caught everything" state is carried by the pill and a full bar — fading the row just made
   already-marginal text worse */
/* Leaderboard confidence pills */
.conf-high { color: var(--add); border: 1px solid var(--add); }
.conf-medium { color: var(--med); border: 1px solid var(--med); }
.conf-low { color: var(--del-text); border: 1px solid var(--del); }
/* one width for every level (sized to MEDIUM, the longest) so the CI text after it lines up */
.conf-high, .conf-medium, .conf-low { box-sizing: content-box; min-width: calc(6ch + 3px); text-align: center; }
/* Methodology pairwise win matrix — compact, row label sticky-ish, diagonal muted */
.matrix-wrap { overflow-x: auto; }
table.matrix { font-size: 12.5px; }
table.matrix th, table.matrix td { padding: 5px 8px; text-align: right; white-space: nowrap; }
table.matrix td.l, table.matrix th.l { text-align: left; color: var(--cyan); }

/* Per-bot block on a trace page — a clear neon divider + header bar between bots */
.botblock { margin-top: 34px; border-top: 1px solid var(--line); }
.botblock .bothead {
  font-family: var(--display); font-size: 21px; letter-spacing: 1px;
  color: #fff; background: linear-gradient(90deg, rgba(255,45,143,.16), transparent 70%);
  border-left: 4px solid var(--neon); padding: 10px 14px; margin: 14px 0 12px;
}
.botblock .bothead a { color: #fff; }
.botblock .bothead a:hover { color: var(--neon-text); }

/* Cards for findings / defects */
.card { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 6px; padding: 12px 14px; margin: 10px 0; }
.card.defect { border-left-color: var(--neon); }
.card .meta { color: var(--muted); font-size: 13px; margin-bottom: 4px; font-family: var(--mono); }
.body { white-space: pre-wrap; word-break: break-word; }

/* Diff */
details.diff { margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg2); }
details.diff summary { cursor: pointer; padding: 10px 14px; font-family: var(--mono); color: var(--cyan); }
pre.diff { margin: 0; padding: 8px 0; overflow-x: auto; font: 13.5px/1.55 ui-monospace, SFMono-Regular, monospace; }
pre.diff .ln { display: block; padding: 0 14px; white-space: pre; }
pre.diff .add { background: var(--add-bg); color: #b9ffe6; }
pre.diff .del { background: var(--del-bg); color: #ffc4cf; }
pre.diff .hunk { color: var(--cyan); }
pre.diff .meta { color: var(--muted); }

/* Sparkline / trajectory — a glow on a graphic, where it costs no legibility */
.spark { stroke: var(--neon); fill: none; stroke-width: 2; filter: drop-shadow(0 0 3px var(--neon-dim)); }
.spark-dot { fill: var(--cyan); }
.spark-axis { stroke: var(--line); stroke-width: 1; }

footer { color: var(--muted); border-top: 1px solid var(--line); margin-top: 50px; padding: 20px; text-align: center; font-size: 14px; }
.bar { height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden; display: inline-block; width: 90px; vertical-align: middle; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--neon)); }

/* ── Responsive: phones & small tablets ──────────────────────────────────────
   The dense data tables (the 9-column leaderboard especially) scroll
   horizontally instead of letting the browser crush columns — which was
   character-wrapping bot names into unreadable vertical strings. Methodology
   prose tables have no .data class, so they keep wrapping normally. */
td.bot { white-space: nowrap; }   /* a bot name never breaks mid-word, at any width */

@media (max-width: 820px) {
  body { font-size: 15px; }
  .wrap { padding: 0 14px 60px; }
  h1 { font-size: 26px; margin: 20px 0 6px; }
  h2 { font-size: 19px; margin-top: 28px; }
  h3 { font-size: 18px; }

  /* Header: the nav drops below the brand instead of overflowing the row. */
  header.top .wrap { flex-wrap: wrap; gap: 8px 16px; padding: 12px 14px; }
  .brand { font-size: 21px; }
  nav.main { margin-left: 0; width: 100%; gap: 14px; font-size: 13px; flex-wrap: wrap; }

  /* Data tables become a horizontally-scrollable block; every cell keeps its line. */
  table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 7px 10px; }

  .stats { gap: 10px; }
  .stat { flex: 1 1 100px; padding: 10px 12px; }
  .stat .n { font-size: 26px; }
}

/* ── Reader overrides ────────────────────────────────────────────────────────
   The identity stays as loud as it likes by default; anyone who needs a flat,
   high-contrast page can have one. */
@media (prefers-contrast: more) {
  :root { --fg: #e6edf7; --muted: #b3c0d4; --line: #47587a; --neon-text: #ff8ec2; --crit: #ff8ec2; }
  * { text-shadow: none !important; }
  body { background: var(--bg); }          /* drops the scanline and the radial washes */
  .brand, h1 { text-shadow: none; }
  .spark { filter: none; }
  .pill-btn:hover { box-shadow: none; }
  main p a, main li a, .tagline a, .body a, footer a, thead th a { text-decoration: underline; }
}

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

/* Diff-size breakdown: edge over the field, and the small-vs-large verdict pill */
.pos { color: var(--add); font-family: var(--mono); }
.neg { color: var(--del-text); font-family: var(--mono); }
.size-verdict {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--cyan);
  border-radius: 6px; padding: 12px 16px; margin: 10px 0 16px;
}
.size-verdict ul { margin: 10px 0 8px; padding-left: 20px; }
.size-verdict p { margin: 0; }
.howto {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 18px 14px; margin: 18px 0 24px;
}
.howto h2 { margin-top: 12px; }
.howto ol { padding-left: 20px; }
.howto li { margin: 6px 0; }
.howto .example { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 0; }
table.sizes .big { font-size: 16px; color: #fff; }
table.sizes .sub, .size-verdict .sub { font-size: 12.5px; color: var(--muted); }
.size-ahead { color: var(--add); border-color: var(--add); }
.size-pace { color: var(--med); border-color: var(--med); }
.size-behind { color: var(--del-text); border-color: var(--del); }
