/* ================================================================
   ATW — 2026 STATE OF AFRICAN TOURISM
   Main Stylesheet
   ================================================================ */

/* ----------------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg:           #080808;
  --bg-surface:   #0E0E0E;
  --bg-elevated:  #161616;
  --bg-card:      #1E1C1A;

  /* Brand */
  --gold:         #C9A84C;
  --gold-light:   #E8CC78;
  --gold-dim:     #7A6530;

  /* Part palette */
  --part1:        #C9A84C;   /* Gold  — Competitiveness */
  --part2:        #4A9B72;   /* Green — Welcome         */
  --part3:        #C4622E;   /* Terra — Growth          */
  --part4:        #3A80C2;   /* Blue  — Winners         */

  /* Aviation heat map */
  --heat-fire:    #FF4500;
  --heat-hot:     #FF8C00;
  --heat-warm:    #FFD700;
  --heat-cold:    #4A9B72;

  /* Text */
  --text:         #F2EDE4;
  --text-muted:   #BDB5AC;   /* was #9A9188 — lifted to ~10:1 contrast on dark bg */
  --text-dim:     #857F79;   /* was #52504C — lifted to ~5.6:1, now passes WCAG AA */

  /* Borders */
  --border:       #202020;
  --border-lg:    #2E2C28;

  /* Light Theme Overrides */
  --bg-light:      #f7f7f7;
  --bg-surface-light: #ffffff;
  --text-light:    #0d0d0d;
  --text-muted-light: #3A3A3A;   /* was #444444 — darkened slightly for light sections */
  --border-light:  #e0e0e0;

  /* Typography */
  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-sans:    'DM Sans', system-ui, -apple-system, sans-serif;

  /* Spacing rhythm */
  --section-v:    clamp(80px, 12vw, 180px);
  --section-h:    clamp(24px, 6vw, 80px);

  /* Max widths */
  --w-wide:       1360px;
  --w-content:    1060px;   /* was 780px — wider editorial column */
  --w-narrow:     580px;

  /* Easing */
  --ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ----------------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: auto; /* Lenis handles this */ }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: 0.75; }
::selection { background: var(--gold); color: #000; }

/* ----------------------------------------------------------------
   3. TYPOGRAPHY
   ---------------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(3.2rem, 7vw, 7rem); }
h2 { font-size: clamp(2.4rem, 5vw, 4.8rem); margin-bottom: 0.5em; }
h3 { font-size: clamp(1.8rem, 3vw, 2.8rem); margin-top: 1.8em; margin-bottom: 0.5em; }
h4 { font-size: clamp(1.2rem, 2vw, 1.8rem); font-family: var(--font-sans); font-weight: 500; letter-spacing: 0; margin-top: 1.4em; margin-bottom: 0.4em; }
p  { font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.8; margin-bottom: 1.4em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.lead {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.65;
  font-weight: 300;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------
   4. LAYOUT HELPERS
   ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--w-wide);
  margin-inline: auto;
  padding-inline: var(--section-h);
}
.container--content {
  max-width: var(--w-content);
  margin-inline: auto;
  padding-inline: var(--section-h);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 60px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ----------------------------------------------------------------
   4b. THEME UTILITIES
   ---------------------------------------------------------------- */
.section--theme-light {
  --bg:           var(--bg-light);
  --bg-surface:   var(--bg-surface-light);
  --bg-card:      #ffffff;
  --text:         var(--text-light);
  --text-muted:   var(--text-muted-light);
  --border:       var(--border-light);
  background:     var(--bg);
  color:          var(--text);
}

.section--theme-light .lead {
  color: var(--text-muted-light);
}

.section--theme-light .inclusion-card,
.section--theme-light .viz-block,
.section--theme-light .takeaway-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.section--theme-light .snapshot {
  border-color: var(--border-light);
}

.section--theme-light h1,
.section--theme-light h2,
.section--theme-light h3,
.section--theme-light h4 {
  color: var(--text-light);
}

/* ----------------------------------------------------------------
   5. STICKY NAV
   ---------------------------------------------------------------- */
/* Persistent logo brand — stays visible even when chapter nav hides */
#nav-brand {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1002;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 3vw, 28px);
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(255,255,255,0.04);
}
#nav-brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.nav-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

#chapter-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  /* Left padding reserves space for persistent #nav-brand */
  padding: 0 clamp(16px, 4vw, 40px) 0 170px;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  /* Always visible — side nav handles chapter context while reading */
}

/* TOC toggle button */
#toc-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-lg);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
  flex-shrink: 0;
  margin-left: 10px;
}
#toc-toggle:hover,
#toc-toggle[aria-expanded="true"] {
  color: var(--gold);
  border-color: var(--gold);
}

.nav-chapters {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.nav-chapters li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
  position: relative;
}
.nav-chapters li a:hover { color: var(--text); border-color: var(--border-lg); }
.nav-chapters li a.active { color: var(--gold); border-color: var(--gold); }
.nav-chapters li a .nav-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-card);
  border: 1px solid var(--border-lg);
  color: var(--text);
  font-size: 0.68rem;
  font-family: var(--font-sans);
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--ease);
}
.nav-chapters li a:hover .nav-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nav-progress {
  display: none; /* #chapter-progress (fixed, colour-coded per part) replaces this — two 2px bars were stacking */
}

/* ----------------------------------------------------------------
   Left side-nav: up arrow · chapter label · down arrow
   ---------------------------------------------------------------- */
#side-nav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;          /* above chapter content, below nav bar */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: rgba(8, 8, 8, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-lg);
  border-radius: 40px;
  padding: 10px 0;
  /* hidden until a chapter is active */
  opacity: 0;
  pointer-events: none;
}
/* #side-nav visibility controlled by GSAP in initSideNav() */
.side-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s;
}
.side-nav-btn:hover:not(:disabled) {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}
.side-nav-btn:disabled {
  opacity: 0.18;
  cursor: default;
}
.side-nav-line {
  width: 1px;
  height: clamp(12px, 2vh, 24px);
  background: var(--border-lg);
  flex-shrink: 0;
  margin: 2px 0;
}
#side-nav-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  padding: 10px 0;
  max-height: 140px;
  overflow: hidden;
}

