@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Serif:wght@600&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  --paper: #fafaf8;
  --surface: #ffffff;
  --ink: #16191a;
  --muted: #5b5f60;
  --faint: #8a8e8f;
  --line: rgba(22, 25, 26, .12);
  --line-2: rgba(22, 25, 26, .22);
  --brand: #1e3a8a;
  --brand-wash: rgba(30, 58, 138, .06);
  --pass: #2e6b45;
  --pass-wash: rgba(46, 107, 69, .08);
  --fail: #a6372f;
  --fail-wash: rgba(166, 55, 47, .08);

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .92em; background: var(--brand-wash); padding: .1em .35em; border-radius: 2px; }
::selection { background: var(--brand); color: #fff; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------------------------------- header ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 248, .9); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 600 13px var(--mono); letter-spacing: .02em; }
.site-nav { display: flex; gap: 22px; margin-left: 8px; }
.site-nav a { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--ink); }
.header-cta { margin-left: auto; font: 500 13px var(--sans); color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 12px; }
.header-cta:hover { color: var(--ink); border-color: var(--ink); }

/* ---------------------------------- hero ---------------------------------- */
.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.hero .wrap { max-width: 820px; }
.hero-copy { min-width: 0; }
.hero-title-lockup {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 22px;
}
.hero-title-lockup > div { min-width: 0; }
.hero-logo { display: block; width: 120px; height: 120px; object-fit: contain; flex: 0 0 auto; }
.eyebrow { font: 600 11px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--brand); margin: 0 0 12px; }
.hero h1 { font-family: var(--serif); font-size: clamp(34px, 5vw, 46px); letter-spacing: -.005em; line-height: 1.1; margin: 0; }
.hero .lead { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 58ch; margin-bottom: 28px; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.button {
  display: inline-flex; align-items: center; gap: 6px; font: 600 13.5px var(--sans);
  padding: 10px 18px; border-radius: 4px; border: 1px solid transparent;
}
.button.primary { background: var(--ink); color: var(--paper); }
.button.primary:hover { background: var(--brand); }
.button.ghost { border-color: var(--line-2); color: var(--ink); }
.button.ghost:hover { border-color: var(--ink); }
.dataset-link {
  display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px var(--mono);
  color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 7px 12px;
}
.dataset-link img { width: 18px; height: 17px; flex: 0 0 auto; }
.dataset-link:hover { color: var(--ink); border-color: var(--ink); }
.meta-line { display: flex; gap: 18px; flex-wrap: wrap; font: 500 12.5px var(--mono); color: var(--faint); padding-top: 20px; border-top: 1px solid var(--line); }
.meta-line strong { color: var(--ink); font-weight: 600; }

/* ---------------------------------- stat strip ---------------------------------- */
.stat-strip { border-bottom: 1px solid var(--line); }
.stat-strip .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat-strip div { padding: 22px 20px; border-right: 1px solid var(--line); }
.stat-strip div:last-child { border-right: 0; }
.stat-strip strong { display: block; font-family: var(--serif); font-size: 25px; }
.stat-strip span { font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .03em; }

/* ---------------------------------- generic section ---------------------------------- */
.section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
.section-head { max-width: 620px; margin-bottom: 32px; }
.kicker { display: block; font: 600 11px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.section-head h2 { font-family: var(--serif); font-size: clamp(24px, 3vw, 30px); letter-spacing: -.005em; margin-bottom: 10px; }
.section-head p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* ---------------------------------- coverage ---------------------------------- */
.coverage-section .wrap { max-width: var(--max); }
.coverage-section .section-head { max-width: 620px; margin: 0 0 24px; }
.coverage-section .section-head h2 { font-size: clamp(22px, 2.5vw, 26px); }
.coverage-figure {
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.coverage-figure > a { display: block; }
.coverage-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.coverage-figure figcaption {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 500 11.5px/1.5 var(--mono);
}
.coverage-figure figcaption span { color: var(--brand); }

/* ---------------------------------- leaderboard ---------------------------------- */
.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.segmented-group { display: inline-flex; align-items: center; gap: 8px; }
.segmented-group .seg-label { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px; }
.segmented button {
  border: 0; background: transparent; padding: 6px 12px; font: 500 12.5px var(--sans);
  color: var(--muted); border-radius: 4px; cursor: pointer;
}
.segmented button.active { background: var(--ink); color: var(--paper); }
.segmented button:not(.active):hover { color: var(--ink); }

.scaffold-select {
  font: 500 12.5px var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 7px 10px;
  max-width: 190px;
}
.scaffold-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.board-table-wrap { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
table.board { width: 100%; border-collapse: collapse; }
table.board th, table.board td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.board thead th {
  background: #f4f4f1; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--faint);
  cursor: pointer; user-select: none;
}
table.board thead th.active { color: var(--brand); }
table.board thead th:not(:first-child):not(:nth-child(2)) { text-align: right; }
table.board tbody tr:last-child td { border-bottom: 0; }
table.board tbody tr:hover { background: var(--brand-wash); }
table.board td:not(:first-child):not(:nth-child(2)) { text-align: right; font-family: var(--mono); font-size: 13px; }
.rank-cell { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.rank-cell.top { color: var(--ink); }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--paper);
  font: 600 11px var(--mono);
}
.model-cell strong { display: block; font-size: 13.5px; font-weight: 600; }
.model-cell span { display: block; font-size: 11.5px; color: var(--faint); font-family: var(--mono); margin-top: 2px; }
.score-primary { font-weight: 600; color: var(--ink); }
.score-secondary { color: var(--muted); }
.board-footnote { margin-top: 12px; font: 500 11.5px var(--mono); color: var(--faint); }

/* ---------------------------------- method ---------------------------------- */
.method-list { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: 720px; }
.method-list li {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--line); counter-increment: step;
}
.method-list li:first-child { border-top: 0; }
.method-list li::before {
  content: counter(step, decimal-leading-zero); font: 600 11px var(--mono); color: var(--brand);
  padding-top: 2px; flex: 0 0 30px;
}
.method-step-body { flex: 1 1 auto; min-width: 0; }
.method-list h3 { font-size: 14.5px; margin-bottom: 4px; }
.method-list p { color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ---------------------------------- examples ---------------------------------- */
.example {
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  margin-bottom: 10px; overflow: hidden;
}
.example summary {
  list-style: none; cursor: pointer; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.example summary::-webkit-details-marker { display: none; }
.example summary .disclosure { flex-shrink: 0; color: var(--faint); font-family: var(--mono); font-size: 14px; width: 14px; text-align: center; }
.example[open] summary .disclosure::before { content: "\2212"; }
.example:not([open]) summary .disclosure::before { content: "+"; }
.example-tag { font: 600 11px var(--mono); border: 1px solid var(--line-2); border-radius: 3px; padding: 3px 7px; color: var(--muted); flex-shrink: 0; }
.example-head-text { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.example-title { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.example-repo { font: 500 11.5px var(--mono); color: var(--faint); }
.verdict-tag { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .03em; border-radius: 3px; padding: 3px 8px; flex-shrink: 0; }
.verdict-tag.fail { background: var(--fail-wash); color: var(--fail); }
.verdict-tag.pass { background: var(--pass-wash); color: var(--pass); }
.example-body { padding: 0 18px 20px; border-top: 1px solid var(--line); }
.example-body p { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 16px 0; max-width: 68ch; }
.example-instruction { margin: 16px 0; }
.example-instruction p { margin: 0 0 12px; max-width: none; }
.example-instruction p:last-child { margin-bottom: 0; }
.example-instruction h4 {
  font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .05em;
  color: var(--brand); margin: 18px 0 8px;
}
.example-instruction h4:first-child { margin-top: 0; }
.example-instruction ul { margin: 0 0 12px; padding-left: 20px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.example-instruction li { margin-bottom: 8px; }
.example-instruction li:last-child { margin-bottom: 0; }
.example-fix { font-style: italic; }
.example-body pre {
  background: #17191a; color: rgba(250, 250, 248, .85); font: 400 12px/1.7 var(--mono);
  padding: 14px 16px; border-radius: 4px; overflow-x: auto; margin: 0 0 16px;
}
.example-body pre .add { color: #7fd39d; }
.example-body pre .del { color: #e0938c; }
.example-verdicts { display: flex; gap: 6px; flex-wrap: wrap; }
.model-chip {
  font: 500 11.5px var(--mono); border: 1px solid var(--line-2); border-radius: 3px; padding: 4px 8px;
  display: inline-flex; align-items: center; gap: 5px;
}
.model-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.model-chip.pass { color: var(--pass); border-color: rgba(46,107,69,.3); }
.model-chip.pass::before { background: var(--pass); }
.model-chip.fail { color: var(--fail); border-color: rgba(166,55,47,.3); }
.model-chip.fail::before { background: var(--fail); }

/* ---------------------------------- footer ---------------------------------- */
.site-footer { padding: 28px 0 40px; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer p { font-size: 12.5px; color: var(--faint); }
.site-footer a { color: var(--brand); font-weight: 600; }

/* ---------------------------------- responsive ---------------------------------- */
@media (max-width: 700px) {
  .site-nav { display: none; }
  .hero-title-lockup { gap: 18px; }
  .hero-logo { width: 88px; height: 88px; }
  .stat-strip .wrap { grid-template-columns: repeat(2, 1fr); }
  .stat-strip div:nth-child(2n) { border-right: 0; }
  .board-table-wrap { overflow-x: auto; }
  table.board { min-width: 560px; }
  .board-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
