:root {
  color-scheme: dark;
  --ink: #0c1c24;
  --ink-2: #0f2630;
  --panel: #11303b;
  --panel-2: #143a47;
  --line: rgba(243, 237, 224, 0.12);
  --line-2: rgba(243, 237, 224, 0.22);
  --ivory: #f3ede0;
  --ivory-2: #c9cfc8;
  --muted: #82979c;
  --amber: #f0a44e;
  --amber-deep: #d9772b;
  --teal: #74c7b6;
  --grid: rgba(243, 237, 224, 0.08);
  --radius: 6px;
  --radius-lg: 10px;
  --display: "Space Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ivory);
  font-family: var(--sans);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 620px at 92% -10%, rgba(240, 164, 78, 0.16), transparent 58%),
    radial-gradient(1000px 640px at -10% -4%, rgba(95, 185, 168, 0.12), transparent 56%),
    var(--ink);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.site-shell {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 110px;
}

/* ---------- bezel header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.brand-mark {
  position: relative;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--amber);
  border-radius: 50%;
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 50% 0 0 50%;
  width: 7.5px;
  height: 1.5px;
  background: var(--amber);
  transform-origin: left center;
  transform: rotate(-38deg);
}
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  padding: 7px 13px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1.5px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.nav-links a:hover { color: var(--ivory); }
.nav-links a[aria-current="page"] { color: var(--ivory); border-bottom-color: var(--amber); }

main { padding-top: 38px; }

/* ---------- type ---------- */
.eyebrow {
  margin: 0 0 22px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--amber); opacity: 0.7; }
h1, h2, h3 { margin-top: 0; font-family: var(--display); color: var(--ivory); }
h1 {
  font-size: clamp(3rem, 8.5vw, 6.2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 26px;
}
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.08; margin-bottom: 12px; }
h3 { font-size: 1.04rem; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 6px; }
p { margin-top: 0; }
.lede {
  font-family: var(--sans);
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.55;
  color: var(--ivory-2);
  max-width: 54ch;
}

/* ---------- buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.button.primary { color: var(--ink); background: var(--amber); border-color: var(--amber); }
.button.primary:hover { background: var(--amber-deep); border-color: var(--amber-deep); }
.button.primary::after { content: "\2192"; }
.button.secondary { color: var(--ivory); }
.button.secondary:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- hero ---------- */
.hero { padding-bottom: 8px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(232px, 300px); gap: 56px; align-items: center; }
.hero-copy { min-width: 0; }
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: 1.16; letter-spacing: -0.02em; max-width: 30ch; margin-bottom: 16px; }
.hero .lede { font-size: clamp(1rem, 1.2vw, 1.08rem); line-height: 1.55; max-width: 56ch; margin-bottom: 0; }

/* leader readout — the page's primary answer */
.hero-leader {
  position: relative;
  padding: 24px 26px 26px;
  border: 1px solid rgba(240, 164, 78, 0.4);
  border-radius: var(--radius-lg);
  background: linear-gradient(158deg, rgba(240, 164, 78, 0.12), rgba(17, 48, 59, 0.45));
  overflow: hidden;
}
.hero-leader::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--amber);
}
.hl-label { display: block; font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.hl-name { display: block; font-family: var(--display); font-size: 2.6rem; font-weight: 500; line-height: 1; letter-spacing: -0.02em; color: var(--ivory); }
.hl-stat { margin: 14px 0 0; font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.03em; color: var(--muted); }
.hl-stat-value { font-size: 1.18rem; font-weight: 500; color: var(--amber); font-variant-numeric: tabular-nums; margin-right: 4px; }

/* ---------- principles ---------- */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 72px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.principle { padding: 28px 26px; background: var(--ink); }
.principle .tag {
  display: block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}
.principle h2 { font-size: 1.16rem; margin-bottom: 10px; }
.principle p { font-family: var(--sans); color: var(--ivory-2); margin: 0; font-size: 0.98rem; line-height: 1.55; }

/* ---------- boundary ---------- */
.boundary { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); gap: 44px; align-items: start; margin-top: 80px; padding-top: 40px; border-top: 1px solid var(--line); }
.boundary p { font-family: var(--sans); color: var(--ivory-2); margin: 0; font-size: 1.04rem; line-height: 1.55; }

