/* ============================================================
   CYSTADS V2 — Cinematic Scrollytelling
   Single fixed frame. Background + heading animate. Chrome persists.
   ============================================================ */

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

:root {
  /* ── Backgrounds ── */
  --void: #0d0a18;
  /* deep purple-black */

  /* ── Brand purple (primary) ── */
  --purple: #8a2be2;
  --purple-light: #a855f7;
  --purple-mid: rgba(138, 43, 226, 0.22);
  --purple-glow: rgba(138, 43, 226, 0.40);
  --purple-soft: rgba(138, 43, 226, 0.10);

  /* ── Gold (secondary / heritage accent) ── */
  --gold: #c8923a;
  --gold-light: #e8b96a;
  --gold-soft: rgba(200, 146, 58, 0.18);

  /* ── Neutrals ── */
  --cream: #f0e8d8;
  --white: #ffffff;
  --muted: rgba(240, 232, 216, 0.50);

  /* ── Typography ── */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', sans-serif;

  /* ── Easing ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html,
body {
  width: 100%;
  height: 100%;
  /* Event-driven navigation — no native scrolling */
  overflow: hidden;
  background: var(--void);
  font-family: var(--font-sans);
  cursor: default;
}

body.v2-landing {
  height: 100%;
}

/* ── Fixed scene frame ── */
#v2-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  /* CRITICAL — clips oversized heading */
}

/* ════════════════════════════════════
   BACKGROUND LAYER STACK
   ════════════════════════════════════ */
#bg-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bg-layer {
  position: absolute;
  inset: 0;
  background-size: 100% auto;
  /* full viewport width, proportional height — no side bars */
  background-repeat: no-repeat;
  background-position: center center;
  background-color: #0d0a18;
  /* void fill if image is shorter than viewport */
  opacity: 0;
  /* Waiting state: subtle slide-in from the right */
  transform: scale(1.04) translateX(4%);
  will-change: opacity, transform;
  /* Default transition (entering) — matches heading phase2 spring timing */
  transition:
    opacity 560ms ease-out,
    transform 680ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ACTIVE: image settles into frame */
.bg-layer.active {
  opacity: 1;
  transform: scale(1) translateX(0);
}

/* EXITING: push the old image out to the left */
.bg-layer.exiting {
  opacity: 0;
  transform: scale(1.02) translateX(-3%);
  transition:
    opacity 400ms ease-in,
    transform 500ms cubic-bezier(0.4, 0, 1, 1);
}

/* Per-section backgrounds */
/* S1 — The Awakening: sepia painterly illustration of African woman + Africa silhouette + dancers */
.bg-s1 {
  background-image: url('../assets/img/v2_test_landing_image/afro.jpg');
  background-position: center center;
}

/* S2 — Lineage Labs: historical B&W archival collage of African ancestral hairstyle portraits */
.bg-s2 {
  background-image: url('../assets/img/v2_test_landing_image/download (11).jpg');
  background-position: center center;
}

/* S3 — Edutainment: vibrant Nigerian women in orange gele at a cultural celebration */
.bg-s3 {
  background-image: url('../assets/img/v2_test_landing_image/Culture and traditions.jpg');
  background-position: center center;
}

/* S4 — Meet Ancestor (AI Tutor): ceremonial drummer in body paint — the ancestral griot/knowledge keeper */
.bg-s4 {
  background-image: url('../assets/img/v2_test_landing_image/download (7).jpg');
  background-position: center center;
}

/* S5 — Sovereign Soil: Samburu/Maasai women in full regalia in their ancestral homeland */
.bg-s5 {
  background-image: url('../assets/img/v2_test_landing_image/africa.jpg');
  background-position: center center;
}

/* S6 — Join the Platform: Egungun masquerade performers & crowd — communal celebration */
.bg-s6 {
  background-image: url('../assets/img/v2_test_landing_image/Photo byHaryisAfvia Iwaria.jpeg');
  background-position: center center;
}

/* Purple-tinted cinematic overlay — always present */
#bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg,
      rgba(13, 8, 30, 0.78) 0%,
      rgba(8, 5, 20, 0.48) 50%,
      rgba(10, 6, 26, 0.72) 100%);
  transition: background 1s ease;
}

