/* ============================================================
   ChatBB Landing Page — Hero Styles
   Video background with Intelligence Network canvas effect
   ============================================================ */

/* ---- Z-INDEX STACK (bottom to top) -------------------------
   1. .atmo-base           (dark floor)
   2. .atmo-poster         (static fallback, hidden when video plays)
   3. .atmo-video          (hero video loop)
   4. .intelligence-network (canvas grid effect)
   5. .atmo-scrim          (headline readability)
   6. .atmo-vignette       (edge darkening)
   10. .hero-content, .phone-stage (content layer)
   ------------------------------------------------------------ */

/* ---- Static poster layer -----------------------------------
   Paints immediately. Hidden once video is ready and playing.
   Remains visible for: reduced-motion, mobile, Save-Data,
   JS-disabled, playback failure. */
.atmo-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("../video/chatbb-hero-dark-poster.webp") center / cover no-repeat;
  transition: opacity 0.6s ease-out;
}

/* Hide poster when video is playing successfully */
.atmo[data-video-ready="true"] .atmo-poster {
  opacity: 0;
  pointer-events: none;
}

/* ---- Video layer -------------------------------------------
   1080p H.264, above poster. No CSS filters or blur. */
.atmo-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* No filter, no blur - preserve crisp gold lines */
}

/* ---- Intelligence Network canvas ---------------------------
   Academy-derived pointer-responsive grid effect.
   DOCUMENT-LEVEL: Covers entire page, inserted at body start.
   Grid continues behind all sections from hero to footer.
   Opacity reduced by 30% from original Academy values. */
.intelligence-network {
  /* Position set by JS: absolute, top:0, left:0, z-index:1 */
  pointer-events: none;
}

/* Ensure body has relative positioning for the canvas */
body {
  position: relative;
}

/* All sections need z-index to sit above the document-level canvas */
section,
footer {
  position: relative;
  z-index: 2;
}

/* Hero special case: let canvas show through while keeping content above */
.hero {
  position: relative;
  /* No z-index here - let elements use body stacking context */
}

/* Hero background layers - below the global canvas */
.atmo {
  z-index: 0;
}

/* Hero content above the global canvas */
.hero-grid {
  position: relative;
  z-index: 3;
}

/* Nav is already fixed with z-index: 50 */

/* ---- Readability scrim -------------------------------------
   Darkening over headline column. ABOVE canvas (z-index 1), below content. */
.atmo-scrim {
  position: absolute;
  inset: 0;
  z-index: 2; /* Above canvas (1), below hero content (3) */
  background: linear-gradient(
    100deg,
    rgba(18, 18, 18, 0.55) 0%,
    rgba(18, 18, 18, 0.32) 38%,
    rgba(18, 18, 18, 0.08) 62%,
    rgba(18, 18, 18, 0) 78%
  );
  pointer-events: none;
}

/* Stacked hero (<=1080px): uniform veil for centered layout */
@media (max-width: 1080px) {
  .atmo-scrim {
    background: rgba(18, 18, 18, 0.38);
  }
}

