/* ============================================
   CHARISMA: Design System & Layout
   Tone: Organic-Sacred Premium
   Architecture: Five Sections x Five Elements
   Research: REPORT.md fully integrated
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
/* HSL-calibrated from REPORT.md — all WCAG AA on cream */
:root {
  /* --- PRIMARY: Sacred Aquamarine --- */
  --color-primary: hsl(176, 50%, 38%);           /* #31998F */
  --color-primary-dark: hsl(176, 55%, 20%);      /* #174F49 — Deep Tide */
  --color-primary-light: hsl(176, 35%, 82%);     /* #BDD9D6 — Morning Mist */

  /* --- SECONDARY: Virginia Terracotta --- */
  --color-secondary: hsl(18, 52%, 48%);          /* #B06A3F */
  --color-secondary-light: hsl(18, 38%, 78%);    /* #D3B8A4 — Sandstone Wash */

  /* --- BACKGROUND: Parchment Cream --- */
  --color-bg: hsl(30, 55%, 97%);                 /* #FBF7F1 */
  --color-bg-alt: hsl(30, 35%, 93%);             /* #F0ECE6 — Dried Sage Paper */

  /* --- ACCENT: Petroglyph Amethyst --- */
  --color-accent: hsl(272, 38%, 35%);            /* #4A2E6B */

  /* --- HIGHLIGHT: Canopy Green --- */
  --color-highlight: hsl(145, 32%, 35%);         /* #3D7554 */

  /* --- TEXT COLORS --- */
  --color-text: hsl(25, 20%, 18%);               /* #37291F — Bark Brown */
  --color-text-light: hsl(25, 12%, 48%);         /* #8A7A6E — Driftwood (18px+ only) */
  --color-white: hsl(30, 50%, 99%);              /* #FEFCFA — Moonlit Cream */

  /* Typography: Research Confirmed */
  --font-heading: 'Ephesis', cursive;
  --font-body: 'Cormorant Garamond', 'Georgia', serif;

  /* Spacing: generous, stillness, breathing room */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;

  /* Section rhythm */
  --section-padding: var(--space-2xl) var(--space-md);
  --section-max-width: 800px;

  /* Transitions */
  --ease-gentle: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-bloom: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration-slow: 800ms;
  --duration-medium: 500ms;

  /* Ceremonial Easing Tokens (Research-locked) */
  --ease-arrive: cubic-bezier(0.23, 1, 0.32, 1);        /* easeOutQuint: bird landing */
  --ease-settle: cubic-bezier(0.215, 0.61, 0.355, 1);   /* easeOutCubic: stone on shelf */
  --ease-breathe: cubic-bezier(0.39, 0.575, 0.565, 1);  /* easeOutSine: slow exhale */
}


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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text);
  background-color: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-medium) var(--ease-gentle);
}

a:hover,
a:focus-visible {
  color: var(--color-accent);
}


/* --- Screen-Reader Only (SEO H1) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: clamp(3.5rem, 10vw, 7rem);
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.02em;
}

em {
  font-style: italic;
  color: var(--color-text-light);
}


/* --- Section Base --- */
.section {
  padding: var(--section-padding);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  scroll-margin-top: 2rem;
  contain: layout style;
}

/* Offscreen sections skip rendering until near viewport */
.section--spirit,
.section--invitation,
.section--story,
.section--connection {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

.section > * {
  max-width: var(--section-max-width);
  width: 100%;
}

/* Full-bleed overlay layers must escape the max-width constraint */
.sparkle-field,
.fire-sparks,
.spirit-vine,
.vine-lotus,
.spirit-orb,
.atmo-dust {
  max-width: none;
}


/* --- Fade-In Animation (Scroll-Triggered) --- */
/* --- Vertical Reveal (Momentum Animation) --- */
.reveal-up {
  opacity: 0;
  transform: translateY(60px);
  will-change: opacity, transform;
  transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* Stagger delays for children inside .reveal-group */
.reveal-group > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-group > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-group > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-group > *:nth-child(4) { transition-delay: 0.4s; }
.reveal-group > *:nth-child(5) { transition-delay: 0.5s; }

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
  transition: opacity var(--duration-slow) var(--ease-gentle), transform var(--duration-slow) var(--ease-gentle);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================
   SECTION 1: THE ARRIVAL (Spirit)
   Halo Effect: 50ms verdict
   Animation: Progressive Depth of Field
   ============================================ */
.section--arrival {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--color-primary-dark);
}

/* Separate image layer for blur-to-sharp animation */
.arrival__image-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* NEW HERO IMAGE: Dolphin Hero */
  background-image: url('../public/assets/hero/Dolphin-hero.webp');
  background-size: cover;
  background-position: center;
  z-index: 1;
  /* Raw clarity: no filters, let the image speak */
  opacity: 0.9;
  max-width: none; /* override global limit */
}

/* 6-Stop Surgical Gradient (Research REPORT.md lines 255-263)
   Top 35% fully transparent so the dolphin hero breathes.
   Darkening begins at 55%, intensifies surgically where text lives. */
.arrival__overlay {
  position: absolute;
  inset: 0;
  max-width: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 35%,
    hsla(176, 45%, 18%, 0.25) 55%,
    hsla(176, 50%, 18%, 0.55) 75%,
    hsla(176, 55%, 20%, 0.85) 90%,
    hsl(176, 55%, 20%) 100%
  );
  z-index: 1;
}

.arrival__content {
  position: relative;
  z-index: 2;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-height: 60vh;
}

.arrival__logo-wrapper {
  opacity: 0;
  animation: breatheIn 2s var(--ease-gentle) 0.3s forwards;
  margin-bottom: var(--space-sm);
  display: flex;
  justify-content: center;
}

/* Override reveal-up: breatheIn is the sole reveal for the logo */
.arrival__logo-wrapper.reveal-up {
  transform: none;
}
.arrival__logo-wrapper.reveal-up.is-visible {
  transform: none;
}

.arrival__logo {
  max-width: clamp(240px, 50vw, 500px);
  height: auto;
  display: block;
  /* Relying on native Alpha channel of the PNG to float organically */
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  animation: organicFloat 6s ease-in-out infinite alternate;
}

@keyframes organicFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

.arrival__prelude {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: hsla(30, 50%, 92%, 0.85);
  text-shadow: 0 1px 6px hsla(176, 55%, 10%, 0.4);
  opacity: 0;
  animation: breatheIn 2.5s var(--ease-gentle) 0.8s forwards;
  margin-bottom: var(--space-xs);
}

.arrival__tagline {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: hsla(42, 50%, 88%, 1);
  text-shadow: 0 1px 8px hsla(176, 55%, 10%, 0.5), 0 0 30px hsla(176, 50%, 40%, 0.25);
  opacity: 0;
  animation: breatheIn 2s var(--ease-gentle) 1.6s forwards;
}

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

.arrival__scroll-hint {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: hsl(45, 100%, 90%);
  text-decoration: none;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease;
  animation:
    hintBreatheIn 2s var(--ease-gentle) 2.5s forwards,
    discoverPulse 4s ease-in-out 4.5s infinite;
  text-shadow:
    0 0 8px hsla(45, 100%, 75%, 0.8),
    0 0 20px hsla(40, 90%, 60%, 0.5),
    0 0 40px hsla(35, 80%, 50%, 0.3),
    0 1px 3px rgba(0,0,0,0.8);
}

/* Override reveal-up: discover must stay centered at all times */
.arrival__scroll-hint.reveal-up {
  transform: translateX(-50%) translateY(60px);
}
.arrival__scroll-hint.reveal-up.is-visible {
  transform: translateX(-50%) translateY(0);
}

.arrival__scroll-hint:hover {
  color: hsl(50, 100%, 97%);
  text-shadow:
    0 0 12px hsla(45, 100%, 80%, 1),
    0 0 30px hsla(40, 100%, 70%, 0.8),
    0 0 60px hsla(35, 90%, 55%, 0.5),
    0 1px 3px rgba(0,0,0,0.8);
}

.scroll-hint__arrow {
  display: block;
  font-size: 1.4rem;
  color: hsl(45, 100%, 85%);
  animation: gentleBounce 2s ease-in-out infinite;
}

