/* ==========================================================================
   344,799 Bible Cross References — Stylesheet
   Design System: Sacred Cosmic Obsidian & Relic Gold
   Typography: Gabriela (Headings) & Lato (Body) — self-hosted, OFL licensed
   ========================================================================== */

/* Self-hosted fonts (Latin subset). No third-party request, no render-blocking @import. */
@font-face {
  font-family: 'Gabriela';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Gabriela-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Lato-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Lato-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url('fonts/Lato-Bold.woff2') format('woff2');
}

:root {
  color-scheme: dark;

  --bg-main: #080914;
  --bg-surface: #0e1224;
  --bg-card: #131832;
  --bg-card-hover: #192042;
  --border-color: #212952;
  --border-gold: rgba(245, 197, 66, 0.35);

  --gold-primary: #f5c542;
  --gold-light: #fef08a;
  --gold-glow: rgba(245, 197, 66, 0.25);
  --cyan-accent: #38bdf8;
  --purple-accent: #a855f7;
  --crimson-accent: #ef4444;
  --emerald-accent: #10b981;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8e9bb5;
  --text-gold: #fde047;

  /* Book-genre palette: shared by the legend and the canvas (Scripts.js reads these) */
  --genre-law: #f59e0b;
  --genre-history: #fb923c;
  --genre-poetry: #38bdf8;
  --genre-prophets_maj: #a855f7;
  --genre-prophets_min: #c084fc;
  --genre-gospels: #10b981;
  --genre-epistles: #60a5fa;
  --genre-apocalypse: #f43f5e;

  --font-heading: 'Gabriela', Georgia, 'Times New Roman', serif;
  --font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --shadow-dark: 0 12px 35px -8px rgba(0, 0, 0, 0.75);
  --shadow-gold: 0 0 25px rgba(245, 197, 66, 0.2);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  /* z-index scale: header < lightbox < splash < Bible popup (99999, set by Bible_popup.js) */
  --z-header: 1000;
  --z-lightbox: 50000;
  --z-splash: 60000;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* keep anchor targets clear of the sticky header */
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(30, 41, 89, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 10% 30%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(56, 189, 248, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

img {
  max-width: 100%;
}

/* ==========================================================================
   Accessibility helpers
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: calc(var(--z-splash) + 1);
  padding: 0.6rem 1.1rem;
  background: var(--gold-primary);
  color: #0b0c16;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
  color: #0b0c16;
}

:focus-visible {
  outline: 3px solid var(--gold-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

main:focus {
  outline: none;
}

/* ==========================================================================
   Typography & Shadows
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--gold-light);
  line-height: 1.25;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.85), 0 0 20px var(--gold-glow);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 0.75rem; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); margin-bottom: 0.5rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.4rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

strong, b {
  color: #ffffff;
  font-weight: 700;
}

a {
  color: var(--cyan-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--gold-primary);
  text-shadow: 0 0 10px var(--gold-glow);
}

/* Bible Popups contrast styling */
a.bible-ref {
  color: var(--gold-primary) !important;
  font-weight: 700;
  border-bottom: 1px dotted var(--gold-primary);
  padding: 0 2px;
  cursor: pointer;
  transition: var(--transition);
}

a.bible-ref:hover {
  color: #ffffff !important;
  background: rgba(245, 197, 66, 0.2);
  border-radius: 4px;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1260px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

section {
  padding: 5rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 3.5rem auto;
}

.section-header--compact {
  margin-bottom: 2rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(245, 197, 66, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: 9999px;
  color: var(--gold-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.section-lead {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   2-Second Splash Screen (Modal)
   JS dismisses it after 2s / on click / on Escape. If JS never runs, the
   failsafe animation below still hides it, so visitors are never trapped.
   ========================================================================== */

.splash-screen {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 12, 0.97);
  z-index: var(--z-splash);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  cursor: pointer;
  animation: splashFailsafe 0.5s ease 2.6s forwards;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-card {
  position: relative;
  max-width: 920px;
  width: 90%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 40px rgba(245, 197, 66, 0.25);
  border: 2px solid var(--border-gold);
  text-align: center;
}

.splash-card img {
  width: 100%;
  height: auto;
  display: block;
}

.splash-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gold-primary), var(--cyan-accent));
  width: 100%;
  animation: splashCountdown 2s linear forwards;
}

.splash-dismiss-hint {
  margin-top: 1.25rem;
  padding: 0 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

@keyframes splashCountdown {
  from { width: 100%; }
  to { width: 0%; }
}

@keyframes splashFailsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ==========================================================================
   Site Header & Sticky Nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(8, 9, 20, 0.985);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1400px; /* the header needs more room than the 1260px content column */
  padding: 0.85rem 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-icon {
  font-size: 1.8rem;
  color: var(--gold-primary);
  text-shadow: 0 0 15px var(--gold-glow);
}

.brand-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold-light);
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--cyan-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

.nav-links a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}

.nav-links a:hover,
.nav-links a.is-current {
  color: var(--gold-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff !important;
  padding: 0.45rem 1.1rem !important;
  border-radius: 9999px !important;
  font-weight: 700 !important;
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.35);
}

.nav-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  transform: translateY(-1px);
}

/* Hamburger (only shown when JS is available and the links no longer fit) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold-light);
  border-radius: 2px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero Banner Section
   ========================================================================== */

.hero-section {
  padding: 3rem 0 5rem 0;
}

.hero-banner-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-gold);
  box-shadow: var(--shadow-dark), 0 0 40px rgba(0, 0, 0, 0.9);
  margin-bottom: 3.5rem;
}

.hero-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 1;
}

