:root {
  --stanford: #8C1515;
  --stanford-dark: #5a0e0e;
  --ink: #1a1a1a;
  --muted: #5b5b5b;
  --line: #e5e5e5;
  --bg: #ffffff;
  --bg-alt: #f7f5f2;
  --accent: #2f6fed;
  --good: #2f9e44;
  --bad: #c92a2a;
  --gold: #fadf4b;
  --silver: #d8dee3;
  --bronze: #e7b481;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(140,21,21,.08), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(47,111,237,.06), transparent 60%),
    linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 56px;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  background: var(--stanford);
  color: white;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.title {
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 28px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.authors {
  font-size: 16px;
  color: #333;
  margin: 0 auto 14px;
  max-width: 920px;
  line-height: 1.8;
}

.authors a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted #bbb;
}
.authors a:hover { color: var(--stanford); border-bottom-color: var(--stanford); }

.affiliations {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}

.footnote-authors {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 32px;
}

.cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--stanford);
  color: white;
}
.btn-primary:hover { background: var(--stanford-dark); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-secondary {
  background: white;
  color: var(--ink);
  border-color: #d4d4d4;
}
.btn-secondary:hover { background: #f2f2f2; transform: translateY(-1px); }
.btn-secondary[aria-disabled="true"] { opacity: .65; cursor: not-allowed; pointer-events: none; }

/* ---------- Sections ---------- */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}
.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--stanford);
  margin-top: 10px;
  border-radius: 2px;
}
.subsection-title {
  font-size: 20px;
  font-weight: 700;
  margin: 48px 0 14px;
}
.section-sub {
  color: #333;
  max-width: 900px;
  margin: 0 0 28px;
  font-size: 16px;
}

/* ---------- Figures ---------- */
.figure {
  margin: 24px 0 0;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 12px;
  border-radius: 6px;
}
.figure figcaption {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  text-align: left;
}

.figure-wide {
  margin-top: 24px;
}
.figure-wide img {
  width: 100%;
  height: auto;
}

.stats-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 800px) {
  .stats-grid-2col { grid-template-columns: 1fr; }
}

/* ---------- Abstract ---------- */
.abstract {
  font-size: 16.5px;
  line-height: 1.75;
  color: #222;
  max-width: 980px;
}

/* ---------- Stats grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 12px;
  margin: 4px 0 40px;
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--stanford);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 620px;
}
thead th {
  background: #fafafa;
  font-weight: 600;
  color: #333;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f2f2f2;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fcfaf7; }

/* domain table */
.domain-table td:first-child { font-weight: 600; color: var(--stanford); width: 32%; }

/* comparison table */
.compare-table th, .compare-table td { text-align: center; }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; font-weight: 500; }
.compare-table td.c { color: var(--good); font-weight: 700; }
.compare-table td.x { color: #c0c0c0; }
.compare-table tr.ours td { background: #fff7e6; font-weight: 600; }
.compare-table tr.ours td.c { color: var(--good); }

/* ---------- Leaderboard ---------- */
.leaderboard-controls {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}
.tab {
  background: white;
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  transition: all .15s ease;
}
.tab:hover { border-color: var(--stanford); color: var(--stanford); }
.tab.active {
  background: var(--stanford);
  color: white;
  border-color: var(--stanford);
}

.leaderboard td.rank {
  width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--muted);
}
.leaderboard th.rank { width: 42px; }
.leaderboard .agent { font-weight: 600; }
.leaderboard .overall { width: 38%; }
.leaderboard td:not(.agent):not(.rank) { font-variant-numeric: tabular-nums; }

.leaderboard tr.gold td.rank { color: #b88800; }
.leaderboard tr.silver td.rank { color: #808a94; }
.leaderboard tr.bronze td.rank { color: #a36a3b; }
.leaderboard tr.gold, .leaderboard tr.silver, .leaderboard tr.bronze {
  background: linear-gradient(90deg, rgba(250,223,75,.08) 0%, transparent 40%);
}
.leaderboard tr.silver { background: linear-gradient(90deg, rgba(160,170,180,.10) 0%, transparent 40%); }
.leaderboard tr.bronze { background: linear-gradient(90deg, rgba(231,180,129,.14) 0%, transparent 40%); }

.bar-wrap {
  position: relative;
  background: #f1eee9;
  border-radius: 6px;
  height: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}
.bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--stanford) 0%, #b83232 100%);
  border-radius: 6px;
  transition: width .4s ease;
}
.bar-val {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  font-weight: 700;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}

.lb-footnote {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Citation ---------- */
.bibtex {
  background: #1e1e1e;
  color: #e8e8e8;
  padding: 20px 22px;
  border-radius: var(--radius);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  overflow-x: auto;
  line-height: 1.55;
  box-shadow: var(--shadow);
}
.bibtex code { font-family: inherit; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 0 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  .section { padding: 56px 0; }
  .stat-value { font-size: 24px; }
}
