/* Business Arena, site v3. Shared tokens and components for every page.
   Brand: Arena Black and White, Paper for soft surfaces, Charcoal and Graphite for data only.
   Quattrocento for display and numbers in headlines, Quattrocento Sans for reading and data.
   Texture (grain) is reserved for the one principal object on each page. */

:root {
  --black: #0E0E0E;
  --charcoal: #272727;
  --graphite: #333333;
  --paper: #F7F7F7;
  --white: #FFFFFF;

  --bg: var(--white);
  --fg: var(--black);
  --surface: var(--paper);
  --muted: rgba(14, 14, 14, 0.64);
  --faint: rgba(14, 14, 14, 0.4);
  --rule: rgba(14, 14, 14, 0.12);
  --rule-strong: rgba(14, 14, 14, 0.28);
  --track: rgba(14, 14, 14, 0.08);
  --btn-bg: var(--black);
  --btn-fg: var(--white);

  --display: "Quattrocento", Georgia, "Times New Roman", serif;
  --text: "Quattrocento Sans", "Helvetica Neue", Arial, sans-serif;
  --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1280px;
  --pad: clamp(20px, 4vw, 48px);
  --gap: 24px;
  --band: clamp(80px, 10vw, 144px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
}

/* Dark reading surface (system preference or ?theme=dark). The black bands look the same in both. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--black);
    --fg: var(--white);
    --surface: #161616;
    --muted: rgba(255, 255, 255, 0.66);
    --faint: rgba(255, 255, 255, 0.42);
    --rule: rgba(255, 255, 255, 0.14);
    --rule-strong: rgba(255, 255, 255, 0.32);
    --track: rgba(255, 255, 255, 0.1);
    --btn-bg: var(--white);
    --btn-fg: var(--black);
  }
}
:root[data-theme="dark"] {
  --bg: var(--black);
  --fg: var(--white);
  --surface: #161616;
  --muted: rgba(255, 255, 255, 0.66);
  --faint: rgba(255, 255, 255, 0.42);
  --rule: rgba(255, 255, 255, 0.14);
  --rule-strong: rgba(255, 255, 255, 0.32);
  --track: rgba(255, 255, 255, 0.1);
  --btn-bg: var(--white);
  --btn-fg: var(--black);
}

/* Always-black band (hero and headers). Re-scopes the tokens so every component inside inverts. */
.band--black {
  --bg: var(--black);
  --fg: var(--white);
  --surface: #161616;
  --muted: rgba(255, 255, 255, 0.66);
  --faint: rgba(255, 255, 255, 0.42);
  --rule: rgba(255, 255, 255, 0.14);
  --rule-strong: rgba(255, 255, 255, 0.32);
  --track: rgba(255, 255, 255, 0.1);
  --btn-bg: var(--white);
  --btn-fg: var(--black);
  background: var(--black);
  color: var(--white);
}
.band--paper { background: var(--surface); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.55;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
::selection { background: var(--fg); color: var(--bg); }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--pad)); margin: 0 auto; padding-inline: max(var(--pad), env(safe-area-inset-left)) max(var(--pad), env(safe-area-inset-right)); }
.band { padding-block: var(--band); }
.band + .band:not(.band--black):not(.band--paper) { border-top: 1px solid var(--rule); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--pad); top: 12px; background: var(--bg); padding: 8px 12px; z-index: 10; }

