/* ============================================================
   Charles Cable Savage — V2 cinematic scrollytelling
   Dark theme per brief: #0F172A, #C9A962, #F5F0E6
   Fonts: Playfair Display, EB Garamond, Inter
   ============================================================ */

:root {
  --bg:           #0F172A;
  --bg-deep:      #0a1020;
  --bg-deeper:    #06090f;
  --bg-paper:     #1a2335;
  --ink:          #F5F0E6;
  --ink-muted:    #A8A29E;
  --ink-faded:    #7B828F;  /* WCAG AA: 4.62:1 on --bg (was #6b7280 = 3.69:1 fail) */
  --brass:        #C9A962;
  --brass-deep:   #a88e4f;
  --brass-bright: #e3c47a;
  --olive:        #556B2F;
  --olive-bright: #7a8a4a;
  --rule:         rgba(201, 169, 98, 0.22);
  --rule-soft:    rgba(245, 240, 230, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================================
   ACCESSIBILITY — focus indicators + skip link
   ============================================================ */

/* Visible focus ring for keyboard users (does not appear on mouse click) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 4px;
}

/* Skip link — hidden until keyboard-focused, then jumps to main content */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 9999;
  padding: 12px 18px;
  background: var(--brass);
  color: var(--bg);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.2s ease;
}
.skip-link:focus, .skip-link:focus-visible {
  top: 8px;
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* Honour EXIF orientation tags — several high-res flatbed scans were
     appearing sideways in browsers that default to ignoring rotation metadata. */
  image-orientation: from-image;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4 {
  font-family: 'Playfair Display', 'Instrument Serif', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.08;
  color: var(--ink);
}

.kicker, .nav-link, .timeline-year, .ui-label, .credit, .meta {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 400;
  font-size: 11px;
  color: var(--brass);
}

a {
  color: var(--brass);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 169, 98, 0.4);
  transition: color .25s ease, border-color .25s ease;
}
a:hover { color: var(--brass-bright); border-bottom-color: var(--brass-bright); }

em, .italic-serif {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
}

strong { font-weight: 600; color: #fbf6e4; }

p { margin: 0 0 1.2em; }

/* ============================================================
   PAGE-WIDE FRAMEWORK
   ============================================================ */

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--brass-deep), var(--brass-bright), var(--brass));
  z-index: 1000;
  transition: width 60ms linear;
  box-shadow: 0 0 8px rgba(201, 169, 98, 0.6);
}

.floating-nav {
  position: fixed;
  top: 24px; right: 28px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 11px 22px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--rule-soft);
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .55s ease, transform .55s ease;
}
.floating-nav.show { opacity: 1; transform: translateY(0); }
.floating-nav a { color: var(--ink-muted); border: none; transition: color .25s; }
.floating-nav a:hover { color: var(--brass); }
.floating-nav .nav-name {
  color: var(--brass);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  padding-right: 16px;
  border-right: 1px solid var(--rule-soft);
}

@media (max-width: 760px) {
  .floating-nav { right: 12px; top: 12px; gap: 14px; padding: 9px 16px; font-size: 9.5px; }
  .floating-nav .nav-name { font-size: 12px; padding-right: 10px; }
  .floating-nav .nav-extra { display: none; }
}

/* ============================================================
   STICKY MINI-TIMELINE — chapter dots connected by a brass line
   ============================================================ */

.timeline-strip {
  position: fixed;
  top: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 800;
  display: flex;
  align-items: center;
  padding: 8px 18px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--rule-soft);
  border-radius: 100px;
  opacity: 0;
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}
.timeline-strip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.timeline-strip ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  position: relative;
}
.timeline-strip ol::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--brass);
  opacity: 0.35;
  z-index: 0;
}
.timeline-strip li {
  position: relative;
  z-index: 1;
  padding: 0 5px;
}
.timeline-strip .ts-ch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--ink-muted);
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--rule-soft);
  border-radius: 50%;
  transition: color .25s ease, background .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
}
.timeline-strip .ts-ch:hover {
  color: var(--brass-bright);
  border-color: var(--brass);
  transform: scale(1.12);
}
.timeline-strip .ts-ch.active {
  color: var(--bg);
  background: var(--brass-bright);
  border-color: var(--brass-bright);
  font-weight: 500;
  box-shadow: 0 0 18px rgba(227, 196, 122, 0.45);
  transform: scale(1.12);
}

/* Mid-size screens: move strip BELOW the floating-nav to avoid overlap */
@media (max-width: 1100px) {
  .timeline-strip { top: 78px; }
}
@media (max-width: 880px) {
  .timeline-strip { padding: 6px 14px; }
  .timeline-strip .ts-ch { width: 24px; height: 24px; font-size: 11px; }
  .timeline-strip li { padding: 0 3px; }
}
@media (max-width: 560px) {
  .timeline-strip { display: none; }  /* tiny screens fall back to the existing top-right nav */
}

/* The chapter marker that lives in the left rail */
.chapter-rail {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transition: opacity .6s ease;
}
.chapter-rail.show { opacity: 1; }
.chapter-rail a {
  color: var(--ink-faded);
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: color .3s, transform .3s;
  font-weight: 500;
  white-space: nowrap;
}
.chapter-rail a::before {
  content: "";
  display: inline-block;
  width: 16px; height: 1px;
  background: var(--ink-faded);
  transition: width .3s, background .3s;
  flex-shrink: 0;
}
.chapter-rail a:hover {
  color: var(--brass);
  transform: translateX(4px);
}
.chapter-rail a.active { color: var(--brass); }
.chapter-rail a:hover::before, .chapter-rail a.active::before {
  width: 30px;
  background: var(--brass);
}
.chapter-rail a .roman {
  color: var(--brass);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.7;
  margin-right: 6px;
}
@media (max-width: 1100px) { .chapter-rail { display: none; } }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 80px 40px 160px;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(85, 107, 47, 0.12), transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(201, 169, 98, 0.08), transparent 60%),
    var(--bg);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.96  0 0 0 0 0.94  0 0 0 0 0.9  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 0.85fr;
  gap: 70px;
  align-items: center;
  max-width: 1180px;
  width: 100%;
  z-index: 2;
}