/* Hide side-nav on narrow screens — not enough horizontal space */
@media (max-width: 900px) { #side-nav { display: none; } }

/* Resume reading badge */
#resume-badge {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.4s var(--ease-expo);
  pointer-events: none;
  max-width: 280px;
}
#resume-badge.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
#resume-badge .rb-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
#resume-badge .rb-text { font-size: 0.8rem; }
#resume-badge .rb-text strong { display: block; color: var(--gold); font-weight: 500; font-size: 0.85rem; }
#resume-badge .rb-close {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 2px 6px;
  flex-shrink: 0;
}
#resume-badge .rb-close:hover { color: var(--text); }

/* ----------------------------------------------------------------
   6. HERO
   ---------------------------------------------------------------- */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* IMAGE: Replace with full-bleed hero photo or video still
     Recommended: High-impact African landscape/wildlife aerial shot
     Size: 1920×1080px minimum */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201, 168, 76, 0.08) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, rgba(8,8,8,0.4) 50%, var(--bg) 100%);
}
.hero-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  z-index: -1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 var(--section-h);
  margin-top: 12vh;
}
.hero-eyebrow {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 8vw, 9rem);
  font-weight: 600;
  line-height: 1.0;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.hero-title .accent { color: var(--gold); }
.hero-subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  font-weight: 400;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 40px;
  line-height: 1.55;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vw, 80px);
  margin-bottom: 56px;
}

.hero-stat .number {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  display: block;
}
.hero-stat .label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}
.hero-stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border-lg);
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-map {
  position: absolute;
  right: 2%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(280px, 38vw, 540px);
  z-index: 1;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-scroll span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ----------------------------------------------------------------
   7. BUTTONS
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--gold);
  color: #000;
}
.btn-primary:hover {
  background: var(--gold-light);
  color: #000;
  opacity: 1;
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-lg);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  opacity: 1;
}

/* ----------------------------------------------------------------
   8. PART DIVIDERS
   ---------------------------------------------------------------- */
.part-divider {
  position: relative;
  min-height: 100vh;      /* full viewport for pin moment */
  display: flex;
  align-items: center;
  overflow: hidden;
}
/* Static dark tint — always visible */
.part-divider::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);   /* pure dark, no competing tint */
  z-index: 0;
}
/* Animated color sweep — injected & driven by GSAP */
.part-divider-sweep {
  position: absolute;
  inset: 0;
  background: var(--part-color, var(--gold));
  opacity: 0.09;
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 0;
}
.part-divider-inner {
  position: relative;
  z-index: 2;
  padding: var(--section-v) var(--section-h);
  max-width: var(--w-wide);
  margin-inline: auto;
  width: 100%;
}
.part-number {
  font-family: var(--font-serif);
  font-size: clamp(8rem, 20vw, 22rem);
  font-weight: 600;
  color: var(--part-color, var(--gold));
  opacity: 0.14;
  line-height: 0.85;
  position: absolute;
  right: var(--section-h);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
  z-index: 2;
  will-change: transform, opacity;
}
.part-label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--part-color, var(--gold));
  margin-bottom: 20px;
  display: block;
}
.part-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5.5vw, 6rem);
  font-weight: 600;
  line-height: 1.05;
  max-width: 760px;
  overflow: hidden;  /* clip for line reveal */
}
/* Each SplitText line inside .part-title */
.part-title .split-line {
  display: block;
  overflow: hidden;
}

/* H3 heading accent line — injected by JS */
.h3-accent {
  display: block;
  width: 52px;
  height: 2px;
  background: var(--chapter-color, var(--gold));
  transform-origin: left center;
  transform: scaleX(0);
  margin-top: 10px;
  border-radius: 1px;
  opacity: 0.65;
}

/* ----------------------------------------------------------------
   9. CHAPTER SECTIONS
   ---------------------------------------------------------------- */
.chapter {
  position: relative;
  padding: var(--section-v) 0;
  border-bottom: 1px solid var(--border);
}

/* Chapter opener: full-screen title card */
.chapter-opener {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--section-v) var(--section-h);
  max-width: var(--w-wide);
  margin-inline: auto;
  position: relative;
}

/* ── Chapter opener background images ─────────────────────────── */
.chapter-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  /* Break out of max-width container to fill full viewport width */
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.72;
  z-index: 0;
  pointer-events: none;
}
/* Fade image into section background at the bottom */
.chapter-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, var(--bg) 100%);
}
/* Lighter touch on light-themed sections */
.section--theme-light .chapter-bg {
  opacity: 0.52;
}
.section--theme-light .chapter-bg::after {
  background: linear-gradient(to bottom, transparent 50%, var(--bg-card) 100%);
}
/* Chapter number sits above bg but below text */
.chapter-number {
  z-index: 1;
}
/* Text content sits above everything */
.chapter-opener > *:not(.chapter-bg):not(.chapter-number) {
  position: relative;
  z-index: 2;
}

