/* =====================================================
   ROMANTIC CINEMATIC WEBSITE — STYLES
   ===================================================== */

:root {
  --deep-blue: #03040f;
  --night-blue: #060820;
  --sky-blue: #0d1535;
  --soft-pink: #f4a8c0;
  --rose: #e87fa0;
  --deep-rose: #c45a7a;
  --gold: #f5c842;
  --warm-gold: #e8a830;
  --purple: #2a1a5a;
  --violet: #4a2a8a;
  --cream: #fff8f0;
  --white-soft: rgba(255, 248, 240, 0.92);
  --text-light: rgba(255, 248, 240, 0.75);
  --glow-pink: rgba(244, 168, 192, 0.35);
  --glow-gold: rgba(245, 200, 66, 0.4);
  --glow-white: rgba(255, 248, 240, 0.25);
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'IM Fell English', 'Georgia', serif;
  --font-letter: 'Libre Baskerville', 'Georgia', serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: auto;
}

body {
  background: var(--deep-blue);
  color: var(--cream);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: default;
}

/* Custom cursor */
body * { cursor: none !important; }

#cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: rgba(255, 220, 200, 0.9);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, background 0.3s ease;
  mix-blend-mode: screen;
}

#cursor-trail {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 200, 180, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease;
}

/* =====================================================
   CANVAS LAYERS
   ===================================================== */

#three-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

#flowers-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

#petals-layer {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.vignette {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 30%,
    rgba(3, 4, 15, 0.5) 70%,
    rgba(3, 4, 15, 0.85) 100%
  );
}

/* =====================================================
   START OVERLAY
   ===================================================== */

#start-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center,
    rgba(10, 8, 30, 0.92) 0%,
    rgba(3, 4, 15, 0.98) 100%
  );
  transition: opacity 1.5s ease;
}

#start-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.start-content {
  text-align: center;
  position: relative;
}

.start-moon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 300px;
  height: 300px;
  background: radial-gradient(ellipse at center,
    rgba(255, 240, 180, 0.15) 0%,
    rgba(200, 180, 255, 0.05) 50%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
  animation: moonPulse 4s ease-in-out infinite;
}

@keyframes moonPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -60%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
}

.start-eyebrow {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--soft-pink);
  opacity: 0.7;
  margin-bottom: 1rem;
  animation: fadeSlideUp 1.2s ease 0.3s both;
}

.start-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  line-height: 1;
  text-shadow:
    0 0 60px rgba(244, 168, 192, 0.3),
    0 0 120px rgba(200, 150, 255, 0.15);
  animation: fadeSlideUp 1.4s ease 0.5s both;
  letter-spacing: -0.02em;
}

.start-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  letter-spacing: 0.1em;
  animation: fadeSlideUp 1.4s ease 0.7s both;
}

.start-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 3rem;
  padding: 0.9rem 2.5rem;
  background: transparent;
  border: 1px solid rgba(244, 168, 192, 0.5);
  color: var(--soft-pink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  cursor: pointer !important;
  overflow: visible;
  animation: fadeSlideUp 1.4s ease 1s both;
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.start-btn:hover {
  background: rgba(244, 168, 192, 0.1);
  border-color: var(--soft-pink);
  color: var(--cream);
}

.btn-ring {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(244, 168, 192, 0.15);
  border-radius: 0;
  animation: ringPulse 3s ease-in-out infinite;
}
.btn-ring--2 {
  inset: -16px;
  animation-delay: 0.5s;
  opacity: 0.5;
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.02); }
}

.start-hint {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(255, 248, 240, 0.3);
  text-transform: uppercase;
  animation: fadeSlideUp 1.4s ease 1.3s both;
}

/* =====================================================
   MUSIC CONTROLS
   ===================================================== */

#music-controls {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  transition: opacity 0.5s ease;
}

#music-controls.hidden { opacity: 0; pointer-events: none; }

#music-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 248, 240, 0.2);
  background: rgba(6, 8, 32, 0.6);
  color: rgba(255, 248, 240, 0.6);
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

#music-toggle:hover {
  border-color: var(--soft-pink);
  color: var(--soft-pink);
  background: rgba(244, 168, 192, 0.1);
}

#music-toggle svg { width: 16px; height: 16px; }

/* =====================================================
   SCROLL INDICATOR
   ===================================================== */

#scroll-indicator {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 248, 240, 0.3);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transition: opacity 0.5s ease;
}

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

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(255, 248, 240, 0.3));
  animation: scrollPulse 2s ease-in-out infinite;
}

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

/* =====================================================
   SMOOTH SCROLL WRAPPER
   ===================================================== */