@keyframes discoverPulse {
  0%, 100% {
    text-shadow:
      0 0 8px hsla(45, 100%, 75%, 0.8),
      0 0 20px hsla(40, 90%, 60%, 0.5),
      0 0 40px hsla(35, 80%, 50%, 0.3),
      0 1px 3px rgba(0,0,0,0.8);
  }
  50% {
    text-shadow:
      0 0 14px hsla(45, 100%, 80%, 1),
      0 0 35px hsla(40, 100%, 70%, 0.7),
      0 0 70px hsla(35, 90%, 55%, 0.4),
      0 0 120px hsla(30, 80%, 50%, 0.2),
      0 1px 3px rgba(0,0,0,0.8);
  }
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Dedicated breathe-in for scroll hint that preserves translateX(-50%) */
@keyframes hintBreatheIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes gentle-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* Scroll-driven depth-of-field removed: raw image clarity preferred */


/* K-3.1: UNDERWATER SUN RAYS — Fixed light source, wave-refracted beams
   Light enters from top and stays fixed. Ray lengths/opacity shift
   as if waves overhead are refracting the light at depth.
   Free will is willingness to serve: light shaped by waves, not performing */
@media (prefers-reduced-motion: no-preference) {

  /* Primary ray layer: beams radiating downward from fixed top-center source */
  .section--arrival::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;

    /* Fixed conic beams from top center, no rotation */
    background:
      repeating-conic-gradient(
        from 0deg at 50% 0%,
        hsla(176, 60%, 90%, 0.09) 0deg 3deg,
        transparent 3deg 12deg
      ),
      repeating-conic-gradient(
        from 5deg at 50% 0%,
        hsla(38, 50%, 90%, 0.05) 0deg 5deg,
        transparent 5deg 18deg
      );

    mix-blend-mode: screen;
    opacity: 0.5;

    /* Rays fade from center outward, stronger at top */
    -webkit-mask-image: radial-gradient(
      ellipse 90% 80% at 50% 0%,
      black 0%,
      rgba(0,0,0,0.4) 50%,
      transparent 100%
    );
    mask-image: radial-gradient(
      ellipse 90% 80% at 50% 0%,
      black 0%,
      rgba(0,0,0,0.4) 50%,
      transparent 100%
    );

    /* No rotation. Opacity + scale pulse simulates wave refraction */
    transform: translateZ(0);
    animation:
      rayRefract 14s ease-in-out infinite,
      rayPulse 8s ease-in-out infinite;
  }

  /* Second ray layer: slightly offset beams for depth and caustic interference */
  .section--arrival::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: repeating-conic-gradient(
      from 8deg at 52% 0%,
      hsla(180, 50%, 92%, 0.06) 0deg 4deg,
      transparent 4deg 16deg
    );
    mix-blend-mode: screen;
    opacity: 0.3;
    -webkit-mask-image: radial-gradient(
      ellipse 85% 75% at 48% 0%,
      black 0%,
      rgba(0,0,0,0.3) 50%,
      transparent 100%
    );
    mask-image: radial-gradient(
      ellipse 85% 75% at 48% 0%,
      black 0%,
      rgba(0,0,0,0.3) 50%,
      transparent 100%
    );
    transform: translateZ(0);
    /* Counter-phase to primary: when one brightens, other dims */
    animation:
      rayRefract 14s ease-in-out 7s infinite,
      rayPulse 8s ease-in-out 4s infinite;
  }

  /* Central glow at ray origin: warm light entry point */
  .arrival__image-layer::before {
    content: '';
    position: absolute;
    top: -15%;
    left: 20%;
    width: 60%;
    height: 40%;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(
      ellipse at 50% 0%,
      hsla(45, 80%, 85%, 0.14) 0%,
      hsla(176, 60%, 70%, 0.06) 35%,
      transparent 70%
    );
    animation: glowBreathe 8s ease-in-out infinite;
  }

  /* Horizontal wave shimmer (looking through water surface) */
  .arrival__image-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 40px,
      hsla(176, 60%, 80%, 0.03) 42px,
      transparent 44px,
      transparent 80px,
      hsla(180, 50%, 85%, 0.04) 82px,
      transparent 84px
    );
    animation: waveShimmer 6s ease-in-out infinite;
  }

  /* Floating water particles: tiny specs drifting upward like sediment */
  .arrival__content::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
      radial-gradient(1px 1px at 15% 30%, hsla(176, 80%, 90%, 0.6), transparent),
      radial-gradient(1.5px 1.5px at 30% 60%, hsla(180, 70%, 85%, 0.4), transparent),
      radial-gradient(1px 1px at 45% 20%, hsla(174, 60%, 95%, 0.5), transparent),
      radial-gradient(2px 2px at 60% 75%, hsla(178, 70%, 88%, 0.3), transparent),
      radial-gradient(1px 1px at 75% 40%, hsla(176, 80%, 92%, 0.5), transparent),
      radial-gradient(1.5px 1.5px at 85% 15%, hsla(180, 60%, 90%, 0.4), transparent),
      radial-gradient(1px 1px at 20% 85%, hsla(174, 70%, 85%, 0.5), transparent),
      radial-gradient(1.5px 1.5px at 55% 45%, hsla(176, 60%, 92%, 0.3), transparent),
      radial-gradient(1px 1px at 90% 65%, hsla(180, 80%, 88%, 0.4), transparent),
      radial-gradient(2px 2px at 8% 55%, hsla(178, 60%, 90%, 0.3), transparent);
    animation: particleDrift 20s linear infinite;
  }

  /* === KEYFRAMES === */

  /* Wave refraction: rays stretch/compress as waves pass overhead */
  @keyframes rayRefract {
    0%   { transform: translateZ(0) scaleY(1); }
    25%  { transform: translateZ(0) scaleY(1.08); }
    50%  { transform: translateZ(0) scaleY(0.95); }
    75%  { transform: translateZ(0) scaleY(1.05); }
    100% { transform: translateZ(0) scaleY(1); }
  }

  /* Opacity breathing: depth changes from wave surface */
  @keyframes rayPulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 0.55; }
  }

  /* Central glow breathing */
  @keyframes glowBreathe {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.05); }
  }

  @keyframes waveShimmer {
    0%   { transform: translateY(0); opacity: 0.5; }
    50%  { transform: translateY(-10px); opacity: 1; }
    100% { transform: translateY(0); opacity: 0.5; }
  }

  /* Particles drift slowly upward like sediment in water */
  @keyframes particleDrift {
    0%   { transform: translateY(0); opacity: 0.4; }
    50%  { transform: translateY(-30px); opacity: 0.7; }
    100% { transform: translateY(0); opacity: 0.4; }
  }
}

/* Mobile: simplified rays, no rotation (performance) */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
  .section--arrival::before {
    background: repeating-conic-gradient(
      from 0deg at 50% 25%,
      hsla(176, 60%, 90%, 0.06) 0deg 5deg,
      transparent 5deg 16deg
    );
    animation: rayPulse 12s ease-in-out infinite;
    /* No rotation on mobile */
  }
  .section--arrival::after {
    display: none;
  }
}


/* ============================================
   STRUCTURE: THE SPIRIT (SECTION 2)
   ============================================ */
.section--spirit {
  /* Earth Horizon: teal top fading to warm sand bottom for smooth parallax blend */
  background: linear-gradient(
    to bottom,
    hsl(176, 55%, 20%) 0%,
    hsl(176, 40%, 30%) 4%,
    hsl(176, 20%, 50%) 8%,
    hsl(30, 30%, 94%) 15%,
    hsl(32, 28%, 93%) 40%,
    hsl(30, 25%, 93%) 65%,
    hsl(28, 28%, 92%) 80%,
    hsl(25, 30%, 91%) 90%,
    hsl(22, 32%, 90%) 100%
  );
  color: var(--color-text);
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-3xl);
  display: flex;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Ensure pseudo-element animations are visible */
  isolation: isolate;
}

/* Override fade-in on all major sections: backgrounds must paint immediately
   so the user never sees white gaps between sections. Content inside still
   fades via .reveal-up on individual elements. */
.section--spirit.fade-in,
.section--invitation.fade-in,
.section--story.fade-in,
.section--connection.fade-in {
  opacity: 1;
  transform: none;
}

/* K-3.2: Spirit ambient — floating light fills the whitespace */
@media (prefers-reduced-motion: no-preference) {
  /* Layer 1: Soft color pools scattered throughout (Safari-safe syntax) */
  .section--spirit::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(ellipse 200px 200px at 8% 20%, hsla(176, 55%, 60%, 0.18), transparent),
      radial-gradient(ellipse 150px 150px at 25% 65%, hsla(22, 50%, 60%, 0.15), transparent),
      radial-gradient(ellipse 250px 250px at 50% 30%, hsla(270, 35%, 65%, 0.12), transparent),
      radial-gradient(ellipse 175px 175px at 72% 50%, hsla(148, 40%, 55%, 0.14), transparent),
      radial-gradient(ellipse 220px 220px at 90% 25%, hsla(176, 50%, 65%, 0.13), transparent),
      radial-gradient(ellipse 130px 130px at 15% 80%, hsla(38, 55%, 60%, 0.15), transparent),
      radial-gradient(ellipse 300px 300px at 60% 85%, hsla(174, 45%, 60%, 0.1), transparent),
      radial-gradient(ellipse 160px 160px at 85% 75%, hsla(270, 30%, 60%, 0.12), transparent);
    animation: spiritFloat 20s ease-in-out infinite;
  }

  /* NOTE: ::after is used for rain (defined in spirit animations block below) */

  @keyframes spiritFloat {
    0% { transform: translateY(0); }
    25% { transform: translateY(-15px); }
    50% { transform: translateY(5px); }
    75% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
  }
}

.spirit__content {
  max-width: var(--max-width-content);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  position: relative;
  z-index: 1;
}

/* Ensure spirit orbs are visible above background but below text */
.spirit-orb {
  z-index: 1;
}