/* Type. Display sizes follow the brand scale (96, 48, 24) and step down on small screens. */
h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: -0.04em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(52px, 7vw, 96px); line-height: 0.98; }
h2 { font-size: clamp(34px, 4vw, 48px); line-height: 1.04; }
h3 { font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
.lede { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.45; color: var(--muted); max-width: 34em; text-wrap: pretty; }
.body { color: var(--muted); max-width: 36em; text-wrap: pretty; }
.body + .body { margin-top: 16px; }
.small { font-size: 15px; line-height: 1.5; color: var(--muted); }
.code { font-family: var(--code); font-size: 0.86em; }
.num { font-variant-numeric: lining-nums tabular-nums; }

/* Nav: sits inside the first black band on every page. */
.nav { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 22px; letter-spacing: -0.03em; }
.brand svg { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 28px; font-size: 16px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color var(--fast) var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
@media (max-width: 720px) {
  .nav { height: 64px; }
  .nav-links { gap: 18px; font-size: 15px; }
  .nav-links a:not(.keep) { display: none; }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 22px; border: 1px solid var(--fg);
  font: 700 16px/1 var(--text); text-decoration: none; cursor: pointer;
  background: transparent; color: var(--fg);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn--solid { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn:hover { background: var(--fg); color: var(--bg); }
.btn--solid:hover { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn:active { transform: scale(0.98); }
.btn--small { height: 36px; padding: 0 14px; font-size: 14px; }
.link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--fg); }

/* Section head: title left, short text right on wide screens. */
.head { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gap); align-items: end; margin-bottom: 48px; }
.head .small, .head .body { justify-self: end; text-align: right; max-width: 30em; }
@media (max-width: 860px) {
  .head { grid-template-columns: 1fr; gap: 12px; }
  .head .small, .head .body { justify-self: start; text-align: left; }
}

/* Rows: name, text, status. Used for evals, offers, engines. */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: minmax(180px, 3fr) 6fr minmax(120px, 3fr); gap: var(--gap); padding: 24px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.row-name { font-family: var(--display); font-size: 28px; line-height: 1.1; letter-spacing: -0.03em; }
.row-name a { text-decoration: none; }
.row-name a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.row-text { color: var(--muted); text-wrap: pretty; }
.row-status { font-size: 15px; color: var(--muted); text-align: right; }
@media (max-width: 860px) {
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row-status { text-align: left; }
}

/* Leaderboard table, shared by home and eval pages. */
.lb { width: 100%; border-collapse: collapse; font-size: 16px; }
.lb th { text-align: left; font-weight: 400; font-size: 14px; color: var(--muted); padding: 0 12px 12px 0; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.lb td { padding: 16px 12px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.lb .r { text-align: right; }
.lb .rank { width: 48px; color: var(--muted); }
.lb .who { font-family: var(--display); font-size: 21px; letter-spacing: -0.02em; line-height: 1.15; }
.lb .who small { display: block; font-family: var(--text); font-size: 14px; letter-spacing: 0; color: var(--muted); margin-top: 2px; }
.lb .kind { color: var(--muted); font-size: 15px; white-space: nowrap; }
.lb .val { white-space: nowrap; }
.lb .val b { font-weight: 700; }
.lb .ci { color: var(--muted); font-size: 14px; }
.lb tr.pending td { color: var(--muted); }
.lb tr.pending .who { color: var(--fg); }
.lb-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lb-caption { margin-top: 16px; }

/* Diverging bar with interval whisker: zero sits at --zero (0..1) of the track. */
.bar { position: relative; height: 10px; min-width: 160px; background: var(--track); }
.bar .zero { position: absolute; top: -6px; bottom: -6px; width: 1px; background: var(--rule-strong); }
.bar .fill { position: absolute; top: 0; bottom: 0; background: var(--fg); }
.bar .ci-line { position: absolute; top: 4px; height: 2px; background: var(--fg); opacity: 0.45; }
.bar .ci-cap { position: absolute; top: 1px; width: 1px; height: 8px; background: var(--fg); opacity: 0.45; }

/* Footer */
.footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--gap); padding-block: 40px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }
.footer .wit { font-family: var(--display); font-size: 20px; color: var(--fg); letter-spacing: -0.02em; }
.footer nav { justify-self: end; display: flex; gap: 20px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--fg); }
@media (max-width: 720px) {
  .footer { grid-template-columns: 1fr; justify-items: start; }
  .footer nav { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* Fixes after QA (15 Nov). */
[hidden] { display: none !important; }
.brand { min-height: 44px; }
.nav-links a, .footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
@media (pointer: coarse) { .btn--small { height: 44px; padding: 0 16px; } }

/* In dark mode the black bands sit on a black page: mark every edge between a black band and the next block with one hairline. */
:root[data-theme="dark"] .band--black + .band:not(.band--black),
:root[data-theme="dark"] .band--black + footer,
:root[data-theme="dark"] .band:not(.band--black) + .band--black { border-top: 1px solid rgba(255, 255, 255, 0.14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .band--black + .band:not(.band--black),
  :root:not([data-theme="light"]) .band--black + footer,
  :root:not([data-theme="light"]) .band:not(.band--black) + .band--black { border-top: 1px solid rgba(255, 255, 255, 0.14); }
}
:root[data-theme="dark"] header.band--black + main > .band:first-child:not(.band--black),
:root[data-theme="dark"] main:has(> .band--black:last-child) + footer { border-top: 1px solid rgba(255, 255, 255, 0.14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) header.band--black + main > .band:first-child:not(.band--black),
  :root:not([data-theme="light"]) main:has(> .band--black:last-child) + footer { border-top: 1px solid rgba(255, 255, 255, 0.14); }
}