.hero-portrait-wrap {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(201, 169, 98, 0.25),
    0 0 0 9px var(--bg),
    0 0 0 10px rgba(201, 169, 98, 0.4),
    0 30px 80px rgba(0,0,0,0.5);
  background: var(--bg-deep);
  transform: translateY(40px);
  opacity: 0;
}
.hero-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: sepia(0.18) contrast(1.05) brightness(0.95) saturate(0.85);
  transform: scale(1.08);
  transition: transform 8s cubic-bezier(.2,.5,.2,1);
}
.hero-portrait-wrap.in img { transform: scale(1); }
.hero-portrait-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.hero-text {
  position: relative;
}
.hero-text .kicker {
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 0.95;
  margin: 0 0 36px;
  letter-spacing: -0.02em;
}
.hero h1 .word {
  display: inline-block;
  overflow: hidden;
}
.hero h1 .word span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
}
.hero h1 em {
  color: var(--brass);
  font-style: italic;
  font-family: 'Instrument Serif', 'Playfair Display', serif;
}

.hero-dates {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 24px;
  opacity: 0;
  transform: translateY(20px);
}
.hero-dates .dash { color: var(--brass); margin: 0 14px; }

.hero-tagline {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55;
  color: var(--ink);
  max-width: 460px;
  margin: 0 0 36px;
  opacity: 0;
  transform: translateY(20px);
}

.hero-ranks {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 2;
  opacity: 0;
  transform: translateY(20px);
}
.hero-ranks .sep { color: var(--brass); margin: 0 10px; }
.hero-ranks .grade { color: var(--brass); font-weight: 600; }

.scroll-prompt {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity .6s ease;
  text-align: center;
  line-height: 1.6;
}
.scroll-prompt.show { opacity: 1; }
.scroll-prompt::after {
  content: "";
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, var(--brass) 0%, transparent 100%);
  animation: scrollPulse 2.4s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.6); opacity: 0.5; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; max-width: 560px; }
  .hero-portrait-wrap { max-width: 340px; margin: 0 auto; }
}

/* ============================================================
   PROLOGUE / EPIGRAPH
   ============================================================ */

.prologue {
  padding: 14vh 40px 14vh;
  background: var(--bg);
  position: relative;
  text-align: center;
}
.prologue::before, .prologue::after {
  content: "";
  display: block;
  width: 80px; height: 1px;
  background: var(--brass);
  margin: 0 auto;
  opacity: 0.55;
}
.prologue::before { margin-bottom: 50px; }
.prologue::after { margin-top: 50px; }

.epigraph-large {
  max-width: 720px;
  margin: 0 auto;
}
.epigraph-large blockquote {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 28px;
  font-weight: 400;
}
.epigraph-large cite {
  display: block;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ============================================================
   OPENING NARRATION
   ============================================================ */

.opening-narration {
  padding: 12vh 40px;
  background: var(--bg);
}
.opening-narration .container {
  max-width: 720px;
  margin: 0 auto;
  font-size: 22px;
  line-height: 1.7;
}
.opening-narration .container > p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3.2em;
  float: left;
  line-height: 1;
  padding: 6px 18px 6px 0;
  color: var(--brass);
  font-weight: 500;
  shape-outside: margin-box;
}
.opening-narration p {
  margin-bottom: 1.4em;
  color: var(--ink);
}
.opening-narration p.lead {
  font-size: 26px;
  line-height: 1.5;
  font-style: italic;
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  color: var(--ink);
  margin-bottom: 1.6em;
}
.opening-narration strong { color: var(--brass-bright); font-weight: 500; }

/* ============================================================
   HORIZONTAL TIMELINE — the spine
   ============================================================ */

.timeline-section {
  position: relative;
  background: var(--bg-deep);
  overflow: hidden;
}

.timeline-pin {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.timeline-header {
  position: absolute;
  top: 8vh;
  left: 0; right: 0;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}
.timeline-header .kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--ink-muted);
}
.timeline-header h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 500;
  color: var(--ink);
}
.timeline-header h2 em {
  color: var(--brass);
  font-style: italic;
  font-family: 'Instrument Serif', serif;
}

.timeline-track {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 80px;
  padding: 0 50vw 0 6vw;
  height: 60vh;
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--brass) 6%, var(--brass) 94%, transparent 100%);
  opacity: 0.55;
  z-index: 1;
}