/* ════════════════════════════════════
   PERSISTENT CHROME
   ════════════════════════════════════ */

/* ════════════════════════════════════
   NAV
   ════════════════════════════════════ */
#v2-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.7s var(--ease-out), opacity 0.7s ease;
  will-change: transform;
}

#v2-nav.visible {
  transform: translateY(0);
  opacity: 1;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 2.5rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0) 100%);
  position: relative;
  z-index: 2;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  flex-shrink: 0;
}

.nav-logo-mark {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav-logo-tagline {
  font-size: 0.56rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 160px;
  padding-top: 0.1rem;
}

/* ── Center nav links ── */
.nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-links>li {
  position: relative;
}

.nav-links a {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 232, 216, 0.68);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a:hover {
  color: var(--purple-light);
}

.nav-link-donate {
  color: rgba(200, 146, 58, 0.9) !important;
}

.nav-link-donate:hover {
  color: var(--gold-light) !important;
}

/* Admin toggle caret */
.v2-admin-toggle {
  cursor: pointer;
}

.v2-admin-toggle .v2-caret {
  width: 12px;
  height: 12px;
  stroke: rgba(240, 232, 216, 0.5);
  transition: transform 0.25s;
  flex-shrink: 0;
}

.v2-has-dropdown.active>a {
  color: var(--purple-light);
}

.v2-has-dropdown.active .v2-caret {
  transform: rotate(180deg);
}

/* ── Admin nav dropdown ── */
.v2-nav-dropdown {
  position: absolute;
  top: calc(100% + 0.8rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.97);
  width: 260px;
  max-height: 72vh;
  overflow-y: auto;
  background: rgba(13, 9, 26, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(138, 43, 226, 0.25);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(138, 43, 226, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s var(--ease-out);
  z-index: 300;
  padding: 0.5rem 0;
}

.v2-nav-dropdown.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: all;
}

.v2-nav-dropdown::-webkit-scrollbar {
  width: 4px;
}

.v2-nav-dropdown::-webkit-scrollbar-thumb {
  background: rgba(138, 43, 226, 0.35);
  border-radius: 4px;
}

.v2-nadrop-section {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(138, 43, 226, 0.7);
}

.v2-nadrop-divider {
  height: 1px;
  background: rgba(138, 43, 226, 0.12);
  margin: 0.35rem 0;
}

.v2-nadrop-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.74rem;
  color: rgba(240, 232, 216, 0.72);
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.v2-nadrop-item i {
  font-size: 0.82rem;
  color: rgba(138, 43, 226, 0.65);
}

.v2-nadrop-item:hover {
  background: rgba(138, 43, 226, 0.12);
  color: var(--purple-light);
}

.v2-nadrop-item:hover i {
  color: var(--purple-light);
}

/* ── Right CTA strip ── */
.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* ── Dashboard button (auth) ── */
.btn-nav-dashboard {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 1rem;
  background: var(--purple);
  border: 1px solid rgba(138, 43, 226, 0.5);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  transition: background 0.22s, border-color 0.22s, box-shadow 0.22s;
  letter-spacing: 0.04em;
}

.btn-nav-dashboard i {
  font-size: 0.9rem;
}

.btn-nav-dashboard:hover {
  background: var(--purple-light);
  border-color: var(--purple-light);
  box-shadow: 0 4px 18px rgba(138, 43, 226, 0.45);
}

/* ── Currency selector — gold tones (financial accent) ── */
.v2-currency-wrap {
  position: relative;
}

.v2-currency-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.22s, border-color 0.22s;
  white-space: nowrap;
  user-select: none;
}

.v2-currency-btn i {
  font-size: 0.82rem;
}

.v2-currency-btn:hover {
  background: rgba(138, 43, 226, 0.12);
  border-color: rgba(138, 43, 226, 0.4);
  color: var(--purple-light);
}

#v2-currency-caret {
  font-size: 0.7rem;
  transition: transform 0.25s;
  color: rgba(240, 232, 216, 0.45);
}

#v2-currency-caret.rotated {
  transform: rotate(180deg);
}