/* Per-chapter images — swap file paths as images are ready */
#ch1    .chapter-bg { background-image: url(../assets/images/ch1-opener.jpg); }
/* Ch1 bg is warm/golden — gold number blends in. Override to dark for contrast. */
#ch1    .chapter-number { color: #1a1a1a; }
#ch2    .chapter-bg { background-image: url(../assets/images/ch2-opener.jpg); }
#ch3    .chapter-bg { background-image: url(../assets/images/ch3-opener.jpg); }
#ch4    .chapter-bg { background-image: url(../assets/images/ch4-opener.jpg); }
#ch5    .chapter-bg { background-image: url(../assets/images/ch5-opener.jpg); }
#ch6    .chapter-bg { background-image: url(../assets/images/ch6-opener.jpg); }
#ch7    .chapter-bg { background-image: url(../assets/images/ch7-opener.jpg); }
#ch8    .chapter-bg { background-image: url(../assets/images/ch8-opener.jpg); }
#ch9    .chapter-bg { background-image: url(../assets/images/ch9-opener.jpg); }
#ch10   .chapter-bg { background-image: url(../assets/images/ch10-opener.jpg); }
#ch11   .chapter-bg { background-image: url(../assets/images/ch11-opener.jpg); }
#ch12   .chapter-bg { background-image: url(../assets/images/ch12-opener.jpg); }
.chapter-number {
  font-family: var(--font-serif);
  font-size: clamp(10rem, 25vw, 28rem);
  font-weight: 600;
  color: var(--chapter-color, var(--gold));
  opacity: 0.45;
  line-height: 0.8;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
}
.chapter-label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--gold));
  margin-bottom: 12px;
  display: block;
}
.chapter-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 6.5rem);
  font-weight: 600;
  line-height: 1.05;
  max-width: 900px;
  margin-top: 40px;
  margin-bottom: 8px;
}
.chapter-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
}

/* Snapshot box */
.snapshot {
  background: var(--bg-card);
  border: 1px solid var(--border-lg);
  border-radius: 6px;
  padding: clamp(28px, 3.5vw, 48px) clamp(28px, 4vw, 52px);
  margin: clamp(32px, 5vw, 64px) auto !important; /* Force absolute centering */
  max-width: 800px;
  position: relative;
  overflow: hidden;
  opacity: 0; /* GSAP will reveal on scroll */
  display: block; /* Ensure it's not flexed into a corner */
}
.snapshot-title {
  text-align: center; /* Center the label too */
  margin-bottom: 24px;
}
.snap-viz {
  margin: 32px auto 0;
  max-width: 100%;
}
/* Animated left accent bar — driven by GSAP scaleY */
.snapshot-bar {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--chapter-color, var(--gold));
  transform-origin: top center;
  transform: scaleY(0);
}
.snapshot-title {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--gold));
  margin-bottom: 20px;
  opacity: 0; /* GSAP reveals */
}
.snapshot ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.snapshot ul li {
  padding-left: 22px;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  opacity: 0; /* GSAP staggers */
}
.snapshot ul li strong { color: var(--text); }
.snapshot ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--chapter-color, var(--gold));
  font-size: 0.82rem;
  line-height: 1.6;
}

/* Chapter body */
.chapter-body {
  max-width: var(--w-content);
  margin-inline: auto;
  padding-inline: var(--section-h);
  padding-top: clamp(32px, 5vw, 64px);
  padding-bottom: clamp(60px, 10vw, 120px); /* Smooth transitions out of vertical sections */
}
/* Give body-copy paragraphs proper breathing room — the global 1.4em
   is too tight at chapter-body's wider font size and long line lengths */
.chapter-body p {
  margin-bottom: 2.2em;
}
.chapter-body p:last-child {
  margin-bottom: 0;
}
/* Increase h4 margin-bottom within chapter context — global 0.4em is too tight
   at long-form body copy sizes */
.chapter-body h4 {
  margin-bottom: 0.8em;
}
/* Explicit top margin on paragraphs following a heading — overrides margin-collapse
   and prevents reveal-animation initial states from creating visual overlap */
.chapter-body h3 + p,
.chapter-body h4 + p {
  margin-top: 1.2em;
}

/* ----------------------------------------------------------------
   10. STAT CALLOUTS
   ---------------------------------------------------------------- */
.stat-callout {
  text-align: center;
  padding: clamp(40px, 6vw, 80px) var(--section-h);
}
.stat-callout .number {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 10vw, 10rem);
  font-weight: 600;
  color: var(--chapter-color, var(--gold));
  line-height: 1;
  display: block;
}
.stat-callout .label {
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: var(--text-muted);
  max-width: 400px;
  margin: 12px auto 0;
}

/* Stat grid — default 2×2 for all 4-item grids */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin: clamp(32px, 5vw, 64px) 0;
}

/* 3-column override for 6-item grids (e.g. the "Cannot" manifesto grid) */
.stats-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid-item {
  background: var(--bg-surface);
  padding: clamp(32px, 4vw, 56px);
  position: relative;
  border-top: 2px solid transparent;
  transition: border-color 0.4s var(--ease);
}
.stats-grid-item.lit {
  border-top-color: var(--chapter-color, var(--gold));
}
.stats-grid-item .number {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 600;
  color: var(--chapter-color, var(--gold));
  line-height: 1;
  display: block;
  margin-bottom: 14px;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
/* Counter is inline inside .number — no extra line break */
.stats-grid-item .number .counter {
  display: inline;
}
.stats-grid-item .label {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ----------------------------------------------------------------
   11. PULLQUOTES
   ---------------------------------------------------------------- */
.pullquote {
  position: relative;
  padding: clamp(32px, 5vw, 64px) clamp(36px, 6vw, 72px) clamp(32px, 5vw, 64px) clamp(52px, 7vw, 84px);
  margin: clamp(56px, 9vw, 110px) auto; /* Centered */
  overflow: hidden;
  max-width: 900px;
}
/* Animated left accent bar — injected and driven by GSAP */
.pullquote-bar {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--chapter-color, var(--gold));
  transform-origin: top center;
  transform: scaleY(0);
}
/* Oversized decorative quote mark */
.pullquote::before {
  content: '\201C';
  font-family: var(--font-serif);
  font-size: clamp(7rem, 14vw, 12rem);
  color: var(--chapter-color, var(--gold));
  opacity: 0.28;
  position: absolute;
  top: -12px;
  left: 12px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.pullquote p {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  font-style: italic;
  line-height: 1.42;
  color: var(--text);
  margin-bottom: 22px;
}
/* Each SplitText line wrapper */
.pullquote .pq-line {
  overflow: hidden;
  display: block;
}
.pullquote cite {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--gold));
  font-style: normal;
  opacity: 0.75;
}

