/* ==========================================================================
   SHAWNA'S UNIVERSE — BIBLICAL CHARACTER ATLAS (V2: LIVING OBSERVATORY)
   Inspired by Netflix Dark.io, Riot Games Universe, and Apple TV+ X-Ray
   ========================================================================== */

:root {
  --bg-abyss: #050811;
  --bg-obsidian: #0a0f1e;
  --bg-card: rgba(14, 21, 38, 0.84);
  --bg-card-solid: #0e1526;
  --bg-card-hover: rgba(22, 33, 58, 0.95);
  --bg-glass: rgba(8, 12, 24, 0.82);
  --bg-glass-heavy: rgba(6, 9, 19, 0.94);

  --gold-primary: #d4af37;
  --gold-bright: #f5d76e;
  --gold-deep: #9a7b1c;
  --gold-glow: rgba(212, 175, 55, 0.28);
  --gold-Border: rgba(212, 175, 55, 0.36);

  --text-primary: #f8f5ee;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent-crimson: #f43f5e;
  --accent-emerald: #10b981;
  --accent-royal: #3b82f6;
  --accent-purple: #a855f7;

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-gold: rgba(212, 175, 55, 0.35);
  --border-gold-strong: rgba(245, 215, 110, 0.72);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-deep: 0 24px 64px rgba(0, 0, 0, 0.72);
  --shadow-gold: 0 0 36px rgba(212, 175, 55, 0.22);

  --font-display: 'Cinzel', 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 8%, rgba(212, 175, 55, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 82% 16%, rgba(59, 130, 246, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 50% 88%, rgba(168, 85, 247, 0.07) 0%, transparent 50%),
    var(--bg-abyss);
  overflow-x: hidden;
  line-height: 1.6;
}

/* View Transitions (Same-Document & Cross-View Progressive Enhancement) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Deferred Heavy Off-Screen Sections (Modern Web Guidance Mandatory Pairing) */
.heavy-section-deferred {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 420px;
}

/*Cached Toggled Views */
.cached-view {
  display: none;
}
.cached-view.is-active {
  display: block;
}
@supports (content-visibility: hidden) {
  .cached-view {
    display: block;
    content-visibility: hidden;
  }
  .cached-view.is-active {
    content-visibility: visible;
  }
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: var(--gold-bright);
  color: #050811;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* ==========================================================================
   1. TOP NAVIGATION & FLOATING OBSERVATORY HUD
   ========================================================================== */
.atlas-topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(5, 8, 17, 0.84);
  border-bottom: 1px solid var(--border-subtle);
}

.atlas-topbar-inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.atlas-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  min-width: 0;
}

.atlas-brand-crest {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  display: grid;
  place-items: center;
  color: #050811;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.45);
  flex-shrink: 0;
}

.atlas-brand-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atlas-brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
}

.atlas-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.atlas-nav::-webkit-scrollbar {
  display: none;
}

.atlas-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.atlas-nav a:hover,
.atlas-nav a[aria-current="page"] {
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--border-gold);
}

.atlas-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(18, 27, 48, 0.92);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.14);
  flex-shrink: 0;
}

.atlas-search-trigger:hover {
  border-color: var(--gold-bright);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.atlas-search-kbd {
  font-size: 0.68rem;
  padding: 0.1rem 0.38rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-bright);
  border: 1px solid var(--border-subtle);
}

.atlas-nav-cta {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary)) !important;
  color: #050811 !important;
  font-weight: 800 !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.28);
}

@media (max-width: 820px) {
  .atlas-brand-sub,
  .atlas-search-kbd,
  .atlas-nav a.hide-mobile {
    display: none;
  }
  .atlas-topbar-inner {
    padding: 0.5rem 0.75rem;
  }
}

/* ==========================================================================
   2. FULL-SCREEN OBSERVATORY STAGE (NETFLIX DARK.IO + RIOT UNIVERSE HYBRID)
   ========================================================================== */
.observatory-shell {
  position: relative;
  width: 100%;
  min-height: calc(100dvh - 57px);
  display: flex;
  flex-direction: column;
}