.tl-event {
  position: relative;
  min-width: 320px;
  max-width: 360px;
  flex-shrink: 0;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-event.major { min-width: 380px; max-width: 420px; }

.tl-event .dot {
  width: 14px;
  height: 14px;
  background: var(--bg-deep);
  border: 2px solid var(--brass);
  border-radius: 50%;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}
.tl-event.major .dot {
  width: 22px;
  height: 22px;
  background: var(--brass);
  box-shadow: 0 0 0 4px rgba(201, 169, 98, 0.18), 0 0 20px rgba(201, 169, 98, 0.5);
}

.tl-event .above, .tl-event .below {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 22px;
}
.tl-event .above {
  bottom: calc(50% + 26px);
}
.tl-event .below {
  top: calc(50% + 26px);
}

/* NOTE: Originally these rules used :nth-child(odd/even) to hide the wrong
   side per position. That broke when we added .tl-phase markers as siblings,
   shifting the odd/even positions. Since each .tl-event has only ONE child
   (.above OR .below — never both), we can safely drop the hiding rules:
   the existing absolute positioning above already routes each event to the
   correct side. */

.tl-event .tl-year {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 8px;
  font-weight: 500;
}

/* Age-first labelling — the structural change of V3 */
.tl-event .tl-age {
  font-family: 'Playfair Display', 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0.01em;
  color: var(--brass);
  line-height: 1;
  margin-bottom: 4px;
}
.tl-event .tl-age::before {
  content: 'AGE ';
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  vertical-align: 0.45em;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin-right: 4px;
}
.tl-event.major .tl-age {
  color: var(--brass-bright);
  font-size: 36px;
}
.tl-event .tl-date {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
  font-weight: 500;
}

/* Seven-year-gap aside — a visual silence on the timeline */
.tl-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 28px;
  min-width: 260px;
  max-width: 280px;
  border-left: 1px dashed rgba(245, 240, 230, 0.20);
  border-right: 1px dashed rgba(245, 240, 230, 0.20);
  flex-shrink: 0;
  text-align: center;
  z-index: 2;
  height: 65%;
  align-self: center;
}
.tl-aside-age {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.tl-aside-gap {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  color: var(--brass);
  margin: 6px 0 14px;
  line-height: 1.1;
}
.tl-aside-text {
  font-family: 'EB Garamond', serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  font-style: italic;
  margin: 0;
}

/* Phase markers — broad chapter groupings on the timeline.
   Visually more prominent than the seven-year aside: solid brass borders
   instead of dashed, brighter label colour. Acts as a clear signpost
   ("you are now entering D-Day & France") between event clusters. */
.tl-phase {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 26px;
  min-width: 260px;
  max-width: 280px;
  flex-shrink: 0;
  text-align: center;
  z-index: 2;
  height: 78%;
  align-self: center;
  border-left: 2px solid var(--brass);
  border-right: 2px solid var(--brass);
  background: linear-gradient(180deg, transparent 0%, rgba(201,169,98,0.06) 50%, transparent 100%);
  position: relative;
}
.tl-phase-period {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.tl-phase-label {
  font-family: 'Playfair Display', 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 28px;
  color: var(--brass-bright);
  margin: 0 0 12px;
  line-height: 1.1;
}
.tl-phase-tagline {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
}

.tl-event h4 {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 6px;
  color: var(--ink);
}
.tl-event .tl-blurb {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.tl-event.major h4 { color: var(--brass-bright); font-size: 22px; }

@media (max-width: 760px) {
  .timeline-track { gap: 50px; padding: 0 30vw 0 6vw; }
  .tl-event { min-width: 240px; }
  .tl-event.major { min-width: 260px; }
}

/* MOBILE FALLBACK — under 720px, drop the scroll-jacked horizontal layout
   for a simpler stacked vertical layout. GSAP's pin behaviour on touch is
   counter-intuitive at small widths; a normal scroll feels right. */
@media (max-width: 720px) {
  .timeline-pin {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 80px 0 60px;
  }
  .timeline-header {
    position: relative;
    top: 0;
    padding: 0 22px 50px;
  }
  .timeline-track {
    position: relative;
    top: auto;
    left: auto;
    transform: none !important;
    flex-direction: column;
    height: auto;
    padding: 0 22px;
    gap: 0;
    align-items: stretch;
  }
  .timeline-track::before {
    left: 30px; right: auto;
    top: 0; bottom: 0;
    width: 1px; height: auto;
    background: linear-gradient(180deg, transparent 0%, var(--brass) 4%, var(--brass) 96%, transparent 100%);
    opacity: 0.5;
  }
  .tl-event {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    padding: 18px 0 18px 60px;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    position: relative;
  }
  .tl-event .above,
  .tl-event .below {
    position: relative;
    inset: auto;
    text-align: left;
    padding: 0;
    display: block !important;
  }
  .tl-event .dot {
    position: absolute;
    left: 25px;
    top: 24px;
    margin: 0;
  }
  .tl-event.major .dot {
    left: 21px;
    top: 21px;
  }
  .tl-event .tl-age { font-size: 24px; margin-bottom: 2px; }
  .tl-event.major .tl-age { font-size: 28px; }
  .tl-event .tl-date { margin-bottom: 6px; }
  .tl-event h4 { font-size: 17px; }
  .tl-aside {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    padding: 28px 0 28px 60px;
    border-left: none;
    border-right: none;
    border-top: 1px dashed rgba(245, 240, 230, 0.2);
    border-bottom: 1px dashed rgba(245, 240, 230, 0.2);
    text-align: left;
    align-items: flex-start;
    margin: 12px 0;
    position: relative;
  }
  .tl-aside-gap { font-size: 22px; }

  /* Phase markers — horizontal banners on mobile, hugging the rail */
  .tl-phase {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    padding: 26px 22px 22px 60px;
    border-left: none;
    border-right: none;
    border-top: 2px solid var(--brass);
    border-bottom: 2px solid var(--brass);
    text-align: left;
    align-items: flex-start;
    margin: 28px 0 16px;
    position: relative;
    background: linear-gradient(180deg, rgba(201,169,98,0.08) 0%, rgba(201,169,98,0.02) 100%);
  }
  .tl-phase-period { margin-bottom: 8px; font-size: 10px; letter-spacing: 0.28em; }
  .tl-phase-label { font-size: 22px; margin-bottom: 6px; }
  .tl-phase-tagline { font-size: 13px; }
}

/* ============================================================
   CHAPTERS
   ============================================================ */

.chapter {
  position: relative;
  background: var(--bg);
}

.chapter-intro {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(201, 169, 98, 0.06), transparent 60%),
    var(--bg-deep);
  overflow: hidden;
}

.chapter-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.96  0 0 0 0 0.94  0 0 0 0 0.9  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.chapter-card {
  position: relative;
  text-align: center;
  max-width: 760px;
  z-index: 2;
}
.chapter-card .roman {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(48px, 7vw, 88px);
  color: var(--brass);
  font-weight: 400;
  margin-bottom: 12px;
  line-height: 1;
}
.chapter-card .ch-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 30px;
}
.chapter-card h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 1.05;
  margin-bottom: 28px;
  letter-spacing: -0.012em;
}
.chapter-card h2 em {
  color: var(--brass);
  font-style: italic;
  font-family: 'Instrument Serif', serif;
}
.chapter-card .ch-dates {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 24px;
}
.chapter-card .ch-blurb {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 580px;
  margin: 0 auto;
}
.chapter-card .ornament {
  display: block;
  color: var(--brass);
  font-size: 20px;
  letter-spacing: 0.6em;
  margin-top: 36px;
  opacity: 0.7;
}