.v2-currency-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 280px;
  background: rgba(13, 9, 26, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(138, 43, 226, 0.22);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(138, 43, 226, 0.06);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s var(--ease-out);
  z-index: 300;
}

.v2-currency-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.v2-currency-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: rgba(138, 43, 226, 0.08);
  border-bottom: 1px solid rgba(138, 43, 226, 0.15);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple-light);
  letter-spacing: 0.06em;
}

.v2-currency-header i {
  font-size: 0.9rem;
}

.v2-currency-options {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.4rem 0;
}

.v2-currency-options::-webkit-scrollbar {
  width: 4px;
}

.v2-currency-options::-webkit-scrollbar-thumb {
  background: rgba(138, 43, 226, 0.3);
  border-radius: 4px;
}

.v2-currency-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.18s, border-color 0.18s;
}

.v2-currency-option:hover {
  background: rgba(138, 43, 226, 0.1);
  border-left-color: var(--purple);
}

.v2-currency-option.selected {
  background: rgba(138, 43, 226, 0.14);
  border-left-color: var(--purple);
}

.v2-cur-symbol {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 26px;
  text-align: center;
}

.v2-cur-details {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  flex: 1;
}

.v2-cur-code {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cream);
}

.v2-cur-name {
  font-size: 0.65rem;
  color: var(--muted);
}

.v2-cur-check {
  font-size: 0.9rem;
  color: var(--purple-light);
  margin-left: auto;
}

.v2-currency-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  background: rgba(138, 43, 226, 0.05);
  border-top: 1px solid rgba(138, 43, 226, 0.1);
  font-size: 0.64rem;
  color: var(--muted);
}

.v2-currency-footer i {
  color: var(--purple-light);
  font-size: 0.8rem;
}

/* ── Hamburger (mobile only) ── */
.v2-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.4rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.v2-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  transform-origin: center;
}

.v2-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.v2-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.v2-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile overlay menu ── */
.v2-mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(13, 9, 26, 0.98);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(138, 43, 226, 0.25);
  padding: 1.5rem 2rem 2rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
  z-index: 1;
  max-height: 80vh;
  overflow-y: auto;
}

.v2-mobile-menu.open {
  opacity: 1;
  transform: translateY(0);
}

.v2-mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.5rem;
}

.v2-mobile-links>li>a,
.v2-mobile-links a {
  display: block;
  padding: 0.7rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(240, 232, 216, 0.72);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.2s, padding-left 0.2s;
}

.v2-mobile-links a:hover {
  color: var(--purple-light);
  padding-left: 0.75rem;
}

/* Admin section in mobile */
.v2-mobile-admin-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

.v2-mobile-section-label {
  display: block;
  padding: 0.7rem 0.5rem 0.3rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(138, 43, 226, 0.7);
}

.v2-mobile-sub-link {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(240, 232, 216, 0.55) !important;
  text-decoration: none;
  border-bottom: none !important;
  transition: color 0.18s, padding-left 0.2s;
}

.v2-mobile-sub-link:hover {
  color: var(--purple-light) !important;
  padding-left: 1.5rem;
}

.v2-mobile-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

/* BOTTOM-LEFT persistent info */
#bottom-info {
  position: absolute;
  bottom: 2rem;
  left: 2.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bottom-info-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.8;
  transition: opacity 0.5s ease;
}

.bottom-info-sub {
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.6;
  transition: opacity 0.5s ease;
}

/* PROGRESS DOTS — right edge, above panels */
#progress-dots {
  position: absolute;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s var(--ease-spring), height 0.3s;
}

.pdot.active {
  background: var(--purple);
  transform: scale(1.5);
  box-shadow: 0 0 8px var(--purple-glow);
}

/* ════════════════════════════════════
   CONTENT STAGE — animated per section
   ════════════════════════════════════ */
#content-stage {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 2.5rem 0 2.5rem;
  pointer-events: none;
}

/* Section eyebrow tag */
#section-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(12px);
  /* Delay matches phase2 landing so chrome appears as heading settles */
  transition: opacity 0.45s ease 0.38s, transform 0.45s var(--ease-out) 0.38s;
  will-change: opacity, transform;
}

