/* ============================================================================
   BIGBANG — design system
   deep space · accretion gold · hairline structure
   ============================================================================ */

:root {
  --bg:        #04060b;
  --bg-2:      #080b13;
  --panel:     rgba(233, 235, 241, 0.025);
  --ink:       #e9ebf1;
  --dim:       rgba(233, 235, 241, 0.64);
  --faint:     rgba(233, 235, 241, 0.38);
  --line:      rgba(233, 235, 241, 0.10);
  --line-soft: rgba(233, 235, 241, 0.06);
  --gold:      #d8b26a;
  --gold-2:    #f0d9a8;
  --gold-dim:  rgba(216, 178, 106, 0.55);
  --ice:       #a8c6e8;
  --bar-gray:  rgba(233, 235, 241, 0.16);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, "Helvetica Neue", sans-serif;
  --mono:  "IBM Plex Mono", "SF Mono", Menlo, monospace;

  --pad: clamp(1.25rem, 4vw, 3rem);
  --max: 1160px;

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

/* ── reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--bg-2) 0%, var(--bg) 55%) fixed,
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: #e3b341; color: #05070b; }

/* ── scrollbar ─────────────────────────────────────────────────────────── */
html { scrollbar-width: thin; scrollbar-color: rgba(233,235,241,0.16) transparent; }
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(233,235,241,0.14); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(216,178,106,0.4); }

/* ── scroll progress hairline ──────────────────────────────────────────── */
.progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 1px; z-index: 70;
  background: linear-gradient(90deg, #a37c36, var(--gold-2));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* ── drop cap ──────────────────────────────────────────────────────────── */
.lead::first-letter {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 3.3em;
  line-height: 0.78;
  float: left;
  padding: 0.08em 0.14em 0 0;
  color: var(--gold-2);
}

/* ── neo-grotesque layer (wordmarks, card titles) ──────────────────────── */
:root { --grot: "Space Grotesk", var(--sans); }
.nav-brand, .footer-brand {
  font-family: var(--grot);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.32em;
}
.card h3 {
  font-family: var(--grot);
  font-weight: 500;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

:focus-visible { outline: 1px solid var(--gold-dim); outline-offset: 3px; }

/* ── grain ─────────────────────────────────────────────────────────────── */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }  20% { transform: translate(-2%,1%); }
  40% { transform: translate(1%,-2%); }   60% { transform: translate(-1%,2%); }
  80% { transform: translate(2%,-1%); }
}

/* ── shared atoms ──────────────────────────────────────────────────────── */
.micro {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}
.micro.gold, .gold { color: var(--gold); }

em { font-style: italic; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--line);
  color: var(--dim);
  transition: color .45s var(--ease), border-color .45s var(--ease),
              background .45s var(--ease), box-shadow .45s var(--ease);
}
.btn:hover { color: var(--ink); border-color: rgba(233,235,241,0.35); }
.btn-solid {
  background: linear-gradient(120deg, #c49a54, var(--gold-2));
  border-color: transparent;
  color: #17110a;
  font-weight: 500;
}
.btn-solid:hover {
  color: #17110a;
  box-shadow: 0 0 32px rgba(216,178,106,0.35);
  border-color: transparent;
}
.btn-s { padding: 0.55rem 1rem; }

/* ── nav ───────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem var(--pad);
  border-bottom: 1px solid transparent;
  transform: translateY(-102%);
  transition: transform .6s var(--ease), background .6s var(--ease),
              border-color .6s var(--ease);
}
.nav.show {
  transform: translateY(0);
  background: rgba(4, 6, 11, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.nav-brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.34em;
  color: var(--ink);
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color .3s;
}
.nav-links a:hover { color: var(--gold-2); }
.nav-cta { display: flex; align-items: center; gap: 1rem; }
.nav-icon { color: var(--faint); display: inline-flex; transition: color .3s; }
.nav-icon:hover { color: var(--ink); }

/* ── hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 var(--pad) 12vh;
  overflow: hidden;
}
#cosmos {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero-inner { position: relative; z-index: 2; }

.hero-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3.6rem, 13vw, 10.5rem);
  line-height: 1;
  letter-spacing: 0.14em;
  margin: 1.4rem 0 1.6rem;
  padding-left: 0.14em; /* optical centering vs letter-spacing */
  background: linear-gradient(180deg, #fff 30%, rgba(240,217,168,0.9) 78%, rgba(216,178,106,0.55));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 90px rgba(216,178,106,0.18);
}
.hero-sub {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  line-height: 1.55;
  color: var(--dim);
}
.hero-sub em { color: var(--gold-2); }
.hero-cta {
  display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2.6rem;
}
.hero-authors { margin-top: 2rem; letter-spacing: 0.14em; text-transform: none; }

/* ── sections ──────────────────────────────────────────────────────────── */
.section {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20vh var(--pad) 0;
  scroll-margin-top: 4rem;
}
.section-head {
  display: flex; align-items: baseline; gap: 1.2rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.sec-index {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold-dim);
}
.sec-rule { flex: 1; height: 1px; background: var(--line-soft); }

.sec-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.7rem, 6.5vw, 5rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin-bottom: clamp(1.6rem, 3vw, 2.4rem);
}
.sec-title em { color: var(--gold-2); }