/* Chapter body content */
.chapter-body {
  padding: 14vh 40px;
  position: relative;
}
.chapter-body .container {
  max-width: 720px;
  margin: 0 auto;
}
.chapter-body p {
  font-size: 20px;
  line-height: 1.75;
  margin-bottom: 1.4em;
  color: var(--ink);
}
.chapter-body p.lead {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 1.6em;
}
.chapter-body p.dropcap::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3.2em;
  float: left;
  line-height: 1;
  padding: 6px 18px 6px 0;
  color: var(--brass);
  font-weight: 500;
  shape-outside: margin-box;
}
.chapter-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 500;
  margin: 60px 0 18px;
  color: var(--ink);
}
.chapter-body h3 em { color: var(--brass); font-style: italic; }
.chapter-body strong { color: #fbf6e4; font-weight: 600; }

/* Pull quote */
.pullquote-cinema {
  margin: 60px 0;
  padding: 38px 50px 38px 40px;
  border-left: 2px solid var(--brass);
  background: linear-gradient(90deg, rgba(201, 169, 98, 0.04) 0%, transparent 100%);
  position: relative;
}
.pullquote-cinema::before {
  content: "\201C";
  position: absolute;
  top: -10px;
  left: 12px;
  font-family: 'Playfair Display', serif;
  font-size: 86px;
  color: var(--brass);
  opacity: 0.22;
  line-height: 1;
}
.pullquote-cinema p {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 14px;
}
.pullquote-cinema cite {
  display: block;
  font-style: normal;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}
.pullquote-cinema cite .who { color: var(--ink-muted); display: block; font-style: italic; font-family: 'EB Garamond', serif; text-transform: none; letter-spacing: 0; font-size: 13px; margin-top: 4px; }

/* Inline photo presentation */
.scene-image {
  margin: 50px auto;
  position: relative;
  max-width: 520px;
}
.scene-image .frame {
  position: relative;
  background: var(--bg-paper);
  padding: 7px;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  overflow: hidden;
}
.scene-image img {
  width: 100%;
  height: auto;
  filter: sepia(0.1) contrast(1.04) brightness(0.96);
  transform: scale(1.04);
  transition: transform 6s cubic-bezier(.2,.5,.2,1);
}
.scene-image.in img { transform: scale(1); }
.scene-image figcaption {
  margin-top: 18px;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-muted);
  text-align: center;
  padding: 0 20px;
}
.scene-image figcaption strong {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
}
.scene-image figcaption .credit {
  display: block;
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}

/* Wide photo — slightly larger but no longer breaking out of container */
.scene-image.wide {
  max-width: 680px;
  margin: 60px auto;
}

/* Archival variant — for public-domain WW2 imagery from Wikimedia/IWM */
.scene-image.archival .frame {
  border-color: rgba(85, 107, 47, 0.5);
  background: #1a2335;
}
.scene-image.archival figcaption {
  text-align: left;
  padding: 0;
}
.scene-image.archival figcaption .credit {
  color: var(--olive-bright);
  font-style: italic;
  font-family: 'EB Garamond', serif;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  display: block;
  margin-top: 8px;
}
.scene-image.archival figcaption .credit a {
  color: var(--olive-bright);
  border-bottom-color: rgba(122, 138, 74, 0.35);
}
.scene-image.archival img {
  filter: sepia(0.05) contrast(1.06) brightness(0.92);
}

/* Photo pair */
.scene-pair {
  margin: 50px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 680px;
}
.scene-pair .scene-image { margin: 0; max-width: none; }
@media (max-width: 700px) {
  .scene-pair { grid-template-columns: 1fr; }
}

/* Day & Night card — lived conditions per chapter (quarters / routine / weather / food).
   Visually distinct from the brass fact-card and olive meanwhile-band: warmer, parchment-tinted
   with a faint olive frame, suggesting a documentary side-note. */
.day-night-card {
  margin: 50px 0 60px;
  padding: 38px 42px 32px;
  background:
    linear-gradient(180deg, rgba(85, 107, 47, 0.05) 0%, rgba(15, 23, 42, 0.45) 100%),
    var(--bg-paper);
  border: 1px solid rgba(85, 107, 47, 0.32);
  border-radius: 2px;
  position: relative;
}
.day-night-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(85, 107, 47, 0.16);
  pointer-events: none;
}
.day-night-card .dnc-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--olive-bright);
  font-weight: 600;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.day-night-card .dnc-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 28px;
  position: relative;
  z-index: 1;
}
.dnc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  position: relative;
  z-index: 1;
}
.dnc-section .dnc-heading {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201, 169, 98, 0.22);
}
.dnc-section p {
  font-family: 'EB Garamond', serif;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0;
}
.dnc-section p + p { margin-top: 0.6em; }
.dnc-section strong { color: var(--ink); font-weight: 500; }
.day-night-card .dnc-source {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faded);
  font-style: italic;
  position: relative;
  z-index: 1;
}
.day-night-card .dnc-source strong { color: var(--ink-muted); font-style: normal; font-weight: 500; }