/* ---- Vignette - topmost decorative layer ------------------- */
.atmo-vignette {
  position: absolute;
  inset: 0;
  z-index: 2; /* Same level as scrim */
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

/* ---- DISABLED LAYERS ---------------------------------------
   These are disabled in favor of the Intelligence Network canvas.
   Kept for reference but not rendered. */
.atmo-topo,
.atmo-surface,
.atmo-edge,
.atmo-pathways,
.atmo-pointer {
  display: none !important;
}

/* ---- Static-only conditions --------------------------------
   Reduced motion, small mobile, Save-Data, video-off states. */

@media (prefers-reduced-motion: reduce) {
  .atmo-video { display: none; }
  .atmo-poster { opacity: 1 !important; }
  .intelligence-network { display: none; }
}

@media (max-width: 640px) {
  .atmo-video { display: none; }
  .atmo-poster { opacity: 1 !important; }
  .intelligence-network { display: none; }
}

.atmo[data-video-off="true"] .atmo-video {
  display: none;
}
.atmo[data-video-off="true"] .atmo-poster {
  opacity: 1 !important;
}

/* ============================================================
   HEADER HIDE-AND-REVEAL
   - Hides on scroll down, reveals on scroll up
   - Stays visible when: at top (<100px), mobile menu open,
     keyboard focus inside, internal nav active
   - Uses transform, not layout changes (no reflow)
   - Respects reduced-motion
   ============================================================ */

.nav {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease-out, visibility 0.35s;
}

/* Hidden state (scroll down) - !important needed to override nav-enter animation forwards */
.nav[data-nav-hidden="true"] {
  transform: translateY(-100%) !important;
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

/* Force visible when menu open or focused */
.nav[data-nav-force-visible="true"],
.nav:focus-within {
  transform: translateY(0) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Reduced motion: no transform animation */
@media (prefers-reduced-motion: reduce) {
  .nav {
    transition: none !important;
  }
  .nav[data-nav-hidden="true"] {
    /* Instant hide via opacity only */
    transform: none;
    opacity: 0;
  }
}

/* ============================================================
   TYPOGRAPHY FIX: Ensure headline is always above decorative layers
   ============================================================ */

.hero-content {
  position: relative;
  z-index: 10;
}

.phone-stage {
  position: relative;
  z-index: 10;
}

/* Ensure the headline text is crisp and not affected by canvas */
.hero-title {
  position: relative;
  z-index: 11;
}

/* ============================================================
   LIQUID-GLASS SURFACE SYSTEM
   Premium translucent surfaces for content containers.
   Dark charcoal-black with subtle gold accents.
   Grid remains faintly visible but text is readable.
   ============================================================ */

/* Base glass surface mixin (applied via .glass class) */
.glass {
  position: relative;
  isolation: isolate;
  background: rgba(18, 18, 18, 0.78);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid rgba(255, 200, 60, 0.08);
  border-radius: 12px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Stronger glass for cards with more isolation */
.glass-card {
  position: relative;
  isolation: isolate;
  background: rgba(20, 20, 20, 0.82);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(255, 200, 60, 0.06);
  border-radius: 16px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2);
  transition: border-color 0.25s ease-out, box-shadow 0.25s ease-out;
}

/* Subtle hover for pointer devices - border illumination only */
@media (hover: hover) and (pointer: fine) {
  .glass-card:hover {
    border-color: rgba(255, 200, 60, 0.14);
    box-shadow:
      0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
      0 0 0 1px rgba(255, 255, 255, 0.03) inset,
      0 8px 32px rgba(0, 0, 0, 0.45),
      0 2px 8px rgba(0, 0, 0, 0.25);
  }
}

/* Panel-level glass (larger containers) */
.glass-panel {
  position: relative;
  isolation: isolate;
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(10px) saturate(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  border: 1px solid rgba(255, 200, 60, 0.05);
  border-radius: 20px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.03) inset,
    0 12px 48px rgba(0, 0, 0, 0.35);
  padding: 32px;
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  .glass,
  .glass-card,
  .glass-panel {
    background: rgba(22, 22, 22, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ============================================================
   APPLY GLASS TO CONTENT SURFACES
   Complete section-level backgrounds for card groups.
   ============================================================ */

/* Quick Facts strip - complete glass container */
.fact-strip {
  position: relative;
  isolation: isolate;
  background: rgba(18, 18, 18, 0.88) !important;
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  border: 1px solid rgba(255, 200, 60, 0.08) !important;
  border-radius: 20px !important;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.35);
}

@supports not (backdrop-filter: blur(1px)) {
  .fact-strip {
    background: rgba(20, 20, 20, 0.96) !important;
  }
}

/* How It Works - CONTAINER-LEVEL glass background */
.sovereign {
  position: relative;
  isolation: isolate;
  background: rgba(18, 18, 18, 0.88) !important;
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  border: 1px solid rgba(255, 200, 60, 0.08) !important;
  border-radius: 20px !important;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

@supports not (backdrop-filter: blur(1px)) {
  .sovereign {
    background: rgba(20, 20, 20, 0.96) !important;
  }
}

/* Individual step cards - lighter treatment within container */
.sov-cell {
  background: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(255, 200, 60, 0.06) !important;
  transition: background 0.25s ease-out;
}

.sov-cell:last-child {
  border-right: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .sov-cell:hover {
    background: rgba(255, 255, 255, 0.03) !important;
  }
}

/* Mobile: stack cards with gap */
@media (max-width: 1080px) {
  .sovereign {
    gap: 0 !important;
    padding: 0 !important;
  }
  .sov-cell {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 200, 60, 0.06) !important;
    padding: 24px !important;
  }
  .sov-cell:last-child {
    border-bottom: none !important;
  }
}

/* What You Can Ask - CONTAINER-LEVEL glass background */
.domains {
  position: relative;
  isolation: isolate;
  background: rgba(18, 18, 18, 0.88) !important;
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  border: 1px solid rgba(255, 200, 60, 0.08) !important;
  border-radius: 20px !important;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

@supports not (backdrop-filter: blur(1px)) {
  .domains {
    background: rgba(20, 20, 20, 0.96) !important;
  }
}

/* Individual domain cards - subtle treatment within container */
.domain {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 200, 60, 0.06) !important;
  transition: background 0.25s ease-out;
}

.domain:last-child {
  border-bottom: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .domain:hover {
    background: rgba(255, 255, 255, 0.03) !important;
  }
}

/* Mobile: domain cards stacked */
@media (max-width: 640px) {
  .domains {
    gap: 0 !important;
    padding: 0 !important;
  }
  .domain {
    padding: 20px 16px !important;
  }
}

/* Trusted Information - CONTAINER-LEVEL glass background */
.trust {
  position: relative;
  isolation: isolate;
  background: rgba(18, 18, 18, 0.88) !important;
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  border: 1px solid rgba(255, 200, 60, 0.08) !important;
  border-radius: 20px !important;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.35);
}

@supports not (backdrop-filter: blur(1px)) {
  .trust {
    background: rgba(20, 20, 20, 0.96) !important;
  }
}

/* Source items within Trusted Information - NO nested backgrounds */
.source-simple-item {
  background: transparent !important;
  border: none !important;
  border-radius: 0;
}

/* Remove any nested backgrounds from trust section children */
.trust > div,
.trust .source-simple,
.trust p,
.trust h2,
.trust span {
  background: transparent !important;
}

/* Accessible by Design - CONTAINER-LEVEL glass background */
.access-grid {
  position: relative;
  isolation: isolate;
  background: rgba(18, 18, 18, 0.88) !important;
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  border: 1px solid rgba(255, 200, 60, 0.08) !important;
  border-radius: 20px !important;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.35);
  padding: 8px !important;
  gap: 0 !important;
}

@supports not (backdrop-filter: blur(1px)) {
  .access-grid {
    background: rgba(20, 20, 20, 0.96) !important;
  }
}

/* Individual access cards - equal treatment within container */
.access-item {
  background: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(255, 200, 60, 0.06) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: background 0.25s ease-out;
}

.access-item:last-child {
  border-right: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .access-item:hover {
    background: rgba(255, 255, 255, 0.03) !important;
  }
}

/* Mobile: access cards stacked */
@media (max-width: 640px) {
  .access-grid {
    padding: 0 !important;
  }
  .access-item {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 200, 60, 0.06) !important;
    padding: 24px 20px !important;
  }
  .access-item:last-child {
    border-bottom: none !important;
  }
}

/* CTA band glass surface */
.cta-band {
  position: relative;
  isolation: isolate;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(18, 18, 18, 0.7);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border-top: 1px solid rgba(255, 200, 60, 0.06);
  border-bottom: 1px solid rgba(255, 200, 60, 0.06);
}

@supports not (backdrop-filter: blur(1px)) {
  .cta-band::before {
    background: rgba(22, 22, 22, 0.95);
  }
}

/* ============================================================
   CPL SEASON PROMOTION SECTION
   Centered feature section between What You Can Ask and Trusted Info.
   Premium charcoal with warm-gold accents.
   ============================================================ */

.cpl-section {
  padding: 64px 0;
}

.cpl-promo {
  position: relative;
  isolation: isolate;
  max-width: 820px; /* Widened for longer heading */
  margin: 0 auto;
  padding: 44px 56px;
  text-align: center;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(255, 200, 60, 0.12);
  border-radius: 20px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

@supports not (backdrop-filter: blur(1px)) {
  .cpl-promo {
    background: rgba(22, 22, 22, 0.98);
  }
}

.cpl-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 14px;
}

.cpl-heading {
  font-size: 26px; /* Reduced to fit on one line at 1200px+ */
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-1);
  margin: 0 0 12px 0;
}

.cpl-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 28px 0;
}