.hero-content {
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
}

.hero-title {
  margin-bottom: 1.25rem;
}

.hero-description {
  font-size: 1.35rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  box-shadow: var(--shadow-dark);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), #d97706);
  color: #0b0c16;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fef08a, var(--gold-primary));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 197, 66, 0.4);
  color: #000;
}

.btn-secondary {
  background: rgba(30, 41, 75, 0.6);
  color: #ffffff;
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
  transform: translateY(-2px);
}

/* ==========================================================================
   Statistics Grid
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--gold-glow);
}

.stat-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  color: var(--gold-primary);
  line-height: 1.1;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.stat-label {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.stat-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Interactive Arc Visualizer (Canvas)
   ========================================================================== */

.visualizer-wrapper {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-dark);
}

.visualizer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-btn {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn:hover {
  background: rgba(245, 197, 66, 0.15);
  border-color: var(--border-gold);
  color: var(--gold-primary);
}

.pill-btn.active {
  background: var(--gold-primary);
  color: #0b0c16;
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px var(--gold-glow);
}

.viz-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.canvas-container {
  position: relative;
  width: 100%;
  height: 480px;
  background: #04050d;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#arc-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y; /* vertical swipes still scroll the page; horizontal moves drive the tooltip */
}

.viz-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.viz-status[hidden] {
  display: none;
}

.viz-caption {
  margin: 1.1rem auto 0;
  max-width: 900px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.viz-caption strong {
  color: var(--gold-light);
}

.viz-arcs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 0.5rem;
  margin: 1.1rem 0 0;
}

.viz-arcs[hidden] {
  display: none;
}

.viz-arc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.viz-arc-item::before {
  content: '';
  flex: 0 0 0.7rem;
  height: 0.7rem;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: var(--arc-color, var(--gold-primary));
  box-shadow: 0 0 8px var(--arc-color, var(--gold-primary));
}

.viz-arc-item:hover,
.viz-arc-item.is-active {
  color: #ffffff;
  border-color: var(--border-gold);
  background: rgba(245, 197, 66, 0.08);
}

.viz-arc-label {
  flex: 1;
}

.viz-arc-count {
  color: var(--gold-primary);
  font-weight: 700;
  white-space: nowrap;
}

.viz-status button {
  pointer-events: auto;
  margin-left: 0.6rem;
  padding: 0.35rem 0.9rem;
  background: rgba(245, 197, 66, 0.15);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  color: var(--gold-primary);
  font-weight: 700;
  cursor: pointer;
}

.viz-credit a,
.footer-bottom a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.viz-credit {
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.canvas-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.genre-law { background: var(--genre-law); }
.genre-history { background: var(--genre-history); }
.genre-poetry { background: var(--genre-poetry); }
.genre-prophets_maj { background: var(--genre-prophets_maj); }
.genre-prophets_min { background: var(--genre-prophets_min); }
.genre-gospels { background: var(--genre-gospels); }
.genre-epistles { background: var(--genre-epistles); }
.genre-apocalypse { background: var(--genre-apocalypse); }

.canvas-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  max-width: min(320px, 90%);
  pointer-events: none;
  background: rgba(8, 10, 24, 0.95);
  border: 1px solid var(--border-gold);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.85rem;
  line-height: 1.45;
  z-index: 10;
  display: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   YouTube Video & Synced Chapters
   ========================================================================== */

.video-section-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.video-section-layout > * {
  min-width: 0;
}

.video-player-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-gold);
  box-shadow: var(--shadow-dark), 0 0 30px rgba(0, 0, 0, 0.9);
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.video-note {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  text-align: right;
}

.chapters-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-height: 540px;
  display: flex;
  flex-direction: column;
}

