/* PuttBench — dark-locked, data-first benchmark site.
   No build step: hand-rolled CSS, self-hosted Geist. */

/* ---------- fonts ---------- */
@font-face { font-family: 'Geist'; src: url('fonts/geist400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/geist-mono400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/geist-mono600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --bg: #0c0d0c;
  --surface: #131513;
  --surface-2: #1a1d1a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f4f1;
  --text-2: #b8bdb6;
  --muted: #878c85;
  --accent: #3ecf8e;
  --accent-ink: #0a331f;
  --accent-dim: rgba(62, 207, 142, 0.13);
  --bad: #e5645f;
  --grid: #232623;
  --dot: #8a8f88;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --maxw: 1200px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
h1 { font-size: 32px; font-weight: 600; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
code, pre { font-family: var(--mono); font-size: 13px; }
pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.55;
}
.muted { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ---------- header / footer ---------- */
.site-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 22px; height: 22px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text-2);
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.active { color: var(--text); background: var(--surface-2); }
.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 24px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}
.site-foot a { color: var(--text-2); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 48px;
  align-items: center;
  padding: 48px 0 56px;
}
.hero h1 {
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.hero h1 em { font-style: italic; color: var(--accent); padding-bottom: 2px; }
.hero .sub {
  color: var(--text-2);
  font-size: 16px;
  max-width: 46ch;
  margin: 0 0 26px;
}
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #55d89c; color: var(--accent-ink); }

/* featured game */
.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage .poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--surface);
  display: block;
}
.stage .poster img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; transition: opacity 0.2s; }
.stage .poster:hover img { opacity: 1; }
.stage .poster .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage .poster .play span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 13, 12, 0.82);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(4px);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.stage .poster:hover .play span { border-color: var(--accent); color: var(--accent); }
.stage-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.stage-caption a { color: var(--text-2); }

/* ---------- stat strip ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 0 56px;
}
.stat {
  padding: 18px 20px 16px;
}
.stat + .stat { border-left: 1px solid var(--border); }
.stat .label { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.stat .value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.stat .value small { font-size: 14px; color: var(--text-2); font-weight: 500; margin-left: 4px; }

/* ---------- sections ---------- */
.section { margin: 0 0 64px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 6px;
}
.section-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* segmented version control */
.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: 500 13px var(--sans);
  padding: 6px 14px;
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-2); color: var(--text); }

/* ---------- leaderboard table ---------- */
.table-wrap { overflow-x: auto; margin-top: 14px; }
table.lb {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}
table.lb th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-strong);
  cursor: pointer;
  user-select: none;
}
table.lb th:hover { color: var(--text-2); }
table.lb th.nosort { cursor: default; }
table.lb td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.lb tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
table.lb .num, table.lb th.num { text-align: right; }
table.lb .rank { color: var(--muted); font-family: var(--mono); width: 34px; }
table.lb tr.top .rank { color: var(--accent); font-weight: 600; }
.model-cell a { font-weight: 500; }
.model-cell .provider { font-size: 12px; color: var(--muted); margin-left: 7px; }

/* score cell: number + trackless micro-bar */
.score-cell { min-width: 120px; }
.score-cell .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.score-bar { height: 3px; border-radius: 2px; background: var(--accent); margin: 5px 0 0 auto; opacity: 0.85; }
.score-bar.low { background: var(--dot); }

/* check pips */
.pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.pip.ok { color: var(--accent); background: var(--accent-dim); }
.pip.no { color: var(--bad); background: rgba(229, 100, 95, 0.12); }

.badge {
  display: inline-block;
  font: 500 11px var(--mono);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
}
.badge.fail { color: var(--bad); border-color: rgba(229, 100, 95, 0.4); }
.badge.api { color: var(--muted); }

.stars { color: var(--accent); letter-spacing: 1px; }
.depth-ok { color: var(--accent); font-weight: 600; }
.depth-broken { color: var(--bad); }
.playlink { font-weight: 500; color: var(--accent); }
.playlink:hover { text-decoration: underline; }

/* ---------- charts ---------- */
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 10px;
  position: relative;
}
.chart-card h3 { margin: 0 0 2px; font-size: 15px; }
.chart-card .chart-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-card svg text { font-family: var(--sans); }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: #202320;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  display: none;
  z-index: 5;
  max-width: 220px;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.chart-tip b { font-family: var(--mono); font-weight: 600; }
