:root {
  --ink: #12151c;
  --muted: #5a6270;
  --paper: #f3f1ec;
  --panel: rgba(255, 255, 255, 0.72);
  --line: rgba(18, 21, 28, 0.12);
  --mit: #a31f34;
  --mit-deep: #7a1224;
  --accent: #1f4e5f;
  --shadow: 0 18px 50px rgba(18, 21, 28, 0.08);
  --max: 980px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  background: var(--paper);
  position: relative;
  min-height: 100vh;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(163, 31, 52, 0.16), transparent 60%),
    radial-gradient(700px 480px at 90% 8%, rgba(31, 78, 95, 0.14), transparent 55%),
    linear-gradient(180deg, #ebe7df 0%, #f3f1ec 38%, #ece8e1 100%);
}

a { color: var(--mit-deep); text-underline-offset: 3px; }
a:hover { color: var(--mit); }

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--mit);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.nav a:hover { color: var(--ink); }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.hero {
  padding: 3.5rem 0 2.5rem;
  max-width: 46rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.15rem, 4.4vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.lede {
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 40rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--mit);
  color: #fff;
}

.btn-primary:hover {
  background: var(--mit-deep);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
  color: var(--ink);
}

.authors {
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.authors span {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.86rem;
}

.section {
  padding: 2.4rem 0 0.4rem;
  border-top: 1px solid var(--line);
  margin-top: 1.5rem;
}

.section h2 {
  margin: 0 0 0.85rem;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
}

.section-note {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.72rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(18, 21, 28, 0.03);
}

tr.group td {
  font-weight: 700;
  background: rgba(31, 78, 95, 0.06);
  color: var(--accent);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

tr.ours td {
  font-weight: 600;
  background: rgba(163, 31, 52, 0.05);
}

.stat-strip {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.stat-strip div {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.stat-strip strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.fig {
  margin: 0 0 1.6rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
}

.fig figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.code-section pre.cite {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #171a21;
  color: #e8e4dc;
  font-size: 0.82rem;
  line-height: 1.55;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .fine {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  opacity: 0.85;
}

@media (max-width: 720px) {
  .stat-strip { grid-template-columns: 1fr; }
  .hero { padding-top: 2rem; }
  .nav { display: none; }
}