#section-tag.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Heading clip container — clips the oversized heading during transition */
#heading-clip {
  overflow: hidden;
  /* Bleed well past viewport so letters can grow without scrollbars appearing */
  margin: -4rem -12rem;
  padding: 4rem 12rem;
  position: relative;
}

/* THE HEADING — cinematic element, JS controls transition property directly */
#main-heading {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 10.5vw, 14rem);
  font-weight: 800;
  line-height: 0.92;
  color: var(--white);
  letter-spacing: -0.02em;
  transform: scale(1);
  transform-origin: center center;
  will-change: transform;
  /* NO static transition here — JS sets it precisely per phase */
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 0.05em;
}

#main-heading .h-line {
  display: block;
  overflow: visible;
}

/* Sub-label row (right of heading) */
#sub-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-top: 1.25rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease 0.5s, transform 0.45s var(--ease-out) 0.5s;
  will-change: opacity, transform;
}

#sub-row.visible {
  opacity: 1;
  transform: translateY(0);
}

#sub-label {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 400;
  font-style: italic;
  color: var(--gold);
  line-height: 1.2;
}

#sub-desc {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 200px;
  padding-top: 0.2rem;
}

/* CTA strip */
#cta-strip {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  align-items: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease 0.62s, transform 0.45s var(--ease-out) 0.62s;
  pointer-events: none;
  will-change: opacity, transform;
}

#cta-strip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ════════════════════════════════════
   SCAN LINE — sweeps across at section swap
   ════════════════════════════════════ */
#scan-line {
  position: absolute;
  top: 48vh;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(to right,
      transparent 0%,
      rgba(138, 43, 226, 0) 15%,
      rgba(168, 85, 247, 0.9) 50%,
      rgba(138, 43, 226, 0) 85%,
      transparent 100%);
  z-index: 220;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-110%);
}

#scan-line.sweep {
  animation: scanSweep 0.42s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes scanSweep {
  0% {
    transform: translateX(-110%);
    opacity: 0.9;
  }

  55% {
    opacity: 1;
  }

  100% {
    transform: translateX(110%);
    opacity: 0;
  }
}

/* ════════════════════════════════════
   CIRCULAR NEXT-SECTION BUTTON — centre-bottom
   ════════════════════════════════════ */
#scroll-cta {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 100;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--purple);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  transition: background 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  will-change: transform;
  animation: ctaBob 3.5s ease-in-out infinite;
  pointer-events: all;
  box-shadow: 0 6px 24px rgba(138, 43, 226, 0.4);
}

#scroll-cta:hover {
  transform: translateX(-50%) scale(1.1);
  background: var(--purple-light);
  box-shadow: 0 12px 36px rgba(138, 43, 226, 0.6);
  animation: none;
}

@keyframes ctaBob {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-5px);
  }
}

#scroll-cta svg {
  width: 20px;
  height: 20px;
  stroke: var(--void);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

#scroll-cta .cta-micro {
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--void);
  line-height: 1;
  text-align: center;
}

/* ════════════════════════════════════
   BUTTON SYSTEM
   ════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 1.6rem;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
  pointer-events: all;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* Primary — brand purple */
.btn-gold {
  background: var(--purple);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(138, 43, 226, 0.35);
}

.btn-gold:hover {
  background: var(--purple-light);
  box-shadow: 0 8px 28px rgba(138, 43, 226, 0.55);
}

/* Secondary outline — gold border */
.btn-outline {
  background: transparent;
  color: var(--cream);
  border: 1.5px solid rgba(200, 146, 58, 0.45);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(138, 43, 226, 0.1);
  border-color: rgba(138, 43, 226, 0.3);
}

.btn svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