/* Mode Bar & Quick Clue Ticker at Top of Stage */
.observatory-hud-top {
  position: relative;
  z-index: 30;
  padding: 0.65rem 1rem 0.5rem;
  background: linear-gradient(180deg, rgba(5, 8, 17, 0.95) 0%, rgba(5, 8, 17, 0.65) 75%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.observatory-hud-row {
  max-width: 1840px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.mode-Origin-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 0.22rem;
  gap: 0.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.mode-Origin-switcher::-webkit-scrollbar {
  display: none;
}

.mode-tab-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.mode-tab-btn.is-active {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  color: #050811;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.38);
}

/* Clue Ticker Strip */
.clue-ticker-row {
  max-width: 1840px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.15rem;
}
.clue-ticker-row::-webkit-scrollbar {
  display: none;
}

.clue-ticker-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.clue-pill {
  appearance: none;
  background: rgba(14, 21, 38, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: var(--text-secondary);
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.clue-pill:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.15);
  transform: translateY(-1px);
}

/* Interactive Portrait Web Stage */
.web-stage-viewport {
  position: relative;
  width: 100%;
  height: calc(100dvh - 148px);
  min-height: 540px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(212, 175, 55, 0.11) 0%, rgba(14, 21, 38, 0.45) 48%, #040710 100%);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#atlas-constellation-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#atlas-constellation-canvas:active {
  cursor: grabbing;
}

/* Active World Context Pill on Canvas */
.canvas-world-banner {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  z-index: 20;
  background: rgba(8, 12, 24, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 88px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.canvas-world-kicker {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-primary);
}

.canvas-world-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-world-link {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-bright);
  text-decoration: none;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--border-gold);
  white-space: nowrap;
}

/* Floating Zoom & Legend Controls */
.canvas-zoom-controls {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.canvas-ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.18s ease;
}
.canvas-ctrl-btn:hover {
  background: rgba(212, 175, 55, 0.22);
  transform: scale(1.06);
}

.canvas-legend-pills {
  position: absolute;
  top: 4.5rem;
  left: 1rem;
  z-index: 18;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  pointer-events: none;
}

.legend-dot-pill {
  background: rgba(6, 9, 19, 0.78);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ==========================================================================
   3. SYNCHRONIZED 9:16 CINEMA PORTRAIT CAROUSEL DOCK + SEASON SCRUBBER
   ========================================================================== */
.observatory-bottom-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  background: linear-gradient(0deg, rgba(4, 7, 16, 0.98) 0%, rgba(4, 7, 16, 0.86) 72%, transparent 100%);
  padding: 0.5rem 0 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
}

.observatory-bottom-dock > * {
  pointer-events: auto;
}

.dock-header-bar {
  max-width: 1840px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dock-toggle-pill {
  appearance: none;
  background: rgba(14, 21, 38, 0.92);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.26rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
}

/* Horizontal 9:16 Portrait Carousel */
.portrait-carousel-track {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.35rem 1.25rem 0.45rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  max-height: 230px;
}
.portrait-carousel-track::-webkit-scrollbar {
  display: none;
}
.portrait-carousel-track.is-minimized {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.reel-portrait-card {
  flex: 0 0 148px;
  height: 204px;
  scroll-snap-align: center;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0b1222;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}

.reel-portrait-card:hover,
.reel-portrait-card.is-focused {
  transform: translateY(-6px) scale(1.04);
  border-color: var(--gold-bright);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 24px rgba(212, 175, 55, 0.42);
}

.reel-portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  transition: transform 0.45s ease;
}
.reel-portrait-card:hover .reel-portrait-img {
  transform: scale(1.07);
}

.reel-portrait-silhouette {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, rgba(212, 175, 55, 0.24), #080d1a 78%);
  padding-bottom: 2.2rem;
}
.reel-portrait-silhouette svg {
  width: 54px;
  height: 54px;
  color: var(--gold-primary);
  opacity: 0.88;
}

.reel-card-top {
  position: relative;
  z-index: 2;
  padding: 0.45rem 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem;
}

.reel-season-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  background: rgba(5, 8, 17, 0.84);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  backdrop-filter: blur(6px);
}

.reel-card-bottom {
  position: relative;
  z-index: 2;
  padding: 1.8rem 0.58rem 0.55rem;
  background: linear-gradient(0deg, rgba(4, 7, 16, 0.97) 0%, rgba(4, 7, 16, 0.82) 58%, transparent 100%);
}

.reel-card-name {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.18;
  color: #ffffff;
  margin: 0 0 0.18rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reel-card-hook {
  font-size: 0.68rem;
  line-height: 1.28;
  color: var(--text-secondary);
  margin: 0 0 0.38rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reel-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.26rem 0.45rem;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

/* Dark.netflix.io Season & World Scrubber Bar */
.world-scrubber-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.2rem 1rem 0.15rem;
  scrollbar-width: none;
  max-width: 1840px;
  width: 100%;
  margin: 0 auto;
}
.world-scrubber-bar::-webkit-scrollbar {
  display: none;
}

.world-scrub-pill {
  appearance: none;
  background: rgba(14, 21, 38, 0.88);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.world-scrub-pill:hover {
  border-color: var(--border-gold);
  color: var(--text-primary);
}

.world-scrub-pill.is-active {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  color: #050811;
  border-color: transparent;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   4. STORY WORLDS MODE (NETFLIX HORIZONTAL ROWS + HERO SPOTLIGHT)
   ========================================================================== */
.story-worlds-container {
  max-width: 1840px;
  margin: 0 auto;
  padding: 0.5rem 1rem 4rem;
}

.spotlight-stage {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-gold);
  background: linear-gradient(125deg, rgba(14, 21, 38, 0.96) 0%, rgba(7, 11, 20, 0.92) 60%, rgba(212, 175, 55, 0.14) 100%);
  box-shadow: var(--shadow-deep);
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 340px;
}

@media (max-width: 780px) {
  .spotlight-stage {
    grid-template-columns: 1fr;
  }
}

.spotlight-portrait-wrap {
  position: relative;
  min-height: 300px;
  background: #080d1a;
  overflow: hidden;
}
.spotlight-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.spotlight-body {
  padding: 1.6rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.netflix-row-section {
  margin-bottom: 2.1rem;
}

.netflix-row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.netflix-row-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-bright);
  margin: 0;
}

.netflix-row-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.netflix-row-track {
  display: flex;
  gap: 0.95rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.35rem 0.25rem 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent;
}

.netflix-row-track .reel-portrait-card {
  flex: 0 0 185px;
  height: 268px;
  scroll-snap-align: start;
}

/* ==========================================================================
   5. INTERACTIVE 4-DECK DOSSIER SHEET (<dialog>) & STANDALONE DOSSIER
   ========================================================================== */
#dossier-sheet-dialog {
  width: min(1180px, 96vw);
  max-height: 92dvh;
  margin: auto;
  padding: 0;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  color: var(--text-primary);
  border: 1px solid var(--border-gold-strong);
  border-radius: 26px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.88), 0 0 48px rgba(212, 175, 55, 0.22);
  overflow: hidden;
}

@media (max-width: 760px) {
  #dossier-sheet-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 92dvh;
    max-height: 92dvh;
    margin: auto 0 0 0;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
  }
}

