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

:root {
  --bg:        #07080F;
  --deep:      #0D0F1E;
  --indigo:    #1B0A3C;
  --violet:    #2D1B69;
  --gold:      #C9A84C;
  --gold-soft: #E8D5A3;
  --text:      #E8E4F0;
  --muted:     #8A85A0;
  --glow:      rgba(123, 104, 238, 0.18);
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  overflow-x: hidden;
  cursor: default;
}

/* ── Canvas cosmos ── */
#cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Vignette overlay ── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 40%,
    rgba(7, 8, 15, 0.65) 100%
  );
}

/* ── Stage ── */
.stage {
  position: relative;
  z-index: 2;
}

/* ── Poem scenes ── */
.poem-scene {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  padding: 4rem 2rem;
  position: relative;
}

/* ── Line wraps ── */
.line-wrap {
  text-align: center;
  max-width: 680px;
  width: 100%;
}

.line-wrap.stacked {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* ── Typography ── */
.title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 6rem);
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text);
  position: relative;
}

.title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--gold);
  margin: 1.6rem auto 0;
  opacity: 0;
  transform: scaleX(0);
  transition: opacity 1.2s ease 1.2s, transform 1.2s ease 1.2s;
  transform-origin: center;
}

.title.is-visible::after {
  opacity: 0.7;
  transform: scaleX(1);
}

.line {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: var(--text);
}

.line.small {
  font-family: 'Manrope', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.8vw, 1.5rem);
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.line.closing {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  letter-spacing: 0.03em;
  line-height: 1.5;
  color: var(--text);
}

.italic { font-style: italic; }

.gold {
  color: var(--gold-soft);
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.35);
}

/* ── Reveal animation ── */
.reveal-up {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.delay-1 { transition-delay: 0.25s; }
.delay-2 { transition-delay: 0.55s; }
.delay-3 { transition-delay: 0.85s; }
.delay-4 { transition-delay: 1.1s; }

/* ── Floating orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
  animation: drift 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(45, 27, 105, 0.55) 0%, transparent 70%);
  top: -10%;
  left: -8%;
  animation-duration: 22s;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(123, 104, 238, 0.22) 0%, transparent 70%);
  bottom: 10%;
  right: -5%;
  animation-duration: 17s;
  animation-delay: -6s;
}

.orb-3 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.12) 0%, transparent 70%);
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  animation-duration: 25s;
  animation-delay: -12s;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.05); }
  66%  { transform: translate(-20px, 30px) scale(0.97); }
  100% { transform: translate(15px, -35px) scale(1.03); }
}

/* ── Scene-specific accents ── */
#scene-1 { background: transparent; }

#scene-2::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(27, 10, 60, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

#scene-3::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(45, 27, 105, 0.3) 0%, transparent 65%);
  pointer-events: none;
}

#scene-5::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Scroll hint ── */
.scroll-hint {
  position: fixed;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.scroll-hint.hidden { opacity: 0; pointer-events: none; }

.scroll-hint span {
  font-family: 'Manrope', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-arrow {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 0.9; transform: scaleY(1.15); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .poem-scene { padding: 3rem 1.5rem; }
  .line-wrap.stacked { gap: 1rem; }
}