/* SVCBench project page - editorial, ink-on-paper, single accent.
   Light theme only (print-emulating editorial). */

:root {
  --content: 1080px;
  --wide: 1200px;

  --paper: #f4f3ef;
  --surface: #fbfaf8;
  --surface-2: #efede7;
  --ink: #1b1d22;
  --muted: #5a5d67;
  --faint: #8b8e98;
  --line: rgba(27, 29, 34, 0.12);
  --line-soft: rgba(27, 29, 34, 0.07);

  --accent: #27408b;
  --accent-deep: #1d3068;
  --accent-soft: rgba(39, 64, 139, 0.08);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
p { margin: 0; }

::selection { background: var(--accent-soft); }

.kicker {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.prose {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.06rem;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  width: min(100%, var(--wide));
  margin: 0 auto;
  height: 62px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; }
.brand-mark { width: 26px; height: 26px; object-fit: contain; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; }

.nav-links { display: flex; gap: 1.4rem; }
.nav-links a {
  position: relative;
  font-size: 0.92rem;
  color: var(--muted);
  padding: 0.2rem 0;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; background: var(--accent);
}

.nav-code {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-code:hover { border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 820px) { .nav-links { display: none; } }

/* ---------- Layout ---------- */
.section {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 6rem 1.5rem;
}
.section-alt {
  width: 100%;
  max-width: none;
  padding: 6rem 0;
  background: var(--surface);
  border-block: 1px solid var(--line-soft);
}
.section-alt > * { width: min(100%, var(--content)); margin-inline: auto; padding-inline: 1.5rem; }

.head { max-width: 70ch; margin-bottom: 3rem; }
.head h2, .lead-block h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); margin-bottom: 1.1rem; }
.head .prose { margin-top: 0; }

/* ---------- Hero ---------- */
.hero {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 5.5rem 1.5rem 3.5rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 3.5rem;
  align-items: center;
}
.hero-art { margin: 0; }
.hero-art img { display: block; width: 100%; height: auto; }
.hero-title {
  font-size: clamp(3.4rem, 8vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.96;
}
.hero-tagline {
  margin-top: 1rem;
  max-width: 24ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.95rem);
  font-weight: 400;
  line-height: 1.22;
  color: var(--ink);
}
.hero-text {
  margin-top: 1.6rem;
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2.2rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.85rem;
  padding: 0 1.15rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-quiet { background: transparent; }

.facts {
  display: grid;
  grid-template-columns: repeat(5, auto);
  justify-content: start;
  gap: 2.4rem;
  margin: 3.4rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.facts div { display: flex; flex-direction: column; }
.facts dt {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.facts dd { margin: 0.3rem 0 0; font-size: 0.84rem; color: var(--faint); }

/* ---------- Byline ---------- */
.byline {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 0 1.5rem 4.5rem;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}
.authors { max-width: 68ch; margin: 0 auto; font-size: 1.05rem; line-height: 1.7; }
.authors sup { color: var(--accent); font-size: 0.7em; }
.affils {
  list-style: none;
  margin: 1.1rem auto 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.6rem;
  max-width: 76ch;
  color: var(--muted);
  font-size: 0.92rem;
}
.affils sup { color: var(--accent); }
.corr { margin-top: 0.6rem; color: var(--faint); font-size: 0.84rem; }
.corr sup { color: var(--accent); }
.orgs { display: flex; align-items: center; justify-content: center; gap: 1.8rem; margin-top: 1.8rem; }
.org { display: inline-flex; align-items: center; height: 38px; opacity: 0.85; transition: opacity 0.2s var(--ease); }
.org:hover { opacity: 1; }
.org img { height: 34px; width: auto; object-fit: contain; }
.org-meituan img { height: 22px; }

/* ---------- Figures ---------- */
.fig { margin: 0; }
.fig img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.fig-wide img { padding: 1.2rem; }
.fig-center { max-width: 720px; margin-left: auto; margin-right: auto; }
.fig-center figcaption { text-align: center; }
.fig figcaption {
  margin-top: 0.9rem;
  max-width: 70ch;
  color: var(--faint);
  font-size: 0.9rem;
  line-height: 1.55;
}
.lead-block { margin-bottom: 3rem; }
#overview .fig { margin-top: 0; }

/* ---------- Taxonomy ---------- */
.tax-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3.5rem;
  margin-bottom: 3.2rem;
}
.tax-fam {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 0.9rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.tax-row { display: flex; gap: 1.1rem; padding: 1.1rem 0; }
.tax-row + .tax-row { border-top: 1px solid var(--line-soft); }
.tax-id {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  padding-top: 0.2rem;
  width: 2rem;
}
.tax-row h3 { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; margin-bottom: 0.35rem; letter-spacing: 0; }
.tax-row p { color: var(--muted); font-size: 0.96rem; }

/* ---------- Data table ---------- */
.table-wrap { margin-top: 3rem; overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.stats-table caption { text-align: left; color: var(--faint); font-size: 0.88rem; margin-bottom: 1rem; }
.stats-table th, .stats-table td { padding: 0.62rem 0.8rem; text-align: right; }
.stats-table thead th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.stats-table tbody th { text-align: left; font-weight: 400; color: var(--ink); }
.stats-table td { font-family: var(--mono); color: var(--muted); }
.stats-table thead th:first-child { text-align: left; }
.stats-table tbody tr { border-bottom: 1px solid var(--line-soft); }
.stats-table tr.grp th { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; }
.stats-table tr.grp { background: var(--accent-soft); }
.stats-table tr.grp td { color: var(--ink); }
.stats-table tbody th:not(.grp th) { padding-left: 1.4rem; }
.stats-table tr.grp th { padding-left: 0.8rem; }

/* ---------- Metrics ---------- */
.metrics-list { display: grid; gap: 0; }
.metric { display: flex; gap: 1.5rem; padding: 1.8rem 0; align-items: baseline; }
.metric + .metric { border-top: 1px solid var(--line); }
.metric-tag {
  flex: 0 0 auto;
  width: 4.5rem;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.metric h3 { font-family: var(--sans); font-weight: 600; font-size: 1.15rem; margin-bottom: 0.4rem; letter-spacing: 0; }
.metric p { color: var(--muted); max-width: 60ch; }

/* ---------- Leaderboard ---------- */
.board {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.board-head, .board-row {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 2.1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
}
.board-head {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.col-gpa { text-align: right; }
.board-row { border-bottom: 1px solid var(--line-soft); transition: background 0.18s var(--ease); }
.board-row:last-child { border-bottom: 0; }
.board-row:hover { background: var(--accent-soft); }
.board-row.human { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.r-name { display: flex; align-items: baseline; gap: 0.7rem; font-weight: 500; }
.r-rank { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); width: 1.6rem; }
.r-cat { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.r-bar { display: flex; align-items: center; gap: 0.8rem; }
.bar-track { position: relative; flex: 1; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; border-radius: 99px; background: var(--accent); transition: transform 1s var(--ease); }
.human .bar-fill { background: var(--ink); }
.bar-val { width: 2.8rem; text-align: right; font-family: var(--mono); font-size: 0.95rem; font-weight: 500; }
.r-extra {
  grid-column: 1 / -1;
  display: none;
  gap: 1.4rem;
  padding-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.board-row:hover .r-extra { display: flex; }
.board-note { margin-top: 1.4rem; color: var(--muted); font-size: 0.95rem; max-width: 70ch; }
.board-note strong { color: var(--ink); }

/* ---------- Findings ---------- */
.finding-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.finding img { padding: 0.9rem; }
.finding figcaption { font-size: 0.95rem; color: var(--muted); }
.finding figcaption strong { color: var(--ink); font-weight: 600; }

/* ---------- Citation ---------- */
.cite { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.cite-file { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.copy {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.copy:hover { border-color: var(--accent); }
.cite pre { margin: 0; padding: 1.3rem; overflow-x: auto; background: var(--surface); }
.cite code { font-family: var(--mono); font-size: 0.85rem; line-height: 1.7; color: var(--ink); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner {
  width: min(100%, var(--wide));
  margin: 0 auto;
  padding: 2.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--serif); font-weight: 600; }
.footer-brand img { width: 22px; height: 22px; object-fit: contain; }
.footer-links { display: flex; gap: 1.4rem; }
.footer-links a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
[data-anim] { opacity: 0; transform: translateY(18px); }
.anim-ready [data-anim] { will-change: opacity, transform; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .hero-art { max-width: 560px; }
  .tax-grid { grid-template-columns: 1fr; gap: 2rem; }
  .finding-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(3, auto); gap: 1.6rem 2rem; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 4rem 1.25rem; }
  .section-alt { padding: 4rem 0; }
  .section-alt > * { padding-inline: 1.25rem; }
  .hero { padding: 3.5rem 1.25rem 2.5rem; }
  .facts { grid-template-columns: repeat(2, auto); }
  .board-head, .board-row { grid-template-columns: 1.4fr 1.7fr; }
  .col-cat { display: none; }
  .r-cat { display: none; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-anim] { opacity: 1; transform: none; }
  .bar-fill { transition: none !important; }
}
