/* ===================================================================
   VIGILO — The Life of Major-General Guy Patrick Gregson
   CB CBE DSO* MC | Royal Horse Artillery | 1906–1988
   =================================================================== */

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

:root {
  --navy:       #0a1628;
  --navy-light: #132240;
  --navy-mid:   #1a2d4d;
  --gold:       #c8a45c;
  --gold-light: #e0c882;
  --gold-dim:   #8a7340;
  --cream:      #f5f0e6;
  --cream-dark: #e8e0d0;
  --sand:       #d4c5a9;
  --blood:      #8b2020;
  --blood-light:#a83030;
  --white:      #ffffff;
  --text:       #2c2c2c;
  --text-light: #c8c0b0;
  --text-muted: #8a8478;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Source Serif 4', 'Crimson Text', Georgia, serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --max-width: 1200px;
  --reading-width: 720px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: var(--gold);
  color: var(--navy);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-dim); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--gold); }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }

.section-heading {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--navy);
  margin-bottom: 0.3em;
}

.section-subheading {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1.5rem;
}

.section-intro {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: var(--reading-width);
  margin-bottom: 3rem;
}

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 164, 92, 0.15);
  transition: transform 0.4s ease, background 0.3s;
}

.site-nav.hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.nav-logo .crest {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Sub-navigation (biography chapters) --- */
.sub-nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(10, 22, 40, 0.95);
  border-bottom: 1px solid rgba(200, 164, 92, 0.1);
  backdrop-filter: blur(8px);
}
.sub-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  height: 36px;
  align-items: center;
}
.sub-nav-link {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-light);
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border-radius: 2px;
  transition: color 0.2s;
}
.sub-nav-link:hover { color: var(--gold); }
.sub-nav-link.active { color: var(--gold); background: rgba(200, 164, 92, 0.1); }
.sub-nav { transition: top 0.4s ease; }
.site-nav.hidden + .sub-nav { top: 0; }
.sub-nav + .chapter-hero { margin-top: 36px; }

/* --- Hero chapter nav (prev/next in hero) --- */
.hero-chapter-nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin-top: 2rem;
}
.hero-nav-btn {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(200, 164, 92, 0.5);
  transition: color 0.2s;
  text-decoration: none;
}
.hero-nav-btn:hover { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--gold);
  position: absolute;
  left: 0;
  transition: all 0.3s;
}

.nav-hamburger span:nth-child(1) { top: 0; }
.nav-hamburger span:nth-child(2) { top: 11px; }
.nav-hamburger span:nth-child(3) { top: 22px; }

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
  padding: 2rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(200, 164, 92, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(19, 34, 64, 0.8) 0%, transparent 50%),
    linear-gradient(180deg, var(--navy) 0%, #0d1f38 100%);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(200, 164, 92, 0.5) 50px),
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(200, 164, 92, 0.5) 50px);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-motto {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s 0.3s ease forwards;
}

.hero-crest {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: 0;
  transform: scale(0.8);
  animation: fadeScale 1s 0.1s ease forwards;
}

.hero-crest::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(200, 164, 92, 0.3);
  border-radius: 50%;
}

.hero-crest svg {
  width: 36px;
  height: 36px;
  fill: var(--gold);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 0.6rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s 0.5s ease forwards;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--gold-light);
  font-style: italic;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s 0.7s ease forwards;
}

.hero-postnominals {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--sand);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 1s 0.9s ease forwards;
}

.hero-dates {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-light);
  opacity: 0;
  animation: fadeUp 1s 1.1s ease forwards;
}

.hero-dates .separator {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin: 0 1rem;
}

.hero-scroll {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUp 1s 1.5s ease forwards;
}