/* ----------------------------------------------------------------
   12. DATA VISUALIZATION WRAPPERS
   ---------------------------------------------------------------- */
.viz-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-lg);
  border-radius: 8px;
  padding: clamp(32px, 4vw, 56px);
  margin: clamp(40px, 6vw, 80px) auto; /* Centered */
  position: relative;
  overflow: hidden;
  max-width: 800px;
}
.viz-title {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.viz-source {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Aviation heat map — full-bleed treatment */
#ch1-aviation {
  padding: clamp(32px, 4vw, 48px) clamp(32px, 4vw, 48px) clamp(24px, 3vw, 36px);
  overflow: visible;
}
#africa-map-viz {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
#africa-ch1-map-container {
  width: 100%;
  max-width: 100%;
}
.map-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 32px;
  margin-top: 28px;
}
.map-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.map-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 22px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 90px; align-items: center; gap: 20px; }
.bar-label { font-size: 1rem; color: var(--text-muted); text-align: right; font-family: var(--font-sans); }
.bar-track { height: 16px; background: var(--border-lg); border-radius: 8px; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 8px;
  width: 0%; /* animated in */
  transition: none; /* GSAP handles this */
  background: var(--chapter-color, var(--gold));
}
.bar-value { font-size: 1rem; color: var(--text-light); font-family: var(--font-serif); font-weight: 600; }

/* Trust equation */
.trust-equation {
  text-align: center;
  padding: clamp(40px, 6vw, 80px) var(--section-h);
  margin: 0 auto;
  max-width: 800px;
}
.trust-formula {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  color: var(--text);
  margin-bottom: 40px;
  line-height: 1.8;
}
.trust-formula .numerator, .trust-formula .denominator {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
}
.trust-formula .fraction-bar {
  width: 100%;
  height: 2px;
  background: var(--gold);
  margin: 6px 0;
}
.trust-formula .equals {
  margin: 0 24px;
  color: var(--gold);
}

/* Barbell diagram */
.barbell-html {
  display: flex;
  align-items: stretch;   /* weights grow to same height */
  gap: 0;
  max-width: 1020px;
  margin: 40px auto; /* Centered with vertical space */
}

.barbell-weight {
  flex: 0 0 280px;
  border: 1.5px solid var(--part1);
  border-radius: 10px;
  padding: 40px 28px;
  text-align: center;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.barbell-weight-title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-style: italic;
  color: var(--part1);
  margin: 0 0 16px;
}

.barbell-weight-sub {
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.8;
}

.barbell-connector {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;  /* vertically centre the label + bar + sub */
  gap: 12px;
  padding: 0 8px;
}

.barbell-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--part1), var(--border-lg) 40%, var(--border-lg) 60%, var(--part1));
  border-radius: 2px;
  transform-origin: left center;
  opacity: 0.5;
}

.barbell-mid-title {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  text-align: center;
}

.barbell-mid-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
  text-align: center;
  opacity: 0.7;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .barbell-html { flex-direction: column; gap: 0; }
  .barbell-weight { flex: none; width: 100%; }
  .barbell-connector { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 12px 0; }
  .barbell-bar { width: 3px; height: 40px; transform-origin: top center; }
}

/* OTA flow diagram */
.flow-diagram {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
.flow-diagram svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* ----------------------------------------------------------------
   13. IMAGE BLOCKS
   ---------------------------------------------------------------- */
.image-block {
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  margin: clamp(32px, 5vw, 64px) 0;
  position: relative;
}
.image-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-placeholder {
  background: var(--bg-elevated);
  border: 2px dashed var(--border-lg);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  color: var(--text-dim);
  gap: 12px;
  font-size: 0.85rem;
}
.image-placeholder .placeholder-icon { font-size: 2rem; }
.image-placeholder .placeholder-title { font-weight: 500; color: var(--text-muted); }

/* Full-bleed image section */
.full-bleed-image {
  width: 100%;
  height: clamp(280px, 45vw, 600px);
  overflow: hidden;
  position: relative;
}
.full-bleed-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08); /* parallax start */
}

/* ----------------------------------------------------------------
   14. VIDEO BLOCKS
   ---------------------------------------------------------------- */
.video-block {
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  margin: clamp(32px, 5vw, 64px) 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-lg);
}
/* VIDEO PLACEHOLDER — Replace inner content with <iframe> or <video> when footage available */
.video-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  text-align: center;
}
.video-play-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gold);
}
.video-placeholder p { color: var(--text-dim); font-size: 0.85rem; margin: 0; }
.video-placeholder strong { color: var(--text-muted); font-size: 1rem; }

/* ----------------------------------------------------------------
   15. TAKEAWAY / ACTION BOXES
   ---------------------------------------------------------------- */
.takeaway-box {
  background: var(--bg-card);
  border: 1px solid var(--border-lg);
  border-radius: 8px;
  padding: clamp(32px, 4vw, 56px);
  margin: clamp(40px, 6vw, 80px) 0;
}
.takeaway-box h4 {
  color: var(--chapter-color, var(--gold));
  margin-bottom: 24px;
}
.action-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.action-list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  align-items: start;
}
.action-number {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--chapter-color, var(--gold));
  opacity: 0.6;
  line-height: 1.4;
}
.action-list li p { margin: 0; font-size: 0.95rem; }
.action-list li strong { color: var(--text); display: block; margin-bottom: 4px; }

/* ----------------------------------------------------------------
   16. DATA BOX
   ---------------------------------------------------------------- */
.data-box {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: clamp(32px, 4vw, 56px);
  margin: clamp(40px, 6vw, 80px) 0;
  /* Always dark bg — pin dark-theme token values so light-section overrides don't bleed in */
  --text:       #E8E2D9;
  --text-muted: #BDB5AC;
  --border:     #202020;
}
.data-box-title {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--gold));
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.data-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.data-list li {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
  padding-bottom: clamp(20px, 2.5vw, 28px);
  border-bottom: 1px solid var(--border);
}
.data-list li:last-child { border-bottom: none; padding-bottom: 0; }
.data-list .data-num {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 4.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--chapter-color, var(--gold));
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.data-list .data-desc { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; }
.data-list .data-desc strong { color: var(--text); }

