/* ================================================================
   WorldCache — Project Page Stylesheet
   Clean, compact, professional academic project page
   ================================================================ */

:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --bg: #f7f9fc;
  --bg-alt: #eef2f9;
  --surface: #ffffff;
  --text: #111827;
  --text-secondary: #4b5563;
  --muted: #6b7280;
  --border: #e2e8f0;
  --border-light: #f0f4f8;

  --blue: #2563eb;
  --teal: #0d9488;
  --orange: #f97316;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06), 0 16px 48px rgba(0, 0, 0, 0.08);
  --ease: 260ms cubic-bezier(.4, 0, .2, 1);

  --content: 1280px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input {
  font: inherit;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
}

.container {
  width: min(var(--content), calc(100% - 32px));
  margin: 0 auto;
}

/* ── Navigation ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(180%);
  background: rgba(247, 249, 252, 0.85);
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

.nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: color var(--ease);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Hero ── */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.badge-accent {
  color: var(--blue);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.06));
  border-color: rgba(37, 99, 235, 0.2);
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  color: var(--text);
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.hero-desc {
  max-width: 860px;
  margin: 0 auto 18px;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.hero-desc em {
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}

.title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.title-wrapper h1 {
  margin-bottom: 0 !important;
}

.main-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.authors {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 4px;
}

.authors sup {
  color: var(--blue);
  font-weight: 700;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.contact {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.contact a {
  color: var(--blue);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.hero-video {
  margin-top: 56px;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #fff;
}

.hero-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}

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

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.btn-outline {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ── Proof bar ── */
.proof-bar {
  padding: 0 0 32px;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.proof-card {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.proof-primary {
  background: linear-gradient(180deg, #eff6ff, #f0fdfa);
  border-color: rgba(147, 197, 253, 0.5);
}

.proof-card span {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.proof-card strong {
  display: block;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--text);
  margin: 4px 0 2px;
}

.proof-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── Teaser ── */
.teaser {
  padding-bottom: 24px;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.pillar {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.pillar strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: var(--text);
}

.pillar p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Sections ── */
.section {
  padding: 48px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.kicker::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.section h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 8px;
}

.section-lead {
  max-width: 900px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* ── Figure cards ── */
.figure-card {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 0;
}

.figure-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 0;
}

.figure-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.zoom-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.15);
  cursor: pointer;
  transition: all var(--ease);
}

.zoom-btn:hover {
  background: rgba(37, 99, 235, 0.12);
}

.figure-card img {
  width: 100%;
  padding: 12px 16px 8px;
}

.figure-card figcaption {
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* ── Numbered cards ── */
.card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.num-card {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(20, 184, 166, 0.08));
  color: var(--blue);
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.num-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.num-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Summary box ── */
.summary-box {
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), #f8fafe);
  border: 1px solid #d4e0f0;
  box-shadow: var(--shadow);
  text-align: center;
}

.summary-box h3 {
  max-width: 900px;
  margin: 0 auto 10px;
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  letter-spacing: -0.03em;
}

.summary-box p {
  max-width: 920px;
  margin: 0 auto 16px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ── Two-column grid ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

/* ── Module panel ── */
.module-panel {
  margin-top: 20px;
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.module-tab {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--ease);
}

.module-tab:hover,
.module-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.06));
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.module-body {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.module-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.module-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
}

.module-body h3 {
  font-size: 1.1rem;
}

.module-body>p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.formula {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: normal;
  margin-bottom: 12px;
}

.module-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.note-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.module-notes p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Results ── */
.results-shell {
  display: grid;
  gap: 16px;
}

#resultsStandardView {
  display: grid;
  gap: 14px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-bar.centered {
  justify-content: center;
}

.tab-bar button {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--ease);
}

.tab-bar button:hover,
.tab-bar button.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.06));
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.tab-bar.secondary button {
  height: 32px;
  font-size: 0.82rem;
}

.results-title-block {
  text-align: center;
}

.results-title-block h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.results-title-block p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 800px;
  margin: 0 auto 8px;
}

.headline-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(135deg, #e0f2fe, #ecfdf5);
  border: 1px solid #bae6fd;
}

/* ── Metric grid ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.metric-grid.compact {
  margin: 8px 0;
}

.metric-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.metric-card.accent {
  background: linear-gradient(180deg, #eff6ff, #f0fdfa);
  border-color: rgba(147, 197, 253, 0.4);
}

.metric-card span {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin: 2px 0;
}

.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Charts ── */
.chart-panel {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.chart-header {
  margin-bottom: 10px;
}

.chart-header h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.chart-header p {
  color: var(--muted);
  font-size: 0.84rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

#frontierChart,
#budgetChart {
  width: 100%;
  height: auto;
  display: block;
}

#budgetChart {
  max-width: 600px;
  margin: 0 auto;
}

.chart-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.chart-axis {
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.chart-label,
.chart-note,
.chart-point-label,
.chart-axis-title {
  fill: #6b7280;
  font-size: 12px;
  font-family: var(--font);
}

.chart-axis-title {
  font-size: 13px;
  font-weight: 700;
}

.chart-point-label {
  font-size: 11px;
  font-weight: 700;
}

.chart-note {
  font-size: 11px;
}

/* ── Latency bars ── */
.latency-bars {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text);
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-meta {
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
}

.bar-meta strong {
  color: var(--text);
}

/* ── Tables ── */
.table-panel {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-top: 14px;
}

.table-header {
  margin-bottom: 10px;
  text-align: center;
}

.table-header h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 4px 0;
}

.table-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
  white-space: nowrap;
  font-size: 0.86rem;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

th:first-child,
td:first-child {
  text-align: left;
}

tr:hover td {
  background: #fafcff;
}

tr.highlight td {
  background: #f0fdf4;
}

tr.group-row td {
  background: #f8fafc;
  font-weight: 800;
  color: var(--text);
}

.hidden {
  display: none !important;
}

.all-results {
  display: grid;
  gap: 14px;
}

/* ── Step pills ── */
.step-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.step-pills button {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--ease);
}