/* nav-specific small buttons */
.btn-nav-signin {
  font-size: 0.72rem;
  padding: 0.5rem 1.1rem;
  background: transparent;
  color: rgba(240, 232, 216, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-nav-signin:hover {
  color: var(--purple-light);
  border-color: rgba(138, 43, 226, 0.45);
  background: rgba(138, 43, 226, 0.08);
}

.btn-nav-join {
  font-size: 0.72rem;
  padding: 0.5rem 1.2rem;
  background: var(--purple);
  color: var(--white);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-spring);
  box-shadow: 0 4px 14px rgba(138, 43, 226, 0.4);
}

.btn-nav-join:hover {
  background: var(--purple-light);
  box-shadow: 0 6px 22px rgba(138, 43, 226, 0.55);
  transform: translateY(-1px);
}

/* ════════════════════════════════════
   INTERACTIVE PANELS — floating card, bottom-right
   ════════════════════════════════════ */
.content-panel {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 75;
  width: min(460px, calc(46vw - 2rem));
  /* Entrance: spring up from below */
  transform: translateY(48px) scale(0.9);
  opacity: 0;
  transition:
    transform 0.65s cubic-bezier(0.22, 1.3, 0.36, 1),
    opacity 0.45s ease;
  will-change: transform, opacity;
  pointer-events: none;
}

.content-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Glass card — shared by all panels */
.panel-inner {
  background: rgba(13, 8, 24, 0.90);
  backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(138, 43, 226, 0.28);
  border-radius: 20px;
  padding: 1.4rem 1.5rem 1.5rem;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.80),
    0 0 0 1px rgba(138, 43, 226, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  position: relative;
}

/* ── Shimmer sweep — light streak every 5s ── */
.panel-inner::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -120%;
  width: 55%;
  background: linear-gradient(105deg,
      transparent 0%,
      rgba(255, 255, 255, 0.045) 50%,
      transparent 100%);
  pointer-events: none;
  z-index: 10;
}

.content-panel.open .panel-inner::after {
  animation: panelShimmer 5s ease-in-out infinite 1.2s;
}

@keyframes panelShimmer {
  0% {
    left: -120%;
  }

  18%,
  100% {
    left: 160%;
  }
}

/* ── Purple border glow pulse ── */
.content-panel.open .panel-inner {
  animation:
    panelGlow 3.5s ease-in-out infinite 0.8s,
    panelFloat 5s ease-in-out infinite 0.6s;
}

@keyframes panelGlow {

  0%,
  100% {
    border-color: rgba(138, 43, 226, 0.28);
    box-shadow:
      0 32px 80px rgba(0, 0, 0, 0.80),
      0 0 0 1px rgba(138, 43, 226, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  50% {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow:
      0 32px 80px rgba(0, 0, 0, 0.80),
      0 0 40px rgba(138, 43, 226, 0.28),
      0 0 0 1px rgba(138, 43, 226, 0.10),
      inset 0 1px 0 rgba(168, 85, 247, 0.08);
  }
}

/* ── Gentle breathing float ── */
@keyframes panelFloat {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* Panel header row */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--purple-light);
}

.panel-badge {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 232, 216, 0.55);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0.22rem 0.6rem;
}

.panel-badge--live {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.1);
  animation: livePulse 2s ease-in-out infinite;
}

.panel-badge--verified {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.1);
}

@keyframes livePulse {

  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.35);
  }
}

.panel-hint {
  font-size: 0.68rem;
  color: rgba(200, 146, 58, 0.5);
  font-style: italic;
  text-align: center;
  margin-top: -0.15rem;
}

/* ── S2: Family Tree ── */
.tree-wrap {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}

#family-tree-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.tree-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1s var(--ease-out);
}

.tree-node-circle {
  fill: rgba(0, 0, 0, 0.6);
  stroke: var(--gold);
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.25s;
}

.tree-node-circle:hover {
  fill: var(--gold);
}

.tree-node-label {
  font-family: var(--font-sans);
  font-size: 9px;
  fill: var(--cream);
  text-anchor: middle;
  pointer-events: none;
}

.tree-pulse {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0;
  animation: tPulse 2s ease-out infinite;
}

@keyframes tPulse {
  0% {
    r: 14px;
    opacity: 0.7;
  }

  100% {
    r: 28px;
    opacity: 0;
  }
}

.node-group {
  position: relative;
}

/* Node tooltip */
.node-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.92);
  background: rgba(13, 9, 26, 0.97);
  border: 1px solid rgba(138, 43, 226, 0.35);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  min-width: 180px;
  max-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease-spring);
  z-index: 200;
}

.node-tip.open {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: all;
}

.node-tip h5 {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: var(--purple-light);
  margin-bottom: 0.3rem;
}