/* ----------------------------------------------------------------
   17. TRUST MATRIX TABLE
   ---------------------------------------------------------------- */
.trust-matrix {
  width: 100%;
  border-collapse: collapse;
  margin: clamp(32px, 5vw, 64px) 0;
  font-size: 0.88rem;
}
.trust-matrix th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 2px solid var(--border-lg);
}
.trust-matrix td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
  line-height: 1.6;
}
.trust-matrix td:first-child { color: var(--text); font-weight: 500; }

/* ----------------------------------------------------------------
   18. INCLUSION SECTION CARDS
   ---------------------------------------------------------------- */
.inclusion-card {
  background: var(--bg-card);
  border: 1px solid var(--border-lg);
  border-radius: 8px;
  padding: clamp(28px, 4vw, 48px);
  margin-bottom: 32px;
}
.inclusion-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.inclusion-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.inclusion-card h4 { font-size: 1.3rem; margin: 0; }

/* ----------------------------------------------------------------
   19. GROWTH SECTOR CARDS (horizontal scroll)
   ---------------------------------------------------------------- */
.sectors-scroll-container {
  overflow: hidden;
  position: relative;
}
.sectors-track {
  display: flex;
  gap: 24px;
  padding: 0 var(--section-h) clamp(32px, 4vw, 60px);
  will-change: transform;
}
.sector-card {
  flex-shrink: 0;
  width: clamp(280px, 35vw, 440px);
  background: var(--bg-card);
  border: 1px solid var(--border-lg);
  border-radius: 8px;
  overflow: hidden;
}
.sector-card-image {
  height: 220px;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}
.sector-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 0.6s var(--ease);
}
.sector-card:hover .sector-card-image img { transform: scale(1); }
.sector-card-body { padding: 28px; }
.sector-card-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--gold));
  margin-bottom: 10px;
}
.sector-card h4 { font-size: 1.4rem; margin-bottom: 12px; }
.sector-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0; line-height: 1.65; }

/* ----------------------------------------------------------------
   20. MANIFESTO (Conclusion)
   ---------------------------------------------------------------- */
#conclusion {
  background: var(--bg);
  min-height: 100vh;
  padding: var(--section-v) 0;
}
.manifesto-intro {
  max-width: var(--w-content);
  margin: 0 auto clamp(60px, 8vw, 120px);
  padding-inline: var(--section-h);
  text-align: center;
}
.manifesto-list {
  max-width: 900px;
  margin-inline: auto;
  padding-inline: var(--section-h);
  list-style: none;
  counter-reset: manifesto;
  overflow: hidden; /* clip off-screen slide-in x offsets */
}
.manifesto-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  align-items: start;
  padding: clamp(32px, 4vw, 56px) 0;
  border-bottom: 1px solid var(--border);
  text-align: left; /* Keep text left-aligned, but container centered */
}
.manifesto-item:last-child { border-bottom: none; }
.manifesto-num {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 600;
  color: var(--gold);
  opacity: 0.25;
  line-height: 1;
  text-align: right;
}
.manifesto-content h4 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin-bottom: 10px;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 500;
}
.manifesto-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

/* ----------------------------------------------------------------
   20b. CARD HOVER LIFTS
   Subtle elevation on interactive cards — CSS only, no JS needed
   ---------------------------------------------------------------- */
.inclusion-card,
.takeaway-box,
.data-box,
.viz-block {
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.inclusion-card:hover,
.takeaway-box:hover,
.data-box:hover,
.viz-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  border-color: rgba(201, 168, 76, 0.22);
}

/* Reading-time badge injected by JS */
.reading-time {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 14px;
  font-family: var(--font-sans);
}

/* Chapter progress bar — thin gold line at top of each chapter */
#chapter-progress {
  position: fixed;
  top: 56px;           /* sits just below the sticky nav */
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--chapter-color, var(--gold));
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s var(--ease), background-color 0.5s var(--ease);
  pointer-events: none;
  will-change: width;
}
#chapter-progress.visible { opacity: 1; }

/* Data-num scroll-reveal — initial state set by JS */
.data-num[data-count-to] { cursor: default; }

/* ----------------------------------------------------------------
   21. FOOTER
   ---------------------------------------------------------------- */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: clamp(40px, 6vw, 80px) var(--section-h);
  text-align: center;
}
.footer-logo { height: 40px; margin: 0 auto 24px; }
footer p { font-size: 0.82rem; color: var(--text-dim); margin: 0; }

/* ----------------------------------------------------------------
   22. SECTION REVEAL ANIMATIONS (initial states)
   Only apply when JS is confirmed loaded — prevents invisible content on JS fail
   ---------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
}
.js .reveal-left {
  opacity: 0;
  transform: translateX(-40px);
}
.js .reveal-right {
  opacity: 0;
  transform: translateX(40px);
}
.js .reveal-scale {
  opacity: 0;
  transform: scale(0.94);
}

/* Stagger children */
.js .stagger > * {
  opacity: 0;
  transform: translateY(24px);
}

/* Hero elements — only hide when JS running */
.js .hero-eyebrow,
.js .hero-title,
.js .hero-subtitle,
.js #hero-stats,
.js #hero-cta,
.js #hero-scroll,
.js .hero-map {
  opacity: 0;
}
.js .manifesto-item {
  opacity: 0;
  /* x/opacity on children is set by JS — item is just the opacity gate */
}

/* ----------------------------------------------------------------
   23. PART COLOR OVERRIDES
   ---------------------------------------------------------------- */
[data-part="1"] { --chapter-color: var(--part1); }
[data-part="2"] { --chapter-color: var(--part2); }
[data-part="3"] { --chapter-color: var(--part3); }
[data-part="4"] { --chapter-color: var(--part4); }