/* Visible spirit section animations: spore network + subtle flash */
@media (prefers-reduced-motion: no-preference) {

  /* Layer 1: Soft warm-teal wash that breathes across the section */
  .section--spirit::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
      radial-gradient(ellipse 500px 300px at 20% 40%, hsla(176, 40%, 65%, 0.1), transparent 60%),
      radial-gradient(ellipse 400px 400px at 80% 60%, hsla(22, 45%, 65%, 0.08), transparent 60%);
    animation: spiritWash 15s ease-in-out infinite alternate;
  }

  @keyframes spiritWash {
    0% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.7; transform: scale(0.98); }
  }

  /* Layer 2: Spore/mycelium network on the tapestry grid */
  .spirit__tapestry::before {
    content: '';
    position: absolute;
    inset: -60px;
    z-index: 0;
    pointer-events: none;
    background:
      /* Glowing spore nodes at card corners and gaps */
      radial-gradient(circle 30px at 0% 0%, hsla(176, 55%, 65%, 0.3), transparent),
      radial-gradient(circle 35px at 100% 0%, hsla(38, 50%, 65%, 0.25), transparent),
      radial-gradient(circle 32px at 50% 50%, hsla(176, 45%, 70%, 0.3), transparent),
      radial-gradient(circle 28px at 0% 100%, hsla(148, 45%, 60%, 0.25), transparent),
      radial-gradient(circle 35px at 100% 100%, hsla(270, 35%, 70%, 0.2), transparent),
      /* Connecting veins between nodes */
      radial-gradient(ellipse 160px 3px at 25% 0%, hsla(176, 50%, 70%, 0.18), transparent),
      radial-gradient(ellipse 3px 140px at 0% 50%, hsla(176, 45%, 65%, 0.15), transparent),
      radial-gradient(ellipse 160px 3px at 75% 100%, hsla(38, 45%, 65%, 0.15), transparent),
      radial-gradient(ellipse 3px 140px at 100% 50%, hsla(148, 40%, 65%, 0.12), transparent),
      /* Cross veins */
      radial-gradient(ellipse 200px 2px at 50% 25%, hsla(176, 50%, 72%, 0.15), transparent),
      radial-gradient(ellipse 2px 160px at 50% 75%, hsla(38, 45%, 68%, 0.12), transparent);
    animation: sporePulse 8s ease-in-out infinite;
  }

  /* Layer 3: Subtle distant heat lightning */
  .spirit__tapestry::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
      ellipse 60% 40% at 50% 20%,
      hsla(176, 40%, 85%, 0.2),
      transparent 70%
    );
    opacity: 0;
    animation: distantFlash 15s ease-in-out infinite;
  }

  /* Spore network breathing */
  @keyframes sporePulse {
    0%   { opacity: 0.5; transform: scale(1); }
    25%  { opacity: 0.8; transform: scale(1.01); }
    50%  { opacity: 0.6; transform: scale(0.99); }
    75%  { opacity: 0.75; transform: scale(1.005); }
    100% { opacity: 0.5; transform: scale(1); }
  }

  /* Subtle flash: brief bright then fade, every 15s */
  @keyframes distantFlash {
    0%, 89% { opacity: 0; }
    90%     { opacity: 0.5; }
    92%     { opacity: 0.1; }
    93%     { opacity: 0.35; }
    95%     { opacity: 0; }
    100%    { opacity: 0; }
  }
}

/* Ambient color orbs: SunLife-style large blurred circles that fill whitespace */
.spirit-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(70px);
  opacity: 0.35;
}

.spirit-orb--1 {
  width: 220px;
  height: 220px;
  background: hsla(176, 50%, 65%, 0.4);
  top: 5%;
  left: -5%;
  animation: orbFloat1 18s ease-in-out infinite;
}

.spirit-orb--2 {
  width: 180px;
  height: 180px;
  background: hsla(38, 55%, 65%, 0.35);
  top: 25%;
  right: -3%;
  animation: orbFloat2 22s ease-in-out infinite;
}

.spirit-orb--3 {
  width: 250px;
  height: 250px;
  background: hsla(270, 30%, 70%, 0.25);
  bottom: 15%;
  left: 10%;
  animation: orbFloat3 20s ease-in-out infinite;
}

.spirit-orb--4 {
  width: 160px;
  height: 160px;
  background: hsla(148, 45%, 60%, 0.3);
  bottom: 5%;
  right: 8%;
  animation: orbFloat4 16s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(30px, 20px); }
  66%      { transform: translate(-15px, 35px); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(-25px, 30px); }
  66%      { transform: translate(20px, -15px); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(35px, -20px); }
  66%      { transform: translate(-20px, -30px); }
}

@keyframes orbFloat4 {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(-20px, -25px); }
  66%      { transform: translate(15px, 20px); }
}


/* =============================================
   Floating Spore Particles
   Real DOM elements, JS-positioned, CSS animated
   ============================================= */
.tapestry-spores {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.spore {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(176, 55%, 70%, 0.6) 0%, transparent 70%);
  box-shadow: 0 0 8px 2px hsla(176, 55%, 65%, 0.3);
  pointer-events: none;
  animation: sporeFloat var(--spore-duration, 8s) ease-in-out infinite,
             sporePulseGlow var(--spore-pulse, 4s) ease-in-out infinite alternate;
  animation-delay: var(--spore-delay, 0s);
}

/* Warm-toned spores */
.spore--warm {
  background: radial-gradient(circle, hsla(38, 55%, 70%, 0.5) 0%, transparent 70%);
  box-shadow: 0 0 8px 2px hsla(38, 55%, 65%, 0.25);
}

/* Lavender-toned spores */
.spore--lavender {
  background: radial-gradient(circle, hsla(270, 35%, 75%, 0.4) 0%, transparent 70%);
  box-shadow: 0 0 8px 2px hsla(270, 35%, 70%, 0.2);
}

@keyframes sporeFloat {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: var(--spore-opacity, 0.7); }
  50% { transform: translate(var(--spore-dx, 20px), var(--spore-dy, -40px)) scale(1.2); }
  90% { opacity: var(--spore-opacity, 0.7); }
  100% { transform: translate(calc(var(--spore-dx, 20px) * 2), calc(var(--spore-dy, -40px) * 2)) scale(0.8); opacity: 0; }
}

@keyframes sporePulseGlow {
  0% { box-shadow: 0 0 8px 2px hsla(176, 55%, 65%, 0.2); }
  100% { box-shadow: 0 0 20px 6px hsla(176, 55%, 65%, 0.5); }
}

/* Depth tier: background particles (small, blurry, distant) */
.spore--bg {
  filter: blur(1.5px);
  z-index: 0;
}

/* Depth tier: foreground particles (large, vivid, close) */
.spore--fg {
  box-shadow: 0 0 18px 5px hsla(176, 55%, 65%, 0.4);
  z-index: 4;
}
.spore--fg.spore--warm {
  box-shadow: 0 0 18px 5px hsla(38, 55%, 65%, 0.35);
}
.spore--fg.spore--lavender {
  box-shadow: 0 0 18px 5px hsla(270, 35%, 70%, 0.3);
}

/* Bokeh background: large soft gradient circles behind cards */
.tapestry-spores::before {
  content: '';
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 80px at 12% 20%, hsla(176, 50%, 55%, 0.12), transparent),
    radial-gradient(circle 60px at 85% 15%, hsla(38, 50%, 60%, 0.1), transparent),
    radial-gradient(circle 100px at 50% 50%, hsla(176, 45%, 50%, 0.08), transparent),
    radial-gradient(circle 70px at 20% 80%, hsla(270, 30%, 60%, 0.09), transparent),
    radial-gradient(circle 90px at 78% 72%, hsla(176, 55%, 50%, 0.1), transparent),
    radial-gradient(circle 50px at 40% 30%, hsla(38, 55%, 55%, 0.08), transparent),
    radial-gradient(circle 75px at 65% 88%, hsla(176, 40%, 58%, 0.1), transparent),
    radial-gradient(circle 55px at 30% 55%, hsla(270, 25%, 65%, 0.07), transparent);
  animation: bokehDrift 30s ease-in-out infinite alternate;
}

@keyframes bokehDrift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10px, -8px) scale(1.03); }
  100% { transform: translate(-8px, 5px) scale(0.98); }
}

/* ============================================
   SPARKLE / FAIRY-DUST PARTICLES
   Diamond-shaped, twinkling, float upward
   ============================================ */
.sparkle {
  position: absolute;
  background: hsla(38, 60%, 65%, 0.7);
  transform: rotate(45deg);
  pointer-events: none;
  box-shadow: 0 0 3px 1px hsla(38, 55%, 60%, 0.3);
  animation:
    sparkleFloat var(--sparkle-duration, 8s) ease-in-out infinite,
    sparkleTwinkle var(--sparkle-twinkle, 2s) ease-in-out infinite alternate;
  animation-delay: var(--sparkle-delay, 0s);
  z-index: 2;
}

.sparkle--bg {
  filter: blur(0.5px);
  opacity: 0.4;
  z-index: 0;
  background: hsla(176, 50%, 65%, 0.4);
}

.sparkle--mid {
  opacity: 0.55;
  z-index: 2;
  box-shadow: 0 0 5px 2px hsla(38, 55%, 65%, 0.3);
}

.sparkle--fg {
  opacity: 0.7;
  z-index: 4;
  background: hsla(38, 60%, 72%, 0.7);
  box-shadow: 0 0 8px 3px hsla(38, 55%, 70%, 0.35),
              0 0 16px 5px hsla(38, 55%, 65%, 0.1);
}

@keyframes sparkleFloat {
  0% { transform: rotate(45deg) translate(0, 0); opacity: 0; }
  15% { opacity: 0.8; }
  50% { transform: rotate(45deg) translate(var(--sparkle-drift, 10px), calc(var(--sparkle-rise, -60px) * 0.5)); }
  85% { opacity: 0.6; }
  100% { transform: rotate(45deg) translate(calc(var(--sparkle-drift, 10px) * 1.5), var(--sparkle-rise, -100px)); opacity: 0; }
}

@keyframes sparkleTwinkle {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.8); }
}

/* ============================================
   FIRE SPARK ANIMATIONS
   Warm ember particles in the dark gradient
   ============================================ */
.fire-spark {
  position: absolute;
  border-radius: 50%;
  background: var(--spark-color, hsl(30, 90%, 60%));
  box-shadow: 0 0 6px 2px var(--spark-color, hsl(30, 90%, 60%)),
              0 0 12px 4px hsla(30, 80%, 50%, 0.3);
  pointer-events: none;
  animation: sparkRise var(--spark-duration, 4s) ease-out infinite;
  animation-delay: var(--spark-delay, 0s);
}