#dossier-sheet-dialog::backdrop,
#atlas-search-dialog::backdrop {
  background: rgba(3, 5, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dossier-sheet-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem;
  background: rgba(6, 9, 19, 0.94);
  border-bottom: 1px solid var(--border-subtle);
}

.dossier-sheet-scroll {
  max-height: calc(92dvh - 58px);
  overflow-y: auto;
  padding: 1.15rem;
  -webkit-overflow-scrolling: touch;
}

/* Interactive Dossier Grid (Used in both Sheet & /characters/{slug} Page) */
.atlas-main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

.dossier-interactive-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.65rem;
  align-items: start;
}

@media (max-width: 960px) {
  .dossier-interactive-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }
}

/* 3D Tilt Portrait Stage */
.dossier-portrait-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg-card-solid);
  border: 1.5px solid var(--border-gold);
  box-shadow: var(--shadow-deep), var(--shadow-gold);
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
}

.dossier-portrait-aspect {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #070b15;
  overflow: hidden;
}

@media (max-width: 640px) {
  .dossier-portrait-aspect {
    aspect-ratio: 16 / 13;
    max-height: 310px;
  }
}

.dossier-portrait-aspect img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  display: block;
  transition: opacity 0.28s ease, transform 0.45s ease;
}

.silhouette-stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(212, 175, 55, 0.22), #070b14 78%);
}
.silhouette-stage svg {
  width: 84px;
  height: 84px;
  color: var(--gold-primary);
  margin-bottom: 0.65rem;
}
.silhouette-caption {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: rgba(212, 175, 55, 0.12);
}