.node-tip p {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── S3: Quiz ── */
.quiz-q {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--cream);
  line-height: 1.55;
}

.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.quiz-opt {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.22s, background 0.22s, transform 0.18s;
  /* Staggered entrance */
  opacity: 0;
  transform: translateX(12px);
}

.quiz-opt:hover {
  border-color: var(--purple);
  background: rgba(138, 43, 226, 0.1);
  color: var(--cream);
  transform: translateX(0) translateX(-2px);
}

/* JS adds .quiz-revealed to the panel when open */
#panel-s3.open .quiz-opt:nth-child(1) {
  animation: quizReveal 0.35s var(--ease-out) 0.15s forwards;
}

#panel-s3.open .quiz-opt:nth-child(2) {
  animation: quizReveal 0.35s var(--ease-out) 0.27s forwards;
}

#panel-s3.open .quiz-opt:nth-child(3) {
  animation: quizReveal 0.35s var(--ease-out) 0.39s forwards;
}

#panel-s3.open .quiz-opt:nth-child(4) {
  animation: quizReveal 0.35s var(--ease-out) 0.51s forwards;
}

@keyframes quizReveal {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.quiz-opt.correct {
  border-color: var(--purple);
  background: rgba(138, 43, 226, 0.15);
  color: var(--cream);
  animation: quizReveal 0.35s var(--ease-out) 0.27s forwards,
    correctPulse 2.5s ease-in-out infinite 1s !important;
}

@keyframes correctPulse {

  0%,
  100% {
    background: rgba(138, 43, 226, 0.15);
  }

  50% {
    background: rgba(138, 43, 226, 0.28);
  }
}

.opt-letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(138, 43, 226, 0.2);
  color: var(--purple-light);
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.correct .opt-letter {
  background: var(--purple);
  color: var(--white);
}

.quiz-timer-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  color: var(--muted);
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.timer-svg {
  width: 24px;
}

.timer-svg circle {
  fill: none;
  stroke: var(--purple);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 63;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: countdown 30s linear forwards;
}

@keyframes countdown {
  to {
    stroke-dashoffset: 63;
  }
}

/* ── S4: Chat ── */
.panel-chat {
  padding: 0;
  overflow: hidden;
  gap: 0;
}

.chat-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b1abd, var(--purple-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.35);
  animation: avaPulse 3s ease-in-out infinite 2s;
}

@keyframes avaPulse {

  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.35);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(138, 43, 226, 0.55), 0 0 18px rgba(138, 43, 226, 0.25);
  }
}

.chat-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream);
}

.chat-status {
  font-size: 0.62rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.chat-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: blink 1.8s ease infinite;
  box-shadow: 0 0 6px #4ade80;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.3
  }
}

.chat-body {
  padding: 0.9rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.chat-bubble {
  max-width: 92%;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(240, 232, 216, 0.88);
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  font-size: 0.76rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.38s ease, transform 0.38s var(--ease-out);
}

.chat-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-bubble a {
  color: var(--purple-light);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(138, 43, 226, 0.35);
}

.chat-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  width: fit-content;
  opacity: 0;
  transition: opacity 0.3s;
}

.chat-dots.show {
  opacity: 1;
}

.chat-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  animation: dot-bob 1.1s ease infinite;
}

.chat-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.chat-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes dot-bob {

  0%,
  60%,
  100% {
    transform: translateY(0)
  }

  30% {
    transform: translateY(-5px)
  }
}

/* ── S5: Heritage card ── */
.heritage-card {
  border: 1px solid rgba(138, 43, 226, 0.25);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(138, 43, 226, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Green scanner line that sweeps down the card */
.heritage-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent 10%, rgba(74, 222, 128, 0.8) 50%, transparent 90%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

#panel-s5.open .heritage-card::before {
  animation: cardScan 2.8s ease-in-out infinite 1s;
}

@keyframes cardScan {
  0% {
    top: -2px;
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  92% {
    opacity: 0.7;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

.hc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.38rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
}

.hc-row:last-child {
  border-bottom: none;
}

.hc-k {
  color: rgba(200, 146, 58, 0.65);
}

.hc-v {
  color: var(--cream);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hc-v.fill {
  opacity: 1;
}

/* ════════════════════════════════════
   TRANSITION OVERLAY — flashes during heading swap
   ════════════════════════════════════ */
#transition-flash {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.15s ease;
}

#transition-flash.flash {
  background: rgba(0, 0, 0, 0.15);
}

/* ════════════════════════════════════
   DUST PARTICLES (S1)
   ════════════════════════════════════ */
#dust-field {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.8s ease;
}

#dust-field.hidden {
  opacity: 0;
}