@keyframes sparkRise {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(var(--spark-drift, 10px), calc(var(--spark-rise, -100px) * 0.5)) scale(0.8); opacity: 0.8; }
  100% { transform: translate(calc(var(--spark-drift) * 1.5), var(--spark-rise, -200px)) scale(0.3); opacity: 0; }
}

/* ============================================
   CENTERLINE VINE (Spirit Section)
   SVG vine growing down the center
   ============================================ */
.spirit-vine {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  z-index: 5;
  pointer-events: none;
  opacity: 0.7;
  /* top, height set dynamically by JS to span lotus-to-lotus */
}

.vine-stem {
  stroke-dasharray: 10000;
  stroke-dashoffset: 10000;
  transition: stroke-dashoffset 44s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.vine--growing .vine-stem {
  stroke-dashoffset: 0;
}

.vine-branch {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  transition: stroke-dashoffset 2.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vine--growing .vine-branch {
  stroke-dashoffset: 0;
  transition-delay: var(--branch-delay, 2s);
}

.vine-bulb {
  opacity: 0;
  transform-origin: center;
  transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
}

.vine--growing .vine-bulb {
  opacity: 1;
  transition-delay: var(--bulb-delay, 3s);
}

/* Subtle bulb glow pulse */
@keyframes bulbPulse {
  0%, 100% { r: 3; fill: hsla(140, 40%, 55%, 0.15); }
  50% { r: 4; fill: hsla(140, 40%, 55%, 0.3); }
}

.vine--growing .vine-bulb {
  animation: bulbPulse 4s ease-in-out infinite;
  animation-delay: var(--bulb-delay, 3s);
}

/* Lotus bookend images */
.vine-lotus {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: auto;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s ease-in-out;
}

.vine-lotus--top {
  top: var(--space-lg);
}

.vine-lotus--bottom {
  /* positioned by JS to align with vine end */
  transform: translateX(-50%) scaleY(-1);
}

/* Show lotuses when vine starts growing (parent gets .vine-active) */
.vine-active .vine-lotus {
  opacity: 0.85;
}

/* ============================================
   ATMOSPHERIC DUST (Invitation Section)
   Golden pollen drifting for warmth
   ============================================ */
.atmo-dust {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.dust-mote {
  position: absolute;
  border-radius: 50%;
  background: hsla(38, 60%, 70%, 0.4);
  box-shadow: 0 0 4px 1px hsla(38, 60%, 70%, 0.2);
  pointer-events: none;
  animation: dustFloat var(--dust-duration, 12s) ease-in-out infinite;
  animation-delay: var(--dust-delay, 0s);
}

@keyframes dustFloat {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: 0.5; }
  50% { transform: translate(var(--dust-drift, 15px), var(--dust-float, -20px)); opacity: 0.4; }
  80% { opacity: 0.3; }
  100% { transform: translate(calc(var(--dust-drift) * 2), calc(var(--dust-float) * 2)); opacity: 0; }
}

.spirit__heading {
  font-family: var(--font-body);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  /* Break monochrome: gradient text, cream-to-teal shimmer */
  background: linear-gradient(135deg, hsla(30, 55%, 97%, 0.95), hsla(176, 40%, 75%, 0.9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 8px hsla(176, 55%, 10%, 0.6));
  text-align: center;
  margin-bottom: var(--space-xl);
}

.spirit__narrative {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: 0 var(--space-md);
  text-align: center;
}

.spirit__body {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.8;
  color: var(--color-text);
  max-width: 700px;
  margin: 0 auto;
  text-shadow: 0 0 24px hsla(40, 50%, 50%, 0.08);
}

/* Golden Thread: gold gradient on key emotional phrases */
.golden-thread {
  background: linear-gradient(
    135deg,
    hsl(40, 70%, 55%),
    hsl(35, 80%, 45%),
    hsl(30, 65%, 50%)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  filter: drop-shadow(0 0 6px hsla(40, 70%, 50%, 0.3));
}

/* Ornamental divider between paragraphs */
.spirit__leaf-divider {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) 0;
  color: hsl(38, 60%, 55%);
  filter: drop-shadow(0 0 8px hsla(40, 60%, 50%, 0.3));
  animation: dividerPulse 4s ease-in-out infinite;
}

@keyframes dividerPulse {
  0%, 100% { opacity: 0.8; filter: drop-shadow(0 0 8px hsla(40, 60%, 50%, 0.3)); }
  50% { opacity: 1; filter: drop-shadow(0 0 14px hsla(40, 70%, 55%, 0.5)); }
}

.spirit__tapestry {
  display: grid;
  /* Fixed 2x2 grid: no orphan cards */
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-md);
  margin-bottom: var(--space-md);  /* K2: Was --space-lg (4rem), now 2rem */
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  /* REMOVED overflow:hidden - was clipping all pseudo-element animations */
  overflow: visible;
}

.tapestry-node {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  min-height: 300px;
  border-radius: 12px;
  border: none;
  overflow: hidden;
  isolation: isolate;
  /* Element color accent top-border (overridden per card below) */
  border-top: 3px solid hsla(176, 50%, 50%, 0.3);
  transform: translateZ(0); /* GPU compositing layer */
  transition: transform var(--duration-medium) var(--ease-gentle),
              box-shadow var(--duration-medium) var(--ease-gentle),
              border-top-color var(--duration-medium) var(--ease-gentle);
}

/* --- Photo Layer (<img> sibling, not background-image) --- */
.tapestry-node__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
}

/* --- Glass Overlay (real DOM element, not ::before) ---
   Koa/Scout agreed values:
   Saturation 50% (research), alpha 0.45 (Scout: Commander wants photos),
   blur 10px (Koa compromise: 8 too revealing, 12 too opaque) */
.tapestry-node__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: hsla(176, 50%, 12%, 0.45);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border: none;
  border-radius: inherit;
  transition: background var(--duration-medium) var(--ease-settle),
              backdrop-filter var(--duration-medium) var(--ease-settle),
              -webkit-backdrop-filter var(--duration-medium) var(--ease-settle);
}

/* --- Text Content Layer --- */
.tapestry-node__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* @supports fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
  .tapestry-node__overlay {
    background: hsla(176, 50%, 12%, 0.78);
  }
}

/* --- Hover: Reveal Lift --- */
@media (hover: hover) and (pointer: fine) {
  .tapestry-node:hover {
    transform: translateY(-4px) translateZ(0);
    border-color: hsla(176, 50%, 70%, 0.25);
    box-shadow:
      0 12px 40px hsla(176, 50%, 8%, 0.3),
      0 4px 12px hsla(176, 50%, 8%, 0.15);
  }

  /* Hover: glass clears to reveal photo (Scout's interaction pattern) */
  .tapestry-node:hover .tapestry-node__overlay {
    background: hsla(176, 50%, 12%, 0.25);
    -webkit-backdrop-filter: blur(2px) saturate(160%);
    backdrop-filter: blur(2px) saturate(160%);
  }
}

/* --- Focus Visible --- */
.tapestry-node:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* K-3.3: Card selected glow state (Scout adds/removes via JS) */
.tapestry-node--active {
  border-color: var(--color-secondary);
  box-shadow:
    0 0 20px hsla(22, 55%, 50%, 0.25),
    0 0 60px hsla(22, 55%, 50%, 0.1),
    0 12px 40px hsla(176, 50%, 8%, 0.3);
  transform: translateY(-4px) translateZ(0);
}

.tapestry-node--active .tapestry-node__overlay {
  background: hsla(176, 50%, 12%, 0.3);
  -webkit-backdrop-filter: blur(4px) saturate(160%);
  backdrop-filter: blur(4px) saturate(160%);
}

@media (prefers-reduced-motion: no-preference) {
  .tapestry-node--active {
    animation: cardGlow 1.5s var(--ease-settle) 1;
  }

  @keyframes cardGlow {
    0% { box-shadow: 0 0 0 hsla(22, 55%, 50%, 0); }
    40% { box-shadow: 0 0 30px hsla(22, 55%, 50%, 0.4), 0 0 80px hsla(22, 55%, 50%, 0.15); }
    100% { box-shadow: 0 0 20px hsla(22, 55%, 50%, 0.25), 0 0 60px hsla(22, 55%, 50%, 0.1), 0 12px 40px hsla(176, 50%, 8%, 0.3); }
  }
}

.tapestry-node__title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 400;
  color: hsla(30, 55%, 95%, 1);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.4);
}

/* Element-coded card accents: four elements, four colors */
/* Elements = Earth (terracotta) */
.spirit__tapestry .tapestry-node:nth-child(1) {
  border-top-color: var(--color-secondary);
}
.spirit__tapestry .tapestry-node:nth-child(1):hover {
  box-shadow:
    0 12px 40px hsla(18, 52%, 48%, 0.15),
    0 4px 12px hsla(176, 50%, 8%, 0.15);
}

/* Life = Canopy Green */
.spirit__tapestry .tapestry-node:nth-child(2) {
  border-top-color: var(--color-highlight);
}
.spirit__tapestry .tapestry-node:nth-child(2):hover {
  box-shadow:
    0 12px 40px hsla(145, 32%, 35%, 0.15),
    0 4px 12px hsla(176, 50%, 8%, 0.15);
}