/* Era Scrubber inside Portrait Card */
.era-switcher {
  padding: 0.85rem 0.95rem;
  background: rgba(6, 10, 20, 0.95);
  border-top: 1px solid var(--border-subtle);
}

.era-switcher-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--gold-primary);
  margin-bottom: 0.45rem;
}

.era-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.era-pill {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.era-pill.is-active,
.era-pill:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  color: #050811;
  border-color: transparent;
  font-weight: 800;
}

/* Before / After Transformation Curtain Slider */
.transform-card {
  margin-top: 0.9rem;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
}

.transform-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  user-select: none;
  --split: 50%;
}
.transform-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.transform-before-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}
.transform-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2.5px;
  background: var(--gold-bright);
  box-shadow: 0 0 12px rgba(245, 215, 110, 0.9);
}
.transform-handle {
  position: absolute;
  top: 50%;
  left: var(--split);
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-bright);
  color: #050811;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75);
}
.transform-range {
  width: 100%;
  margin-top: 0.55rem;
  accent-color: var(--gold-bright);
  cursor: ew-resize;
}

/* ==========================================================================
   6. KINETIC 4-DECK TABS & EXPANDABLE "BIBLICAL DNA" ACCORDION CARDS
   ========================================================================== */
.dossier-header-block {
  margin-bottom: 1rem;
}

.dossier-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.badge-pill {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
}

.dossier-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 0.45rem;
  color: #ffffff;
}

.dossier-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-bottom: 0.65rem;
}

.alias-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.dossier-hook-lead {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--gold-bright);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.12), transparent);
  border-radius: 0 12px 12px 0;
}

/* 4-Deck Navigation Bar */
.dossier-deck-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.3rem;
  background: rgba(6, 10, 20, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  margin-bottom: 1.1rem;
  scrollbar-width: none;
}
.dossier-deck-tabs::-webkit-scrollbar {
  display: none;
}

.deck-tab-btn {
  flex: 1 0 auto;
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.58rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.deck-tab-btn.is-active {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  color: #050811;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.32);
}

.deck-panel {
  display: none;
  animation: deckFadeIn 0.24s ease;
}
.deck-panel.is-active {
  display: block;
}

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

/* Quick Stat Bento Strip */
.dna-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.dna-stat-tile {
  background: rgba(14, 21, 38, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
}
.dna-stat-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: block;
}
.dna-stat-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gold-bright);
  margin-top: 0.12rem;
  display: block;
}