.chapters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.chapters-title {
  font-size: 1.25rem;
  margin: 0;
}

.chapters-hint {
  font-size: 0.85rem;
  color: var(--gold-primary);
}

.chapters-list {
  overflow-y: auto;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chapters-list::-webkit-scrollbar {
  width: 6px;
}
.chapters-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.chapter-item:hover {
  background: rgba(245, 197, 66, 0.1);
  border-color: var(--border-gold);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--gold-primary);
}

.chapter-item.active {
  background: rgba(245, 197, 66, 0.18);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.chapter-time {
  font-family: monospace;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--cyan-accent);
  font-weight: 700;
}

.chapter-title {
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
}

/* ==========================================================================
   Historical Timeline (1,700-Year Journey)
   ========================================================================== */

.timeline-container {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-primary), var(--cyan-accent), var(--purple-accent));
  transform: translateX(-50%);
}

.timeline-node {
  position: relative;
  margin-bottom: 3.5rem;
  display: flex;
  align-items: center;
}

.timeline-node:nth-child(odd) {
  flex-direction: row-reverse;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  width: 24px;
  height: 24px;
  background: var(--bg-main);
  border: 3px solid var(--gold-primary);
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 5;
  box-shadow: 0 0 15px var(--gold-glow);
}

.timeline-card {
  width: 44%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-dark);
  transition: var(--transition);
}

.timeline-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
}

.timeline-year {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold-primary);
  background: rgba(245, 197, 66, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-gold);
}

.timeline-figure {
  margin: 1rem 0 0;
}

/* Shared lightbox trigger (timeline figures + gallery images) */
.lb-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
}

.lb-trigger img {
  display: block;
  width: 100%;
  height: auto;
}

.timeline-figure .lb-trigger {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.timeline-figure .lb-trigger:hover {
  border-color: var(--gold-primary);
}

.timeline-figure .lb-trigger img {
  transition: transform 0.4s ease;
}

.timeline-figure .lb-trigger:hover img {
  transform: scale(1.03);
}

/* ==========================================================================
   Case Files Tabs & Deep-Dives
   ========================================================================== */

.case-file-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-dark);
}

.case-file-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.case-badge {
  background: linear-gradient(135deg, var(--gold-primary), #d97706);
  color: #0b0c16;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  text-transform: uppercase;
  white-space: nowrap;
}

.case-sub {
  margin: 0;
}

.thread-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.thread-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  position: relative;
  transition: var(--transition);
}

.thread-step-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-3px);
}