/* ----------------------------------------------------------------
   24. SCROLLBAR
   Hide the native scrollbar completely — GSAP pin spacers cause a
   second scrollbar ghost when the native bar appears/disappears.
   Reading progress is shown by the #progress bar at the top instead.
   ---------------------------------------------------------------- */
html {
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge */
}
html::-webkit-scrollbar { display: none; }  /* Chrome/Safari/Opera */
body::-webkit-scrollbar { display: none; }

/* ----------------------------------------------------------------
   25. RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .hero-stat-divider { display: none; }
  .hero-map { display: none; }
  .chapter-number { display: none; }
  .part-number { display: none; }
  .bar-row { grid-template-columns: 90px 1fr 60px; }
  .manifesto-item { grid-template-columns: 48px 1fr; gap: 16px; }
  .trust-matrix { font-size: 0.78rem; }
  .nav-chapters { display: none; }
  /* On mobile, nav only needs to show the TOC toggle — reduce padding */
  #chapter-nav { padding-left: 130px; justify-content: flex-end; }
  /* TOC becomes the primary chapter navigation on mobile */
  #toc-toggle { display: flex; }
  /* Tighter brand on mobile */
  #nav-brand { padding: 0 16px; }
  .nav-logo { height: 36px; }
}
@media (max-width: 480px) {
  .hero-cta-group { flex-direction: column; align-items: stretch; }
  .snapshot { margin-inline: 16px; }
  #back-to-top { right: 20px; bottom: 96px; }
  #resume-badge { right: 20px; bottom: 20px; }
}

/* ----------------------------------------------------------------
   26. SNAPSHOT MICRO-VISUALIZATIONS
   Compact inline data charts inside snapshot cards
   ---------------------------------------------------------------- */
.snap-viz {
  margin: 40px auto 0; /* Centered */
  padding-top: 20px;
  border-top: 1px solid var(--border);
  max-width: 600px;
}
.snap-viz-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--gold));
  margin-bottom: 14px;
  opacity: 0.8;
}
.snap-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.snap-bar-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  font-family: var(--font-sans);
  line-height: 1.3;
}
.snap-bar-val {
  font-size: 0.88rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 600;
}
/* Smaller bar tracks for snapshots */
.snap-viz .bar-track {
  height: 10px;
  border-radius: 5px;
}
.snap-viz .bar-track .bar-fill {
  border-radius: 5px;
}

/* Ratio bar: two-tone (certified vs uncertified, etc.) */
.ratio-bar-wrap { margin: 4px 0; }
.ratio-bar-track {
  height: 12px;
  background: var(--border-lg);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.ratio-fill {
  height: 100%;
  background: var(--chapter-color, var(--gold));
  border-radius: 6px 0 0 6px;
  width: 0%;
  transition: none; /* GSAP handles this */
}
.ratio-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
}
.ratio-label-a {
  font-size: 0.78rem;
  color: var(--chapter-color, var(--gold));
  font-family: var(--font-serif);
  font-weight: 600;
}
.ratio-label-b {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-sans);
}

/* Growth display: $X → $Y */
.growth-display {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}
.growth-from {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  color: var(--text-muted);
  font-weight: 600;
}
.growth-arrow-txt {
  font-size: 1.1rem;
  color: var(--text-dim);
}
.growth-to {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  color: var(--chapter-color, var(--gold));
  font-weight: 600;
}
.growth-cagr {
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Two-column stat pair inside snapshots */
.snap-stat-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
.snap-stat { text-align: center; }
.snap-stat-num {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--chapter-color, var(--gold));
  font-weight: 600;
  line-height: 1;
  display: block;
}
.snap-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .snap-bar-row { grid-template-columns: 80px 1fr 50px; gap: 8px; }
  .snap-stat-pair { grid-template-columns: 1fr; gap: 12px; }
}

/* ----------------------------------------------------------------
   27. TABLE OF CONTENTS OVERLAY
   ---------------------------------------------------------------- */
#toc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  visibility: hidden;
}
#toc-overlay.open {
  pointer-events: auto;
  visibility: visible;
}
/* Dark backdrop */
#toc-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 4, 0.72);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
#toc-overlay.open::before { opacity: 1; }

/* Slide-in panel */
#toc-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
#toc-overlay.open #toc-panel { transform: translateX(0); }

#toc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.toc-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 5px;
}
.toc-report-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
}
#toc-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 0.72rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}
#toc-close:hover { color: var(--gold); border-color: var(--gold); }

#toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-lg) transparent;
}
#toc-list::-webkit-scrollbar { width: 3px; }
#toc-list::-webkit-scrollbar-thumb { background: var(--border-lg); border-radius: 3px; }

.toc-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 28px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  position: relative;
  cursor: pointer;
}
.toc-item:last-child { border-bottom: none; }
.toc-item:hover { background: var(--bg-elevated); }
.toc-item.active { background: rgba(201, 168, 76, 0.06); }
.toc-item.active .toc-name,
.toc-item.active .toc-num { color: var(--gold); }

/* Visited: left edge accent bar */
.toc-item.visited::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 2px;
  background: var(--chapter-color, var(--gold));
  border-radius: 0 2px 2px 0;
  opacity: 0.5;
}

.toc-num {
  flex-shrink: 0;
  width: 30px;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: right;
  padding-top: 2px;
  line-height: 1.3;
}
.toc-body { flex: 1; min-width: 0; }
.toc-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 2px;
  transition: color 0.2s;
}
.toc-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
}
.toc-time {
  flex-shrink: 0;
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
  padding-top: 4px;
  font-family: var(--font-sans);
}

#toc-footer {
  padding: 12px 28px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
#toc-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border-lg);
  border-radius: 3px;
  font-size: 0.62rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: var(--bg-elevated);
}

/* ----------------------------------------------------------------
   28. BACK TO TOP
   ---------------------------------------------------------------- */
