/* ============================================================
   survivorsbias.com — Shared Stylesheet
   Dark Cosmic Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,700;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg-deep:        #080810;
  --bg-mid:         #0d0d1e;
  --surface:        rgba(18, 18, 48, 0.72);
  --surface-hover:  rgba(30, 30, 80, 0.85);
  --amber:          #f0a500;
  --amber-dim:      rgba(240, 165, 0, 0.15);
  --indigo:         #6060d8;
  --indigo-dim:     rgba(96, 96, 216, 0.12);
  --text:           #dde0ff;
  --text-muted:     #7878a8;
  --border:         rgba(100, 100, 200, 0.18);
  --border-amber:   rgba(240, 165, 0, 0.30);
  --radius:         12px;
  --radius-lg:      20px;
  --transition:     0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
}

body {
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  padding-top: 52px; /* Offset for fixed navbar */
}

a, a:visited {
  color: var(--amber);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  text-decoration: underline;
}

/* ── Star-field Canvas ─────────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* ── Layout wrapper ──────────────────────────────────────── */
.page-wrapper {
  /* Simple block container — no override of browser scroll/zoom */
  position: relative;
  z-index: 1;
}

main { display: block; }

/* ── Paper theme (document pages) ──────────────────────── */
body.theme-paper {
  /* Remap dark-theme CSS vars so every rule using them auto-adapts */
  --text:         #2e2b38;
  --text-muted:   #6b6575;
  --amber:        #8a6a20;          /* darker gold, readable on cream */
  --amber-dim:    rgba(80, 60, 10, 0.07);
  --border-amber: rgba(100, 80, 20, 0.22);
  --indigo:       #4535a8;          /* deeper for cream contrast */
  --indigo-dim:   rgba(50, 40, 140, 0.08);
  --border:       rgba(80, 75, 70, 0.18);
  --surface:      rgba(200, 195, 180, 0.4);

  background: #eee9df;
  color: #2e2b38;
}
body.theme-paper h1,
body.theme-paper h2,
body.theme-paper h3,
body.theme-paper h4 {
  color: #1c1927;
}
body.theme-paper a {
  color: #4535a8;
}
body.theme-paper code,
body.theme-paper pre {
  background: #e0dbd1;
  color: #2e2b38;
}
body.theme-paper blockquote {
  border-left-color: #9d9890;
  background: rgba(0, 0, 0, 0.04);
  color: #2e2b38;
}

/* ── Site Navigation (Global) ── */
site-nav, #global-site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: rgba(8, 8, 16, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: block;
}

.nav-inner {
  width: 100%;
  max-width: 960px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* nav brand: just the icon, no text */
.nav-brand img { height: 38px; width: 38px; display: block; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem; /* Better spacing between globe and hamburger */
  position: relative;
}

/* Hamburger & Dropdown Links (Global) */
.nav-links {
  display: none;
  position: absolute;
  top: 52px;
  right: 0;
  left: auto;
  min-width: 200px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(18, 16, 56, 0.98);
  backdrop-filter: blur(20px);
  padding: 0.75rem 1rem 3rem;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 0 0 0 var(--radius);
  z-index: 99;
  gap: 0.25rem;
  list-style: none; /* Remove white dots */
}
.nav-links.open { display: flex; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-align: left; /* Left align instead of right align */
  width: 100%;
  display: block; /* Ensure the link fills the li */
}

.nav-links li.nav-section-title {
  color: var(--amber);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 1.2rem 1.2rem 0.3rem 1.2rem;
  font-weight: 700;
  opacity: 0.9;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
  cursor: pointer;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links li.nav-section-title::after {
  content: "▼";
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.nav-links li.nav-section-title.collapsed::after {
  transform: rotate(-90deg);
}

.nav-links li.nav-indented a {
  padding-left: 2rem;
}

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

.nav-links a.active {
  color: #ffffff;
  background: rgba(96, 96, 216, 0.22);
  border-left: 3px solid var(--amber);
  padding-left: calc(1.2rem - 3px);
  font-weight: 600;
}

.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  z-index: 101;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}
/* ≡ → ✕ animation */
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* ── Hero Section ──────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem 5rem; /* Reduced top padding since header no longer overlaps */
  position: relative;
}

/* Only the homepage hero should stretch full screen */
.hero.home-hero {
  min-height: calc(100vh - 64px); /* Account for sticky header height */
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.7) 40%, rgba(8, 8, 16, 0.2) 100%),
    url('img/airliner_hero_bg.png');
  background-size: cover;
  background-position: center 85%;
  background-repeat: no-repeat;
}

.hero.platform-hero {
  min-height: calc(100vh - 64px);
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.85) 50%, rgba(8, 8, 16, 0.6) 100%),
    url('img/platform_bg.png');
  background-size: cover;
  background-position: center 70%;
  background-repeat: no-repeat;
}