/* Creators = Amber (Fire) */
.spirit__tapestry .tapestry-node:nth-child(3) {
  border-top-color: hsl(38, 60%, 52%);
}
.spirit__tapestry .tapestry-node:nth-child(3):hover {
  box-shadow:
    0 12px 40px hsla(38, 60%, 52%, 0.15),
    0 4px 12px hsla(176, 50%, 8%, 0.15);
}

/* Presence = Amethyst (Ether) */
.spirit__tapestry .tapestry-node:nth-child(4) {
  border-top-color: var(--color-accent);
}
.spirit__tapestry .tapestry-node:nth-child(4):hover {
  box-shadow:
    0 12px 40px hsla(272, 38%, 35%, 0.15),
    0 4px 12px hsla(176, 50%, 8%, 0.15);
}

.tapestry-node__text {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: hsla(0, 0%, 100%, 1);
  text-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.5);
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
}

.tapestry-node__text li {
  margin-bottom: 0.4em;
  letter-spacing: 0.02em;
}

.tapestry-node__text li::before {
  content: "✦";
  font-size: 0.55em;
  color: hsla(38, 80%, 75%, 0.85);
  margin-right: 0.5em;
  vertical-align: middle;
  text-shadow: 0 0 6px hsla(38, 80%, 75%, 0.4);
}

.spirit__core-truth {
  text-align: center;
  padding: var(--space-lg) var(--space-lg);
  position: relative;
  /* Glassmorphic card treatment for visual containment */
  background: hsla(176, 40%, 96%, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid hsla(176, 50%, 70%, 0.12);
  border-top: 3px solid hsla(176, 50%, 50%, 0.2);
  max-width: 800px;
  margin: var(--space-sm) auto 0; /* tight margin so lotus sits on the card */
}

/* Spirit section decorative growing line (Web of Oneness visual) */
.spirit__core-truth::before {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  margin: 0 auto var(--space-md);
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-secondary) 20%,
    var(--color-primary) 50%,
    var(--color-accent) 80%,
    transparent
  );
  border-radius: 1px;
}

/* Scroll-driven: line grows from 60px to full width as you scroll to it */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .spirit__core-truth::before {
      animation: lineGrow linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
    @keyframes lineGrow {
      from { width: 30px; opacity: 0.3; }
      to { width: 200px; opacity: 1; }
    }
  }
}

.spirit__body--emphasized {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--color-secondary);  /* Terracotta accent for emphasis text */
  max-width: 800px;
  margin: 0 auto;
}

/* --- Spirit Card Reveal: Diagonal Wave Stagger --- */
/* Asymmetric delays (0.14/0.16 gap registers as "not a machine") */
/* Cards use .reveal-up class; the stagger adds per-card delay */
.spirit__tapestry .tapestry-node.reveal-up {
  transition: opacity 0.8s var(--ease-arrive),
              transform 0.8s var(--ease-arrive);
}

/* Diagonal wave: top-left, top-right, bottom-left, bottom-right */
.spirit__tapestry .tapestry-node.reveal-up:nth-child(1) { transition-delay: 0s; }
.spirit__tapestry .tapestry-node.reveal-up:nth-child(2) { transition-delay: 0.14s; }
.spirit__tapestry .tapestry-node.reveal-up:nth-child(3) { transition-delay: 0.16s; }
.spirit__tapestry .tapestry-node.reveal-up:nth-child(4) { transition-delay: 0.32s; }

/* Spirit quote reveal (for the core-truth below cards) */
.spirit-quote-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-breathe),
              transform 1s var(--ease-breathe);
  transition-delay: 0.5s; /* arrives after cards finish */
}

.spirit-quote-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion: instant reveal, no transform */
@media (prefers-reduced-motion: reduce) {
  .spirit__tapestry .tapestry-node.reveal-up,
  .spirit-quote-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   EARTH HORIZON TRANSITIONS
   CSS gradient zones between sections
   ============================================ */
.section-horizon {
  height: 100px;  /* K3: Was 80px; more breathing room */
  width: 100%;
}

.section-horizon--spirit-to-invitation {
  height: 40px;
  position: relative;
  background: linear-gradient(
    to bottom,
    hsl(22, 32%, 90%) 0%,
    hsl(22, 28%, 88%) 100%
  );
  border: none;
  outline: none;
}

/* Decorative golden divider line */
.section-horizon--spirit-to-invitation::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(400px, 60%);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    hsla(38, 55%, 65%, 0.5) 20%,
    hsla(176, 45%, 55%, 0.4) 50%,
    hsla(38, 55%, 65%, 0.5) 80%,
    transparent
  );
}
.parallax-divider {
  width: 100%;
  height: 40vh;
  min-height: 300px;
  /* K1/K3: Removed background-attachment: fixed (broken on iOS Safari) */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  z-index: 2; /* Sit above spirit section content to prevent text bleed */
  transform: translateZ(0);  /* GPU compositing layer for scroll perf */
}

/* K1: Ocean sunset replaces tree canopy. Continues dolphin/water thread. */
.parallax-divider--canopy {
  background-image: url('../public/assets/IMG_2322.webp');
}

/* K1: Warm tonal overlay + seamless gradient fade into surrounding sections */
.parallax-divider--canopy::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    hsl(30, 40%, 90%) 0%,
    hsla(30, 40%, 90%, 0.4) 12%,
    transparent 30%,
    transparent 70%,
    hsla(22, 32%, 94%, 0.4) 88%,
    hsl(22, 32%, 94%) 100%
  );
  pointer-events: none;
}

.parallax-divider--canopy::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    hsla(176, 40%, 18%, 0.2) 0%,
    hsla(176, 30%, 25%, 0.1) 40%,
    hsla(22, 32%, 90%, 0.25) 100%
  );
  pointer-events: none;
}

/* K3: Improved crossfade. Was abrupt gray band; now warm breathe. */
.section-horizon--invitation-to-story {
  background: linear-gradient(
    to bottom,
    hsl(22, 32%, 94%) 0%,
    hsl(28, 32%, 92%) 40%,
    hsl(30, 28%, 93%) 100%
  );
  box-shadow: inset 0 2px 20px hsla(30, 20%, 50%, 0.08);
}

.section-horizon--story-to-connection {
  height: 40px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    hsl(22, 20%, 82%) 0%,
    hsl(15, 8%, 8%) 100%
  );
}

/* Golden divider line at the top of the black zone */
.section-horizon--story-to-connection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, 70%);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    hsla(30, 50%, 55%, 0.4) 20%,
    hsla(30, 60%, 65%, 0.6) 50%,
    hsla(30, 50%, 55%, 0.4) 80%,
    transparent
  );
  z-index: 2;
}

/* Fire sparks container inside the gradient */
.fire-sparks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  max-width: none;
  width: 100%;
}


/* ============================================
   SECTION 3: THE INVITATION (Fire)
   Ethical Conversion: warm CTA, no dark patterns
   Animation: CTA Micro-Gravity
   ============================================ */
.section--invitation {
  /* Light veil: tree photo shows through prominently */
  background:
    linear-gradient(
      to bottom,
      hsla(22, 32%, 90%, 1) 0%,
      hsla(22, 32%, 90%, 0.65) 5%,
      hsla(140, 12%, 85%, 0.30) 15%,
      hsla(140, 10%, 82%, 0.22) 35%,
      hsla(140, 8%, 80%, 0.18) 55%,
      hsla(30, 15%, 85%, 0.25) 80%,
      hsla(30, 25%, 88%, 0.35) 100%
    ),
    url('../public/assets/fanal-forest-tree.webp');
  background-position: center center;
  background-size: cover;
  position: relative;
  overflow: hidden;
}

/* Ambient warm light pools drifting through the invitation section */
@media (prefers-reduced-motion: no-preference) {
  .section--invitation::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(ellipse 300px 200px at 15% 30%, hsla(38, 60%, 52%, 0.15), transparent),
      radial-gradient(ellipse 250px 250px at 80% 60%, hsla(176, 50%, 38%, 0.12), transparent),
      radial-gradient(ellipse 200px 300px at 50% 80%, hsla(18, 52%, 48%, 0.1), transparent);
    animation: invitationDrift 20s ease-in-out infinite alternate;
  }

  @keyframes invitationDrift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    50% { transform: translate(15px, -10px) scale(1.05); opacity: 1; }
    100% { transform: translate(-10px, 8px) scale(0.98); opacity: 0.8; }
  }

  /* Warm glow wash that breathes behind the form */
  .section--invitation::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 60%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
      ellipse at center,
      hsla(22, 55%, 50%, 0.12) 0%,
      hsla(38, 60%, 52%, 0.08) 40%,
      transparent 70%
    );
    animation: warmBreathe 8s ease-in-out infinite;
  }

  @keyframes warmBreathe {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
  }
}

/* Ensure content is above ambient layers */
.section--invitation .invitation__content {
  position: relative;
  z-index: 1;
}

.invitation__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  /* Glassmorphic content panel: frosted glass over the tree */
  background: hsla(176, 20%, 22%, 0.55);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-radius: 28px;
  padding: var(--space-xl) var(--space-lg);
  border: 1px solid hsla(176, 40%, 60%, 0.2);
  box-shadow:
    0 8px 32px hsla(176, 50%, 10%, 0.15),
    inset 0 1px 0 hsla(0, 0%, 100%, 0.1);
  max-width: 720px;
}