.cpl-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  color: #1a1206;
  background: linear-gradient(180deg, #ffe49a 0%, #f5bc34 50%, #d99a1d 100%);
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cpl-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.cpl-cta:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
}

.cpl-cta svg {
  flex-shrink: 0;
}

/* Mobile: smaller padding and text */
@media (max-width: 640px) {
  .cpl-section {
    padding: 48px 0;
  }

  .cpl-promo {
    padding: 36px 24px;
    margin: 0 16px;
    border-radius: 16px;
  }

  .cpl-heading {
    font-size: 26px;
  }

  .cpl-body {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .cpl-cta {
    padding: 12px 24px;
    font-size: 14px;
  }
}

/* ============================================================
   HEADER BEHAVIOR FIX
   - Visible at top (<100px from top)
   - Fully hidden after scrolling more than 100px
   - Does NOT reveal on scroll up
   - Only reveals when returning close to top
   ============================================================ */

/* Override existing hide/reveal behavior */
.nav[data-nav-hidden="true"] {
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Force visible states (menu open, focus) */
.nav[data-nav-force-visible="true"],
.nav:focus-within {
  transform: translateY(0) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Reduced motion: instant state change */
@media (prefers-reduced-motion: reduce) {
  .nav {
    transition: none !important;
  }
  .nav[data-nav-hidden="true"] {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
  }
}
/* ============================================================
   ChatBB Theme Toggle - Light Mode Overrides

   Architecture:
   - Dark mode: Handled entirely by baseline CSS in index.html
   - Light mode: Overrides defined here with [data-theme="light"]
   - This file NEVER changes dark mode appearance except for
     approved typography standardization (bold eyebrows/numbers)
   ============================================================ */

/* ============================================================
   TYPOGRAPHY STANDARDIZATION (BOTH THEMES)
   Bold treatment for section eyebrows and step numbers
   ============================================================ */

/* Section eyebrows - consistent bold treatment */
.section-eyebrow,
.cpl-eyebrow {
  font-weight: 700 !important;
}

/* Step numbers - consistent bold treatment */
.sov-num {
  font-weight: 700 !important;
}

/* Fact labels - ensure consistent bold */
.fact-text strong {
  font-weight: 700 !important;
}

/* ============================================================
   LIGHT THEME TOKENS
   Official ChatBB brand palette
   ============================================================ */
[data-theme="light"] {
  /* Background layers - Sand palette */
  --bg-0: #F6F4EF;
  --bg-1: #FAFAF8;
  --bg-2: #FFFFFF;
  --bg-3: #F0EDE6;
  --bg-card: #FFFFFF;

  /* Remap gold to use blue accent in light mode */
  --gold-50:  #E6F0FA;
  --gold-100: #CCE1F5;
  --gold-200: #99C3EB;
  --gold-300: #4D94D6;
  --gold-400: #1B66B3;
  --gold-500: #154D8A;
  --gold-600: #0F3561;
  --gold-glow: 27, 102, 179;

  /* Text colors - Slate Ink palette */
  --ink-0: #22303C;
  --ink-1: #22303C;
  --ink-2: #526776;
  --ink-3: #7A8B99;
  --ink-4: #9AABB8;
  --ink-5: #C4D1DB;

  /* Borders */
  --rule:  rgba(27, 102, 179, 0.08);
  --rule-2: rgba(27, 102, 179, 0.14);
}

/* ============================================================
   SYSTEM PREFERENCE FALLBACK
   When no explicit theme choice is stored
   ============================================================ */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-0: #F6F4EF;
    --bg-1: #FAFAF8;
    --bg-2: #FFFFFF;
    --bg-3: #F0EDE6;
    --bg-card: #FFFFFF;
    --gold-50:  #E6F0FA;
    --gold-100: #CCE1F5;
    --gold-200: #99C3EB;
    --gold-300: #4D94D6;
    --gold-400: #1B66B3;
    --gold-500: #154D8A;
    --gold-600: #0F3561;
    --gold-glow: 27, 102, 179;
    --ink-0: #22303C;
    --ink-1: #22303C;
    --ink-2: #526776;
    --ink-3: #7A8B99;
    --ink-4: #9AABB8;
    --ink-5: #C4D1DB;
    --rule:  rgba(27, 102, 179, 0.08);
    --rule-2: rgba(27, 102, 179, 0.14);
  }
}

/* ============================================================
   THEME TOGGLE BUTTON
   Works in both themes using CSS custom properties
   ============================================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(var(--gold-glow), 0.08);
  border-color: var(--gold-400);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.theme-toggle:hover svg {
  color: var(--ink-1);
}

/* Sun icon (shown in dark mode) */
.theme-toggle .icon-sun {
  display: block;
}
.theme-toggle .icon-moon {
  display: none;
}

/* Moon icon (shown in light mode) */
[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}
[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .icon-sun {
    display: none;
  }
  :root:not([data-theme]) .theme-toggle .icon-moon {
    display: block;
  }
}

/* ============================================================
   LOGO SWITCHING
   ============================================================ */
.logo-white {
  display: block;
}
.logo-color {
  display: none;
}

[data-theme="light"] .logo-white {
  display: none;
}
[data-theme="light"] .logo-color {
  display: block;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .logo-white {
    display: none;
  }
  :root:not([data-theme]) .logo-color {
    display: block;
  }
}

/* ============================================================
   LIGHT MODE PAGE BACKGROUND
   Sand canvas behind all content
   ============================================================ */
[data-theme="light"] body {
  background: #F6F4EF !important;
}

/* ============================================================
   LIGHT MODE NAVIGATION
   Liquid-glass header with proper contrast
   ============================================================ */
[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border-bottom: 1px solid rgba(27, 102, 179, 0.08) !important;
  box-shadow: 0 1px 3px rgba(34, 48, 60, 0.06) !important;
}

[data-theme="light"] .nav-glass {
  background: transparent !important;
}

[data-theme="light"] .nav-links a {
  color: #526776 !important;
}

[data-theme="light"] .nav-links a:hover {
  color: #22303C !important;
}

[data-theme="light"] .nav-links a.active {
  color: #1B66B3 !important;
}

/* Focus styling distinct from active in light mode */
[data-theme="light"] .nav-links a:focus-visible {
  outline: 2px solid #1B66B3 !important;
}
[data-theme="light"] .nav-links a.active:focus-visible {
  outline: 2px solid #22303C !important;
}

[data-theme="light"] .nav-cta {
  background: linear-gradient(180deg, #2985c4 0%, #1B66B3 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(27, 102, 179, 0.25) !important;
}

[data-theme="light"] .nav-cta:hover {
  box-shadow: 0 4px 16px rgba(27, 102, 179, 0.35) !important;
}

/* Mobile nav in light mode */
[data-theme="light"] .nav-mobile {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(34, 48, 60, 0.08) !important;
}

[data-theme="light"] .nav-mobile a {
  color: #526776 !important;
}

[data-theme="light"] .nav-mobile a:hover {
  background: rgba(27, 102, 179, 0.05) !important;
  color: #22303C !important;
}

[data-theme="light"] .nav-mobile a.active {
  color: #1B66B3 !important;
}
[data-theme="light"] .nav-mobile a:focus-visible {
  outline: 2px solid #1B66B3 !important;
}
[data-theme="light"] .nav-mobile a.active:focus-visible {
  outline: 2px solid #22303C !important;
}

[data-theme="light"] .nav-mobile .mobile-cta {
  background: linear-gradient(180deg, #2985c4 0%, #1B66B3 100%) !important;
  color: #FFFFFF !important;
}

[data-theme="light"] .nav-toggle {
  color: #526776 !important;
}

/* ============================================================
   PAGE-WIDE STACKING ORDER
   Intelligence network canvas is positioned at <body> level.
   All content sections must have z-index > canvas.

   Conceptual stacking order (bottom to top):
   0. Intelligence network canvas (z-index: 0) - atmospheric background
   1. Page sections (z-index: 1+) - hero, fact-strip, cards, etc.
   50. Navigation (z-index: 50) - sticky header

   Within the hero section:
   - Poster (z-index: 1)
   - Video (z-index: 2)
   - Scrim (z-index: 3)
   - Hero content (z-index: 10)
   ============================================================ */

/* Intelligence network canvas - MUST be below all page content */
.intelligence-network {
  z-index: 0 !important;
  pointer-events: none !important;
}

/* All sections above the canvas */
.hero {
  z-index: 1 !important;
}

section {
  position: relative !important;
  z-index: 2 !important;
}

/* Glass cards and surfaces need explicit stacking */
.fact-strip,
.sovereign,
.domains,
.cpl-promo,
.trust,
.access-grid,
.cta-band {
  position: relative !important;
  z-index: 2 !important;
}

/* Footer above canvas */
footer {
  position: relative !important;
  z-index: 2 !important;
}

/* ============================================================
   HERO INTERNAL STACKING
   Within the hero's stacking context
   ============================================================ */

/* Base poster styling - both themes */
.atmo-poster {
  position: absolute !important;
  inset: 0 !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  z-index: 1 !important;
}

.atmo-poster-dark {
  background-image: url('../video/chatbb-hero-dark-poster.webp') !important;
}

.atmo-poster-light {
  background-image: url('../video/chatbb-hero-light-poster.webp') !important;
  display: none !important;
}

/* Video z-index layering */
.atmo-video {
  z-index: 2 !important;
}

/* Scrim above videos */
.atmo-scrim {
  z-index: 3 !important;
}

/* Hero content above all hero background layers */
.hero-grid {
  position: relative !important;
  z-index: 10 !important;
}

/* Phone container needs explicit stacking */
.phone-container {
  position: relative !important;
  z-index: 10 !important;
}

/* DARK MODE (default) - show dark video, hide light */
.atmo-video-dark {
  display: block !important;
}

.atmo-video-light {
  display: none !important;
}

.atmo-poster-dark {
  display: block !important;
}

.atmo-poster-light {
  display: none !important;
}

/* ============================================================
   LIGHT MODE HERO
   Show light video, hide dark video
   ============================================================ */
[data-theme="light"] .hero {
  background: #F6F4EF !important;
}

[data-theme="light"] .atmo {
  background: #F6F4EF !important;
}

[data-theme="light"] .atmo-base {
  background: transparent !important;
}

/* Light mode: show light video/poster, hide dark */
[data-theme="light"] .atmo-video-dark,
[data-theme="light"] .atmo-poster-dark {
  display: none !important;
}

[data-theme="light"] .atmo-video-light {
  display: block !important;
}

[data-theme="light"] .atmo-poster-light {
  display: block !important;
}

/* Hide dark-specific decorative layers in light mode */
[data-theme="light"] .atmo-topo,
[data-theme="light"] .atmo-surface,
[data-theme="light"] .atmo-edge,
[data-theme="light"] .atmo-pathways {
  display: none !important;
}

/* Light mode scrim - subtle text readability overlay */
[data-theme="light"] .atmo-scrim {
  background: linear-gradient(100deg,
    rgba(246, 244, 239, 0.75) 0%,
    rgba(246, 244, 239, 0.5) 35%,
    rgba(246, 244, 239, 0.2) 55%,
    transparent 70%) !important;
}

@media (max-width: 1080px) {
  [data-theme="light"] .atmo-scrim {
    background: rgba(246, 244, 239, 0.6) !important;
  }
}

[data-theme="light"] .atmo-vignette {
  background: radial-gradient(ellipse at center,
    transparent 0%,
    rgba(34, 48, 60, 0.03) 60%,
    rgba(34, 48, 60, 0.08) 100%) !important;
}

/* Phone glow - blue tint for light mode */
[data-theme="light"] .phone-glow {
  opacity: 0.4 !important;
  background: radial-gradient(ellipse at center,
    rgba(27, 102, 179, 0.12) 0%,
    transparent 65%) !important;
}

/* ============================================================
   INTELLIGENCE NETWORK - LIGHT MODE
   Show canvas with light-appropriate colors
   ============================================================ */
[data-theme="light"] .intelligence-network {
  display: block !important;
  opacity: 0.6 !important;
}

/* ============================================================
   LIGHT MODE GLASS SURFACES
   White/translucent cards with proper contrast
   Must use !important to override styles.css
   ============================================================ */

/* Quick Facts strip */
[data-theme="light"] .fact-strip {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border: 1px solid rgba(34, 48, 60, 0.08) !important;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.8) inset,
              0 4px 24px rgba(34, 48, 60, 0.08) !important;
}

/* Fact items (mobile grid) */
[data-theme="light"] .fact-item {
  background: rgba(255, 255, 255, 0.98) !important;
}

/* Fact icons */
[data-theme="light"] .fact-icon {
  background: rgba(27, 102, 179, 0.08) !important;
  color: #1B66B3 !important;
}

/* Fact labels */
[data-theme="light"] .fact-text strong {
  color: #1B66B3 !important;
}

/* How It Works (sovereign) */
[data-theme="light"] .sovereign {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border: 1px solid rgba(34, 48, 60, 0.08) !important;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.8) inset,
              0 4px 24px rgba(34, 48, 60, 0.08) !important;
}

[data-theme="light"] .sov-cell {
  background: transparent !important;
  border-color: rgba(34, 48, 60, 0.06) !important;
}

[data-theme="light"] .sov-cell:hover {
  background: rgba(27, 102, 179, 0.03) !important;
}

/* Step numbers */
[data-theme="light"] .sov-num {
  color: #1B66B3 !important;
}

/* Card titles */
[data-theme="light"] .sov-cell h3 {
  color: #22303C !important;
}

/* Card descriptions */
[data-theme="light"] .sov-cell p {
  color: #526776 !important;
}

/* What You Can Ask (domains) */
[data-theme="light"] .domains {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border: 1px solid rgba(34, 48, 60, 0.08) !important;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.8) inset,
              0 4px 24px rgba(34, 48, 60, 0.08) !important;
}