.hero.fermi-hero {
  min-height: calc(100vh - 64px);
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.88) 50%, rgba(8, 8, 16, 0.65) 100%),
    url('img/fermi_bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero.actions-hero {
  min-height: calc(100vh - 64px);
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.85) 50%, rgba(8, 8, 16, 0.6) 100%),
    url('img/actions_bg.png');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
}

.hero.bias-hero {
  min-height: calc(100vh - 64px);
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.88) 50%, rgba(8, 8, 16, 0.65) 100%),
    url('img/bias_bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero.intro-hero {
  min-height: calc(100vh - 64px);
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.85) 50%, rgba(8, 8, 16, 0.6) 100%),
    url('img/intro_bg.png');
  background-size: cover;
  background-position: center 60%;
  background-repeat: no-repeat;
}

.hero.guardian-hero {
  min-height: calc(100vh - 64px);
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.85) 0%, rgba(8, 8, 16, 0.60) 50%, rgba(8, 8, 16, 0.3) 100%),
    url('img/guardian_bg.png');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.hero.ethics-intro-hero {
  min-height: calc(100vh - 64px);
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.80) 50%, rgba(8, 8, 16, 0.6) 100%),
    url('img/ethics_intro_bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero.ai-hero {
  min-height: calc(100vh - 64px);
  background: 
    linear-gradient(to bottom, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.85) 50%, rgba(8, 8, 16, 0.45) 100%),
    url('img/ai_bottleneck.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}


.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--border-amber);
  background: var(--amber-dim);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.12;
  max-width: 820px;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #aabbff 60%, var(--amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.9));
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #eeeeff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 1px 4px rgba(0, 0, 0, 0.8);
  max-width: 560px;
  margin-bottom: 3rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary, .btn-primary:visited {
  background: var(--amber);
  color: #0a0a0a;
}

.btn-primary:hover {
  background: #ffc030;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(240, 165, 0, 0.35);
}

.btn-ghost, .btn-ghost:visited {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--indigo-dim);
  border-color: var(--indigo);
  transform: translateY(-2px);
}

/* ── Section Layout ─────────────────────────────────────── */
.section {
  padding: 6rem 2rem;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
}

.section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: #fff;
}

.section p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  max-width: 740px;
}

.section p strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Cards ──────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--indigo-dim), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(96, 96, 216, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 60, 0.4);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.6rem;
  position: relative;
}

.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0;
  position: relative;
}

/* ── Blockquote ─────────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--amber);
  padding: 1.25rem 1.75rem;
  margin: 2.5rem 0;
  background: var(--amber-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.15rem !important;
  color: #d0d0ff !important;
  margin-bottom: 0 !important;
  line-height: 1.7;
}

/* ── Table ──────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.5rem 0;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-amber);
  color: var(--amber);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
  line-height: 1.6;
}

.data-table td:first-child {
  color: var(--text);
  font-weight: 500;
}

.data-table tr:hover td {
  background: var(--indigo-dim);
}

/* ── Prose tables (generated from markdown, no class) ────── */
.content table,
article table,
main table:not(.data-table) {
  width: 100%;
  border-collapse: collapse;
  margin: 2.5rem 0;
  font-size: 0.9rem;
}

.content table th,
article table th,
main table:not(.data-table) th {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-bottom: 2px solid var(--border-amber);
  color: var(--amber);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(240, 165, 0, 0.04);
}

.content table td,
article table td,
main table:not(.data-table) td {
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(100, 100, 200, 0.10);
  color: var(--text-muted);
  vertical-align: top;
  line-height: 1.65;
}

.content table td:last-child,
article table td:last-child,
main table:not(.data-table) td:last-child {
  border-right: none;
}

.content table td:first-child,
article table td:first-child,
main table:not(.data-table) td:first-child {
  color: var(--text);
  font-weight: 500;
}

.content table tr:hover td,
article table tr:hover td,
main table:not(.data-table) tr:hover td {
  background: var(--indigo-dim);
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 2rem;
}

/* ── Manifesto Text ─────────────────────────────────────── */
.manifesto {
  max-width: 700px;
  margin: 4rem auto 0;
  text-align: left;
}

.manifesto h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: #fff;
  margin: 2.5rem 0 0.75rem;
}

.manifesto p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 0;
}

/* ── Fade-in Animation ──────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

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

footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ─────────────────────────────────────────── */
  /* bump hero below fixed nav */
  .hero { padding: 7rem 1.25rem 4rem; }
  .section { padding: 4rem 1.25rem; }
  .card-grid { grid-template-columns: 1fr; }
  blockquote { padding: 1rem 1.25rem; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 0.65rem 0.6rem; }
  main table:not(.data-table) { font-size: 0.82rem; }
  main table:not(.data-table) th,
  main table:not(.data-table) td { padding: 0.65rem 0.7rem; }

/* ── Star-field Script (injected in HTML) ───────────────── */