/* Interactive Tap-to-Expand "Biblical DNA" Fact Cards */
.dna-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.dna-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dna-card:hover,
.dna-card.is-open {
  border-color: var(--border-gold);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.dna-card-trigger {
  width: 100%;
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: left;
  padding: 0.85rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dna-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.dna-card-key {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gold-bright);
}

.dna-card-preview {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dna-card.is-open .dna-card-preview {
  display: none;
}

.dna-card-body {
  display: none;
  padding: 0 1rem 0.95rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.58;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.65rem;
}
.dna-card.is-open .dna-card-body {
  display: block;
}

.basis-badge {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.basis-scripture {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.basis-shawna_teaching {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
}
.basis-historical_tradition {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.fact-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.ref-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
}

/* Collapsible Full Biography Drawer */
.bio-drawer-box {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: rgba(14, 21, 38, 0.75);
  border: 1px solid var(--border-subtle);
}

.bio-extra-paragraphs {
  display: none;
  margin-top: 0.75rem;
}
.bio-drawer-box.is-expanded .bio-extra-paragraphs {
  display: block;
}

/* Relationship Cards & Ego Map */
.rel-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.7rem;
}

.rel-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}
.rel-card:hover {
  border-color: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.rel-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-gold);
  background: #080d1a;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--gold-primary);
}
.rel-avatar svg {
  width: 24px;
  height: 24px;
}

/* Video Theater & Apple TV+ X-Ray Co-Star Strip */
.appearance-card {
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.video-theater-stage {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  background: #050811;
}

.video-theater-aspect {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  background: radial-gradient(circle at 50% 40%, rgba(212, 175, 55, 0.2), #050811 80%);
}
.video-theater-aspect iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-play-trigger {
  appearance: none;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  color: #050811;
  border: none;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(212, 175, 55, 0.45);
  transition: transform 0.2s ease;
}
.video-play-trigger:hover {
  transform: scale(1.05);
}

.video-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: rgba(8, 12, 24, 0.95);
  border-top: 1px solid var(--border-subtle);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  appearance: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.filter-chip.is-active {
  background: var(--gold-primary);
  color: #050811;
  border-color: transparent;
  font-weight: 800;
}

/* Apple TV+ X-Ray Co-Cast Strip */
.xray-cast-strip {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
}
.xray-cast-row {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.xray-cast-row::-webkit-scrollbar {
  display: none;
}
.xray-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem 0.28rem 0.32rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.xray-chip:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.xray-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

/* Workbook Conversion Card */
.workbook-cta-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(14, 21, 38, 0.92));
  border: 1px solid var(--border-gold);
}
.workbook-cta-cover {
  width: 74px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  flex-shrink: 0;
}

/* ==========================================================================
   7. SEARCH MODAL (<dialog id="atlas-search-dialog">) & LINEAGE RIVER
   ========================================================================== */
#atlas-search-dialog {
  width: min(720px, 94vw);
  max-height: 84dvh;
  padding: 0;
  background: var(--bg-glass-heavy);
  color: var(--text-primary);
  border: 1px solid var(--border-gold-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-deep), var(--shadow-gold);
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.search-modal-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
}

.search-modal-body {
  padding: 0.85rem 1rem 1.15rem;
  max-height: calc(84dvh - 76px);
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  border: 1px solid transparent;
  transition: all 0.16s ease;
}
.search-result-item:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--border-gold);
}

/* Messianic Lineage River & Subpages */
.atlas-hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}
.atlas-eyebrow {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 0.45rem;
}
.atlas-lead {
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 680px;
  margin: 0.5rem auto 0;
}

.section-block {
  margin-top: 2rem;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold-bright);
  margin: 0;
}

.lineage-river {
  position: relative;
  max-width: 860px;
  margin: 1.5rem auto;
  padding-left: 1.5rem;
  border-left: 2px solid var(--gold-primary);
}
.lineage-step {
  position: relative;
  margin-bottom: 1rem;
}
.lineage-step-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #050811;
  background: var(--gold-bright);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}
.lineage-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.ego-svg-box {
  background: rgba(7, 11, 20, 0.88);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 0.85rem;
  text-align: center;
  margin-bottom: 1rem;
}

.atlas-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(4, 7, 15, 0.96);
  padding: 2.5rem 1rem;
  margin-top: 3rem;
}
.atlas-footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.atlas-footer h4 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  margin: 0 0 0.65rem;
}
.atlas-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.atlas-footer li {
  margin-bottom: 0.4rem;
}
.atlas-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.86rem;
}
.atlas-footer a:hover {
  color: var(--gold-bright);
}