@media (max-width: 880px) {
  .dnc-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
}
@media (max-width: 600px) {
  .day-night-card { padding: 28px 22px 24px; }
  .dnc-grid { grid-template-columns: 1fr; gap: 22px; }
  .day-night-card .dnc-title { font-size: 20px; margin-bottom: 22px; }
}

/* "Meanwhile" wider-context band */
.meanwhile-band {
  margin: 60px 0;
  padding: 36px 40px;
  background: linear-gradient(180deg, rgba(85, 107, 47, 0.10) 0%, rgba(85, 107, 47, 0.02) 100%);
  border-top: 1px solid var(--olive);
  border-bottom: 1px solid rgba(85, 107, 47, 0.3);
  position: relative;
}
.meanwhile-band .label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--olive-bright);
  font-weight: 500;
  margin-bottom: 16px;
}
.meanwhile-band h4 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--ink);
}
.meanwhile-band p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-muted);
  margin-bottom: 0.8em;
}
.meanwhile-band p strong { color: var(--ink); }

/* Verified fact card */
.fact-card {
  margin: 36px 0;
  padding: 26px 30px;
  background: rgba(201, 169, 98, 0.05);
  border-left: 2px solid var(--brass);
  border-radius: 0 4px 4px 0;
}
.fact-card .label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin-bottom: 12px;
}
.fact-card p {
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 0.6em;
  color: var(--ink);
}
.fact-card p:last-child { margin-bottom: 0; }

/* Inter-title (between sections) */
.intertitle-block {
  margin: 80px auto;
  max-width: 720px;
  padding: 48px 50px;
  background: var(--bg-deep);
  border: 1px solid var(--rule);
  text-align: center;
  position: relative;
}
.intertitle-block::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--rule-soft);
  pointer-events: none;
}
.intertitle-block .label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}
.intertitle-block p {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  position: relative;
  z-index: 1;
}
.intertitle-block p em { color: var(--brass); }

/* ============================================================
   STAT ROW (numbers band)
   ============================================================ */

.stat-band {
  padding: 12vh 40px;
  background: var(--bg-deep);
  position: relative;
}
.stat-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.stat-cell {
  text-align: center;
  padding: 22px 16px;
  border-right: 1px solid var(--rule-soft);
}
.stat-cell:last-child { border-right: none; }
.stat-cell .num {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  color: var(--brass);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.stat-cell .lab {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 0; }
  .stat-cell:nth-child(2n) { border-right: none; }
  .stat-cell { border-bottom: 1px solid var(--rule-soft); }
}

/* ============================================================
   PRIMARY SOURCES — MASONRY GALLERY
   ============================================================ */

.sources-section {
  padding: 16vh 40px;
  background: var(--bg);
}

.section-head {
  text-align: center;
  margin-bottom: 70px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.section-head .kicker {
  display: block;
  margin-bottom: 14px;
  color: var(--brass);
}
.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 500;
  line-height: 1.05;
  margin-bottom: 22px;
}
.section-head h2 em {
  color: var(--brass);
  font-style: italic;
  font-family: 'Instrument Serif', serif;
}
.section-head p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* ============================================================
   SOURCES FILTER + SEARCH — refines the masonry gallery
   ============================================================ */
.sources-filter {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  background: var(--bg-paper);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  position: relative;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.filter-chip {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule-soft);
  color: var(--ink-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.filter-chip:hover {
  color: var(--brass-bright);
  border-color: var(--brass);
}
.filter-chip.active {
  color: var(--bg);
  background: var(--brass);
  border-color: var(--brass);
  font-weight: 600;
}
.filter-chip .count {
  font-size: 9.5px;
  opacity: 0.7;
  margin-left: 4px;
  font-weight: 400;
}

.filter-search-wrap {
  position: relative;
  flex: 0 0 auto;
  min-width: 240px;
}
.filter-search {
  width: 100%;
  appearance: none;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--rule-soft);
  color: var(--ink);
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  padding: 10px 36px 10px 16px;
  border-radius: 100px;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
}
.filter-search:focus {
  border-color: var(--brass);
  background: rgba(15, 23, 42, 0.7);
}
.filter-search::placeholder { color: var(--ink-faded); font-style: italic; }
.filter-search::-webkit-search-cancel-button { display: none; }
.filter-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-faded);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.filter-clear.show { display: flex; }
.filter-clear:hover { color: var(--brass); }

.filter-status {
  max-width: 1280px;
  margin: 0 auto 18px;
  padding: 0 4px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  min-height: 16px;
  text-align: center;
}

/* Hidden state for filtered-out sources */
.masonry .source.is-hidden {
  display: none !important;
}

/* Smooth fade-in when a source becomes visible after filtering.
   The hide is instant (display:none collapses layout cleanly); the show fades. */
@keyframes filterReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.masonry.is-filtering .source:not(.is-hidden) {
  animation: filterReveal 0.32s ease both;
}

/* "No results" state */
.masonry.is-empty::after {
  content: "No sources match this filter.";
  display: block;
  text-align: center;
  padding: 60px 20px;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-muted);
  column-span: all;
}

@media (max-width: 760px) {
  .sources-filter { padding: 14px 16px; gap: 14px; }
  .filter-chip { padding: 7px 12px; font-size: 10px; letter-spacing: 0.14em; }
  .filter-search-wrap { min-width: 100%; }
}

.masonry {
  column-count: 3;
  column-gap: 22px;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 980px) { .masonry { column-count: 2; } }
@media (max-width: 620px) { .masonry { column-count: 1; } }