#back-to-top {
  position: fixed;
  bottom: 108px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-lg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              border-color 0.25s, color 0.25s;
  pointer-events: none;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover { border-color: var(--gold); color: var(--gold); }

/* ----------------------------------------------------------------
   29. READING TIME & VISITED INDICATORS
   ---------------------------------------------------------------- */
/* Reading time badge injected on chapter openers */
.reading-time {
  display: inline-block;
  font-size: 0.65rem;
  font-family: var(--font-sans);
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 10px;
}

/* Visited dot under nav chapter links */
.nav-chapters li a.visited::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.55;
}

/* ----------------------------------------------------------------
   30. HORIZONTAL SCROLL SECTION
   ---------------------------------------------------------------- */
#horizontal-section-1 { position: relative; --h-accent: var(--part1); }
#horizontal-section   { position: relative; --h-accent: var(--part3); }
#horizontal-section-4 { position: relative; --h-accent: var(--part4); }

/* Trends Unified Section */
#h-trends-ch2 {
  position: relative;
  --h-accent: var(--gold);
}

/* 2+2 Content Layout */
.h-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  width: 100%;
  max-width: 1400px;
  align-items: end;
  padding: 0 clamp(40px, 7vw, 100px) clamp(40px, 6vw, 100px);
}

/* Trend panels — text-forward, no image, gradient backdrop */
.h-panel--trend {
  align-items: flex-end;  /* content at bottom, matching other panels */
}
.h-panel-trend-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 100%, rgba(201,168,76, 0.13) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(201,168,76, 0.05) 0%, transparent 40%),
    var(--bg-card);
  z-index: 0;
}
/* Wider content column for the richer trend text */
/* Panel inside the grid */
.h-panel-card {
  position: relative;
  z-index: 2;
}
.h-panel--trend .h-panel-body {
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
}
/* Trend icon inline with the part label */
.h-panel--trend .h-panel-part {
  font-size: 0.78rem;
}

/* SVG icon above part label in trend panels */
.h-panel-icon {
  width: 48px;
  height: 48px;
  color: var(--h-accent, var(--gold));
  margin-bottom: 28px;
  opacity: 0;               /* JS animates in */
}
.h-panel-icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.h-panel-icon .icon-path {
  stroke: currentColor;
  fill: none;
  stroke-dasharray: var(--path-len, 200);
  stroke-dashoffset: var(--path-len, 200);
}

.h-track {
  display: flex;
  flex-wrap: nowrap;
  will-change: transform;
}

.h-panel {
  position: relative;
  min-width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  contain: content;
}

.h-panel-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.h-panel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  will-change: transform;
}
.h-panel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(8,8,8,0.92) 0%,
    rgba(8,8,8,0.65) 45%,
    rgba(8,8,8,0.2) 100%
  );
}

.h-panel-content {
  position: relative;
  z-index: 2;
  padding: clamp(40px, 6vw, 80px) clamp(40px, 7vw, 100px);
  max-width: 580px;
}

.h-panel-part {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--h-accent, var(--part3));
  margin-bottom: 12px;
}

.h-panel-num {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 12vw, 12rem);
  font-weight: 600;
  color: var(--h-accent, var(--part3));
  opacity: 0.15;
  line-height: 0.85;
  display: block;
  margin-bottom: -20px;
}

.h-panel-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 8px;
  color: var(--text);
}

.h-panel-sub {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--h-accent, var(--part3));
  font-style: italic;
  font-family: var(--font-serif);
  margin-bottom: 20px;
}

.h-panel-body {
  font-size: clamp(0.88rem, 1.3vw, 1rem);
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 420px;
}

.h-panel-stat {
  font-size: clamp(0.78rem, 1.2vw, 0.9rem);
  color: var(--white);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 8px 16px;
  display: inline-block;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(201,168,76,0.5); /* Increased contrast shadows */
  font-weight: 700; /* Bold for readability */
}

.h-panel-cta {
  font-size: 0.8rem;
}

/* Panel progress dots */
.h-progress {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.h-progress.visible { opacity: 1; pointer-events: all; }
.h-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.h-dot.active {
  background: var(--part3);
  border-color: var(--part3);
  transform: scale(1.3);
}

/* Panel title counter on right edge */
.h-panel-counter {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  z-index: 3;
}

/* ----------------------------------------------------------------
   27. D3 AFRICA MAP STYLES
   ---------------------------------------------------------------- */
#africa-hero-map-container svg,
#africa-ch1-map-container svg {
  overflow: visible;
}

.africa-country {
  transition: none; /* GSAP handles all transitions */
  cursor: default;
}
.africa-country:hover {
  filter: brightness(1.3);
}

.africa-region-label {
  pointer-events: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  opacity: 0;
}

/* ----------------------------------------------------------------
   28. HORIZONTAL SCROLL PANEL ANIMATION INITIAL STATES
   ---------------------------------------------------------------- */
.js .h-panel-icon,
.js .h-panel-part,
.js .h-panel-num,
.js .h-panel-title,
.js .h-panel-sub,
.js .h-panel-stat,
.js .h-panel-body,
.js .h-panel-cta {
  opacity: 0;
  transform: translateY(30px);
}

/* ================================================================
   A11Y — WCAG COMPLIANCE FIXES
   ================================================================ */

/* 1. Skip link -------------------------------------------------- */
.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 9999;
  background: var(--gold);
  color: #1a1600;
  padding: 10px 20px;
  border-radius: 0 0 6px 6px;
  font-weight: 600;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s var(--ease);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.skip-link:focus {
  top: 0;
  outline: none;
}

/* 2. SR-only utility -------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* 3. Focus-visible — keyboard navigation rings ----------------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
/* Circular elements */
#toc-toggle:focus-visible,
#toc-close:focus-visible,
#back-to-top:focus-visible,
.rb-close:focus-visible,
.nav-chapters li a:focus-visible {
  outline-offset: 2px;
  border-radius: 50%;
}
.toc-item:focus-visible {
  outline-offset: -2px;
  border-radius: 0;
}
/* Remove default outline when focus-visible is supported */
:focus:not(:focus-visible) { outline: none; }