[data-theme="light"] .domain {
  background: transparent !important;
  border-color: rgba(34, 48, 60, 0.06) !important;
}

[data-theme="light"] .domain:hover {
  background: rgba(27, 102, 179, 0.03) !important;
}

/* Domain glyphs */
[data-theme="light"] .domain-glyph {
  background: rgba(27, 102, 179, 0.08) !important;
  border-color: rgba(27, 102, 179, 0.15) !important;
  color: #1B66B3 !important;
}

[data-theme="light"] .domain:hover .domain-glyph {
  box-shadow: 0 0 24px -4px rgba(27, 102, 179, 0.4) !important;
}

/* Domain titles */
[data-theme="light"] .domain h4 {
  color: #22303C !important;
}

/* Domain counts */
[data-theme="light"] .domain .count {
  color: #7A8B99 !important;
}

/* Example questions */
[data-theme="light"] .example-item {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(34, 48, 60, 0.08) !important;
}

[data-theme="light"] .example-item:hover {
  border-color: rgba(27, 102, 179, 0.2) !important;
}

[data-theme="light"] .example-q {
  color: #22303C !important;
}

[data-theme="light"] .example-domain {
  color: #1B66B3 !important;
}

/* CPL Promo */
[data-theme="light"] .cpl-promo {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border: 1px solid rgba(27, 102, 179, 0.12) !important;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.8) inset,
              0 8px 32px rgba(34, 48, 60, 0.1) !important;
}

