/* ============================================
   PROPHET TIMELINE — Design System
   ============================================ */

/* --- CSS Variables --- */
:root {
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-pale: #f5e6b8;
  --deep-navy: #060d1f;
  --navy: #0a1628;
  --navy-mid: #0f1f3d;
  --blue-glass: rgba(15, 31, 61, 0.55);
  --blue-glass-hover: rgba(20, 40, 80, 0.7);
  --glass-border: rgba(201, 168, 76, 0.25);
  --glass-border-hover: rgba(201, 168, 76, 0.55);
  --text-primary: #f0e6c8;
  --text-secondary: #b8a882;
  --text-muted: #7a6e58;
  --white-glass: rgba(255, 255, 255, 0.06);
  --blur: blur(20px) saturate(180%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--deep-navy);
  font-family: 'Crimson Pro', serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ============================================
   FIXED BACKGROUND LAYERS
   ============================================ */

/* --- Starfield --- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.starfield::before,
.starfield::after {
  content: '';
  position: absolute;
  inset: 0;
}

.starfield::before {
  background:
    radial-gradient(1px 1px at 5% 12%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 10% 40%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 15% 72%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 20% 25%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 25% 88%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 30% 55%, rgba(201, 168, 76, 0.6), transparent),
    radial-gradient(1px 1px at 35% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 40% 65%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 45% 33%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 50% 80%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 55% 10%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 60% 48%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 65% 92%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 70% 28%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 75% 60%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 80% 15%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 85% 75%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 88% 42%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 92% 85%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 97% 50%, rgba(255, 255, 255, 0.5), transparent);
}

.starfield::after {
  background:
    radial-gradient(1px 1px at 3% 55%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(2px 2px at 8% 82%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 12% 30%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 18% 68%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 22% 5%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 28% 45%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 33% 90%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 38% 22%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 42% 58%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 48% 15%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 52% 70%, rgba(201, 168, 76, 0.5), transparent),
    radial-gradient(1px 1px at 58% 38%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 62% 78%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 68% 8%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 72% 52%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 78% 88%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 82% 35%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 87% 62%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 93% 20%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 96% 72%, rgba(255, 255, 255, 0.3), transparent);
}

/* --- Background Glows --- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(30, 60, 120, 0.4), transparent);
  top: -100px;
  left: -100px;
  animation: driftA 20s infinite alternate;
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(100, 70, 20, 0.3), transparent);
  bottom: 20%;
  right: -80px;
  animation: driftB 25s infinite alternate;
}

.bg-glow-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(20, 50, 100, 0.25), transparent);
  top: 50%;
  left: 30%;
}

@keyframes driftA {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.1); }
}

@keyframes driftB {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-50px, -30px) scale(0.95); }
}

/* ============================================
   PAGE STRUCTURE
   ============================================ */

.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ============================================
   TOP NAV
   ============================================ */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  background: rgba(6, 13, 31, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-brand {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
}

.nav-tabs {
  display: flex;
  gap: 8px;
}

.nav-tab {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  background: var(--white-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.nav-tab:hover {
  border-color: rgba(201, 168, 76, 0.5);
  color: var(--gold-light);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(201, 168, 76, 0.08));
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}

/* ============================================
   VIEWS
   ============================================ */

.view {
  display: none;
  padding-top: 64px;
}

.view.active {
  display: block;
}

/* ============================================
   GLASSMORPHISM CARD
   ============================================ */

.glass-card {
  position: relative;
  background: var(--blue-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px 26px;
  transition: all 0.3s ease;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.glass-card:hover {
  background: var(--blue-glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ============================================
   YEAR BADGE
   ============================================ */

.year-badge {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--deep-navy);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 12px;
}

/* ============================================
   ERA LABEL
   ============================================ */

.era-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 50px 0 30px;
}

.era-label-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  opacity: 0.4;
}

.era-label-text {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  padding: 6px 18px;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 20px;
  background: rgba(201, 168, 76, 0.06);
}

/* ============================================
   QURAN QUOTE
   ============================================ */

.quran-quote {
  text-align: center;
  padding: 40px 30px;
  margin: 50px 0;
}

.quran-quote-inner {
  position: relative;
  overflow: hidden;
  background: var(--white-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 24px;
  padding: 36px 40px;
}

.quran-quote-inner::before {
  content: '\275D';
  position: absolute;
  top: 10px;
  left: 20px;
  font-size: 5rem;
  color: var(--gold);
  opacity: 0.12;
  line-height: 1;
}

.quran-quote-inner::after {
  content: '\275E';
  position: absolute;
  bottom: 0;
  right: 20px;
  font-size: 5rem;
  color: var(--gold);
  opacity: 0.12;
  line-height: 1;
}

.quran-text {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--gold-pale);
  font-style: italic;
  line-height: 1.9;
}

.quran-ref {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
  margin-top: 12px;
}

/* ============================================
   SCROLL-TO-TOP
   ============================================ */

#scrollTop {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--blue-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

#scrollTop.shown {
  opacity: 1;
  pointer-events: all;
}

#scrollTop:hover {
  transform: translateY(-3px);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(201, 168, 76, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
}

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

/* ============================================
   COMPANION STRIPE & PILL CLASSES
   ============================================ */

.stripe-caliph { background: linear-gradient(90deg, #c9a84c, #f5e6b8, #c9a84c); }
.pill-caliph { color: #f5e6b8; border-color: rgba(245, 230, 184, 0.5); background: rgba(201, 168, 76, 0.15); }
.stripe-ten { background: linear-gradient(90deg, #c9a84c, #e8c97a); }
.pill-ten { color: var(--gold); border-color: rgba(201, 168, 76, 0.4); background: rgba(201, 168, 76, 0.08); }
.stripe-female { background: linear-gradient(90deg, #b87fa8, #e8aadd); }
.pill-female { color: #d4a0c8; border-color: rgba(212, 160, 200, 0.4); background: rgba(184, 127, 168, 0.08); }
.stripe-military { background: linear-gradient(90deg, #5a8a6a, #88c4a0); }
.pill-military { color: #88c4a0; border-color: rgba(136, 196, 160, 0.4); background: rgba(88, 138, 100, 0.08); }
.stripe-scholar { background: linear-gradient(90deg, #5a7ab8, #88aadd); }
.pill-scholar { color: #88aadd; border-color: rgba(136, 170, 221, 0.4); background: rgba(88, 122, 184, 0.08); }
.stripe-early { background: linear-gradient(90deg, #a86040, #d4906a); }
.pill-early { color: #d4906a; border-color: rgba(212, 144, 106, 0.4); background: rgba(168, 96, 64, 0.08); }

/* ============================================
   COMPANION FILTERS
   ============================================ */

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

.comp-filter-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--white-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.comp-filter-btn:hover {
  border-color: rgba(201, 168, 76, 0.5);
  color: var(--gold-light);
}

.comp-filter-btn.active {
  background: rgba(201, 168, 76, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

.companions-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 24px;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.companions-intro em {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   COMPANION OVERLAY & DRAWER
   ============================================ */

.comp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.comp-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.comp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  background: rgba(10, 18, 40, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid var(--glass-border);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.comp-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  position: relative;
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.12);
  flex-shrink: 0;
}

.drawer-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--white-glass);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.drawer-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.drawer-category {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  margin-top: 8px;
}

.drawer-name {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 6px;
}

.drawer-title-line {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 4px;
}

.drawer-dates {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.drawer-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* ============================================
   SCROLL TIMELINE
   ============================================ */

.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.hero { text-align: center; padding: 80px 20px 60px; }
.hero-ornament {
  font-size: 2.2rem; color: var(--gold); letter-spacing: 0.3em;
  display: block; margin-bottom: 16px; animation: fadeDown 1s ease 0.2s both;
}
.hero-arabic {
  font-size: clamp(2rem, 6vw, 4rem); font-family: 'Cinzel Decorative', serif; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-pale));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.2; margin-bottom: 8px; animation: fadeDown 1s ease 0.4s both;
}
.hero-subtitle {
  font-family: 'Cinzel', serif; font-size: 1rem; color: var(--text-secondary);
  letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 32px; animation: fadeDown 1s ease 0.6s both;
}
.hero-intro {
  max-width: 700px; margin: 0 auto 40px; font-size: 1.1rem; color: var(--text-secondary);
  font-style: italic; line-height: 1.9; animation: fadeDown 1s ease 0.8s both;
}
.hero-divider {
  display: flex; align-items: center; gap: 16px; justify-content: center;
  margin-bottom: 40px; animation: fadeDown 1s ease 1s both;
}
.hero-divider span { width: 80px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.hero-divider em { font-style: normal; color: var(--gold); font-size: 1.4rem; }
.sources-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--white-glass); backdrop-filter: var(--blur); border: 1px solid var(--glass-border);
  border-radius: 30px; padding: 10px 22px; font-size: 0.82rem; color: var(--text-secondary);
  font-family: 'Cinzel', serif; letter-spacing: 0.08em; animation: fadeUp 1s ease 1.2s both;
}

.timeline { position: relative; padding: 0; }
.timeline::before {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  width: 2px; top: 0; bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(201, 168, 76, 0.15) 5%, rgba(201, 168, 76, 0.35) 20%, rgba(201, 168, 76, 0.35) 80%, rgba(201, 168, 76, 0.15) 95%, transparent 100%);
}

.tl-event { display: flex; align-items: flex-start; margin-bottom: 40px; position: relative; }
.tl-event:nth-child(odd) { flex-direction: row; }
.tl-event:nth-child(even) { flex-direction: row-reverse; }
.tl-event.tl-left { flex-direction: row; }
.tl-event.tl-right { flex-direction: row-reverse; }
.tl-event-content { width: calc(50% - 40px); flex-shrink: 0; }
.tl-event:nth-child(odd) .tl-event-content { margin-right: 40px; text-align: right; }
.tl-event:nth-child(even) .tl-event-content { margin-left: 40px; text-align: left; }
.tl-event.tl-left .tl-event-content { margin-right: 40px; margin-left: 0; text-align: right; }
.tl-event.tl-right .tl-event-content { margin-left: 40px; margin-right: 0; text-align: left; }
.tl-node {
  position: absolute; left: 50%; top: 24px; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light), var(--gold));
  border: 3px solid var(--deep-navy);
  box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(201, 168, 76, 0.6);
  z-index: 2; flex-shrink: 0; transition: transform 0.3s, box-shadow 0.3s;
}
.tl-event:hover .tl-node {
  transform: translateX(-50%) scale(1.4);
  box-shadow: 0 0 0 3px var(--gold-light), 0 0 28px rgba(201, 168, 76, 0.9);
}
.tl-photo { width: calc(50% - 40px); flex-shrink: 0; }
.tl-event:nth-child(odd) .tl-photo { margin-left: 40px; }
.tl-event:nth-child(even) .tl-photo { margin-right: 40px; }
.tl-event.tl-left .tl-photo { margin-left: 40px; margin-right: 0; }
.tl-event.tl-right .tl-photo { margin-right: 40px; margin-left: 0; }
.photo-frame {
  border-radius: 18px; overflow: hidden; border: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); position: relative; aspect-ratio: 4/3;
  background: var(--navy-mid); transition: transform 0.3s, box-shadow 0.3s;
}
.photo-frame:hover { transform: translateY(-4px) scale(1.01); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s; }
.photo-frame:hover img { transform: scale(1.06); }
.photo-caption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 28px 16px 12px;
  background: linear-gradient(transparent, rgba(6, 13, 31, 0.88)); font-size: 0.78rem;
  color: var(--text-secondary); font-style: italic;
}
.photo-caption strong {
  display: block; font-style: normal; font-size: 0.85rem;
  color: var(--gold-pale); font-family: 'Cinzel', serif; margin-bottom: 2px;
}

.tl-full { margin-bottom: 48px; }
.tl-full-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.tl-full .photo-frame { aspect-ratio: 16/10; min-height: 220px; }

.event-title {
  font-family: 'Cinzel', serif; font-size: 1.05rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 10px; line-height: 1.4;
}
.event-body { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.75; }
.event-ref {
  margin-top: 10px; font-size: 0.75rem; font-style: italic; color: var(--text-muted);
  border-top: 1px solid rgba(201, 168, 76, 0.12); padding-top: 8px;
}

/* ============================================
   LINEAGE — Childhood Timeline
   ============================================ */

.childhood-timeline { position: relative; max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; }
.childhood-timeline::before {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  width: 2px; top: 0; bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(201, 168, 76, 0.35) 10%, rgba(201, 168, 76, 0.35) 90%, transparent);
}

/* ============================================
   LINEAGE — Ancestor Profile Cards
   ============================================ */

.ancestor-card {
  background: var(--blue-glass); backdrop-filter: var(--blur); border: 1px solid var(--glass-border);
  border-radius: 20px; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; transition: all 0.3s;
}
.ancestor-card:hover { border-color: var(--glass-border-hover); transform: translateY(-4px); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); }
.ancestor-card-top { padding: 18px; }
.ancestor-era { font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.14em; color: var(--gold); margin-bottom: 6px; text-transform: uppercase; }
.ancestor-name { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; line-height: 1.3; }
.ancestor-significance { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.ancestor-card-footer {
  padding: 10px 18px; border-top: 1px solid rgba(201, 168, 76, 0.1);
  display: flex; justify-content: space-between; align-items: center;
}
.ancestor-type-pill {
  font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 12px; border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--gold); background: rgba(201, 168, 76, 0.06);
}

.prophet-card { border-color: rgba(201, 168, 76, 0.4); }
.prophet-card .ancestor-name {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ============================================
   LINEAGE — D3 Tree SVG Styles
   ============================================ */

#familyTreeSvg { background: transparent; cursor: grab; }
#familyTreeSvg:active { cursor: grabbing; }
.tree-node circle { transition: r 0.2s, filter 0.2s; cursor: pointer; }
.tree-node text { font-family: 'Cinzel', serif; font-size: 11px; fill: var(--text-secondary); cursor: pointer; pointer-events: none; }
.tree-link { fill: none; stroke: rgba(201, 168, 76, 0.3); stroke-width: 1.5px; }
.tree-link.highlighted { stroke: var(--gold); stroke-width: 2.5px; opacity: 1; }
.tree-node.highlighted circle { filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.9)); }
.tree-node.prophet-node circle { fill: var(--gold); filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.8)); }
.tree-node.paternal-node circle { fill: rgba(30, 60, 120, 0.9); stroke: var(--gold); stroke-width: 2px; }
.tree-node.maternal-node circle { fill: rgba(80, 40, 90, 0.9); stroke: #d4a0c8; stroke-width: 2px; }
.tree-node.uncle-node circle { fill: rgba(20, 40, 70, 0.8); stroke: rgba(201, 168, 76, 0.4); stroke-width: 1px; }
.tree-node.family-node circle { fill: rgba(80, 60, 20, 0.8); stroke: var(--gold-light); stroke-width: 2px; }
.tree-tooltip {
  position: fixed; background: rgba(10, 18, 40, 0.95); backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); border-radius: 12px; padding: 10px 14px; pointer-events: none;
  z-index: 500; font-family: 'Cinzel', serif; font-size: 0.72rem; color: var(--text-primary);
  max-width: 200px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.2s;
}

/* ============================================
   MOBILE (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {
  .nav-tabs { gap: 4px; }
  .nav-tab { font-size: 0.58rem; padding: 6px 8px; }
  .nav-brand { display: none; }

  .timeline::before { left: 22px; }
  .tl-event, .tl-event:nth-child(even), .tl-event.tl-left, .tl-event.tl-right { flex-direction: column; padding-left: 52px; }
  .tl-event-content, .tl-photo { width: 100%; margin: 0 0 12px 0 !important; text-align: left !important; }
  .tl-node { left: 22px; }
  .tl-full-inner { grid-template-columns: 1fr; }
  .childhood-timeline::before { left: 22px; }

  .map-sidebar { width: 280px; }
  .map-popup-overlay { width: calc(100vw - 32px); left: 16px; right: 16px; }
  .comp-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important; gap: 12px !important; }
  .comp-drawer { width: 100vw; max-width: 100vw; }
  .drawer-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .comp-filters { gap: 6px; }
  .comp-filter-btn { font-size: 0.58rem; padding: 5px 10px; }
  .lineage-subtabs { flex-wrap: wrap; }
  .tree-controls { flex-wrap: wrap; top: 8px; right: 8px; }
}

@media (max-width: 480px) {
  #mapView { flex-direction: column; }
  .map-sidebar { width: 100%; height: 220px; }
  #map { flex: 1; }
  .comp-grid { grid-template-columns: 1fr 1fr !important; }
}
