/* ══════════════════════════════════════════════════════════════════════
   Symvolia — Living Environment
   Cosmic dark continuity: dust, journey locks, breathing CTA, section moods.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Journey lock during cinematic opening ── */
html.is-intro,
html.is-journey-locked {
  overflow: hidden;
  cursor: none;
}

html.is-intro .sound-toggle,
html.is-journey-locked .sound-toggle {
  cursor: pointer;
}

html.is-intro body,
html.is-journey-locked body {
  overflow: hidden;
}

/* ── Cosmic dust layer ── */
.cosmic-dust {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s ease-out;
}

body.is-stage-alive .cosmic-dust,
html.is-journey-alive .cosmic-dust,
body.is-entered .cosmic-dust {
  opacity: 1;
}

.cosmic-dust canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Soft cosmic depth wash behind content after entry */
body.is-entered::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(10, 26, 61, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(26, 0, 51, 0.12), transparent 65%);
  opacity: 0.85;
  transition: opacity 1.2s ease-out, background 1.2s ease-out;
}

body.is-entered[data-mood="bio"]::before {
  background:
    radial-gradient(ellipse 70% 45% at 50% 20%, rgba(10, 26, 61, 0.22), transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 80%, rgba(26, 0, 51, 0.1), transparent 60%);
}

body.is-entered[data-mood="archive"]::before {
  background:
    radial-gradient(ellipse 80% 55% at 50% 40%, rgba(10, 26, 61, 0.28), transparent 72%),
    radial-gradient(ellipse 40% 30% at 20% 70%, rgba(74, 26, 111, 0.12), transparent 55%);
}

body.is-entered[data-mood="contact"]::before {
  background:
    radial-gradient(ellipse 60% 40% at 50% 80%, rgba(26, 0, 51, 0.16), transparent 65%),
    radial-gradient(ellipse 50% 30% at 50% 10%, rgba(10, 26, 61, 0.14), transparent 60%);
}

/* ── Tagline / Enter: orchestrated by journey classes (not wall-clock CSS) ── */
.stage__tagline {
  animation: none;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.9s cubic-bezier(0.19, 1, 0.22, 1);
}

html.is-journey-alive .stage__tagline {
  opacity: 1;
  transform: translateY(0);
}

.stage__enter {
  animation: none;
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  transition:
    opacity 0.7s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
}

html.is-journey-cta .stage__enter {
  opacity: 1;
  transform: translateY(0) scale(1);
}

html.is-journey-cta .stage__enter.is-active .stage__enter-btn {
  animation: envEnterFloat 3.2s ease-in-out infinite;
}

html.is-journey-cta .stage__enter-hint {
  animation: envHintBreathe 2.4s ease-in-out infinite;
}

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

@keyframes envHintBreathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

/* Enter button: soft gold glow on hover (cosmic, not flashy) */
.stage__enter-btn:hover,
.stage__enter-btn:focus-visible {
  box-shadow:
    0 0 24px rgba(212, 175, 55, 0.18),
    0 0 48px rgba(74, 26, 111, 0.12);
}

/* ── Soft section fade veil during in-page navigation ── */
.section-veil {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: #010101;
  opacity: 0;
  transition: opacity 0.45s ease-out;
}

.section-veil.is-on {
  opacity: 0.35;
}

/* Main content sits above the cosmic wash */
.main {
  position: relative;
  z-index: 1;
}

/* ── Social / nav cohesion ── */
.stage__social-link:hover,
.stage__social-link:focus-visible,
.main__social-link:hover,
.main__social-link:focus-visible {
  color: #d4af37;
  transform: translateY(-2px) scale(1.12) rotate(4deg);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.2);
}

/* Intro veil (legacy black hold) — disabled; portal never cuts to black */
.intro.is-veil .intro__canvas {
  opacity: 1;
}

.intro.is-portal-handoff {
  background: transparent;
  transition: opacity 1.1s cubic-bezier(0.19, 1, 0.22, 1);
}

.intro.is-portal-handoff .intro__canvas {
  /* Opacity driven by portal JS for A/V lock */
  transition: none;
}

.intro__skip.is-locked {
  opacity: 0;
  pointer-events: none;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  html.is-intro,
  html.is-journey-locked {
    cursor: auto;
  }

  html.is-journey-cta .stage__enter.is-active .stage__enter-btn,
  html.is-journey-cta .stage__enter-hint {
    animation: none;
  }

  .cosmic-dust {
    display: none;
  }

  body.is-entered::before {
    display: none;
  }
}
