:root {
  /* Neutral editorial base */
  --bg: #ffffff;
  --bg-alt: #fafbfc;
  --paper: #ffffff;
  --ink: #0b1220;
  --ink-soft: #1f2937;
  --muted: #5b6675;
  --faint: #8a94a3;
  --line: #e7eaef;
  --line-strong: #d4d9e0;

  /* Single restrained accent */
  --accent: #3b5bdb;
  --accent-strong: #2541b2;
  --accent-soft: #eef1fd;
  --accent-tint: #f5f7ff;
  --positive: #157a4b;
  --positive-soft: #e8f6ee;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 10px;

  --container: 1120px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  font-family: var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.018em;
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 5rem 0 3rem;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  height: 540px;
  transform: translateX(-50%);
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 91, 219, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 91, 219, 0.08) 1px, transparent 1px);
  background-position: center top;
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.62) 44%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.62) 44%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
}

.project-label,
.kicker {
  display: inline-block;
  margin: 0 0 1.1rem;
  padding: 0.34rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-tint);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0.7rem;
  font-size: clamp(2.2rem, 4.4vw, 3.3rem);
  line-height: 1.06;
  font-weight: 800;
}

.hero-subtitle {
  max-width: 760px;
  margin: 0 auto 1.7rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.4;
  font-weight: 500;
}

.authors,
.affiliations,
.action-row,
.section-nav,
.tabs {
  display: flex;
  align-items: center;
}

.authors,
.affiliations,
.action-row {
  flex-wrap: wrap;
  justify-content: center;
}