[data-theme="light"] .cpl-eyebrow {
  color: #F59B23 !important; /* Trident Orange accent */
}

[data-theme="light"] .cpl-heading {
  color: #22303C !important;
}

[data-theme="light"] .cpl-body {
  color: #526776 !important;
}

[data-theme="light"] .cpl-cta {
  background: linear-gradient(180deg, #2985c4 0%, #1B66B3 100%) !important;
  color: #FFFFFF !important;
}

/* Trusted Information */
[data-theme="light"] .trust {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border: 1px solid rgba(34, 48, 60, 0.08) !important;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.8) inset,
              0 4px 24px rgba(34, 48, 60, 0.08) !important;
}

[data-theme="light"] .trust h2 {
  color: #22303C !important;
}

[data-theme="light"] .trust p {
  color: #526776 !important;
}

/* Trust stats */
[data-theme="light"] .trust-stat .num {
  color: #1B66B3 !important;
}

[data-theme="light"] .trust-stat .lbl {
  color: #526776 !important;
}

/* Source list */
[data-theme="light"] .source-simple {
  background: rgba(246, 244, 239, 0.8) !important;
  border: 1px solid rgba(34, 48, 60, 0.06) !important;
}

[data-theme="light"] .source-simple-item {
  color: #22303C !important;
}