.hero-scroll span {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.hero-scroll .scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--gold), transparent);
  animation: scrollPulse 2s ease infinite;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScale {
  to { opacity: 1; transform: scale(1); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* --- Epigraph --- */
.epigraph-section {
  padding: 6rem 2rem;
  background: var(--navy);
  text-align: center;
  position: relative;
}

.epigraph-section::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 10rem;
  color: rgba(200, 164, 92, 0.08);
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
}

.epigraph {
  max-width: 700px;
  margin: 0 auto;
}

.epigraph blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--cream);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.epigraph cite {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  font-style: normal;
}

/* --- Section Layout --- */
.section {
  padding: 6rem 2rem;
  position: relative;
}

.section-dark {
  background: var(--navy);
  color: var(--cream);
}

.section-dark .section-heading { color: var(--cream); }
.section-dark .section-intro { color: var(--text-light); }

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

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* --- Interactive Timeline --- */
.timeline-container {
  position: relative;
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold-dim) 5%, var(--gold-dim) 95%, transparent);
  transform: translateX(-50%);
}

.timeline-era {
  margin-bottom: 2rem;
}

.timeline-era-header {
  text-align: center;
  position: relative;
  z-index: 2;
  margin-bottom: 1rem;
}

.timeline-era-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
}

.section-dark .timeline-era-badge {
  background: var(--gold);
  color: var(--navy);
}

.timeline-event {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: -2.5rem;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.timeline-era > .timeline-event:first-of-type {
  margin-top: 0;
}

.timeline-era > .timeline-event:last-of-type {
  margin-bottom: 0;
}

.timeline-event.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Cards alternate via HTML (content in Card1 vs Card2), not CSS flex-direction */
.timeline-event .timeline-card:nth-child(2) { text-align: right; padding-right: 3rem; }
.timeline-event .timeline-card:nth-child(3) { text-align: left; padding-left: 3rem; }

/* Connector line from dot toward the content card */
.timeline-event::before {
  content: '';
  position: absolute;
  top: 0.85rem;
  height: 1px;
  background: rgba(200, 164, 92, 0.35);
  z-index: 2;
  width: 1.8rem;
}
/* Even child positions (2,4,6) have content in Card1 (left) → connector points left */
.timeline-event:nth-child(even)::before {
  right: 50%;
  margin-right: 10px;
}
/* Odd child positions (3,5,7) have content in Card2 (right) → connector points right */
.timeline-event:nth-child(odd)::before {
  left: 50%;
  margin-left: 10px;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 0.4rem;
  width: 14px;
  height: 14px;
  background: var(--cream);
  border: 3px solid var(--gold);
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 3;
  transition: all 0.3s;
}

.timeline-event:hover .timeline-dot {
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(200, 164, 92, 0.2);
}

.timeline-dot.major {
  width: 18px;
  height: 18px;
  background: var(--gold);
}

.timeline-dot.combat {
  border-color: var(--blood);
  background: var(--blood);
}

.section-dark .timeline-dot { background: var(--navy); }

.timeline-card {
  flex: 1;
  max-width: calc(50% - 0.5rem);
  transition: opacity 0.2s;
}
.timeline-card a:hover .timeline-title {
  color: var(--gold);
}

.timeline-year {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
  padding-top: 0.15rem;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.section-dark .timeline-title { color: var(--cream); }

.timeline-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.section-dark .timeline-text { color: var(--text-light); }

.timeline-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-top: 0.5rem;
}

.badge-award {
  background: rgba(200, 164, 92, 0.15);
  color: var(--gold);
  border: 1px solid rgba(200, 164, 92, 0.3);
}

.badge-combat {
  background: rgba(180, 50, 50, 0.2);
  color: var(--blood-light);
  border: 1px solid rgba(180, 50, 50, 0.35);
}

.badge-family {
  background: rgba(10, 22, 40, 0.08);
  color: var(--navy-mid);
  border: 1px solid rgba(10, 22, 40, 0.15);
}

/* --- Chapter Narrative --- */
.chapter {
  padding: 8rem 2rem;
  position: relative;
}

.chapter-number {
  font-family: var(--font-display);
  font-size: 8rem;
  color: rgba(200, 164, 92, 0.08);
  position: absolute;
  top: 3rem;
  left: 2rem;
  line-height: 1;
  user-select: none;
}

.chapter-header {
  max-width: var(--reading-width);
  margin: 0 auto 3rem;
}

.chapter-body {
  max-width: var(--reading-width);
  margin: 0 auto;
}

.chapter-body p {
  font-size: 1.1rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.chapter-body p.lead {
  font-size: 1.25rem;
  color: var(--navy);
}

.chapter-body p.lead::first-letter {
  font-family: var(--font-display);
  font-size: 4rem;
  float: left;
  line-height: 0.8;
  margin: 0.05em 0.15em 0 0;
  color: var(--gold);
}

/* Inline quote */
.inline-quote {
  border-left: 3px solid var(--gold);
  padding: 1.5rem 0 1.5rem 2rem;
  margin: 2.5rem 0;
  position: relative;
}

.inline-quote p {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--navy);
  line-height: 1.7;
  margin-bottom: 0.5rem !important;
}

.inline-quote cite {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
  font-style: normal;
}

/* --- Narrative Image --- */
.narrative-image {
  margin: 3rem -4rem;
  position: relative;
}

.narrative-image img {
  width: 100%;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(10, 22, 40, 0.15);
}

.narrative-image figcaption {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
  padding: 0 4rem;
}

/* --- Document Explorer --- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.doc-card {
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(10, 22, 40, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(10, 22, 40, 0.15);
}

.doc-card-image {
  height: 200px;
  background: var(--navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.doc-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.doc-card:hover .doc-card-image img {
  transform: scale(1.05);
}

.doc-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 22, 40, 0.7));
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.doc-card:hover .doc-card-overlay { opacity: 1; }

.doc-card-overlay span {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

.doc-icon {
  font-size: 2.5rem;
  color: var(--gold-dim);
}

.doc-card-body {
  padding: 1.2rem;
}

.doc-card-type {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.doc-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.doc-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.doc-card-date {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--cream-dark);
}

/* --- Medals Section --- */
.medals-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 3rem 0;
}