.step-num {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--cyan-accent);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.step-ref {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.step-quote {
  font-style: italic;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.step-note {
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

/* Case File 4: the two apex verses */
.apex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.apex-card {
  background: var(--bg-card);
  padding: 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.apex-count {
  font-size: 2.2rem;
  font-family: var(--font-heading);
  color: var(--gold-primary);
}

.apex-title {
  color: #fff;
  margin: 0.5rem 0;
}

.apex-quote {
  font-style: italic;
  color: var(--gold-light);
}

.apex-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Side by Side Comparison Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.psalm-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.psalm-table th {
  background: rgba(30, 41, 75, 0.7);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-weight: 400;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.psalm-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--bg-card);
  vertical-align: top;
}

.psalm-table tr:hover td {
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Sceptic vs Believer Matrix
   ========================================================================== */

.debate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.debate-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-dark);
  position: relative;
}

.debate-card.sceptic {
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-top: 4px solid var(--purple-accent);
}

.debate-card.believer {
  border: 1px solid rgba(245, 197, 66, 0.35);
  border-top: 4px solid var(--gold-primary);
}

.debate-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.debate-emoji {
  font-size: 2rem;
}

.debate-kicker {
  font-size: 0.85rem;
  font-weight: 700;
}

.debate-kicker--sceptic { color: #c084fc; }
.debate-kicker--believer { color: var(--gold-primary); }

.debate-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.debate-list li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--text-secondary);
}

.debate-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold-primary);
}

.sceptic .debate-list li::before {
  color: var(--purple-accent);
}

.callout {
  background: var(--bg-surface);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 3rem;
  text-align: center;
}

.callout-title {
  margin-bottom: 0.75rem;
}

.callout-text {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Sacred Protestant Art Gallery (15 Images)
   ========================================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-dark);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 25px var(--gold-glow);
}

.gallery-img-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #000;
}

.gallery-img-wrapper .lb-trigger {
  height: 100%;
}

.gallery-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-img-wrapper img {
  transform: scale(1.05);
}

.gallery-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  background: rgba(8, 10, 24, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  z-index: 2;
}

.gallery-zoom-icon {
  position: absolute;
  bottom: 0.85rem;
  right: 0.85rem;
  background: rgba(0, 0, 0, 0.7);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  pointer-events: none;
}

.lb-trigger:hover .gallery-zoom-icon,
.lb-trigger:focus-visible .gallery-zoom-icon,
.gallery-card:hover .gallery-zoom-icon {
  background: var(--gold-primary);
  color: #000;
}

.gallery-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.gallery-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
}

.gallery-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.gallery-btn {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--gold-primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.gallery-btn:hover {
  background: var(--gold-primary);
  color: #000;
}

/* ==========================================================================
   Professional LightBox (Clean Background, No Blur, No Filenames, No Arrows)
   ========================================================================== */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 14, 0.94);
  /* Explicitly NO backdrop blur as required */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  /* fade out first, then hide; on open, become visible instantly so focus() works right away */
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  padding: 2rem;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s;
}

.lightbox-container {
  position: relative;
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 40px rgba(245, 197, 66, 0.2);
}

.lightbox-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  background: rgba(8, 10, 24, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition);
}

.lightbox-close-btn:hover {
  background: var(--crimson-accent);
  color: #fff;
  transform: rotate(90deg);
}

.lightbox-image-box {
  width: 100%;
  max-height: 58vh;
  max-height: 58dvh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.lightbox-image-box img {
  max-width: 100%;
  max-height: 58vh;
  max-height: 58dvh;
  object-fit: contain;
  display: block;
}

/* LightBox Educational Quiz / Content Area */
.lightbox-details {
  padding: 1.75rem 2rem;
  background: var(--bg-surface);
  overflow-y: auto;
  min-height: 0;
  border-top: 1px solid var(--border-color);
}

.lightbox-test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.lightbox-test-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--gold-light);
}

.lightbox-question {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  font-weight: 500;
}

.lightbox-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: rgba(245, 197, 66, 0.15);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  color: var(--gold-primary);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-toggle-btn:hover {
  background: var(--gold-primary);
  color: #000;
}

.lightbox-answer-box {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-left: 4px solid var(--cyan-accent);
  border-radius: var(--radius-sm);
  display: none;
}