/* ---------- results ---------- */
.page-hero { padding-bottom: 6px; margin-bottom: 36px; max-width: 64ch; }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 34px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.summary-strip > div { padding: 20px 24px; background: var(--ink); }
.summary-strip span { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.summary-strip strong { display: block; font-family: var(--mono); font-size: clamp(1.3rem, 2.3vw, 1.7rem); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.scorecard-table { margin-top: 48px; }
#scorecard-title { margin-top: 0; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }

/* model/effort earns a column only when it varies between rows */
#runs.no-policy thead th:nth-child(3),
#runs.no-policy tbody td[data-label="Model / effort"] { display: none; }

.empty-state { border: 1px dashed var(--line-2); border-radius: var(--radius-lg); padding: 18px; color: var(--muted); }

.table-frame { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { padding: 13px 18px; font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); background: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 140ms ease; }
tbody tr:hover { background: rgba(240, 164, 78, 0.05); }
td { padding: 14px 18px; }
td { font-family: var(--mono); color: var(--ivory-2); font-variant-numeric: tabular-nums; }

.rank-pill { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: var(--radius); font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.harness-cell { font-family: var(--display); }
.harness-cell strong { display: block; font-size: 1.02rem; font-weight: 500; color: var(--ivory); }
.harness-cell span, .subtle { color: var(--muted); font-size: 0.76rem; font-family: var(--mono); }
.harness-cell span { display: block; margin-top: 3px; white-space: normal; line-height: 1.45; }

th.num { text-align: right; }
td[data-label="Cost / task"], td[data-label="Uncached tokens / task"] { text-align: right; }
.tok-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tok-cell > span:first-child { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ivory); }
.tok-breakdown { font-size: 0.68rem; letter-spacing: 0.01em; line-height: 1.3; }
td[data-label="Model / effort"] { color: var(--muted); font-size: 0.82rem; }

.score-cell { min-width: 150px; }
.score-value { display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ivory); }
.score-value > span:first-child { font-size: 1.04rem; }

/* crown the leader */
tbody tr.is-leader { background: rgba(240, 164, 78, 0.07); }
tbody tr.is-leader:hover { background: rgba(240, 164, 78, 0.1); }
tbody tr.is-leader .rank-pill { background: var(--amber); color: var(--ink); border-color: var(--amber); }
tbody tr.is-leader .score-value > span:first-child { color: var(--amber); font-size: 1.2rem; }

.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 999px; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; color: var(--ivory-2); }

/* ---------- methodology ---------- */
.methodology { margin-top: 64px; padding-top: 44px; border-top: 1px solid var(--line); }
.methodology > h2 { margin-bottom: 20px; }
.method-list { counter-reset: method; display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px 56px; }
.method { counter-increment: method; padding-top: 18px; border-top: 1px solid var(--line); }
.method::before { content: counter(method, decimal-leading-zero); display: block; margin-bottom: 11px; font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em; color: var(--teal); }
.method h3 { font-size: 1.14rem; font-weight: 500; letter-spacing: -0.01em; color: var(--ivory); margin-bottom: 8px; }
.method-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; width: 100%; padding: 0; background: none; border: 0; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.method-head h3 { margin: 0; }
.method-head:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.method-toggle { flex: none; margin-top: 2px; font-family: var(--mono); font-size: 1.1rem; line-height: 1; color: var(--muted); }
.method-toggle::before { content: "+"; }
.method:hover .method-toggle::before, .method:focus-within .method-toggle::before, .method.is-open .method-toggle::before { content: "\2013"; color: var(--amber); }
.method-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 260ms cubic-bezier(.2,.7,.2,1); }
.method-body-inner { overflow: hidden; }
.method:hover .method-body, .method:focus-within .method-body, .method.is-open .method-body { grid-template-rows: 1fr; }
.method p { font-family: var(--sans); color: var(--ivory-2); margin: 0; font-size: 1rem; line-height: 1.6; }
.method-body-inner > p { margin-top: 10px; }
.method [data-policy] { font-family: var(--mono); font-size: 0.9em; color: var(--ivory); }

/* ---------- responsive ---------- */
/* ---------- load motion (one orchestrated moment) ---------- */
@keyframes rowIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
tbody tr { animation: rowIn 460ms cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--row, 0) * 80ms); }