.masonry .source {
  break-inside: avoid;
  margin-bottom: 22px;
  position: relative;
  background: var(--bg-paper);
  border: 1px solid var(--rule);
  padding: 8px;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s;
  overflow: hidden;
}
.masonry .source:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  border-color: var(--brass);
}
.masonry .source img {
  width: 100%;
  display: block;
  filter: sepia(0.1) contrast(1.05) brightness(0.96);
  transition: filter .35s ease, transform 2s ease;
}
.masonry .source:hover img {
  filter: sepia(0) contrast(1.1) brightness(1);
  transform: scale(1.02);
}
.masonry .source figcaption {
  padding: 14px 14px 8px;
  font-family: 'EB Garamond', serif;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.masonry .source figcaption strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 4px;
}
.masonry .source .date-tag {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 6px;
  border-top: 1px solid var(--rule-soft);
  padding-top: 8px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 15, 0.94);
  backdrop-filter: blur(10px);
}
.modal-content {
  position: relative;
  max-width: min(1100px, 90vw);
  max-height: 88vh;
  margin: 6vh auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid var(--rule);
  padding: 6px;
  background: var(--bg-paper);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
}
.modal-caption {
  margin-top: 22px;
  padding: 0 20px;
  font-family: 'EB Garamond', serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-muted);
  text-align: center;
  max-width: 720px;
}
.modal-caption strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 21px;
  color: var(--ink);
  margin-bottom: 6px;
}
.modal-close {
  position: absolute;
  top: -28px;
  right: -8px;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s, border-color .25s;
}
.modal-close:hover { background: var(--brass); border-color: var(--brass); color: var(--bg); }

/* Modal prev/next navigation — left and right arrow buttons. Also tells
   the viewer arrow keys work via tooltip + arrow chars. */
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 4px;
  opacity: 0;
  transition: opacity .35s ease .15s, background .25s ease, border-color .25s ease, transform .25s ease;
}
.modal.open .modal-nav { opacity: 1; }
.modal-nav:hover {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--bg);
}
.modal-nav:active { transform: translateY(-50%) scale(0.94); }
.modal-prev { left: 28px; }
.modal-next { right: 28px; }
@media (max-width: 720px) {
  .modal-nav { width: 40px; height: 40px; font-size: 26px; }
  .modal-prev { left: 8px; }
  .modal-next { right: 8px; }
}

/* ============================================================
   "WHAT WE KNOW" — the verified-facts ledger at chapter head
   ============================================================ */

.knowns {
  margin: 0 0 56px;
  padding: 34px 38px 30px;
  background:
    linear-gradient(180deg, rgba(201,169,98,0.04) 0%, rgba(15,23,42,0.5) 100%),
    var(--bg-paper);
  border: 1px solid var(--brass);
  border-radius: 2px;
  position: relative;
}
.knowns::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(201, 169, 98, 0.18);
  pointer-events: none;
  border-radius: 1px;
}
.knowns-head {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin: 0 0 8px;
  position: relative;
}
.knowns-sub {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-muted);
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(201, 169, 98, 0.22);
  position: relative;
}
.knowns ul {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.knowns li {
  display: grid;
  grid-template-columns: 116px 1fr 200px;
  gap: 22px;
  padding: 14px 0;
  border-bottom: 1px dotted rgba(245, 240, 230, 0.07);
  align-items: start;
}
.knowns li:last-child { border-bottom: none; padding-bottom: 0; }
.knowns li:first-child { padding-top: 0; }
.knowns .fact {
  font-family: 'EB Garamond', serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  padding-top: 1px;
}
.knowns .fact .when {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  display: block;
  margin: 4px 0 0;
  line-height: 1.4;
}
.knowns .fact strong { color: var(--brass-bright); font-weight: 500; }
.knowns .src {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 400;
  line-height: 1.5;
  padding-top: 6px;
}
.knowns .src em {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* When .when is the first column item, place it in its own grid column */
.knowns li > .when-col {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  line-height: 1.4;
  padding-top: 6px;
}

@media (max-width: 880px) {
  .knowns li { grid-template-columns: 100px 1fr; }
  .knowns .src { grid-column: 1 / -1; text-align: left; padding-top: 4px; padding-left: 110px; }
}
@media (max-width: 600px) {
  .knowns { padding: 26px 22px 22px; }
  .knowns li { grid-template-columns: 1fr; gap: 6px; }
  .knowns .src { grid-column: 1; padding-left: 0; }
  .knowns li > .when-col { padding-top: 0; }
}

/* The narrative section header that follows the knowns panel */
.story-head {
  margin: 50px 0 8px;
  display: flex;
  align-items: baseline;
  gap: 20px;
}
.story-head .story-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.story-head .story-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule-soft), transparent);
}

/* ============================================================
   CHAPTER MAPS — stylized SVG geography
   ============================================================ */

.chapter-map {
  margin: 0 auto 60px;
  max-width: 880px;
  padding: 28px 30px 22px;
  background: linear-gradient(180deg, rgba(201,169,98,0.04) 0%, rgba(15,23,42,0.4) 100%);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  position: relative;
}
.chapter-map .map-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 14px;
}
.chapter-map .map-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule-soft), transparent);
}
.chapter-map .map-svg-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
}
.chapter-map svg {
  display: block;
  width: 100%;
  height: 100%;
}
.chapter-map .map-caption {
  margin-top: 14px;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  text-align: center;
}
.chapter-map .map-caption strong { color: var(--brass-bright); font-style: normal; font-weight: 500; }

