:root {
  --bg: #f3f6fa;
  --bg-elevated: #ffffff;
  --bg-soft: #e8eef5;
  --ink: #15202b;
  --muted: #5a6b7c;
  --line: rgba(21, 32, 43, 0.12);
  --accent: #b56b24;
  --accent-soft: rgba(181, 107, 36, 0.12);
  --ok: #2f7a58;
  --ok-bg: rgba(47, 122, 88, 0.12);
  --fail: #b5523f;
  --fail-bg: rgba(181, 82, 63, 0.12);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Sora", "Segoe UI", sans-serif;
  --max: 1120px;
  --pad: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(181, 107, 36, 0.14), transparent 55%),
    radial-gradient(900px 480px at 92% 0%, rgba(70, 120, 160, 0.12), transparent 50%),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 32%, #eef3f8 100%);
  background-attachment: fixed;
  min-height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(21, 32, 43, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 32, 43, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 68%);
  z-index: 0;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 10px 14px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 0 var(--pad);
  border-bottom: 1px solid transparent;
  background: rgba(243, 246, 250, 0.72);
  backdrop-filter: blur(14px);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.brand {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav a:hover { color: var(--ink); background: rgba(21, 32, 43, 0.05); }

.header-actions { display: flex; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid {
  background: var(--accent);
  color: #fff8ef;
}
.btn-solid:hover { background: #c47a2f; }
.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}
.btn-ghost:hover { border-color: rgba(181, 107, 36, 0.45); }

main { position: relative; z-index: 1; }

.hero {
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  padding: clamp(36px, 6vh, 64px) var(--pad) 0;
  animation: rise 0.7s ease;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(28px, 4vw, 64px);
  row-gap: 18px;
  align-items: start;
}

.hero-copy > .brand-mark {
  grid-column: 1 / -1;
}

.hero-copy > h1 {
  grid-column: 1;
  padding-right: 8px;
}

.hero-copy > .hero-lede {
  grid-column: 2;
  padding-top: 6px;
}

.hero-copy > .hero-cta {
  grid-column: 1 / -1;
}

.brand-mark {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(52px, 7.2vw, 88px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.hero h1 {
  margin: 0;
  max-width: none;
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.hero-lede {
  margin: 0;
  max-width: none;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.hero-visual {
  margin: 32px 0 0;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: 0 10px 28px rgba(21, 32, 43, 0.04);
  animation: fade-in 0.7s ease;
}
.hero-visual img {
  width: 100%;
  border-radius: 10px;
  background: #fff;
}

.meta-strip {
  padding: 32px var(--pad);
  border-bottom: 1px solid var(--line);
}
.meta-inner { max-width: var(--max); margin: 0 auto; }
.meta-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}
.authors {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.affils {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.notes {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section {
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  padding: clamp(56px, 9vh, 96px) var(--pad) 0;
}

.section-head { max-width: 720px; margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.section-lede {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.point {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.point h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}
.point p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.abstract-block {
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
}
.abstract-block h3 {
  margin: 0 0 12px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.abstract-block p {
  margin: 0;
  max-width: 78ch;
  color: #3d4d5c;
  font-size: 15px;
}

.figure-block {
  margin: 0 0 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: 0 10px 28px rgba(21, 32, 43, 0.04);
}
.figure-block img {
  width: 100%;
  border-radius: 10px;
  background: #fff;
}
.figure-block figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.figure-block.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.figure-block.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.metric {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.metric-value {
  display: block;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
}
.metric-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.video-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 28px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: 0 10px 28px rgba(21, 32, 43, 0.04);
}
.tab {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 84px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.tab-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.72;
}
.tab-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.tab.is-active,
.tab:hover {
  border-color: rgba(181, 107, 36, 0.35);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(181, 107, 36, 0.08);
}
.tab.is-active .tab-kicker,
.tab.is-active .tab-title {
  color: var(--accent);
}

.video-panel[hidden] { display: none; }
.panel-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.task-block { margin-bottom: 28px; }
.task-label {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.video-grid.outcomes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: 0 8px 22px rgba(21, 32, 43, 0.04);
}
.video-card video {
  width: 100%;
  background: #111821;
  aspect-ratio: 16 / 5;
  object-fit: contain;
}
.outcomes .video-card video { aspect-ratio: 4 / 3; }

.video-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
}
.video-caption h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.video-caption span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.fail { color: var(--fail); background: var(--fail-bg); }
.obs {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 13px;
}

.resource-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.resource {
  display: block;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: color 0.2s ease;
}
.resource:hover strong { color: var(--accent); }
.resource-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.resource strong {
  display: block;
  font-size: 18px;
  font-weight: 600;
}
.resource-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.resource[aria-disabled="true"] { pointer-events: none; opacity: 0.7; }

.bib-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.copy-btn.is-copied {
  border-color: rgba(47, 122, 88, 0.4);
  color: var(--ok);
}
#bibtex-block {
  margin: 0;
  padding: 22px 20px;
  overflow-x: auto;
  color: #2a3846;
  font-size: 13px;
  line-height: 1.7;
  background: #f8fafc;
}
#bibtex-block code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: clamp(64px, 10vh, 110px) auto 0;
  padding: 28px var(--pad) 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.site-footer strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}
.footer-links {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 960px) {
  .nav { display: none; }
  .hero-copy {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hero-copy > h1,
  .hero-copy > .hero-lede {
    grid-column: 1;
  }
  .overview-grid,
  .metric-row,
  .resource-row { grid-template-columns: 1fr 1fr; }
  .video-tabs { grid-template-columns: 1fr; }
  .video-grid.outcomes { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .header-actions .btn-ghost { display: none; }
  .overview-grid,
  .metric-row,
  .resource-row,
  .video-grid,
  .video-grid.outcomes { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero,
  .hero-visual,
  .figure-block.reveal { animation: none; transition: none; opacity: 1; transform: none; }
  .btn:hover { transform: none; }
}