@media (max-width: 860px) {
  main { padding-top: 28px; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { max-width: none; }
  .principles, .method-grid, .method-list, .summary-strip { grid-template-columns: 1fr; }
  .boundary { grid-template-columns: 1fr; gap: 22px; }
  .cal-row { grid-template-columns: 32px 1fr auto; grid-template-areas: "rank id read" "plot plot plot"; gap: 6px 16px; }
  .cal-rank { grid-area: rank; }
  .cal-id { grid-area: id; }
  .cal-read { grid-area: read; }
  .cal-plot { grid-area: plot; margin-top: 6px; }
  .cal-axis { grid-template-areas: "plot plot plot"; }
  .cal-axis .cal-rank, .cal-axis .cal-id, .cal-axis .cal-read { display: none; }
}

/* stack the scorecard into cards so it never scrolls sideways on small screens */
@media (max-width: 680px) {
  .table-frame { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { padding: 16px 18px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  tbody tr:hover { background: none; }
  td { border: 0; padding: 6px 0; white-space: normal; text-align: left; }
  td[data-label="Model / effort"] { font-size: 0.82rem; }
  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--muted);
  }
  td[data-label="Rank"] { padding-top: 0; }
  td[data-label="Rank"]::before, td[data-label="Harness"]::before { display: none; }
  .score-cell { min-width: 0; }
  .score-value { justify-content: flex-start; gap: 12px; }
}

@media (max-width: 540px) {
  .site-shell { width: calc(100% - 30px); padding-bottom: 64px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- sortable headers ---------- */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--ivory); }
th.sortable::after { content: "\2195"; margin-left: 6px; opacity: 0.4; font-size: 0.85em; }
th.sortable.sort-active { color: var(--ivory); }
th.sortable.sort-active[data-dir="desc"]::after { content: "\2193"; opacity: 1; color: var(--amber); }
th.sortable.sort-active[data-dir="asc"]::after { content: "\2191"; opacity: 1; color: var(--amber); }
th.sortable:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }

/* ---------- pareto (capability vs token efficiency) ---------- */
.pareto { margin-top: 64px; padding-top: 44px; border-top: 1px solid var(--line); }
.pareto > h2 { margin-bottom: 10px; }
.pareto .lede { max-width: 64ch; margin-bottom: 22px; }
.pareto-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ink-2); padding: 14px 16px; }
.pareto-svg { display: block; width: 100%; height: auto; }
.pareto-note { margin-top: 16px; font-family: var(--sans); color: var(--ivory-2); font-size: 0.98rem; line-height: 1.55; max-width: 72ch; }
.pg-frame { fill: none; stroke: var(--line); }
.pg-grid { stroke: var(--grid); stroke-width: 1; }
.pg-axisline { stroke: var(--line-2); stroke-width: 1; }
.pareto-svg text { font-family: var(--mono); }
.pg-tick { fill: var(--muted); font-size: 11px; }
.pg-axistitle { fill: var(--ivory-2); font-size: 12px; letter-spacing: 0.04em; }
.pg-name { fill: var(--ivory); font-family: var(--display); font-size: 14px; font-weight: 500; }
.pg-val { fill: var(--muted); font-size: 11px; }
.pg-point circle { fill: var(--teal); stroke: var(--ink); stroke-width: 1.5; }
.pg-point .pg-name { fill: var(--ivory); }
.pg-point.leader circle { fill: var(--amber); }
.pg-point.leader .pg-name { fill: var(--amber); }
@media (max-width: 540px) { .pg-name { font-size: 16px; } .pg-tick, .pg-val { font-size: 13px; } }

/* ---------- footer ---------- */
.site-foot { margin-top: 64px; padding-top: 22px; padding-bottom: 8px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.foot-meta { margin: 0; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.03em; color: var(--muted); }
.foot-meta [data-foot-updated], .foot-meta [data-foot-harnesses] { color: var(--ivory-2); }
.foot-links { display: flex; gap: 20px; }
.foot-links a { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.03em; color: var(--muted); border-bottom: 1px solid transparent; padding-bottom: 1px; transition: color 140ms ease, border-color 140ms ease; }
.foot-links a:hover { color: var(--ivory); border-bottom-color: var(--amber); }

@media (max-width: 540px) {
  .site-foot { flex-direction: column; align-items: flex-start; gap: 14px; }
}