/* ── Download Cards ─────────────────────────────────────── */
.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(18, 16, 56, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.download-card h2 {
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
}
.download-card p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.btn-download {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}
.btn-download:hover {
  background: var(--amber);
  color: #000;
  transform: translateY(-1px);
}
@media (max-width: 540px) {
  .download-card { flex-direction: column; align-items: flex-start; }
  .btn-download { align-self: flex-end; }
}

/* ── Language Switcher ──────────────────────────────────── */
.lang-switcher {
  position: relative;
}

.lang-trigger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.6rem;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  line-height: 1;
}

.lang-trigger:hover {
  color: var(--text);
  background: var(--indigo-dim);
  border-color: var(--indigo);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(14, 14, 40, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  list-style: none;
  min-width: 280px; /* Wider for 2 columns */
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,20,0.6);
  max-height: 65vh;
  overflow-y: auto;
}

.lang-menu.open { 
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.lang-menu li { list-style: none; }

.lang-menu button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: block;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  text-align: left;
  width: 100%;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.lang-menu button:hover {
  color: var(--text);
  background: var(--indigo-dim);
}

.lang-menu button.lang-active {
  color: var(--amber);
  font-weight: 600;
}

/* Downloads — language links beside main download button */
.download-langs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.download-langs a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  transition: color var(--transition), border-color var(--transition);
}

.download-langs a:hover {
  color: var(--amber);
  border-color: var(--border-amber);
}


/* ── Callout ──────────────────────────────────────────── */

/* ── Hero Toggle Button ─────────────────────────────────── */
.hero-toggle-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  opacity: 0.6;
}

.hero-toggle-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  transform: scale(1.05);
}

.hero > *:not(.hero-toggle-btn) {
  transition: opacity 0.4s ease;
}

.hero.text-hidden > *:not(.hero-toggle-btn) {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Clear backgrounds when text is hidden */
.hero.home-hero.text-hidden { background: url('img/airliner_hero_bg.png') center 85% / cover no-repeat; }
.hero.platform-hero.text-hidden { background: url('img/platform_bg.png') center 70% / cover no-repeat; }
.hero.fermi-hero.text-hidden { background: url('img/fermi_bg.png') center center / cover no-repeat; }
.hero.actions-hero.text-hidden { background: url('img/actions_bg.png') center 30% / cover no-repeat; }
.hero.bias-hero.text-hidden { background: url('img/bias_bg.png') center center / cover no-repeat; }
.hero.intro-hero.text-hidden { background: url('img/intro_bg.png') center 60% / cover no-repeat; }
.hero.guardian-hero.text-hidden { background: url('img/guardian_bg.png') center bottom / cover no-repeat; }
.hero.ethics-intro-hero.text-hidden { background: url('img/ethics_intro_bg.png') center center / cover no-repeat; }

.callout p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.callout a {
  color: var(--text) !important;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.callout a:hover {
  color: var(--amber) !important;
}

/* ── i18n Anti-FOUC ─────────────────────────────────────── */
html.i18n-loading [data-i18n],
html.i18n-loading [data-i18n-html] {
  opacity: 0 !important;
}

[data-i18n], [data-i18n-html] {
  transition: opacity 0.3s ease;
}

/* ── Paper page typography (document pages only) ─────────── */
.paper-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  line-height: 1.8;
  font-size: 1.05rem;
}

/* Section headings — generous top space so chapters breathe */
.paper-page h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  margin: 0 0 1.25rem;
  line-height: 1.15;
}
.paper-page h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  margin: 3.25rem 0 0.85rem;
  line-height: 1.25;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.paper-page h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  margin: 2.25rem 0 0.6rem;
  line-height: 1.3;
}
.paper-page h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
  line-height: 1.4;
}

/* Paragraphs */
.paper-page p {
  margin: 0 0 1.1rem;
  line-height: 1.8;
  max-width: none;
}

/* Lists */
.paper-page ul,
.paper-page ol {
  padding-left: 1.6rem;
  margin: 0.75rem 0 1.1rem;
}
.paper-page li {
  margin-bottom: 0.45rem;
  line-height: 1.75;
}
.paper-page li:last-child { margin-bottom: 0; }

/* Don't double-space first para after a heading */
.paper-page h2 + p,
.paper-page h3 + p,
.paper-page h4 + p { margin-top: 0; }

/* Horizontal rules */
.paper-page hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Responsive */
@media (max-width: 640px) {
  .paper-page {
    padding: 2rem 1.25rem 4rem;
    font-size: 1rem;
  }
  .paper-page h2 { margin-top: 2.5rem; }
  .paper-page h3 { margin-top: 1.75rem; }
}

/* ── Paper page: suppress double line when hr precedes h2 ── */
/* If the source already has a horizontal rule before the heading,
   don't add the h2 border-top as well */
.paper-page hr + h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 1.25rem;  /* hr already provides the visual gap */
}

/* ── Paper page: figures and diagram captions ── */
.paper-page figure {
  margin: 2rem 0 2.5rem;
}
.paper-page figcaption {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}