.sec-lead {
  max-width: 560px;
  color: var(--dim);
  font-size: 1.05rem;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

/* ── overview ──────────────────────────────────────────────────────────── */
.overview-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.lead {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.75;
  color: var(--dim);
  font-weight: 300;
}
.lead .gold { color: var(--gold-2); }

.defs { display: flex; flex-direction: column; }
.def {
  padding: 1.6rem 0;
  border-top: 1px solid var(--line-soft);
}
.def:last-child { border-bottom: 1px solid var(--line-soft); }
.def p { margin-top: 0.7rem; color: var(--dim); font-size: 0.95rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.stat {
  padding: 2.2rem 1.4rem;
  border-left: 1px solid var(--line-soft);
}
.stat:first-child { border-left: none; }
.stat-value {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-value .suffix { color: var(--gold); }
.stat-label {
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── method / flywheel ─────────────────────────────────────────────────── */
.flywheel-wrap {
  display: flex; justify-content: center;
  margin: clamp(1rem, 4vw, 3rem) 0 clamp(3rem, 7vw, 5rem);
}
#flywheel { width: min(640px, 88vw); height: auto; overflow: visible; }

.fw-orbit {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
.fw-node { fill: var(--bg-2); stroke: var(--line); stroke-width: 1; transition: stroke .3s; }
.fw-node-core { fill: var(--gold); }
.fw-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--dim);
  text-anchor: middle;
}
.fw-step {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  fill: var(--gold-dim);
  text-anchor: middle;
}
.fw-glow { fill: url(#fwCore); }

.agent-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.card {
  background: var(--bg);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  transition: background .5s var(--ease);
}
.card:hover { background: var(--panel); }
.card-index {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--gold-dim);
}
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.55rem;
  margin: 0.9rem 0 0.5rem;
}
.card-tag { margin-bottom: 1.1rem; }
.card p:last-child { color: var(--dim); font-size: 0.92rem; }
.card em { color: var(--gold-2); }

/* ── results ───────────────────────────────────────────────────────────── */
.bench { margin-bottom: clamp(3.5rem, 8vw, 6rem); }
.bench-tabs {
  display: flex; flex-wrap: wrap; gap: 0.4rem 2rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 0.6rem;
}
.bench-tab {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.9rem 0.15rem;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color .3s, border-color .3s;
}
.bench-tab:hover { color: var(--ink); }
.bench-tab.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.bench-note { margin: 0.9rem 0 2.2rem; letter-spacing: 0.14em; }

.bench-chart { display: flex; flex-direction: column; gap: 0.55rem; }
.bench-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr 3.2rem;
  align-items: center;
  gap: 1.1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: row-in .7s var(--ease) forwards;
  animation-delay: calc(var(--i) * 45ms);
}
@keyframes row-in { to { opacity: 1; transform: none; } }
.bench-name {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--dim);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bench-row.ours .bench-name { color: var(--gold-2); }
.bench-track {
  height: 22px;
  background: rgba(233,235,241,0.03);
  position: relative;
}
.bench-bar {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  transition: width 1.1s var(--ease);
  transition-delay: calc(var(--i) * 45ms);
}
.bench-bar.gray { background: var(--bar-gray); }
.bench-bar.sft  { background: linear-gradient(90deg, rgba(168,198,232,0.28), rgba(168,198,232,0.55)); }
.bench-bar.ours {
  background: linear-gradient(90deg, #a37c36, var(--gold) 55%, var(--gold-2));
  box-shadow: 0 0 24px rgba(216,178,106,0.35);
}
.bench-val {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.bench-row.ours .bench-val { color: var(--gold-2); }

.bench-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 0.9rem 0 0.35rem;
}
.bench-divider::before {
  content: "";
  flex: 1; height: 1px;
  background: var(--line-soft);
}
.bench-divider .micro { font-size: 0.5625rem; }

.bench-legend {
  display: flex; flex-wrap: wrap; gap: 0.6rem 2rem;
  margin-top: 2rem;
  letter-spacing: 0.12em;
}
.bench-legend span { display: inline-flex; align-items: center; gap: 0.6rem; }
.sw { width: 18px; height: 8px; display: inline-block; }
.sw-ours { background: linear-gradient(90deg, #a37c36, var(--gold-2)); }
.sw-sft  { background: rgba(168,198,232,0.45); }
.sw-gray { background: var(--bar-gray); }

.difficulty { border-top: 1px solid var(--line-soft); padding-top: 2.4rem; }
.diff-chart { margin-top: 1.8rem; display: flex; flex-direction: column; gap: 0.55rem; }

/* ── citation ──────────────────────────────────────────────────────────── */
.cite-wrap { position: relative; }
.cite-block {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  padding: 1.8rem 2rem;
  overflow-x: auto;
  white-space: pre;
}
#copy-bib { position: absolute; top: 0.9rem; right: 0.9rem; background: var(--bg); }
#copy-bib.copied { color: var(--gold-2); border-color: var(--gold-dim); }

.cite-links { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 2rem; }

/* ── footer ────────────────────────────────────────────────────────────── */
.footer { max-width: var(--max); margin: 0 auto; padding: 22vh var(--pad) 3rem; }
.footer-rule { height: 1px; background: var(--line-soft); margin-bottom: 2.2rem; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--serif);
  letter-spacing: 0.34em;
  font-size: 0.95rem;
  color: var(--faint);
}

/* ── reveal ────────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .agent-cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat { border-top: 1px solid var(--line-soft); }
  .stat:nth-child(-n+2) { border-top: none; }
  .bench-row { grid-template-columns: 108px 1fr 2.8rem; gap: 0.7rem; }
  .bench-name { font-size: 0.6rem; }
}
@media (max-width: 560px) {
  .hero { padding-bottom: 16vh; }
  .hero-cta .btn { padding: 0.75rem 1.1rem; }
  .section { padding-top: 16vh; }
}

/* ── reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .hero-foot-line, .fw-flow { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bench-row { opacity: 1; transform: none; animation: none; }
  .bench-bar { transition: none; }
}

/* ── mobile-fit overrides (appended) ───────────────────────────────────── */
.hero-title {
  font-size: clamp(2.4rem, 11vw, 10.5rem);
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.hero-inner { max-width: 100%; }

@media (max-width: 700px) {
  .hero-meta { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   v2 — editorial restraint: serif prose, merged results, quieter charts
   ════════════════════════════════════════════════════════════════════════ */
:root { --serif2: "Newsreader", Georgia, serif; }

/* prose goes serif — the Anthropic editorial feel */
.lead, .sec-lead, .def p, .card p:last-child {
  font-family: var(--serif2);
  font-weight: 300;
  color: rgba(233, 235, 241, 0.74);
}
.lead { font-size: clamp(1.25rem, 2.1vw, 1.5rem); line-height: 1.72; }
.sec-lead { font-size: 1.18rem; line-height: 1.7; max-width: 600px; }
.def p, .card p:last-child { font-size: 1.02rem; line-height: 1.72; }
.lead::first-letter { font-family: var(--serif2); }
.card h3 {
  font-family: var(--serif2);
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: 0;
}

/* ── headline scores band ──────────────────────────────────────────────── */
.scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin: 0 0 clamp(3.5rem, 7vw, 5.5rem);
}
.score { padding: 2.4rem 1.4rem 2.1rem; border-left: 1px solid var(--line-soft); }
.score:first-child { border-left: none; }
.score-value {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 4.6vw, 4.2rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}
.score-label {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* ── quieter chart ─────────────────────────────────────────────────────── */
.bench-track { height: 15px; background: transparent; }
.bench-chart { gap: 0.5rem; }
.bench { margin-bottom: clamp(3rem, 6vw, 4.5rem); }

/* ── global type bump ──────────────────────────────────────────────────── */
html { font-size: 17px; }
.micro { font-size: 0.75rem; }
.btn, .bench-tab { font-size: 0.75rem; }
.stat-label, .score-label { font-size: 0.6875rem; }
.bench-name { font-size: 0.75rem; }
.bench-val { font-size: 0.8125rem; }
.nav-links a { font-size: 0.6875rem; }
#results .stats { margin-top: 0; }

@media (max-width: 900px) {
  .scores { grid-template-columns: repeat(2, 1fr); }
  .score { border-top: 1px solid var(--line-soft); }
  .score:nth-child(-n+2) { border-top: none; }
  .score:nth-child(odd) { border-left: none; }
}

/* ── flywheel fx canvas ────────────────────────────────────────────────── */
.flywheel-wrap { position: relative; }
#flywheel-fx {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