#smooth-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 10;
}

#smooth-content {
  position: relative;
}

/* =====================================================
   SCENES
   ===================================================== */

.scene {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene--tall {
  height: 180vh;
}

.scene--final {
  height: 100vh;
  background: radial-gradient(ellipse at center bottom,
    rgba(42, 26, 90, 0.4) 0%,
    transparent 60%
  );
}

.scene-content {
  position: relative;
  z-index: 20;
  text-align: center;
  padding: 2rem;
  max-width: 700px;
}

/* =====================================================
   SCENE TYPOGRAPHY
   ===================================================== */

.scene-badge {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--soft-pink);
  opacity: 0.6;
  margin-bottom: 1rem;
  font-style: italic;
}

.scene-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  line-height: 1.1;
  text-shadow:
    0 0 40px rgba(244, 168, 192, 0.2),
    0 2px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(30px);
}

.scene-title.revealed {
  animation: revealFade 1.2s ease forwards;
}

.scene-sub {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(20px);
}

.scene-sub.revealed {
  animation: revealFade 1.2s ease 0.3s forwards;
}

@keyframes revealFade {
  to { opacity: 1; transform: translateY(0); }
}

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

/* =====================================================
   GRASS
   ===================================================== */

.grass-ground {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 200px;
  pointer-events: none;
  overflow: hidden;
}

#grass-layer {
  position: absolute;
  bottom: 0; left: -10%;
  width: 120%;
  height: 100%;
}

/* =====================================================
   POEM
   ===================================================== */

.poem-scene-content {
  max-width: 600px;
  padding-top: 10vh;
}

.poem-wrapper {
  margin-top: 3rem;
  padding: 3rem 2rem;
  border: 1px solid rgba(244, 168, 192, 0.15);
  background: rgba(6, 8, 32, 0.5);
  backdrop-filter: blur(16px);
  position: relative;
  opacity: 0;
}

.poem-wrapper::before,
.poem-wrapper::after {
  content: '';
  position: absolute;
  width: 30px; height: 30px;
  border-color: rgba(244, 168, 192, 0.3);
  border-style: solid;
}
.poem-wrapper::before {
  top: -1px; left: -1px;
  border-width: 1px 0 0 1px;
}
.poem-wrapper::after {
  bottom: -1px; right: -1px;
  border-width: 0 1px 1px 0;
}

.poem-ornament {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: rgba(244, 168, 192, 0.4);
  margin-bottom: 1.5rem;
  display: block;
  text-align: center;
}

.poem-ornament--bottom {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.poem-text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-style: italic;
  font-weight: 300;
  line-height: 2;
  color: var(--cream);
  text-align: center;
  white-space: pre-wrap;
  min-height: 200px;
}

/* =====================================================
   LANTERNS
   ===================================================== */

#lanterns-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.lantern {
  position: absolute;
  bottom: -100px;
  width: 28px;
  height: 42px;
  opacity: 0;
}

.lantern-body {
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 40% 40% / 40% 40% 60% 60%;
  position: relative;
  overflow: hidden;
}

.lantern-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  animation: lanternFlicker 3s ease-in-out infinite;
}

.lantern-string {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 8px;
  background: rgba(255, 220, 100, 0.4);
}

@keyframes lanternFlicker {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  33% { opacity: 1; transform: scale(1.05); }
  66% { opacity: 0.85; transform: scale(0.97); }
}