.dust {
  position: absolute;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.45);
  animation: dustUp linear infinite;
  will-change: transform, opacity;
}

@keyframes dustUp {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 0.5;
  }

  100% {
    transform: translateY(-85vh) translateX(var(--dx));
    opacity: 0;
  }
}

/* ════════════════════════════════════
   STATIC / MOBILE FALLBACK
   ════════════════════════════════════ */
body.static-mode {
  height: auto;
  overflow-y: auto;
}

body.static-mode #v2-scene {
  position: relative;
  height: auto;
  overflow: visible;
}

body.static-mode #bg-stack,
body.static-mode #bg-overlay {
  display: none;
}

body.static-mode .static-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 2.5rem 3rem;
  position: relative;
  overflow: hidden;
}

body.static-mode .static-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  z-index: 0;
}

body.static-mode .static-section>* {
  position: relative;
  z-index: 1;
}

body.static-mode #v2-nav {
  position: fixed;
  transform: translateY(0);
  opacity: 1;
  background: rgba(13, 9, 26, 0.96);
  backdrop-filter: blur(12px);
}

body.static-mode #content-stage {
  position: relative;
  padding: 0;
}

body.static-mode #heading-clip {
  margin: 0;
  padding: 0;
  overflow: visible;
}

body.static-mode #main-heading {
  font-size: clamp(2.5rem, 7vw, 6rem);
  white-space: normal;
}

body.static-mode .content-panel {
  position: relative;
  bottom: auto;
  right: auto;
  width: 100%;
  transform: none;
  opacity: 1;
  pointer-events: all;
}

body.static-mode .panel-inner {
  backdrop-filter: none;
  background: rgba(8, 6, 4, 0.85);
  border-radius: 12px;
  margin: 1rem 0;
  padding: 1.25rem;
  animation: none !important;
}

body.static-mode .panel-inner::after {
  display: none;
}

body.static-mode .quiz-opt {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

body.static-mode #cta-strip {
  opacity: 1;
  transform: none;
  pointer-events: all;
  margin-top: 1.5rem;
}

body.static-mode #section-tag {
  opacity: 1;
  transform: none;
}

body.static-mode #sub-row {
  opacity: 1;
  transform: none;
}

body.static-mode #bottom-info {
  display: none;
}

body.static-mode #scroll-cta {
  bottom: 1.5rem;
  right: 1.5rem;
}

body.static-mode #progress-dots {
  display: none;
}

body.static-mode .tree-path {
  stroke-dashoffset: 0;
}

body.static-mode #africa-map-svg {
  opacity: 1;
}

body.static-mode .trade-route {
  stroke-dashoffset: 0;
}

body.static-mode .map-dot {
  opacity: 1;
}

body.static-mode .hc-v {
  opacity: 1;
}

body.static-mode .chat-bubble {
  opacity: 1;
  transform: none;
}

body.static-mode .chat-dots {
  display: none;
}

body.static-mode #dust-field {
  display: none;
}

@media (max-width: 960px) {

  /* Switch to hamburger on smaller screens */
  .nav-links {
    display: none !important;
  }

  .v2-hamburger {
    display: flex;
  }

  .v2-mobile-menu {
    display: block;
  }

  .nav-inner {
    padding: 1rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    padding: 0.85rem 1.25rem;
  }

  #main-heading {
    font-size: clamp(2.5rem, 9vw, 5rem);
  }

  #content-stage {
    padding: 0 1.25rem;
  }

  #bottom-info {
    left: 1.25rem;
  }

  .content-panel {
    right: 1rem;
    bottom: 1rem;
    width: calc(100vw - 4rem);
  }
}