.chart-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* ---------- funnel / methodology summary ---------- */
.method-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  margin-top: 16px;
}
.gate-list { list-style: none; margin: 0; padding: 0; counter-reset: gate; }
.gate-list li {
  counter-increment: gate;
  padding: 14px 0 14px 44px;
  position: relative;
}
.gate-list li + li { border-top: 1px solid var(--border); }
.gate-list li::before {
  content: counter(gate);
  position: absolute;
  left: 0;
  top: 16px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font: 600 12.5px var(--mono);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-list b { display: block; margin-bottom: 1px; }
.gate-list p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.funnel-row { margin-bottom: 18px; }
.funnel-row .frow-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 5px;
}
.funnel-row .frow-head b { color: var(--text); font-family: var(--mono); }
.funnel-row .fbar { height: 5px; border-radius: 3px; background: var(--accent); }

/* ---------- run cards / detail pages ---------- */
.runcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 16px 0;
}
.runcard .game, .game {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #000;
  margin-top: 12px;
}
.game.tall { aspect-ratio: 16 / 9; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0;
}
.meta b { color: var(--text-2); font-weight: 500; font-family: var(--mono); }
.shots { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.shots img {
  height: 96px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}
.shots a:hover img { border-color: var(--accent); }
pre.errors {
  color: var(--bad);
  font-size: 12px;
  max-height: 260px;
  overflow: auto;
}
details { margin: 10px 0; }
details summary { cursor: pointer; color: var(--text-2); font-size: 13.5px; }
.pct { font-family: var(--mono); font-weight: 600; }

/* generic results table (runs page, subscores) */
table.results { width: 100%; border-collapse: collapse; font-size: 14px; }
table.results th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-strong);
}
table.results td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
table.results .num { text-align: right; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: rgba(255, 255, 255, 0.02); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
}
select, textarea, input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font: 14px var(--sans);
}
select:focus, textarea:focus, input:focus, .btn:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- arcade ---------- */
.arcade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.cab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cab .stage { border: 0; border-radius: 0; border-bottom: 1px solid var(--border); aspect-ratio: 16 / 10; }
/* arcade tiles: keep screenshots unobstructed — the action pill appears on hover */
.cab .stage .play { opacity: 0; transition: opacity 0.15s; }
.cab .stage .poster:hover .play,
.cab .stage .poster:focus-visible .play { opacity: 1; }
.cab .stage a.poster { text-decoration: none; }
.cab .cab-meta { padding: 12px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cab .cab-meta b { font-size: 14px; font-weight: 550; }
.cab .cab-meta .num { color: var(--text-2); font-size: 13px; }

/* ---------- compare ---------- */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.pane { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }

/* ---------- review box ---------- */
.review { display: grid; gap: 10px; max-width: 560px; }
.review textarea { width: 100%; resize: vertical; }
button.star { background: none; border: 0; font-size: 22px; color: var(--accent); cursor: pointer; padding: 2px; }

/* ---------- methodology page ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 40px; }
.prose p, .prose li { color: var(--text-2); font-size: 14.5px; }
.prose b, .prose strong { color: var(--text); }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.prose pre code { background: none; padding: 0; }

/* ---------- entry motion (subtle, once) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .hero > *:nth-child(2) { animation-delay: 0.08s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .charts { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; gap: 28px; }
  .arcade-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .site-head { height: auto; flex-direction: column; align-items: flex-start; padding-top: 14px; gap: 8px; }
  .site-nav { flex-wrap: wrap; }
  .arcade-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  main { padding: 0 16px 60px; }
}

/* run-page score breakdown (glanceable) */
.score-breakdown { margin: 14px 0 6px; max-width: 560px; }
.sb-bar {
  height: 12px; border-radius: 6px; overflow: hidden;
  background: rgba(229, 100, 95, 0.28); /* the gap = lost points */
}
.sb-earned { height: 100%; background: var(--accent); border-radius: 6px 0 0 6px; }
.sb-line { margin-top: 8px; font-size: 13.5px; line-height: 2; }
.loss-chip {
  display: inline-block; background: rgba(229, 100, 95, 0.12);
  border: 1px solid rgba(229, 100, 95, 0.35); color: inherit;
  border-radius: 20px; padding: 1px 10px; margin-right: 6px; white-space: nowrap;
}
.loss-chip b { color: var(--bad); font-weight: 600; }
.score-breakdown details { margin-top: 10px; }
.score-breakdown summary { cursor: pointer; color: var(--muted); font-size: 13px; }