.step-pills button:hover,
.step-pills button.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.06));
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

/* ── Citation ── */
.cite-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.cite-abstract {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.cite-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 8px;
}

.cite-abstract p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  flex: 1;
}

.cite-abstract p em {
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}

.cite-venue {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.cite-venue span:last-child {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.cite-bibtex {
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0f172a, #1e293b);
  border: 1px solid rgba(51, 65, 85, 0.6);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.cite-bibtex .cite-label {
  color: rgba(147, 197, 253, 0.8);
}

.cite-bib-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.copy-btn.copied {
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.4);
  color: #5eead4;
}

.cite-bibtex pre {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(51, 65, 85, 0.5);
  color: #e2e8f0;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  flex: 1;
}

.cite-bibtex pre code {
  font-family: inherit;
  color: inherit;
  white-space: pre;
}

/* ── Footer ── */
.site-footer {
  padding: 20px 0 32px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.footer-inner strong {
  font-size: 0.9rem;
}

.footer-inner p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  transition: color var(--ease);
}

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

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ease), visibility var(--ease);
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-fig {
  margin: 0;
  width: min(1100px, 100%);
  display: grid;
  gap: 10px;
}

.lightbox-fig img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  margin: 0 auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.lightbox-fig figcaption {
  color: #cbd5e1;
  text-align: center;
  font-size: 0.88rem;
}

/* ── Reveal animations ── */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .proof-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col {
    grid-template-columns: 1fr;
  }

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

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

  .card-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 4px);
    left: 8px;
    right: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .hero {
    padding: 32px 0 20px;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 14vw, 3.8rem);
  }

  .section {
    padding: 36px 0;
  }

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

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

  .module-notes {
    grid-template-columns: 1fr;
  }

  .affiliations {
    flex-direction: column;
    gap: 4px;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .bar-meta {
    text-align: left;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}