[data-theme="light"] .source-simple-item svg {
  color: #1B66B3 !important;
}

/* Accessible by Design */
[data-theme="light"] .access-grid {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border: 1px solid rgba(34, 48, 60, 0.08) !important;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.8) inset,
              0 4px 24px rgba(34, 48, 60, 0.08) !important;
}

[data-theme="light"] .access-item {
  background: transparent !important;
  border-color: rgba(34, 48, 60, 0.06) !important;
}

[data-theme="light"] .access-item:hover {
  background: rgba(27, 102, 179, 0.03) !important;
}

[data-theme="light"] .access-item svg {
  color: #1B66B3 !important;
}

[data-theme="light"] .access-title {
  color: #22303C !important;
}

[data-theme="light"] .access-desc {
  color: #526776 !important;
}

/* CTA Band */
[data-theme="light"] .cta-band {
  background: transparent !important;
}

[data-theme="light"] .cta-band::before {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border-top: 1px solid rgba(34, 48, 60, 0.06) !important;
  border-bottom: 1px solid rgba(34, 48, 60, 0.06) !important;
}

[data-theme="light"] .cta-band h2 {
  color: #22303C !important;
}

[data-theme="light"] .cta-band p {
  color: #526776 !important;
}

/* ============================================================
   LIGHT MODE BUTTONS
   ============================================================ */