/* SVG element styles (inherited from chapter-map context) */
.map-coast { fill: none; stroke: rgba(245, 240, 230, 0.18); stroke-width: 1; }
.map-coast-thick { fill: none; stroke: rgba(245, 240, 230, 0.28); stroke-width: 1.4; }
.map-water { fill: rgba(20, 35, 59, 0.4); }
.map-route { fill: none; stroke: var(--brass); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: 0.85; }
.map-route-solid { fill: none; stroke: var(--brass); stroke-width: 1.6; opacity: 0.9; }
.map-pin {
  fill: var(--brass);
  stroke: var(--bg-deep);
  stroke-width: 1.5;
}
.map-pin-major {
  fill: var(--brass-bright);
  stroke: var(--bg-deep);
  stroke-width: 2;
}
.map-pin-ring {
  fill: none;
  stroke: var(--brass);
  stroke-width: 1;
  opacity: 0.45;
}
.map-label-text {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  fill: var(--ink);
}
.map-label-text.major {
  fill: var(--brass-bright);
  font-size: 14px;
}
.map-label-secondary {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  fill: var(--ink-muted);
}
.map-gridline { stroke: rgba(245, 240, 230, 0.05); stroke-width: 1; }

/* On mobile, the SVG renders much smaller — boost the label sizes within
   the viewBox so they remain legible (viewBox font-size is scaled, not absolute).
   IMPORTANT:
   - Keep the 16:7 aspect ratio so the SVG fills its container (a 4:3 wrap
     leaves wasted space top/bottom AND scales the SVG content too small).
   - Allow text labels to render past the viewBox bounds via overflow:visible
     so right-edge labels like "341 Valence Avenue, Dagenham" aren't cropped.
   - Use a modest font boost — too aggressive and labels collide / overflow. */
@media (max-width: 720px) {
  .chapter-map { padding: 18px 14px 14px; margin-bottom: 40px; }
  .chapter-map .map-label { font-size: 9px; letter-spacing: 0.24em; }
  .chapter-map .map-svg-wrap {
    aspect-ratio: 16 / 7;
    overflow: visible;
    margin: 4px -4px;  /* small negative margin gives labels room to breathe */
  }
  .chapter-map svg { overflow: visible; }
  .chapter-map .map-caption { font-size: 13px; line-height: 1.5; margin-top: 18px; }
  .map-label-text { font-size: 17px; }
  .map-label-text.major { font-size: 19px; }
  .map-label-secondary { font-size: 12px; letter-spacing: 0.14em; }
  .map-compass { font-size: 12px !important; letter-spacing: 0.22em !important; }
}
.map-compass {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  fill: var(--ink-faded);
}

/* ============================================================
   RANK PROGRESSION TABLE — the arc in one box
   ============================================================ */

.rank-progression {
  margin: 50px auto;
  max-width: 720px;
  padding: 36px 40px 32px;
  background: linear-gradient(180deg, rgba(201,169,98,0.06) 0%, rgba(15,23,42,0.5) 100%);
  border: 1px solid var(--brass);
  border-radius: 2px;
  position: relative;
}
.rank-progression::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(201,169,98,0.18);
  pointer-events: none;
  border-radius: 1px;
}
.rank-progression .label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin: 0 0 22px;
  text-align: center;
  position: relative;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(201,169,98,0.22);
}
.rank-progression table {
  width: 100%;
  border-collapse: collapse;
  position: relative;
  font-family: 'EB Garamond', serif;
}
.rank-progression th {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: left;
  font-weight: 600;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(245,240,230,0.10);
}
.rank-progression th:last-child { text-align: right; }
.rank-progression td {
  padding: 11px 0;
  border-bottom: 1px dotted rgba(245,240,230,0.07);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  vertical-align: baseline;
}
.rank-progression td:first-child {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  white-space: nowrap;
  padding-right: 18px;
}
.rank-progression td:last-child {
  text-align: right;
  color: var(--ink-muted);
  font-style: italic;
  font-size: 14.5px;
  white-space: nowrap;
}
.rank-progression tr:last-child td { border-bottom: none; padding-bottom: 0; }
.rank-progression tr:last-child td strong { color: var(--brass-bright); }
.rank-progression .rank-note {
  margin: 20px 0 0;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  text-align: center;
  position: relative;
  padding-top: 18px;
  border-top: 1px solid rgba(201,169,98,0.18);
}

@media (max-width: 620px) {
  .rank-progression { padding: 28px 22px 26px; }
  .rank-progression td:last-child { display: none; }
  .rank-progression th:last-child { display: none; }
}

/* ============================================================
   CONTRIBUTE — "A living document" call to family
   ============================================================ */

.contribute-section {
  padding: 14vh 40px;
  background: var(--bg-deep);
  position: relative;
}
.contribute-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 56px 60px;
  background:
    linear-gradient(180deg, rgba(201, 169, 98, 0.07) 0%, rgba(201, 169, 98, 0.02) 100%);
  border: 1px solid var(--brass);
  border-radius: 2px;
  position: relative;
}
.contribute-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 169, 98, 0.25);
  pointer-events: none;
}
.contribute-card .label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin-bottom: 24px;
  position: relative;
  text-align: center;
}
.contribute-card h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.15;
  margin: 0 0 30px;
  color: var(--ink);
  text-align: center;
  position: relative;
}
.contribute-card h2 em { color: var(--brass); font-style: italic; font-family: 'Instrument Serif', serif; }
.contribute-card p {
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 1.2em;
  position: relative;
}
.contribute-card p strong { color: var(--brass-bright); font-weight: 500; }
.contribute-card .invite-list {
  list-style: none;
  margin: 26px 0;
  padding: 0;
  position: relative;
}
.contribute-card .invite-list li {
  padding: 12px 0 12px 30px;
  font-size: 17px;
  color: var(--ink);
  line-height: 1.55;
  position: relative;
  border-top: 1px solid var(--rule-soft);
}
.contribute-card .invite-list li:last-child { border-bottom: 1px solid var(--rule-soft); }
.contribute-card .invite-list li::before {
  content: "&";
  position: absolute;
  left: 0;
  top: 8px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--brass);
  font-size: 1.7em;
  line-height: 1;
}
.contribute-card .invite-list li strong { color: var(--brass-bright); }
.contribute-card .signoff {
  margin-top: 28px;
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--ink-muted);
  text-align: center;
  position: relative;
}
.contribute-card .signoff strong { color: var(--brass); font-style: normal; font-family: 'Playfair Display', serif; }