.authors {
  gap: 0.2rem 0.8rem;
  max-width: 820px;
  margin: 0 auto;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.authors span {
  white-space: nowrap;
}

.authors sup,
.affiliations sup {
  color: var(--accent);
  font-weight: 700;
}

.affiliations {
  gap: 0.15rem 0.8rem;
  max-width: 860px;
  margin: 0.7rem auto 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.action-row {
  gap: 0.6rem;
  margin: 1.9rem 0 0;
}

.button,
.copy-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.97rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.button:hover,
.copy-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.copy-button {
  font: inherit;
  font-weight: 600;
}

.button.primary {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 10px 24px rgba(59, 91, 219, 0.28);
}

.button img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.file-badge {
  min-width: 2.2rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.button.primary .file-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ---------- Hero stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  max-width: 760px;
  margin: 2.6rem auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
}

.stat-card {
  padding: 1.3rem 1rem;
  text-align: center;
  border-right: 1px solid var(--line);
}

.stat-card:last-child {
  border-right: 0;
}

.stat-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-card span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

/* ---------- Hero figure ---------- */
.hero-figure {
  width: min(var(--container), calc(100% - 40px));
  margin: 1rem auto 0;
}

.hero-figure,
.framed-figure,
.analysis-figure,
.wide-figure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.framed-figure,
.analysis-figure,
.wide-figure {
  margin: 2rem 0 0;
}

.hero-figure img,
.framed-figure img,
.analysis-figure img,
.wide-figure img {
  width: 100%;
  padding: 1.5rem;
  background: #fff;
}

figcaption {
  border-top: 1px solid var(--line);
  padding: 0.95rem 1.15rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ---------- Section nav ---------- */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  margin: 0 0 0;
  padding: 0 16px;
  align-items: stretch;
  justify-content: center;
  gap: 0.3rem;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.section-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin-bottom: -1px;
  padding: 0.85rem 1.05rem;
  border-bottom: 4px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.section-nav a.is-current {
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
  font-weight: 800;
}

/* ---------- Sections ---------- */
.section {
  width: 100%;
  margin: 0 auto;
  padding: 5rem max(20px, calc((100% - var(--container)) / 2));
  border-top: 1px solid var(--line);
}

.section:first-of-type {
  border-top: 0;
}

.section:nth-of-type(even) {
  background: var(--bg-alt);
}

.section-head {
  margin-bottom: 2.2rem;
}

.section-head.centered {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-head.narrow {
  max-width: 680px;
}

.section-head.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.62fr);
  gap: 2.4rem;
  align-items: end;
}

.section-head .kicker {
  color: var(--accent);
}

.section-head h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.1;
  font-weight: 800;
}

.section-head h2 em,
.hero-content h2 em {
  font-style: italic;
  color: var(--accent);
}

.section-head p {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.section-head.split p {
  align-self: end;
}

/* ---------- Grid primitives ---------- */
.overview-grid,
.role-grid,
.paradigm-strip,
.timeline,
.metric-row,
.result-panels,
.release-grid,
.chart-grid {
  display: grid;
  gap: 1rem;
}

.overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.card,
.overview-grid article,
.role-card,
.timeline article,
.metric-row article,
.table-panel,
.release-card,
.chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.overview-grid article,
.role-card,
.timeline article {
  padding: 1.5rem;
}

.overview-grid h3,
.role-card h3,
.timeline h3,
.table-panel h3 {
  margin-bottom: 0.5rem;
  font-size: 1.16rem;
  font-weight: 700;
}

.overview-grid p,
.role-card p,
.timeline p,
.release-card span,
.citation-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.overview-grid article .role-index {
  margin-bottom: 0.9rem;
}

.overview-grid p b,
.role-card p b {
  color: var(--ink);
  font-weight: 700;
}

.compare-points {
  margin-top: 1.4rem;
}

/* ---------- Method roles ---------- */
.role-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.role-card {
  position: relative;
}

.role-card.emphasized {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

.role-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.role-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.role-action {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

/* ---------- Paradigm strip ---------- */
.paradigm-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.paradigm-strip div {
  min-height: 92px;
  padding: 1.2rem;
  border-right: 1px solid var(--line);
}

.paradigm-strip div:last-child {
  border-right: 0;
}

.paradigm-strip strong,
.release-card strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
}

.paradigm-strip span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Timeline ---------- */
.timeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.timeline h3 {
  margin-top: 0.9rem;
}

/* ---------- Results: chart highlight ---------- */
.chart-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.4rem;
}

.chart-card {
  padding: 1.3rem 1.3rem 1.5rem;
}

.chart-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.chart-card .chart-sub {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.bar-row {
  margin-bottom: 0.9rem;
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.bar-label b {
  color: var(--ink);
  font-size: 0.92rem;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-fill.base {
  background: var(--line-strong);
}

.bar-fill.ours {
  background: var(--accent);
}

.chart-legend {
  display: flex;
  gap: 1.2rem;
  margin-top: 1.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.legend-dot.base {
  background: var(--line-strong);
}

.legend-dot.ours {
  background: var(--accent);
}

/* ---------- Metric callouts ---------- */
.metric-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.4rem;
}

.metric-row article {
  padding: 1.2rem;
  text-align: center;
}

.metric-row strong {
  display: block;
  color: var(--positive);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}

.metric-row span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---------- Tables ---------- */
.result-panels {
  grid-template-columns: 1fr;
  gap: 1.4rem;
}

.table-panel {
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.panel-title h3 {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.42rem 0.65rem;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.panel-title span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

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

th {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td:first-child {
  font-weight: 700;
  color: var(--ink);
}

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

tbody tr:hover {
  background: var(--accent-tint);
}

tr.group-row td {
  padding: 0.55rem 0.85rem;
  background: var(--bg-alt);
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tr.group-row:hover td {
  background: var(--bg-alt);
}

tr.is-ours td {
  background: var(--positive-soft);
  font-weight: 600;
}

tr.is-ours:hover td {
  background: var(--positive-soft);
}

tr.is-ours td:first-child {
  color: var(--positive);
}

td .up {
  margin-left: 0.3rem;
  color: var(--positive);
  font-size: 0.78rem;
  font-weight: 700;
}

td .down {
  margin-left: 0.3rem;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 700;
}

.delta {
  color: var(--faint);
}

.delta b {
  color: var(--accent-strong);
  font-weight: 700;
}

.delta .arrow {
  margin: 0 0.18rem;
  color: var(--faint);
}

.delta-chip {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--positive-soft);
  color: var(--positive);
  font-size: 0.74rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ---------- Tabs / analysis ---------- */
.tabs {
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.tab {
  min-height: 42px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.is-hidden {
  display: none;
}

.analysis-figure img,
.wide-figure img {
  min-width: 820px;
}

.analysis-figure,
.wide-figure {
  overflow-x: auto;
}

/* ---------- Release ---------- */
.release-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.5rem;
}

.release-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.release-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.release-card img,
.release-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
}

.release-icon.file-badge {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.release-card strong {
  margin-bottom: 0.2rem;
}

/* ---------- Citation ---------- */
.bibtex {
  overflow-x: auto;
  margin: 0;
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1220;
  color: #e7ecf6;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.65;
}

.citation-note {
  margin-top: 1rem;
}

.copy-row {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}

.footer-inner {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 2.4rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
}

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

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .bar-fill {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .section-head.split {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .overview-grid,
  .role-grid,
  .paradigm-strip,
  .timeline,
  .metric-row,
  .release-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .paradigm-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .paradigm-strip div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .hero {
    padding-top: 3rem;
  }

  .authors span {
    white-space: normal;
  }

  .button,
  .copy-button {
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card:nth-child(2) {
    border-right: 0;
  }

  .stat-card:nth-child(1),
  .stat-card:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .section {
    padding: 3.5rem 20px;
  }

  .panel-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