[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, #2985c4 0%, #1B66B3 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(27, 102, 179, 0.25) !important;
}

[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 4px 16px rgba(27, 102, 179, 0.35) !important;
}

[data-theme="light"] .btn-ghost {
  border-color: rgba(27, 102, 179, 0.25) !important;
  color: #1B66B3 !important;
}

[data-theme="light"] .btn-ghost:hover {
  background: rgba(27, 102, 179, 0.06) !important;
  border-color: rgba(27, 102, 179, 0.35) !important;
}

/* ============================================================
   LIGHT MODE FOOTER
   Dark navy for contrast - uses white logo
   ============================================================ */
[data-theme="light"] footer {
  background: #22303C !important;
  color: #f5f5f5 !important;
  border-top-color: transparent !important;
}

[data-theme="light"] footer .logo-white {
  display: block !important;
}

[data-theme="light"] footer .logo-color {
  display: none !important;
}

[data-theme="light"] footer h5 {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="light"] footer p,
[data-theme="light"] footer .ink-2 {
  color: rgba(255, 255, 255, 0.75) !important;
}

[data-theme="light"] footer a {
  color: rgba(255, 255, 255, 0.75) !important;
}

[data-theme="light"] footer a:hover {
  color: #FFFFFF !important;
}

[data-theme="light"] footer a:focus-visible {
  outline-color: rgba(255, 255, 255, 0.5) !important;
}