@media (max-width: 720px) {
  .contribute-card { padding: 36px 28px 40px; }
}

/* ============================================================
   LEGACY / CLOSING
   ============================================================ */

.legacy {
  padding: 18vh 40px;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(201, 169, 98, 0.06), transparent 65%),
    var(--bg-deep);
  position: relative;
  text-align: center;
}
.legacy .container {
  max-width: 720px;
  margin: 0 auto;
}
.legacy .kicker { display: block; margin-bottom: 24px; }
.legacy h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 500;
  line-height: 1.05;
  margin-bottom: 50px;
}
.legacy h2 em { color: var(--brass); font-style: italic; font-family: 'Instrument Serif', serif; }
.legacy p {
  font-family: 'EB Garamond', serif;
  font-size: 22px;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 1.4em;
}
.legacy p.signature {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.4;
  color: var(--brass);
  margin: 60px 0 20px;
}
.legacy .attribution {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */

footer.v2-footer {
  padding: 80px 40px 60px;
  background: var(--bg-deeper);
  text-align: center;
  border-top: 1px solid var(--rule-soft);
}
footer.v2-footer .ornament {
  display: inline-block;
  color: var(--brass);
  letter-spacing: 0.6em;
  font-size: 16px;
  margin-bottom: 28px;
  opacity: 0.7;
}
footer.v2-footer .name {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 28px;
  color: var(--brass);
  margin-bottom: 14px;
}
footer.v2-footer .span {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 30px;
}
footer.v2-footer .links {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 30px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
footer.v2-footer .links a {
  color: var(--ink-muted);
  border: none;
  transition: color .25s;
}
footer.v2-footer .links a:hover { color: var(--brass); }
footer.v2-footer .credits {
  margin-top: 40px;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-faded);
  line-height: 1.7;
}
footer.v2-footer .credits a {
  color: var(--ink-muted);
  border: none;
}

/* ============================================================
   REVEAL ANIMATIONS — initial states for GSAP
   ============================================================ */

[data-reveal] { opacity: 0; transform: translateY(40px); }
[data-reveal-x] { opacity: 0; transform: translateX(40px); }
[data-reveal-instant] { opacity: 0; }
[data-stagger] > * { opacity: 0; transform: translateY(28px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 720px) {
  body { font-size: 17px; }
  .hero { padding: 60px 22px 120px; }
  .hero h1 { font-size: clamp(44px, 11vw, 64px); margin-bottom: 28px; }
  .hero-tagline { font-size: 17px; margin-bottom: 28px; }
  .hero-dates { font-size: 11px; letter-spacing: 0.24em; }
  .hero-ranks { font-size: 10px; line-height: 1.9; }
  .scroll-prompt { bottom: 24px; font-size: 9px; }

  .prologue, .opening-narration, .chapter-body, .sources-section, .legacy, .stat-band { padding-left: 22px; padding-right: 22px; }
  .prologue { padding-top: 10vh; padding-bottom: 10vh; }

  .pullquote-cinema { padding: 28px 26px; }
  .meanwhile-band { padding: 26px 24px; }
  .intertitle-block { padding: 34px 26px; }

  /* Chapter heads — keep them legible on small phones */
  .chapter-card h2 { font-size: clamp(30px, 8vw, 44px); }
  .chapter-card .ch-label { font-size: 11px; }
  .chapter-card { padding-left: 22px; padding-right: 22px; }

  /* Stat band — the "58mo" cell can be tight at 320px; let it shrink */
  .stat-cell { padding: 16px 8px; }
  .stat-cell .num { font-size: clamp(34px, 11vw, 56px); }
  .stat-cell .lab { font-size: 9px; letter-spacing: 0.22em; }

  /* Modal — keep close button reliably inside viewport on small phones */
  .modal-content { max-width: 94vw; margin-top: 8vh; }
  .modal-content img { max-height: 60vh; }
  .modal-close { top: -44px; right: 0; width: 36px; height: 36px; font-size: 20px; }
  .modal-caption { font-size: 14.5px; padding: 0 10px; }

  /* Document gallery captions need breathing room */
  .masonry .source figcaption { padding: 12px 12px 6px; font-size: 14px; }

  /* Floating nav already shrinks at 760px; ensure it never overlaps content */
  .floating-nav { top: 10px; right: 10px; }

  /* Touch targets — make tap zones forgiving on small phones */
  a, button { min-height: 32px; }
}

/* Very small phones (older iPhones, narrow Androids) */
@media (max-width: 380px) {
  body { font-size: 16px; }
  .hero { padding: 50px 16px 100px; }
  .prologue, .opening-narration, .chapter-body, .sources-section, .legacy, .stat-band { padding-left: 16px; padding-right: 16px; }
  .knowns { padding: 22px 16px 18px; }
  .chapter-map { padding: 18px 14px 14px; }
  .pullquote-cinema { padding: 22px 18px; }
  .meanwhile-band { padding: 22px 18px; }
  .modal-content { max-width: 96vw; }
}

/* Respect user's motion preference — replace bold animations with subtle fades */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto !important; }
  .hero-portrait-wrap,
  .hero-portrait-wrap img {
    transform: none !important;
    opacity: 1 !important;
  }
  .hero-text .kicker,
  .hero-dates,
  .hero-tagline,
  .hero-ranks,
  .scroll-prompt {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero h1 .word span {
    transform: none !important;
    opacity: 1 !important;
  }
  [data-reveal], [data-reveal-x], [data-reveal-instant], [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-prompt::after { animation: none !important; }
  .scene-image, .scene-image img { transform: none !important; }
}