@keyframes lanternFloat {
  0% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-8px) rotate(-2deg); }
  75% { transform: translateX(8px) rotate(2deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

/* =====================================================
   ENVELOPE & LETTER
   ===================================================== */

.letter-scene-content {
  max-width: 700px;
  padding-top: 5vh;
}

.envelope-wrapper {
  margin-top: 3rem;
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.envelope {
  position: relative;
  cursor: pointer !important;
  transition: transform 0.4s ease;
  z-index: 30;
}

.envelope:hover {
  transform: scale(1.05) translateY(-4px);
}

.envelope-body {
  position: relative;
  width: 260px;
  height: 180px;
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a0f2e, #2a1848, #1a0f2e);
  border: 1px solid rgba(244, 168, 192, 0.25);
  border-radius: 2px;
}

.envelope-flap {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(160deg, #1e1240, #2e1a58);
  border: 1px solid rgba(244, 168, 192, 0.25);
  border-radius: 2px 2px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 2;
}

.envelope-flap.open {
  transform: rotateX(180deg);
}

.envelope-front {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(135deg, #160d28, #22144a, #160d28);
  border: 1px solid rgba(244, 168, 192, 0.2);
  border-top: none;
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 50% 50%, 0 0);
  z-index: 3;
}

.envelope-seal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: radial-gradient(circle, #e87fa0, #c45a7a);
  border-radius: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow:
    0 0 15px rgba(232, 127, 160, 0.6),
    0 0 30px rgba(196, 90, 122, 0.3);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.envelope-seal.hidden {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

/* Envelope glow effect */
.envelope::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: radial-gradient(ellipse at center,
    rgba(232, 127, 160, 0.15) 0%,
    transparent 70%
  );
  border-radius: 50%;
  animation: envGlow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes envGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Letter */
.letter {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 320px;
  background: linear-gradient(160deg, #fffbf5, #fff5e8, #fffbf5);
  border: 1px solid rgba(200, 150, 120, 0.3);
  padding: 2.5rem 2rem;
  opacity: 0;
  pointer-events: none;
  z-index: 25;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(232, 127, 160, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.letter.visible {
  pointer-events: auto;
}

.letter::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(200, 150, 120, 0.2);
  pointer-events: none;
}

.letter-inner {
  position: relative;
}

.letter-header, .letter-footer {
  text-align: center;
  color: rgba(180, 100, 120, 0.5);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  margin: 0.5rem 0;
}

.letter-body {
  font-family: var(--font-letter);
  font-size: 0.82rem;
  line-height: 1.9;
  color: #3a2a1a;
  font-style: italic;
  min-height: 300px;
}

.letter-body .letter-line {
  display: block;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.letter-body .letter-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.letter-body .letter-line.blank {
  height: 0.75em;
  display: block;
}

/* =====================================================
   HEART CANVAS
   ===================================================== */

#heart-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* =====================================================
   FINAL SCENE
   ===================================================== */

.final-content {
  max-width: 700px;
  animation: none;
}

.final-stars-text {
  font-size: 0.7rem;
  letter-spacing: 0.8em;
  color: rgba(245, 200, 66, 0.4);
  margin-bottom: 2rem;
  opacity: 0;
}

.final-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  line-height: 1.1;
  text-shadow:
    0 0 60px rgba(244, 168, 192, 0.4),
    0 0 120px rgba(200, 150, 255, 0.2);
  opacity: 0;
  letter-spacing: -0.01em;
}

.final-message {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 300;
  font-style: italic;
  color: var(--soft-pink);
  margin-top: 1rem;
  opacity: 0;
  text-shadow: 0 0 30px rgba(244, 168, 192, 0.4);
}

.final-divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(244, 168, 192, 0.4), transparent);
  margin: 2.5rem auto;
  opacity: 0;
}

.final-signature {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
  opacity: 0;
}

.final-flower-icon {
  font-size: 2rem;
  color: var(--soft-pink);
  margin-top: 2rem;
  opacity: 0;
  text-shadow: 0 0 20px rgba(244, 168, 192, 0.6);
  animation: flowerSpin 8s linear infinite;
}

@keyframes flowerSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =====================================================
   FALLING PETALS (DOM-based)
   ===================================================== */

.dom-petal {
  position: fixed;
  width: 10px;
  height: 14px;
  border-radius: 80% 0 80% 0;
  opacity: 0;
  pointer-events: none;
  transform-origin: center center;
  z-index: 500;
}

/* =====================================================
   ATMOSPHERIC OVERLAYS
   ===================================================== */

.scene-1-content {
  position: relative;
  top: -10vh;
}

/* Fog overlay per scene */
.scene::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top,
    rgba(3, 4, 15, 0.6) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 5;
}

/* =====================================================
   UTILITY
   ===================================================== */

.hidden { opacity: 0 !important; pointer-events: none !important; }

/* Glow text utility */
.glow-text {
  text-shadow:
    0 0 20px currentColor,
    0 0 40px currentColor;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 600px) {
  .start-title { font-size: 4rem; }
  .scene-title { font-size: 2.2rem; }
  .envelope-body { width: 220px; height: 150px; }
  .letter { width: 280px; padding: 1.5rem; }
  .letter-body { font-size: 0.75rem; }
}

/* =====================================================
   SCROLL TRIGGERED CLASSES
   ===================================================== */

.is-visible .poem-wrapper { opacity: 1; transition: opacity 1s ease; }

/* =====================================================
   PARTICLE DOTS (scene atmospheric)
   ===================================================== */

.atm-particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
  animation: atmFloat linear infinite;
}

@keyframes atmFloat {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(var(--drift)); opacity: 0; }
}

/* =====================================================
   GRAIN TEXTURE OVERLAY
   ===================================================== */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}
