:root {
  --bg: #ffffff;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --ink: #191512;
  --muted: #665e56;
  --line: rgba(25, 21, 18, 0.12);
  --accent: #ad3e2d;
  --accent-soft: rgba(173, 62, 45, 0.12);
  --green: #d7efd1;
  --green-dark: #98cf98;
  --red: #f6d2cf;
  --cyan: #d7f2f1;
  --shadow: 0 20px 60px rgba(58, 42, 25, 0.08);
  --max-width: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", sans-serif;
  background: var(--bg);
}

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

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding-bottom: 5rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem 0;
  backdrop-filter: blur(18px);
}

.section-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.75);
  box-shadow: var(--shadow);
}

.section-nav a,
.eyebrow,
.kicker,
.callout-label,
.metric-card span,
.table-note,
.action-card span,
.paper-table th {
  font-family: "IBM Plex Mono", monospace;
}

.section-nav a {
  font-size: 0.84rem;
  color: var(--muted);
  transition: color 160ms ease, transform 160ms ease;
}

.section-nav a:hover,
.section-nav a.is-active {
  color: var(--accent);
  transform: translateY(-1px);
}

.hero {
  padding: 4.5rem 0 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow,
.kicker,
.callout-label {
  margin: 0 0 0.8rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1,
.section-header h2,
.section-copy h2,
.citation-section h2 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.hero h1 {
  max-width: min(22ch, 100%);
  font-size: clamp(2.6rem, 6.4vw, 5.1rem);
  margin-inline: auto;
}

.authors,
.lede,
.section-copy p,
.callout p,
.approach-copy p,
.pipeline-card p,
.metric-card p,
.insight-card p,
.action-card p,
.table-note {
  color: var(--muted);
}

.lede,
.section-copy p,
.callout p,
.approach-copy p,
.metric-card p,
.insight-card p,
.action-card p,
.table-note,
.table-explainer {
  font-family: "Source Serif 4", serif;
}

.authors {
  margin: 1rem 0 0;
  font-size: 1.05rem;
}

.authors a {
  transition: color 160ms ease, opacity 160ms ease;
}

.authors a:hover {
  color: var(--accent);
}

.author-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-links {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 2rem 0 2.2rem;
  justify-content: center;
}

.hero-links a {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transition: transform 180ms ease;
}

.hero-links a:hover,
.action-card:hover {
  transform: translateY(-2px);
}

.lede {
  max-width: 48rem;
  font-size: 1.18rem;
  line-height: 1.7;
  margin-inline: auto;
  text-align: justify;
}

.section {
  padding: 2.2rem 0 2.8rem;
  border-top: 1px solid var(--line);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.callout,
.pipeline-card,
.metric-card,
.data-card,
.insight-card,
.action-card,
.citation-section pre {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.callout,
.pipeline-card,
.metric-card,
.insight-card,
.action-card {
  border-radius: 1.4rem;
}

.callout {
  padding: 1.5rem;
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
  text-align: center;
}

.section-header h2,
.section-copy h2,
.citation-section h2 {
  font-size: clamp(2.1rem, 4vw, 4rem);
}

.metric-strip,
.table-grid,
.insight-strip,
.paper-actions {
  display: grid;
  gap: 1rem;
}
.approach-figure {
  margin: 0 0 1.8rem;
}

.approach-figure img {
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.approach-figure figcaption {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.approach-copy {
  max-width: 58rem;
  margin: 0 auto;
}

.approach-copy p {
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
  line-height: 1.75;
  text-align: justify;
}

.approach-copy p:last-child {
  margin-bottom: 0;
}

.table-head h3,
.insight-card h3,
.action-card strong {
  margin: 0 0 0.6rem;
  font-size: 1.08rem;
}

.insight-card p,
.action-card p {
  margin: 0;
  line-height: 1.65;
}

.metric-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.metric-card {
  padding: 1.4rem;
  min-height: 100%;
  text-align: center;
}

.metric-card span {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
}

.metric-card strong {
  display: block;
  margin: 0.45rem 0 0.55rem;
  font-family: "Instrument Serif", serif;
  font-size: clamp(1.75rem, 3.5vw, 2.55rem);
  font-weight: 400;
  line-height: 1.08;
}

.metric-card p {
  margin: 0;
  line-height: 1.6;
}

.table-stack {
  display: grid;
  gap: 2rem;
  justify-items: center;
}

.table-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.finding-grid {
  grid-template-columns: 1fr;
}

.finding-block {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.data-card {
  border-radius: 1.5rem;
  padding: 1rem;
  align-self: start;
  width: 100%;
}

.table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  text-align: center;
}

.table-head .kicker {
  margin-bottom: 0.5rem;
}

.table-head > div {
  width: 100%;
}

.table-note {
  margin: 0;
  max-width: 24rem;
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

.table-note-bottom {
  max-width: none;
  margin-top: 0.9rem;
}

.table-explainer {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
  text-align: justify;
  min-height: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.42);
  margin-top: 0.9rem;
}

.table-wrap--narrow {
  max-width: 100%;
}

.paper-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.paper-table--dense {
  min-width: 980px;
}

.paper-table th,
.paper-table td {
  padding: 0.82rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

.paper-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  z-index: 1;
}

.paper-table tbody td {
  color: var(--muted);
}

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

.teacher-row td {
  color: var(--ink);
  background: rgba(25, 21, 18, 0.03);
  font-weight: 600;
}

.ours-row td:first-child {
  background: var(--cyan);
  color: var(--ink);
  font-weight: 700;
}

.ours-row td:not(:first-child) {
  font-weight: 600;
  color: var(--ink);
}

.recovery-row td {
  color: var(--ink);
  font-weight: 700;
}

.chip {
  font-weight: 700;
}

.chip-green {
  background: var(--green);
}

.chip-dark {
  background: var(--green-dark);
  color: #102010;
}

.chip-red {
  background: var(--red);
}

.insight-strip,
.paper-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insight-strip {
  margin-bottom: 1.5rem;
}

.insight-card,
.action-card {
  padding: 1.25rem;
  min-height: 100%;
  text-align: center;
}

.paper-actions {
  margin-top: 0.5rem;
}

.action-card span {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
}

.action-card strong {
  display: block;
}

.citation-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
  justify-items: center;
  text-align: center;
}

.citation-section pre {
  margin: 0;
  padding: 1.4rem;
  overflow-x: auto;
  border-radius: 1.4rem;
  width: 100%;
  max-width: 860px;
  text-align: left;
}

.citation-section code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.65;
}

@media (max-width: 1040px) {
  .metric-strip,
  .table-grid,
  .insight-strip,
  .paper-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card:last-child,
  .action-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .section-grid,
  .citation-section {
    grid-template-columns: 1fr;
  }

  .table-head {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .hero {
    padding-top: 3rem;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.7rem, 15vw, 4.3rem);
  }

  .authors {
    line-height: 1.5;
  }

  .hero-links {
    gap: 0.65rem;
  }

  .hero-links a {
    padding: 0.75rem 0.95rem;
  }

  .section {
    padding: 1.8rem 0 2.2rem;
  }

  .data-card,
  .callout,
  .metric-card,
  .insight-card,
  .action-card,
  .citation-section pre {
    border-radius: 1.15rem;
  }

  .data-card {
    padding: 0.8rem;
  }

  .table-head {
    margin-bottom: 0.75rem;
  }

  .table-head h3 {
    line-height: 1.2;
  }

  .metric-card strong {
    font-size: 2.2rem;
  }

  .paper-table th,
  .paper-table td {
    padding: 0.72rem 0.68rem;
  }

  .table-stack {
    gap: 1.5rem;
  }

  .section-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .metric-strip,
  .table-grid,
  .insight-strip,
  .paper-actions {
    grid-template-columns: 1fr;
  }

  .paper-table,
  .paper-table--dense {
    min-width: 680px;
  }
}
