:root {
  --bg: #fffdf9;
  --surface: #ffffff;
  --surface-soft: #f6f8ff;
  --cream: #fff8ef;
  --text: #171a2f;
  --muted: #5e6678;
  --line: #e8eaf0;
  --blue: #3478f6;
  --blue-dark: #235ed3;
  --purple: #6d66c6;
  --green: #28a56b;
  --orange: #e88b35;
  --shadow: 0 16px 45px rgba(35, 49, 94, 0.09);
  --radius: 22px;
  --max: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,253,249,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232,234,240,.85);
}
.nav {
  max-width: 1160px;
  margin: 0 auto;
  height: 62px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { font-weight: 850; letter-spacing: -.025em; font-size: 1.1rem; }
.brand .accent { color: var(--blue); }
.navlinks { display: flex; gap: 22px; color: var(--muted); font-size: .93rem; font-weight: 650; }
.navlinks a:hover { color: var(--blue); }

.container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.hero { padding: 74px 0 28px; text-align: center; }
.hero h1 {
  font-size: clamp(2.3rem, 4.8vw, 4rem);
  line-height: 1.03;
  letter-spacing: -.052em;
  margin: 0 auto 22px;
  max-width: 1040px;
}
.hero h1 .accent { color: var(--blue); }
.hero .subtitle {
  max-width: 900px;
  margin: 0 auto 24px;
  color: #3f4758;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.45;
}
.authors { margin: 4px auto 6px; font-size: 1.05rem; }
.authors a { color: #2c63c9; font-weight: 650; }
.authors a:hover { text-decoration: underline; }
.affiliations { color: var(--muted); font-size: .95rem; }
.equal { color: #7b8290; font-size: .83rem; margin-top: 4px; }

.actions { margin-top: 24px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25293b;
  color: #fff;
  border-radius: 999px;
  padding: 10px 17px;
  font-weight: 750;
  font-size: .94rem;
  border: 1px solid #25293b;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(25,31,59,.18); }
.action-btn.secondary { background: white; color: #25293b; border-color: #d8dbe5; }
.action-btn svg { width: 18px; height: 18px; }

.tldr {
  margin: 44px auto 30px;
  max-width: 930px;
  background: linear-gradient(135deg, #f7f9ff 0%, #fff8ee 100%);
  border: 1px solid #e7eaf5;
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  text-align: left;
}
.tldr-label { font-size: .82rem; color: var(--blue); font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.qa { display: grid; grid-template-columns: 42px 1fr; gap: 8px 14px; margin-top: 14px; }
.qa-badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; color: white; background: var(--blue); }
.qa-badge.a { background: var(--green); }
.qa p { margin: 4px 0 12px; font-size: 1.05rem; }

.teaser { margin: 34px 0 18px; }
.teaser img { width: 100%; border-radius: 28px; box-shadow: 0 18px 44px rgba(47,63,113,.08); border: 1px solid #eeece6; }

.section { padding: 52px 0; }
.section + .section { border-top: 1px solid #efefe9; }
.section h2 { font-size: clamp(1.75rem, 3vw, 2.35rem); letter-spacing: -.035em; line-height: 1.15; margin: 0 0 16px; }
.section h3 { margin: 26px 0 8px; font-size: 1.18rem; letter-spacing: -.015em; }
.lead { font-size: 1.08rem; color: #3e4657; margin: 0; }
.center { text-align: center; }

.question-box {
  background: #171a2f;
  color: white;
  border-radius: var(--radius);
  padding: 36px;
  margin: 26px 0 34px;
}
.question-box .eyebrow { color: #8fb5ff; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.question-box .question { font-size: clamp(1.45rem,3vw,2.2rem); line-height: 1.25; font-weight: 800; max-width: 850px; margin: 8px 0 0; letter-spacing: -.03em; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  min-height: 132px;
}
.metric .number { font-weight: 900; font-size: 2rem; letter-spacing: -.04em; line-height: 1.08; }
.metric .label { color: var(--muted); margin-top: 7px; font-size: .91rem; line-height: 1.42; }
.metric.blue .number { color: var(--blue); }
.metric.green .number { color: var(--green); }
.metric.orange .number { color: var(--orange); }
.metric.purple .number { color: var(--purple); }

.figure-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 28px 0 14px; box-shadow: 0 10px 30px rgba(40,50,90,.05); }
.figure-card img { width: 100%; border-radius: 12px; }
.figcap { color: var(--muted); text-align: center; font-size: .9rem; margin: 11px 10px 2px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.info-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.info-card .kicker { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border-radius: 9px; font-size: .8rem; font-weight: 850; background: #eff4ff; color: var(--blue-dark); }
.info-card h3 { margin: 14px 0 7px; font-size: 1.08rem; }
.info-card p { color: var(--muted); font-size: .92rem; margin: 0; }

.result-band {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: stretch;
}
.result-copy { background: linear-gradient(145deg,#eef4ff,#faf6ff); border: 1px solid #e0e7fb; border-radius: 20px; padding: 26px; }
.result-copy h3 { margin-top: 0; font-size: 1.4rem; }
.result-copy p { color: #475064; margin-bottom: 0; }
.big-shift { background: #171a2f; border-radius: 20px; color: white; padding: 26px; display: flex; flex-direction: column; justify-content: center; }
.big-shift .fromto { font-weight: 900; font-size: clamp(2rem,4vw,3.2rem); letter-spacing: -.05em; line-height: 1; }
.big-shift .arrow { color: #8fb5ff; padding: 0 6px; }
.big-shift small { margin-top: 10px; color: #c8cddd; }

.task-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 24px 0; }
.task { border-radius: 16px; border: 1px solid var(--line); padding: 18px 16px; background: white; }
.task strong { display: block; font-size: .98rem; margin-bottom: 5px; }
.task span { color: var(--muted); font-size: .86rem; }

.quote {
  border-left: 4px solid var(--blue);
  background: #f7f9ff;
  padding: 18px 22px;
  border-radius: 0 14px 14px 0;
  color: #364056;
  font-size: 1.04rem;
  margin: 22px 0;
}

.gains { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 20px 0 0; }
.gain { background: #f4faf7; border: 1px solid #d9eee3; border-radius: 16px; padding: 18px; }
.gain b { display: block; font-size: 1.3rem; color: var(--green); }
.gain span { color: var(--muted); font-size: .86rem; }

.bibtex-wrap { position: relative; }
pre {
  margin: 18px 0 0;
  background: #191d2d;
  color: #edf2ff;
  border-radius: 18px;
  padding: 22px;
  overflow: auto;
  font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.copy-btn { position: absolute; top: 30px; right: 12px; border: 1px solid #4b5369; background: #2a3043; color: white; border-radius: 9px; padding: 7px 10px; cursor: pointer; font-weight: 700; }
.copy-btn:hover { background: #363e56; }

footer { border-top: 1px solid #ecece6; margin-top: 52px; padding: 30px 0 42px; color: #7c8390; text-align: center; font-size: .86rem; }
footer a { color: #4c6fb4; }

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .task-grid { grid-template-columns: repeat(2,1fr); }
  .gains { grid-template-columns: repeat(2,1fr); }
  .result-band { grid-template-columns: 1fr; }
  .navlinks { display: none; }
}
@media (max-width: 600px) {
  .container { width: min(100% - 26px, var(--max)); }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: 2.2rem; }
  .tldr { padding: 22px 18px; }
  .qa { grid-template-columns: 34px 1fr; gap: 6px 10px; }
  .section { padding: 40px 0; }
  .question-box { padding: 25px 22px; }
  .metrics, .task-grid, .gains { grid-template-columns: 1fr; }
  .figure-card { padding: 10px; border-radius: 16px; }
  .actions { gap: 8px; }
  .action-btn { padding: 9px 14px; font-size: .9rem; }
}

/* ---------- Results tables (FastWAM-style, RepoMirage palette) ---------- */

.caption {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.table-block {
  margin: 14px 0 6px;
}

.table-block-narrow {
  width: 78%;
  margin-left: auto;
  margin-right: auto;
}

.table-wrapper {
  display: block;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(45, 28, 7, 0.07);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: #ffffff;
}

.results-table th,
.results-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(40, 34, 24, 0.08);
  text-align: center;
  font-size: 0.95rem;
  color: #26241f;
}

.results-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.results-table thead th {
  background: #eef4ff;
  color: #171a2f;
  font-weight: 800;
  border-bottom: 1px solid #dbe6fb;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table .best {
  font-weight: 800;
  color: var(--blue-dark);
}

.results-table .second {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.results-table .hint-row td {
  background: rgba(52, 120, 246, 0.06);
  font-weight: 600;
}

@media (max-width: 900px) {
  .table-block-narrow { width: 100%; }
}

.results-table td.drop {
  color: #d96a1f;
  font-weight: 700;
  background: rgba(232, 139, 53, 0.07);
}

.results-table td.ratio {
  color: var(--blue-dark);
  font-weight: 700;
  background: rgba(52, 120, 246, 0.06);
}

.results-table thead th.drop {
  color: #d96a1f;
}

.results-table thead th.ratio {
  color: var(--blue-dark);
}