[data-theme="light"] .footer-bottom {
  color: rgba(255, 255, 255, 0.5) !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* ============================================================
   SYSTEM PREFERENCE FALLBACK OVERRIDES
   Duplicate key styles for prefers-color-scheme: light
   ============================================================ */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) body {
    background: #F6F4EF !important;
  }

  :root:not([data-theme]) .nav {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid rgba(27, 102, 179, 0.08) !important;
  }

  :root:not([data-theme]) .atmo-video,
  :root:not([data-theme]) .atmo-poster {
    display: none !important;
  }

  :root:not([data-theme]) .atmo {
    background: linear-gradient(180deg, #F6F4EF 0%, #EBE8E0 40%, #F6F4EF 100%) !important;
  }

  :root:not([data-theme]) .intelligence-network {
    display: block !important;
    opacity: 0.6 !important;
  }

  :root:not([data-theme]) .fact-strip,
  :root:not([data-theme]) .sovereign,
  :root:not([data-theme]) .domains,
  :root:not([data-theme]) .trust,
  :root:not([data-theme]) .access-grid {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(34, 48, 60, 0.08) !important;
  }

  :root:not([data-theme]) .cpl-promo {
    background: rgba(255, 255, 255, 0.98) !important;
  }

  :root:not([data-theme]) .btn-primary {
    background: linear-gradient(180deg, #2985c4 0%, #1B66B3 100%) !important;
    color: #FFFFFF !important;
  }

  :root:not([data-theme]) footer {
    background: #22303C !important;
    color: #f5f5f5 !important;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle svg,
  .logo-white,
  .logo-color {
    transition: none !important;
  }
}

/* ============================================================
   TRANSITION SMOOTHING
   Prevent flash during theme change
   ============================================================ */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition-duration: 0.3s !important;
  transition-timing-function: ease-out !important;
}