.lightbox-answer-box.revealed {
  display: block;
  animation: fadeIn 0.3s ease;
}

.lightbox-answer-box p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Sources
   ========================================================================== */

.sources-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0;
}

.sources-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
  font-size: 0.95rem;
}

.source-card {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.source-title,
.source-title a {
  color: var(--gold-light);
}

.source-desc {
  color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: #04050c;
  border-top: 1px solid var(--border-color);
  padding: 4.5rem 0 2rem 0;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-col h3,
.footer-col h4 {
  font-size: 1.25rem;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
}

.footer-brand-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-verse {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col ul a {
  color: var(--text-muted);
}

.footer-col ul a:hover {
  color: var(--gold-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-bottom p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Mid-width laptops: drop the decorative nav emoji so all eight links still fit on one row */
@media (max-width: 1439px) {
  .nav-ico {
    display: none;
  }
}

/* Below ~1200px the links no longer fit beside the brand: switch to a menu button */
@media (max-width: 1200px) {
  .js .nav-toggle {
    display: flex;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 4.5rem);
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    padding: 0.75rem 1.5rem 1.25rem;
    background: rgba(8, 9, 20, 0.98);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.6);
  }

  .js .site-nav.is-open {
    display: block;
  }

  .js .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .js .nav-links a {
    padding: 0.8rem 0.9rem;
    font-size: 1rem;
  }

  .js .nav-btn {
    text-align: center;
    margin-top: 0.5rem;
  }

  /* Without JS: let the links wrap under the brand instead of hiding them */
  .nav-container {
    flex-wrap: wrap;
  }

  .nav-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 992px) {
  .video-section-layout {
    grid-template-columns: 1fr;
  }

  .chapters-sidebar {
    max-height: 420px;
  }

  .timeline-container::before {
    left: 2rem;
  }

  .timeline-node {
    flex-direction: row !important;
    padding-left: 4rem;
  }

  .timeline-dot {
    left: 2rem;
  }

  .timeline-card {
    width: 100%;
  }

  .debate-grid,
  .apex-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 3.5rem 0;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .nav-container {
    padding: 0.7rem 1rem;
  }

  .brand-sub {
    display: none;
  }

  .brand-link {
    min-width: 0;
    gap: 0.6rem;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .hero-section {
    padding: 2rem 0 3rem 0;
  }

  .hero-banner-img {
    aspect-ratio: 2.5 / 1;
  }

  .hero-description {
    font-size: 1.15rem;
  }

  .section-header {
    margin-bottom: 2.25rem;
  }

  .visualizer-wrapper {
    padding: 1rem;
  }

  .canvas-container {
    height: 360px;
  }

  .case-file-card {
    padding: 1.25rem;
  }

  .case-file-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .debate-card {
    padding: 1.25rem;
  }

  .apex-card {
    padding: 1.25rem;
  }

  .lightbox-overlay {
    padding: 0.75rem;
  }

  .lightbox-details {
    padding: 1.25rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .timeline-card {
    padding: 1.25rem;
  }

  .video-note {
    text-align: left;
  }
}

@media (max-width: 400px) {
  .brand-icon {
    font-size: 1.5rem;
  }

  .brand-title {
    font-size: 1rem;
  }

  .nav-container {
    gap: 0.6rem;
  }

  .pill-btn {
    font-size: 0.82rem;
    padding: 0.5rem 0.8rem;
  }
}

/* ==========================================================================
   Reduced motion: no smooth scroll, no hover lifts, no entrance animations
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .stat-card:hover,
  .timeline-card:hover,
  .thread-step-card:hover,
  .gallery-card:hover,
  .btn:hover,
  .nav-btn:hover,
  .lightbox-close-btn:hover {
    transform: none;
  }

  .gallery-card:hover .gallery-img-wrapper img,
  .timeline-figure .lb-trigger:hover img {
    transform: none;
  }

  .splash-bar {
    animation: none;
    width: 0;
  }
}