/* 4. Font size bumps — raise sub-12px text to minimum 12px ------ */
.snap-viz-label          { font-size: 0.72rem; }  /* was 0.62rem */
.toc-label               { font-size: 0.72rem; }  /* was 0.65rem */
.toc-sub                 { font-size: 0.78rem; }  /* was 0.70rem */
.toc-time                { font-size: 0.72rem; }  /* was 0.62rem */
#toc-footer              { font-size: 0.72rem; }  /* was 0.62rem */
#toc-footer kbd          { font-size: 0.72rem; }  /* was 0.62rem */
.reading-time            { font-size: 0.75rem; }  /* was 0.65rem */
.viz-title               { font-size: 0.78rem; }  /* was 0.72rem */
.viz-source              { font-size: 0.78rem; }  /* was 0.70rem */
.growth-cagr             { font-size: 0.75rem; }  /* was 0.68rem */
.ratio-label-a,
.ratio-label-b           { font-size: 0.8rem;  }  /* was 0.78rem */
.snap-bar-label          { font-size: 0.82rem; }  /* was 0.78rem */
.snap-bar-val            { font-size: 0.92rem; }  /* was 0.88rem */

/* 5. Contrast — move dim text up to muted for readable content -- */
.viz-source              { color: var(--text-muted); }
.growth-cagr             { color: var(--text-muted); }
.toc-sub                 { color: var(--text-muted); opacity: 0.8; }
.ratio-label-b           { color: var(--text-muted); opacity: 0.7; }
.snap-viz-label          { color: var(--chapter-color, var(--gold)); opacity: 0.85; }

/* 6. Sports qualitative cards ----------------------------------- */
.sports-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 12px;
  transition: border-color 0.25s var(--ease);
}
.sports-card--recurring {
  border-color: var(--chapter-color, var(--gold));
}
.sports-card--recurring .snap-stat-num {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}
.sports-card--once {
  opacity: 0.65;
}

/* 7. Stats grid scale — ensure number never wraps at any size --- */
#intro-stats .stats-grid-item .number {
  font-size: clamp(1.8rem, 3.5vw, 3.2rem);
}

/* 8. Improved --text-dim for decorative-but-visible content ----- */
/* Raise from ~2.6:1 to ~4.0:1 contrast on dark bg */
:root {
  --text-dim: #6F6D69;
}

/* 9. Data table (cost comparison, procedure tables) ------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
}
.data-table thead tr {
  border-bottom: 2px solid var(--chapter-color, var(--gold));
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.data-table th:not(:first-child) {
  text-align: right;
}
.data-table td {
  padding: 8px 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table td:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ----------------------------------------------------------------
   DESKTOP NOTICE
   ---------------------------------------------------------------- */
#desktop-notice {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 3000;
  width: min(480px, calc(100vw - 32px));
  background: var(--bg-elevated);
  border: 1px solid var(--border-lg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
#desktop-notice.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
#desktop-notice-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-muted);
}
#desktop-notice-body svg {
  flex-shrink: 0;
  color: var(--gold);
}
#desktop-notice-body p {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0;
  color: var(--text-muted);
}
#desktop-notice-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
  transition: color 0.2s;
}
#desktop-notice-close:hover { color: var(--text); }

/* Auto-dismiss progress bar — animates from full width to 0 */
#desktop-notice-progress {
  height: 2px;
  background: var(--gold);
  opacity: 0.5;
  transform-origin: left center;
  transform: scaleX(1);
}

/* ----------------------------------------------------------------
   SEARCH — toggle button (mirrors #toc-toggle)
   ---------------------------------------------------------------- */
#search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-lg);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
  flex-shrink: 0;
  margin-left: 10px;
}
#search-toggle:hover,
#search-toggle[aria-expanded="true"] {
  color: var(--gold);
  border-color: var(--gold);
}

/* ----------------------------------------------------------------
   SEARCH — overlay
   ---------------------------------------------------------------- */
#search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  pointer-events: none;
  visibility: hidden;
}
#search-overlay.open {
  pointer-events: auto;
  visibility: visible;
}

#search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 4, 0.80);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#search-overlay.open #search-backdrop { opacity: 1; }

#search-panel {
  position: absolute;
  top: clamp(60px, 8vh, 100px);
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  width: min(680px, calc(100vw - 40px));
  background: var(--bg-elevated);
  border: 1px solid var(--border-lg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
#search-overlay.open #search-panel {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

#search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  color: var(--text-dim);
}
#search-input-wrap svg { flex-shrink: 0; }

#search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  caret-color: var(--gold);
}
#search-input::placeholder { color: var(--text-dim); }
#search-input::-webkit-search-cancel-button { display: none; }

#search-close {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  padding: 3px 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.03em;
}
#search-close:hover { color: var(--text); border-color: var(--border-lg); }

#search-results {
  max-height: min(480px, 60vh);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-lg) transparent;
}
#search-results::-webkit-scrollbar { width: 3px; }
#search-results::-webkit-scrollbar-thumb { background: var(--border-lg); border-radius: 3px; }

.search-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  text-decoration: none;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover,
.search-result[aria-selected="true"] {
  background: var(--bg-card);
}
.search-result[aria-selected="true"] .search-result-title {
  color: var(--gold);
}

.search-result-meta {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--gold));
  opacity: 0.75;
}
.search-result-title {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  transition: color 0.15s;
}
.search-result-snippet {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-snippet mark {
  background: transparent;
  color: var(--gold-light);
  font-weight: 500;
}

#search-empty {
  padding: 28px 20px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
  font-family: var(--font-sans);
  display: none;
}
#search-empty.visible { display: block; }

/* ----------------------------------------------------------------
   Source attribution labels on visa list items (Ch. 1)
   ---------------------------------------------------------------- */
.source-attr {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  opacity: 0.7;
  margin-left: 4px;
}