/* Warm mycelium particles floating through invitation whitespace */
@media (prefers-reduced-motion: no-preference) {
  .invitation__content::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(1.5px 1.5px at 10% 25%, hsla(38, 60%, 70%, 0.4), transparent),
      radial-gradient(1px 1px at 25% 55%, hsla(22, 50%, 75%, 0.35), transparent),
      radial-gradient(2px 2px at 40% 15%, hsla(176, 50%, 70%, 0.3), transparent),
      radial-gradient(1px 1px at 55% 80%, hsla(38, 55%, 65%, 0.4), transparent),
      radial-gradient(1.5px 1.5px at 70% 35%, hsla(22, 45%, 72%, 0.35), transparent),
      radial-gradient(1px 1px at 85% 70%, hsla(176, 60%, 75%, 0.3), transparent),
      radial-gradient(2px 2px at 15% 90%, hsla(38, 50%, 68%, 0.35), transparent),
      radial-gradient(1px 1px at 60% 42%, hsla(22, 55%, 78%, 0.3), transparent),
      radial-gradient(1.5px 1.5px at 90% 18%, hsla(176, 45%, 72%, 0.35), transparent),
      radial-gradient(1px 1px at 35% 68%, hsla(38, 60%, 75%, 0.3), transparent);
    animation: myceliumDrift 25s ease-in-out 5s infinite;
  }
}

.invitation__heading {
  color: hsl(40, 40%, 97%);
  text-shadow: 0 1px 8px hsla(176, 50%, 10%, 0.4);
}

.invitation__description {
  max-width: 550px;
  color: hsl(40, 25%, 92%);
}

.invitation__free {
  font-weight: 500;
  color: hsl(176, 45%, 75%);
}

/* --- Offering Trinity: three flagship experiences --- */
.invitation__offerings {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding: var(--space-sm) 0;
}

.offering {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.offering__icon {
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* K6: SVG icon styles (Scout replaces emoji spans with inline SVGs) */
.offering__icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--color-primary-light);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--duration-medium) var(--ease-gentle),
              transform var(--duration-medium) var(--ease-gentle);
}

.offering:hover .offering__icon svg {
  stroke: var(--color-secondary);
  transform: translateY(-2px);
}

.offering__label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: hsl(40, 20%, 88%);
  font-weight: 500;
  text-transform: lowercase;
}

.invitation__form-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  max-width: 560px;
  margin-top: var(--space-sm);
  /* Glassmorphic card: nested glass inside the content panel */
  background: hsla(176, 25%, 15%, 0.6);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid hsla(176, 40%, 55%, 0.2);
  border-radius: 20px;
  padding: var(--space-lg) var(--space-md);
  box-shadow:
    0 8px 32px hsla(176, 50%, 10%, 0.08),
    0 2px 8px hsla(176, 40%, 20%, 0.04),
    inset 0 1px 0 hsla(0, 0%, 100%, 0.35);
  transition: border-color var(--duration-slow) var(--ease-settle),
              box-shadow var(--duration-slow) var(--ease-settle);
  position: relative;
}

/* Two-column form row */
.form__row {
  display: flex;
  gap: 12px;
  width: 100%;
}
.form__row .form__field {
  flex: 1 1 0;
}

/* Select and textarea matching input style */
.form__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.form__select option {
  background: #fff;
  color: var(--color-text);
}
.form__textarea {
  resize: vertical;
  min-height: 48px;
  max-height: 100px;
  font-family: var(--font-body);
  line-height: 1.5;
}

/* Ceremony warmth: radial firelight glow behind form */
.invitation__form-container::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 120%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    hsla(22, 55%, 50%, 0.06) 0%,
    hsla(30, 45%, 55%, 0.03) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

@media (min-width: 768px) {
  .invitation__form-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
  }
}

/* K-3.4: Giver Tags — styled as mini spirit cards for section cohesion */
.giver-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: var(--space-md);
  max-width: 640px;
  width: 100%;
  justify-content: center;
  /* Dark glassmorphic container */
  background: hsla(176, 20%, 15%, 0.45);
  border-radius: 20px;
  border: 1px solid hsla(176, 40%, 50%, 0.15);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep across the pills container */
@media (prefers-reduced-motion: no-preference) {
  .giver-pills::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
      110deg,
      transparent 25%,
      hsla(176, 50%, 70%, 0.08) 45%,
      hsla(38, 55%, 65%, 0.1) 50%,
      hsla(176, 50%, 70%, 0.08) 55%,
      transparent 75%
    );
    background-size: 200% 100%;
    animation: pillsShimmer 6s ease-in-out infinite;
  }

  @keyframes pillsShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
}

/* "How would you like to show up?" prompt styling */
.form__pills-prompt {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-primary-light);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--space-xs);
}

.giver-pill {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 18px 20px;
  border: 1px solid hsla(176, 50%, 70%, 0.15);
  border-radius: 12px;
  border-top: 3px solid hsla(176, 50%, 50%, 0.3);
  background: hsla(176, 20%, 18%, 0.5);
  color: hsl(40, 25%, 95%);
  cursor: pointer;
  min-height: 78px;
  flex: 1 1 calc(33.33% - 16px);
  min-width: 120px;
  max-width: calc(50% - 8px);
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-medium) var(--ease-settle),
              color var(--duration-medium) var(--ease-settle),
              border-color var(--duration-medium) var(--ease-settle),
              transform 150ms var(--ease-gentle),
              box-shadow var(--duration-medium) var(--ease-settle);
}

/* Element-coded backgrounds per giver tag */
.giver-pill[data-tag="participant"] {
  border-top-color: hsla(200, 55%, 50%, 0.5);
  background: hsla(200, 45%, 55%, 0.08);
}
.giver-pill[data-tag="builder"] {
  border-top-color: hsla(145, 45%, 42%, 0.5);
  background: hsla(145, 35%, 50%, 0.08);
}
.giver-pill[data-tag="visionary"] {
  border-top-color: hsla(272, 45%, 45%, 0.5);
  background: hsla(272, 35%, 55%, 0.08);
}
.giver-pill[data-tag="investor"] {
  border-top-color: hsla(38, 60%, 52%, 0.5);
  background: hsla(38, 50%, 55%, 0.08);
}
.giver-pill[data-tag="connector"] {
  border-top-color: hsla(176, 50%, 45%, 0.5);
  background: hsla(176, 40%, 50%, 0.08);
}
.giver-pill[data-tag="creator"] {
  border-top-color: hsla(18, 52%, 48%, 0.5);
  background: hsla(18, 45%, 52%, 0.08);
}

/* All-in pill: full-width, distinct accent gradient */
.giver-pill--all-in {
  flex: 1 1 100%;
  max-width: 100%;
  min-height: 68px;
  background: linear-gradient(135deg, hsla(176, 40%, 50%, 0.1), hsla(38, 50%, 55%, 0.1));
  border-top: 3px solid;
  border-image: linear-gradient(90deg, hsla(176, 50%, 50%, 0.5), hsla(38, 55%, 55%, 0.5)) 1;
  border-image-slice: 1;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.giver-pill--all-in:hover {
  background: linear-gradient(135deg, hsla(176, 40%, 50%, 0.18), hsla(38, 50%, 55%, 0.18));
}

/* SVG icon above label */
.giver-pill__icon {
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  color: var(--color-primary-light);
  opacity: 0.8;
  transition: opacity var(--duration-medium) var(--ease-settle),
              color var(--duration-medium) var(--ease-settle),
              transform var(--duration-medium) var(--ease-settle);
}

.giver-pill__icon svg {
  width: 100%;
  height: 100%;
}

.giver-pill:hover .giver-pill__icon {
  opacity: 1;
  color: hsl(40, 50%, 85%);
  transform: scale(1.15);
}

/* Hover: subtle lift and glass brightening (mirrors spirit card hover) */
.giver-pill:hover {
  background: hsla(176, 40%, 30%, 0.5);
  transform: translateY(-2px);
  border-color: hsla(176, 50%, 70%, 0.25);
  box-shadow:
    0 4px 16px hsla(176, 50%, 20%, 0.08),
    0 1px 4px hsla(176, 50%, 20%, 0.06);
}

.giver-pill:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Active state: solid fill matching spirit card --active glow */
.giver-pill--active {
  background: hsla(176, 45%, 35%, 0.45);
  color: var(--color-text);
  border-color: var(--color-primary);
  box-shadow:
    0 0 12px hsla(176, 50%, 38%, 0.15),
    0 4px 16px hsla(176, 50%, 20%, 0.08);
}

.giver-pill--active:hover {
  background: hsla(176, 50%, 12%, 0.18);
  border-color: var(--color-primary);
}

.giver-pill__label {
  pointer-events: none;
  color: hsl(40, 25%, 95%);
  font-weight: 500;
}

.giver-pill__reveal {
  display: block;
  max-height: 0;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 400;
  font-style: italic;
  color: hsl(176, 20%, 72%);
  line-height: 1.4;
  margin-top: 0;
  opacity: 0;
  transition: max-height 0.4s var(--ease-arrive),
              opacity 0.3s var(--ease-arrive),
              margin-top 0.3s var(--ease-arrive);
}

.giver-pill--active + .giver-pill__reveal,
.giver-pill--active .giver-pill__reveal {
  max-height: 80px;
  opacity: 1;
  margin-top: 6px;
}

/* K-3.5: Archetype-Adaptive Form Theming */
.invitation__form-container[data-archetype="elements"] {
  --archetype-accent: hsl(30, 45%, 55%);
  --archetype-glow: hsla(30, 45%, 55%, 0.12);
}

.invitation__form-container[data-archetype="life"] {
  --archetype-accent: hsl(148, 40%, 42%);
  --archetype-glow: hsla(148, 40%, 42%, 0.12);
}

.invitation__form-container[data-archetype="creators"] {
  --archetype-accent: hsl(38, 60%, 52%);
  --archetype-glow: hsla(38, 60%, 52%, 0.12);
}

.invitation__form-container[data-archetype="presence"] {
  --archetype-accent: hsl(270, 35%, 55%);
  --archetype-glow: hsla(270, 35%, 55%, 0.12);
}

.invitation__form-container[data-archetype="all"] {
  --archetype-accent: var(--color-primary);
  --archetype-glow: hsla(176, 50%, 38%, 0.12);
}

/* When archetype is set, form inputs and button adopt the accent */
.invitation__form-container[data-archetype] .form__input:focus {
  border-color: var(--archetype-accent);
  box-shadow: 0 0 0 4px var(--archetype-glow);
}

.invitation__form-container[data-archetype] .form__button {
  background-color: var(--archetype-accent);
}

.invitation__form-container[data-archetype] .form__button:hover {
  filter: brightness(0.9);
  box-shadow: 0 4px 20px var(--archetype-glow);
}

/* --- Flow Waypoints (Lotus) --- decorative separator, not dead space */
.flow-waypoint {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-xs) 0;
  opacity: 0.5;
}