.medal-item {
  text-align: center;
  width: 120px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.medal-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.medal-ribbon {
  width: 36px;
  height: 48px;
  margin: 0 auto 0.8rem;
  border-radius: 2px 2px 0 0;
  position: relative;
}

.medal-ribbon::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid;
  border-color: inherit;
  background: rgba(255,255,255,0.1);
}

.medal-name {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--cream);
  line-height: 1.3;
}

.medal-year {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  color: var(--gold-dim);
  margin-top: 0.2rem;
}

/* Medal ribbon colours */
.ribbon-cb    { background: linear-gradient(90deg, #c8102e 15%, #f0f0f0 15%, #f0f0f0 50%, #c8102e 50%); border-color: #c8102e; }
.ribbon-cbe   { background: linear-gradient(90deg, #d4366e 20%, #808080 20%, #808080 80%, #d4366e 80%); border-color: #d4366e; }
.ribbon-dso   { background: linear-gradient(90deg, #c8102e 25%, #003399 25%, #003399 75%, #c8102e 75%); border-color: #003399; }
.ribbon-mc    { background: linear-gradient(90deg, #f0f0f0 33%, #003399 33%, #003399 67%, #f0f0f0 67%); border-color: #f0f0f0; }
.ribbon-mid   { background: #003399; border-color: #003399; }
.ribbon-cdg   { background: linear-gradient(90deg, #003300 15%, #c8102e 15%, #c8102e 85%, #003300 85%); border-color: #c8102e; }
.ribbon-star  { background: linear-gradient(90deg, #000066 20%, #c8102e 20%, #c8102e 50%, #003399 50%); border-color: #000066; }
.ribbon-korea { background: linear-gradient(90deg, #ffd700 15%, #003399 15%, #003399 85%, #ffd700 85%); border-color: #003399; }

/* --- Map Section --- */
.map-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: var(--navy-light);
  border-radius: 4px;
  overflow: hidden;
}

.map-svg {
  width: 100%;
  height: 100%;
}

.map-marker {
  cursor: pointer;
  transition: all 0.3s;
}

.map-marker:hover .marker-dot {
  r: 8;
  fill: var(--gold);
}

.map-marker .marker-dot {
  fill: var(--gold);
  stroke: var(--white);
  stroke-width: 2;
  transition: all 0.3s;
}

.map-marker .marker-pulse {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  animation: mapPulse 2s ease-in-out infinite;
}

@keyframes mapPulse {
  0% { r: 6; opacity: 0.6; }
  100% { r: 20; opacity: 0; }
}

.map-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  fill: var(--cream);
  letter-spacing: 0.1em;
}

.map-tooltip {
  position: absolute;
  background: var(--navy);
  color: var(--cream);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  border: 1px solid rgba(200, 164, 92, 0.3);
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s;
  z-index: 10;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.map-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.map-tooltip-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.map-tooltip-text {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-light);
}

/* --- Audio Player --- */
.audio-player {
  background: var(--navy-light);
  border: 1px solid rgba(200, 164, 92, 0.2);
  border-radius: 4px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.audio-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}

.audio-play-btn:hover {
  background: var(--gold-light);
  transform: scale(1.05);
}

.audio-play-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--navy);
  margin-left: 3px;
}

.audio-info {
  flex: 1;
}

.audio-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--cream);
  margin-bottom: 0.2rem;
}

.audio-subtitle {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
}

.audio-waveform {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.audio-bar {
  width: 3px;
  background: var(--gold-dim);
  border-radius: 2px;
  transition: height 0.2s;
}

/* --- Family Tree --- */
.family-tree {
  max-width: 900px;
  margin: 3rem auto;
}

.tree-generation {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  position: relative;
}

.tree-person {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 4px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 160px;
  transition: all 0.3s;
  cursor: default;
}

.tree-person:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(200, 164, 92, 0.15);
}

.tree-person.subject {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(200, 164, 92, 0.08), var(--white));
  box-shadow: 0 2px 12px rgba(200, 164, 92, 0.12);
}

.tree-person.deceased-war {
  border-left: 3px solid var(--blood);
}

.tree-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.tree-detail {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.tree-connector {
  width: 1px;
  height: 30px;
  background: var(--gold-dim);
  margin: 0 auto;
}

.tree-branch {
  display: flex;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
}

.tree-branch::before {
  content: '';
  position: absolute;
  top: 0;
  height: 1px;
  background: var(--gold-dim);
}

/* --- Document Viewer Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.9);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  max-width: 900px;
  max-height: 90vh;
  width: 90%;
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.5rem 2rem;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--cream);
}

.modal-close {
  background: none;
  border: 1px solid rgba(200, 164, 92, 0.3);
  color: var(--gold);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.modal-close:hover {
  background: var(--gold);
  color: var(--navy);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-body img {
  width: 100%;
  border-radius: 2px;
}

.modal-meta {
  padding: 1rem 2rem;
  background: var(--cream);
  border-top: 1px solid var(--cream-dark);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 2rem;
}

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
}

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(200, 164, 92, 0.1);
}

.footer-motto {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.footer-translation {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.footer-text {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* --- Animations / Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .timeline-line { left: 2rem; }

  .timeline-event,
  .timeline-event:nth-child(odd),
  .timeline-event:nth-child(even) {
    flex-direction: column;
    padding-left: 4rem;
    margin-bottom: 1.5rem;
  }

  .timeline-event:nth-child(odd) .timeline-card,
  .timeline-event:nth-child(even) .timeline-card {
    text-align: left;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .timeline-event::before,
  .timeline-event:nth-child(odd)::before,
  .timeline-event:nth-child(even)::before {
    left: 2rem !important;
    right: auto !important;
    margin-left: 10px !important;
    margin-right: 0 !important;
    width: 1.2rem;
  }

  .timeline-dot {
    left: 2rem;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .narrative-image {
    margin: 2rem -1rem;
  }

  .narrative-image figcaption {
    padding: 0 1rem;
  }

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

@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }

  .hero-title {
    font-size: 2.5rem;
  }

  .section {
    padding: 4rem 1.5rem;
  }

  .chapter {
    padding: 5rem 1.5rem;
  }

  .chapter-number {
    font-size: 5rem;
  }

  .medals-display {
    gap: 1rem;
  }

  .medal-item {
    width: 80px;
  }

  .audio-player {
    flex-wrap: wrap;
    padding: 1rem;
  }

  .audio-waveform {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
}

/* --- Chapter Read Link (landing page teaser) --- */
.chapter-read-link {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
  border: 1px solid var(--gold-dim);
  padding: 0.8rem 2rem;
  border-radius: 2px;
  transition: all 0.3s;
}

.chapter-read-link:hover {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy);
}

/* --- Utility --- */
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.text-cream { color: var(--cream); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-3 { margin-bottom: 2rem; }

/* --- Chapter Hero (standalone chapter pages) --- */
.chapter-hero {
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

.chapter-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(200, 164, 92, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(19, 34, 64, 0.8) 0%, transparent 50%),
    linear-gradient(180deg, var(--navy) 0%, #0d1f38 100%);
}

.chapter-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
}

.chapter-hero-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s ease forwards;
}

.chapter-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.8rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s ease forwards;
}

.chapter-hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--gold-light);
  font-style: italic;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s ease forwards;
}

/* --- Chapter Article Layout --- */
.chapter-article {
  background: var(--cream);
}

.chapter-article .chapter-body {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
}

.chapter-article .chapter-body p {
  font-size: 1.1rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.chapter-article .chapter-body p.lead {
  font-size: 1.25rem;
  color: var(--navy);
}

.chapter-article .chapter-body p.lead::first-letter {
  font-family: var(--font-display);
  font-size: 4rem;
  float: left;
  line-height: 0.8;
  margin: 0.05em 0.15em 0 0;
  color: var(--gold);
}

.chapter-section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--navy);
  margin: 3.5rem 0 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--cream-dark);
}

.chapter-section-heading:first-of-type {
  border-top: none;
  padding-top: 0;
}

/* --- Chapter Gaps / "What We Don't Know" --- */
.chapter-gaps {
  background: var(--cream-dark);
  border-left: 3px solid var(--gold-dim);
  padding: 2rem 2.5rem;
  margin: 3rem 0 2rem;
  border-radius: 0 4px 4px 0;
}

.chapter-gaps h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 1rem;
}

.chapter-gaps p {
  font-size: 0.95rem !important;
  color: var(--text-muted) !important;
  line-height: 1.75 !important;
  margin-bottom: 1rem !important;
}

.chapter-gaps p:last-child {
  margin-bottom: 0 !important;
}

.chapter-gaps ul {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.chapter-gaps ul:last-child {
  margin-bottom: 0;
}

.chapter-gaps li {
  margin-bottom: 0.4rem;
}

/* --- Chapter Research Flag --- */
.chapter-research-flag {
  background: #faf6ee;
  border: 1px solid var(--gold-dim);
  border-left: 3px solid var(--gold);
  padding: 1.5rem 2rem;
  margin: 0 0 2.5rem;
  border-radius: 0 4px 4px 0;
  font-family: var(--font-sans);
}

.chapter-research-flag h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.chapter-research-flag p {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  line-height: 1.7 !important;
  margin-bottom: 0.75rem !important;
}

.chapter-research-flag p:last-child {
  margin-bottom: 0 !important;
}

.chapter-research-flag ul {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.chapter-research-flag li {
  margin-bottom: 0.3rem;
}

/* --- Chapter Audio Section --- */
.chapter-audio-section {
  background: var(--navy);
  padding: 3rem 2rem;
}

.chapter-audio-section .chapter-body {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 0;
}

.audio-note {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 1rem;
  line-height: 1.6;
}

/* --- Chapter Navigation --- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  border-top: 1px solid var(--cream-dark);
  background: var(--cream);
}

.chapter-nav-link {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  border: 1px solid var(--cream-dark);
  border-radius: 4px;
  transition: all 0.3s;
  text-decoration: none;
  max-width: 45%;
}

.chapter-nav-link:hover {
  border-color: var(--gold);
  background: var(--white);
}

.chapter-nav-direction {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.3rem;
}

.chapter-nav-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
}

.chapter-nav-next {
  text-align: right;
  margin-left: auto;
}

/* --- Responsive (chapter pages) --- */
@media (max-width: 600px) {
  .chapter-hero {
    min-height: 40vh;
    padding: 5rem 1.5rem 3rem;
  }

  .chapter-article .chapter-body {
    padding: 3rem 1.5rem 2rem;
  }

  .chapter-nav {
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 1.5rem 3rem;
  }

  .chapter-nav-link {
    max-width: 100%;
  }

  .chapter-gaps {
    padding: 1.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .chapter-research-flag {
    padding: 1.25rem 1.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }
}

/* --- Chapter Explore / "Explore Further" --- */
.chapter-explore {
  background: var(--cream-dark);
  border-left: 3px solid var(--gold);
  padding: 2rem 2.5rem;
  margin: 3rem 0 2rem;
  border-radius: 0 4px 4px 0;
}

.chapter-explore h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 1rem;
}

.chapter-explore ul {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.chapter-explore li {
  margin-bottom: 0.4rem;
}

.chapter-explore a {
  color: var(--gold-dim);
  border-bottom: 1px solid rgba(138, 115, 64, 0.3);
  transition: color 0.3s, border-color 0.3s;
}

.chapter-explore a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

@media (max-width: 600px) {
  .chapter-explore {
    padding: 1.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }
}

/* --- Print --- */
@media print {
  .site-nav, .hero-scroll, .audio-player, .chapter-nav,
  .chapter-research-flag, .chapter-explore, .nav-hamburger, .map-container,
  .modal-overlay, .filter-bar { display: none; }

  .hero, .chapter-hero { min-height: auto; padding: 2rem; background: white; color: black; }
  .chapter-hero-title, .hero-title { color: black; }
  .chapter-hero-label, .chapter-hero-subtitle { color: #666; }

  .section { padding: 2rem 0; }
  .section-dark { background: white; color: black; }
  .section-dark .section-heading, .section-dark .timeline-title { color: black; }

  .chapter-article .chapter-body { padding: 1rem 0; max-width: 100%; }
  .chapter-article .chapter-body p { font-size: 10.5pt; line-height: 1.6; margin-bottom: 0.8rem; }
  .chapter-article .chapter-body p.lead { font-size: 11.5pt; }
  .chapter-article .chapter-body p.lead::first-letter { font-size: 2.5rem; }

  .chapter-section-heading { font-size: 14pt; margin: 1.5rem 0 0.8rem; border-top: 1px solid #ccc; padding-top: 1rem; }

  .inline-quote { border-left: 2px solid #999; padding: 0.8rem 0 0.8rem 1.2rem; margin: 1.2rem 0; }
  .inline-quote p { font-size: 10.5pt !important; }

  .chapter-gaps { background: #f5f5f5; border-left: 2px solid #999; padding: 1rem; margin: 1.5rem 0; }
  .chapter-gaps p { font-size: 9pt !important; }

  body { font-size: 11pt; }
  a { color: black; text-decoration: none; }
  .site-footer { padding: 1rem 0; border-top: 1px solid #ccc; }
  .footer-motto { color: black; }

  .medals-display, .stats-bar { break-inside: avoid; }
  .timeline-era { break-inside: avoid; }

  @page { margin: 2cm; }
  h2 { break-after: avoid; }
  .inline-quote { break-inside: avoid; }
}