.flow-waypoint img {
  width: 64px;
  height: 64px;
  filter: none;
  opacity: 0.8;
}

@media (prefers-reduced-motion: no-preference) {
  .flow-waypoint img {
    animation: lotusBreathe 4s ease-in-out infinite;
  }
  @keyframes lotusBreathe {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
  }
}

.invitation__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  max-width: 480px;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.form__field--optional {
  opacity: 1;
}

.form__label {
  font-size: 0.9rem;
  color: hsl(40, 25%, 90%);
  letter-spacing: 0.03em;
  font-weight: 500;
}

.form__optional {
  font-weight: 400;
  opacity: 0.6;
  font-size: 0.85em;
  color: hsl(176, 12%, 68%);
}

.form__input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 16px;
  border: 1px solid hsla(176, 30%, 50%, 0.3);
  border-radius: 8px;
  background-color: hsla(176, 15%, 12%, 0.5);
  color: hsl(40, 25%, 92%);
  transition:
    border-color var(--duration-medium) var(--ease-gentle),
    box-shadow var(--duration-medium) var(--ease-gentle);
  /* Touch target: 48px minimum */
  min-height: 48px;
}

.form__input::placeholder {
  color: hsl(176, 15%, 60%);
  opacity: 0.8;
}

/* Gentle focus: warm glow with ambient golden ring */
.form__input:focus {
  outline: none;
  border-color: hsl(40, 50%, 60%);
  box-shadow:
    0 0 0 3px hsla(176, 50%, 38%, 0.2),
    0 0 16px hsla(40, 60%, 50%, 0.15),
    0 0 32px hsla(40, 50%, 45%, 0.08);
}

/* Label teal shift when sibling input is focused */
.form__field:focus-within .form__label {
  color: hsl(176, 50%, 70%);
  transition: color var(--duration-medium) var(--ease-gentle);
}

.form__button {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  padding: 16px 32px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  cursor: pointer;
  transition:
    background-color var(--duration-medium) var(--ease-gentle),
    transform 200ms var(--ease-gentle),
    box-shadow var(--duration-medium) var(--ease-gentle);
  /* Touch target: 48px minimum */
  min-height: 48px;
  margin-top: var(--space-xs);
  box-shadow: 0 4px 15px hsla(176, 55%, 20%, 0.2);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep on button (the glow inviting you) */
@media (prefers-reduced-motion: no-preference) {
  .form__button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      hsla(176, 60%, 80%, 0.15),
      transparent
    );
    animation: buttonShimmer 4s var(--ease-gentle) infinite;
    animation-delay: 2s;
  }

  @keyframes buttonShimmer {
    0% { left: -100%; }
    30% { left: 120%; }
    100% { left: 120%; }
  }
}

.form__button:hover {
  background-color: var(--color-primary-dark);
  box-shadow: 0 4px 20px hsla(176, 55%, 20%, 0.25);
}

.form__button:active {
  transform: scale(0.98);
}

/* --- CTA Micro-Gravity: leaf on still water --- */
@media (prefers-reduced-motion: no-preference) {
  .form__button {
    animation: microGravity 4s var(--ease-gentle) infinite;
  }

  .form__button:hover {
    animation-play-state: paused;
  }

  @keyframes microGravity {
    0% { transform: translateY(0); }
    20% { transform: translateY(-1.5px); }
    40% { transform: translateY(0.5px); }
    70% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
  }
}

.form__assurance {
  font-size: 0.85rem;
  color: hsl(176, 15%, 65%);
  text-align: center;
  line-height: 1.5;
}

/* Confirmation state */
.form__confirmation {
  text-align: center;
  padding: var(--space-md);
}

.form__confirmation-text {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-highlight);
  line-height: 1.7;
  max-width: 440px;
}


/* ============================================
   SECTION 4: THE STORY (Earth)
   Custom Art + Blended Graphics: no stock
   ============================================ */
.section--story {
  /* PARALLAX WAVE BACKGROUND */
  background-image: linear-gradient(to bottom, hsla(30, 28%, 93%, 0.9), hsla(176, 50%, 90%, 0.8)), url('../public/assets/IMG_0943_Facetune_07-03-2026-15-27-14.webp');
  /* K3: Removed background-attachment: fixed (broken iOS Safari) */
  background-position: center;
  background-size: cover;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

/* K4: Story section zoom reveal (CSS scroll-driven) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .section--story {
      animation: storyZoom linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 50%;
    }
    @keyframes storyZoom {
      from { background-size: 115% auto; }
      to { background-size: cover; }
    }
  }
}

/* K4: Story name reveal with ceremonial easing */
.story__name.reveal-up {
  transition: opacity 1.2s var(--ease-arrive),
              transform 1.2s var(--ease-arrive);
}

.story__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .story__content {
    flex-direction: row;
    align-items: center;
    gap: var(--space-xl);
    max-width: 900px;
    margin: 0 auto;
  }
  .story__image-container {
    flex: 0 0 280px;
  }
  .story__text {
    flex: 1;
    text-align: left;
  }
}

.story__image-container {
  width: 100%;
  max-width: 500px;
}

.story__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
}

.story__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.story__name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 0.02em;
}

.story__meaning {
  font-size: 1.1rem;
  color: var(--color-primary);
}

.story__bio {
  max-width: 550px;
  margin: 0 auto;
}

.story__art {
  width: 100%;
  max-width: 600px;
}

.story__painting {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 8px;
}


/* ============================================
   SECTION 5: THE CONNECTION (Water)
   Sustainable UX: dark footer, eco-conscious
   Animation: Footer Bioluminescence
   ============================================ */
.section--connection {
  background-color: hsl(15, 8%, 8%);
  color: var(--color-primary-light);
  padding: var(--space-xl) var(--space-md);
  position: relative;
  overflow: hidden;
}

.footer--night-fire {
  /* Dark overlay on top for seamless gradient merge + text readability */
  background:
    linear-gradient(
      to bottom,
      hsl(15, 8%, 8%) 0%,
      hsla(15, 8%, 8%, 0.7) 15%,
      hsla(0, 0%, 0%, 0.3) 50%,
      hsla(0, 0%, 0%, 0.5) 75%,
      hsl(0, 0%, 0%) 100%
    ),
    url('../public/assets/IMG_0236.webp');
  background-size: cover, cover;
  /* Show the dancing woman fire shape prominently */
  background-position: center, center 30%;
  min-height: 60vh;
}

/* --- Footer Bioluminescence: ocean glowing at night --- */
@media (prefers-reduced-motion: no-preference) {
  .section--connection::before,
  .section--connection::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
  }

  /* Layer 1: 8 dots */
  .section--connection::before {
    background:
      radial-gradient(2px 2px at 10% 20%, hsla(176, 60%, 65%, 0.6), transparent),
      radial-gradient(3px 3px at 25% 70%, hsla(174, 55%, 55%, 0.5), transparent),
      radial-gradient(1.5px 1.5px at 40% 30%, hsla(180, 50%, 70%, 0.4), transparent),
      radial-gradient(4px 4px at 55% 80%, hsla(172, 60%, 60%, 0.5), transparent),
      radial-gradient(2px 2px at 70% 15%, hsla(178, 55%, 65%, 0.6), transparent),
      radial-gradient(3px 3px at 80% 60%, hsla(176, 50%, 55%, 0.4), transparent),
      radial-gradient(1.5px 1.5px at 90% 40%, hsla(174, 60%, 70%, 0.5), transparent),
      radial-gradient(2.5px 2.5px at 15% 90%, hsla(180, 55%, 60%, 0.4), transparent);
    animation: biolumPulse1 6s ease-in-out infinite;
  }

  /* Layer 2: 5 dots, offset phase */
  .section--connection::after {
    background:
      radial-gradient(2.5px 2.5px at 18% 45%, hsla(176, 55%, 65%, 0.5), transparent),
      radial-gradient(3.5px 3.5px at 35% 15%, hsla(178, 60%, 55%, 0.4), transparent),
      radial-gradient(2px 2px at 60% 55%, hsla(174, 50%, 70%, 0.6), transparent),
      radial-gradient(3px 3px at 75% 85%, hsla(180, 55%, 60%, 0.5), transparent),
      radial-gradient(1.5px 1.5px at 88% 25%, hsla(172, 60%, 65%, 0.4), transparent);
    animation: biolumPulse2 6s ease-in-out 3s infinite;
  }

  @keyframes biolumPulse1 {
    0%, 100% { opacity: 0.3; }
    25% { opacity: 0.8; }
    50% { opacity: 0.5; }
    75% { opacity: 1; }
  }

  @keyframes biolumPulse2 {
    0%, 100% { opacity: 0.5; }
    30% { opacity: 1; }
    60% { opacity: 0.3; }
    85% { opacity: 0.7; }
  }
}

.connection__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  /* Frosted dark scrim behind text for guaranteed readability over fire */
  background: hsla(0, 0%, 0%, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 20px;
  padding: var(--space-xl) var(--space-2xl);
  max-width: 700px;
  margin: 0 auto;
  text-shadow:
    0 2px 16px rgba(0,0,0,0.9),
    0 0 40px rgba(0,0,0,0.7),
    0 0 80px rgba(0,0,0,0.4);
}

.connection__closing {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: hsl(50, 100%, 92%);
  text-shadow:
    0 0 8px hsla(45, 100%, 75%, 0.9),
    0 0 20px hsla(40, 100%, 65%, 0.7),
    0 0 40px hsla(35, 90%, 55%, 0.5),
    0 0 80px hsla(30, 80%, 50%, 0.3),
    0 2px 4px rgba(0,0,0,1);
  transition: text-shadow 0.4s ease, color 0.4s ease;
  cursor: default;
}

.connection__closing:hover {
  color: hsl(50, 100%, 97%);
  text-shadow:
    0 0 12px hsla(45, 100%, 80%, 1),
    0 0 30px hsla(40, 100%, 70%, 0.9),
    0 0 60px hsla(35, 95%, 60%, 0.7),
    0 0 120px hsla(30, 85%, 55%, 0.4),
    0 2px 4px rgba(0,0,0,1);
}

.connection__subclose {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: hsl(48, 100%, 90%);
  margin-top: calc(var(--space-xs) * -1);
  text-shadow:
    0 0 6px hsla(45, 100%, 75%, 0.7),
    0 0 16px hsla(40, 90%, 60%, 0.5),
    0 0 35px hsla(35, 80%, 50%, 0.3),
    0 2px 4px rgba(0,0,0,1);
}

.connection__nav {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

.connection__nav-link {
  color: hsl(48, 90%, 90%);
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  text-shadow:
    0 0 4px hsla(45, 90%, 70%, 0.6),
    0 0 12px hsla(40, 80%, 55%, 0.3),
    0 1px 3px rgba(0,0,0,1);
}

.connection__nav-link:hover {
  color: hsl(50, 100%, 97%);
  text-shadow:
    0 0 8px hsla(45, 100%, 80%, 0.9),
    0 0 20px hsla(40, 95%, 65%, 0.6),
    0 0 40px hsla(35, 85%, 55%, 0.3),
    0 1px 3px rgba(0,0,0,1);
}

.connection__social {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: center;
}

.connection__social-divider {
  color: hsl(38, 40%, 65%);
  opacity: 0.5;
  font-size: 1.2rem;
  line-height: 1;
}

.connection__social-link {
  color: hsl(48, 85%, 88%);
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  text-shadow:
    0 0 4px hsla(45, 90%, 70%, 0.5),
    0 0 12px hsla(40, 80%, 55%, 0.3),
    0 1px 3px rgba(0,0,0,1);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.connection__social-link:hover {
  color: hsl(50, 100%, 97%);
  text-shadow:
    0 0 8px hsla(45, 100%, 80%, 0.9),
    0 0 20px hsla(40, 95%, 65%, 0.5),
    0 1px 3px rgba(0,0,0,1);
}

.connection__donate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.donate-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  border: 1px solid hsla(40, 60%, 60%, 0.35);
  border-radius: 50px;
  background: hsla(40, 30%, 20%, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: hsl(40, 50%, 90%);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  box-shadow:
    0 2px 16px hsla(40, 60%, 40%, 0.2),
    inset 0 1px 0 hsla(40, 60%, 80%, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.donate-pill:hover {
  transform: translateY(-3px);
  border-color: hsla(40, 70%, 65%, 0.6);
  box-shadow:
    0 8px 32px hsla(40, 70%, 45%, 0.35),
    0 0 20px hsla(40, 60%, 50%, 0.15),
    inset 0 1px 0 hsla(40, 60%, 80%, 0.15);
}

.donate-pill__arrow {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
  opacity: 0.7;
}

.donate-pill:hover .donate-pill__arrow {
  transform: translateX(4px);
  opacity: 1;
}

.connection__donate-sub {
  font-size: 0.95rem;
  color: hsl(40, 40%, 85%);
  opacity: 0.85;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.connection__legal {
  font-size: 0.9rem;
  opacity: 0.7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: hsl(40, 30%, 80%);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* ============================================
   ARCHETYPE MODAL (Glassmorphism)
   Scout builds DOM (#archetype-modal); Koa styles.
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: hsla(176, 55%, 8%, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.modal__container {
  position: relative;
  z-index: 1;
  max-width: 520px;
  width: 100%;
  padding: var(--space-lg);
  border-radius: 16px;
  background: hsla(176, 50%, 12%, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid hsla(176, 30%, 80%, 0.15);
  border-top-color: hsla(176, 30%, 90%, 0.25);
  box-shadow:
    0 24px 80px hsla(176, 50%, 5%, 0.5),
    0 8px 24px hsla(176, 50%, 5%, 0.25);
  color: var(--color-white);
  text-align: center;
  animation: modalReveal 0.5s var(--ease-arrive) both;
}

@keyframes modalReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  color: hsla(30, 50%, 90%, 0.7);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  border-radius: 50%;
  transition: color var(--duration-medium) var(--ease-gentle),
              background var(--duration-medium) var(--ease-gentle);
}

.modal__close:hover {
  color: var(--color-white);
  background: hsla(176, 30%, 80%, 0.12);
}

.modal__close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.modal__heading {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: hsla(30, 55%, 95%, 1);
  margin-bottom: var(--space-xs);
}

.modal__intro {
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  color: hsla(30, 30%, 85%, 0.8);
  margin-bottom: var(--space-md);
}

.modal__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.modal__option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-md) var(--space-sm);
  background: hsla(176, 40%, 18%, 0.4);
  border: 1px solid hsla(176, 30%, 70%, 0.1);
  border-radius: 12px;
  color: var(--color-white);
  cursor: pointer;
  text-align: center;
  transition: background var(--duration-medium) var(--ease-settle),
              border-color var(--duration-medium) var(--ease-settle),
              transform 200ms var(--ease-gentle),
              box-shadow var(--duration-medium) var(--ease-settle),
              border-top-color var(--duration-medium) var(--ease-settle);
  min-height: 48px;
  border-top: 3px solid transparent;
}

/* Modal element-coded top accents (same colors as spirit cards) */
.modal__options .modal__option:nth-child(1) { border-top-color: var(--color-secondary); }
.modal__options .modal__option:nth-child(2) { border-top-color: var(--color-highlight); }
.modal__options .modal__option:nth-child(3) { border-top-color: hsl(38, 60%, 52%); }
.modal__options .modal__option:nth-child(4) { border-top-color: var(--color-accent); }

.modal__option:hover {
  background: hsla(176, 45%, 22%, 0.55);
  border-color: hsla(176, 40%, 70%, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px hsla(176, 50%, 8%, 0.3);
}

.modal__option:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.modal__option--all {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  font-style: italic;
  background: hsla(176, 30%, 15%, 0.3);
  border-style: dashed;
}

.modal__option-name {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  color: hsla(30, 55%, 95%, 1);
}

.modal__option-desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: hsla(30, 30%, 85%, 0.75);
  line-height: 1.4;
}


/* ============================================
   RESPONSIVE: Mobile-First
   ============================================ */
@media (max-width: 768px) {
  :root {
    --section-padding: var(--space-xl) var(--space-sm);
  }

  h1 {
    font-size: clamp(2.8rem, 12vw, 4.5rem);
  }

  .connection__nav {
    gap: var(--space-sm);
  }

  .section-horizon {
    height: 50px;
  }

  .arrival__scroll-hint {
    bottom: var(--space-md);
  }

  .spirit__tapestry {
    grid-template-columns: 1fr;
  }

  .tapestry-node {
    min-height: 240px;
  }

  /* Modal: single column on mobile */
  .modal__options {
    grid-template-columns: 1fr;
  }

  .modal__container {
    padding: var(--space-md);
  }

  /* Pills: 2 per row on mobile, all-in spans full */
  .giver-pills {
    max-width: 100%;
  }
  .giver-pill {
    flex: 1 1 calc(50% - 8px);
    max-width: calc(50% - 6px);
  }
  .giver-pill--all-in {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Form rows stack on mobile */
  .form__row {
    flex-direction: column;
    gap: var(--space-sm);
  }

  /* Vine hidden on mobile (too small to see) */
  .spirit-vine {
    display: none;
  }

  /* Story alignment: stack on mobile */
  .story__content {
    flex-direction: column;
    text-align: center;
  }
}

@media (min-width: 1200px) {
  .story__content {
    max-width: 1000px;
  }

  .story__image-container {
    flex: 0 0 340px;
  }

  .story__art {
    grid-column: 1 / -1;
  }
}


/* ============================================
   REDUCED MOTION: respect user preferences
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }



  .arrival__logo-wrapper,
  .arrival__wordmark,
  .arrival__prelude,
  .arrival__tagline,
  .arrival__scroll-hint {
    opacity: 1;
    animation: none;
  }
  
  .arrival__logo {
    animation: none;
  }

  .arrival__image-layer {
    filter: none;
    transform: none;
  }
}
