/* ==========================================
   HerValentine — Base Styles
   ========================================== */

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

:root {
  --pink-1: #FFB6C1;
  --pink-2: #FFC0CB;
  --pink-3: #FFD1DC;
  --peach-1: #FFDAB9;
  --peach-2: #FFE5B4;
  --peach-3: #FFCBA4;
  --rose-gold-1: #E8B4B8;
  --rose-gold-2: #D4A5A5;
  --text: #8B4557;
  --dark: #3d1f2b;
  --cream: #FFF8F0;
}

html { scroll-behavior: auto; }

body {
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  background: var(--cream);
  overflow-x: hidden;
}

/* ---- Loader ---- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--pink-3), var(--peach-2), var(--cream));
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-heart {
  position: relative;
  animation: pulse 1.2s ease-in-out infinite;
}
.loader-heart svg {
  filter: drop-shadow(0 0 20px rgba(255, 182, 193, 0.6));
}
.loader-text {
  margin-top: 24px;
  font-size: 1rem;
  color: var(--text);
  opacity: 0.8;
  letter-spacing: 0.5px;
}

/* ---- Progress bar ---- */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 4px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.3);
}
#progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--pink-1), var(--rose-gold-1), var(--peach-3));
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}
.progress-heart {
  position: fixed;
  top: -6px; left: 0%;
  z-index: 1001;
  transition: left 0.1s linear;
  filter: drop-shadow(0 0 4px rgba(232, 180, 184, 0.6));
}

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

#scene-meeting  { height: 200vh; }
#scene-cherry   { height: 150vh; }
#scene-embrace  { height: 150vh; }
#scene-walking  { height: 120vh; }
#scene-sunset   { height: 120vh; }
#scene-dance    { height: 120vh; }
#scene-dinner   { height: 120vh; }
#scene-growing  { height: 120vh; }
#scene-final    { height: 100vh; }

.scene-bg { position: absolute; inset: 0; z-index: 0; }

.scene-vignette {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.12) 100%);
}

/* Scene backgrounds */
#scene-meeting .scene-bg {
  background: linear-gradient(180deg, var(--cream) 0%, var(--pink-3) 40%, var(--pink-2) 70%, var(--pink-1) 100%);
}
#scene-cherry .scene-bg {
  background: linear-gradient(180deg, var(--pink-3) 0%, var(--peach-2) 50%, var(--peach-1) 100%);
}
#scene-embrace .scene-bg {
  background: linear-gradient(180deg, var(--peach-1) 0%, #FFD4A8 40%, #FFCBA4 100%);
}
#scene-walking .scene-bg {
  background: linear-gradient(180deg, #C8E6C9 0%, #A5D6A7 40%, #81C784 100%);
}
#scene-sunset .scene-bg {
  background: linear-gradient(180deg, #FF6B6B 0%, #FF8E53 30%, #FFE66D 60%, #C06C84 80%, #6C5B7B 100%);
}
#scene-dance .scene-bg {
  background: linear-gradient(180deg, #2c1e3f 0%, #1a1230 50%, #0f0a1f 100%);
}
#scene-dinner .scene-bg {
  background: linear-gradient(180deg, #1a1035 0%, #0d0b2e 40%, #070520 100%);
}
#scene-growing .scene-bg {
  background: linear-gradient(180deg, var(--cream) 0%, var(--pink-3) 50%, var(--peach-2) 100%);
}
#scene-final .scene-bg {
  background: linear-gradient(135deg, var(--pink-3), var(--cream), var(--peach-2), var(--pink-3));
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* ---- Scene text ---- */
.scene-text {
  position: absolute;
  bottom: 6%; left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  opacity: 0;
}
.scene-text h2 {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  color: var(--text);
  text-shadow: 0 2px 20px rgba(255,255,255,0.5);
  white-space: nowrap;
}
#scene-dance .scene-text h2,
#scene-dinner .scene-text h2 {
  color: var(--pink-2);
  text-shadow: 0 2px 20px rgba(255,192,203,0.4);
}

/* ==========================================
   HERO LANDING (visible immediately)
   ========================================== */
.hero-landing {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 8;
  pointer-events: none;
  text-align: center;
  padding: 0 24px;
}

.hero-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--text);
  text-shadow: 0 4px 30px rgba(255,255,255,0.6);
  margin-bottom: 12px;
  opacity: 1;
}

.hero-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: var(--rose-gold-2);
  letter-spacing: 1px;
  margin-bottom: 48px;
  opacity: 0.8;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: scrollBounce 2s ease-in-out infinite;
  pointer-events: auto;
}

.scroll-text {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.6;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-arrow {
  opacity: 0.5;
}

/* ---- Center glow ---- */
.center-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,182,193,0.2) 0%, rgba(255,209,220,0.1) 40%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
}

/* ---- Ambient container ---- */
.ambient-container {
  position: absolute; inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

/* ==========================================
   CHARACTER CONTAINERS (Scene 1)
   ========================================== */
.char-wrap {
  position: absolute;
  bottom: 12%;
  z-index: 5;
  opacity: 0;
}
.char-man  { left: -200px; }
.char-woman { right: -200px; }

/* ---- Figure images (silhouette PNGs) ---- */
.figure-img {
  display: block;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.figure-man,
.figure-woman {
  width: 90px;
  height: 230px;
  object-fit: contain;
}
.figure-couple {
  width: 200px;
  height: 200px;
  object-fit: contain;
}
.figure-couple-kiss {
  width: 200px;
  height: 200px;
  object-fit: contain;
}
.figure-couple-sunset {
  width: 200px;
  height: 200px;
  object-fit: contain;
}
.figure-couple-dance {
  width: 200px;
  height: 220px;
  object-fit: contain;
}

/* ---- Flower ---- */
.flower {
  position: absolute;
  bottom: 14%; left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  opacity: 0; scale: 0;
}
.flower-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(255,182,193,0.5) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 2s ease-in-out infinite;
}

/* ---- Hearts container ---- */
.hearts-container {
  position: absolute; inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

/* ---- Cherry blossom ---- */
.tree { position: absolute; bottom: 0; z-index: 2; opacity: 0; }
.tree-left { left: -5%; }
.tree-right { right: -5%; transform: scaleX(-1); }
.petal-container { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }

.couple-cherry {
  position: absolute;
  bottom: 8%; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  opacity: 0;
}

/* ---- Embrace ---- */
.couple-embrace {
  position: absolute;
  bottom: 6%; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  opacity: 0; scale: 0.8;
}
.embrace-glow {
  position: absolute;
  bottom: 16%; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,218,185,0.4) 0%, transparent 70%);
  z-index: 4;
}
.fireflies-container { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* ---- Walking scene ---- */
.parallax-layer { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; z-index: 1; }
.parallax-far { z-index: 1; }
.parallax-mid { z-index: 2; }
.parallax-near { z-index: 3; }

.mountain {
  position: absolute; bottom: 40%; left: 10%;
  width: 0; height: 0;
  border-left: 180px solid transparent;
  border-right: 180px solid transparent;
  border-bottom: 220px solid rgba(139,69,87,0.08);
}
.mountain-2 {
  left: 35%;
  border-bottom-color: rgba(139,69,87,0.06);
  border-left-width: 220px; border-right-width: 220px;
  border-bottom-width: 260px;
}

.tree-simple {
  position: absolute; bottom: 25%;
  width: 6px; height: 60px;
  background: rgba(139,69,87,0.15);
  border-radius: 2px;
}
.tree-simple::before {
  content: '';
  position: absolute; top: -30px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 40px;
  background: rgba(139,69,87,0.1);
  border-radius: 50%;
}
.tree-simple       { left: 8%; }
.tree-simple.t2    { left: 20%; height: 50px; }
.tree-simple.t3    { left: 38%; height: 70px; }
.tree-simple.t4    { left: 55%; height: 45px; }
.tree-simple.t5    { left: 72%; height: 55px; }

.bush {
  position: absolute; bottom: 18%; left: 5%;
  width: 50px; height: 30px;
  background: rgba(139,69,87,0.1);
  border-radius: 50% 50% 20% 20%;
}
.bush.b2 { left: 60%; width: 40px; height: 25px; }

.flower-ground {
  position: absolute; bottom: 20%;
  width: 10px; height: 10px;
  background: var(--pink-1);
  border-radius: 50%;
  opacity: 0.6;
}
.flower-ground.f1 { left: 15%; }
.flower-ground.f2 { left: 45%; }
.flower-ground.f3 { left: 75%; }

.couple-walking {
  position: absolute;
  bottom: 6%; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  opacity: 0;
}
.walking-path {
  position: absolute;
  bottom: 5%; left: 0;
  width: 100%; height: 40px;
  background: linear-gradient(180deg, rgba(255,182,193,0.3) 0%, transparent 100%);
  z-index: 4;
}
.butterfly-container { position: absolute; inset: 0; z-index: 6; pointer-events: none; }

/* ---- Sunset ---- */
.sun {
  position: absolute;
  bottom: 35%; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.sun-core {
  width: 150px; height: 150px;
  background: radial-gradient(circle, #FFE66D 0%, #FF8E53 50%, #FF6B6B 100%);
  border-radius: 50%;
  box-shadow: 0 0 80px #FFE66D, 0 0 120px rgba(255,142,83,0.4);
}
.sun-glow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,230,109,0.3) 0%, transparent 70%);
  border-radius: 50%;
}
.cloud {
  position: absolute; z-index: 3;
  background: rgba(255,255,255,0.25);
  border-radius: 50px; height: 30px;
}
.cloud::before, .cloud::after {
  content: ''; position: absolute;
  background: inherit; border-radius: 50%;
}
.cloud::before { width: 40px; height: 40px; top: -20px; left: 20%; }
.cloud::after  { width: 50px; height: 50px; top: -25px; left: 50%; }
.cloud-1 { top: 15%; left: 10%; width: 120px; }
.cloud-2 { top: 25%; right: 15%; width: 100px; opacity: 0.6; }
.cloud-3 { top: 10%; right: 35%; width: 80px; opacity: 0.4; }

.birds-container {
  position: absolute; top: 18%; left: -10%; z-index: 4;
}

.water {
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 25%; z-index: 3;
  background: linear-gradient(180deg,
    rgba(255,139,105,0.3) 0%,
    rgba(192,108,132,0.3) 50%,
    rgba(108,91,123,0.4) 100%);
}
.water-shimmer {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg, transparent, rgba(255,255,255,0.1) 2px, transparent 4px);
  animation: shimmer 3s ease-in-out infinite;
}
.couple-sunset {
  position: absolute;
  bottom: 26%; left: 50%;
  transform: translateX(-50%);
  z-index: 5; opacity: 0;
}

/* ---- Dance ---- */
.chandelier { position: absolute; top: 0; z-index: 3; }
.ch-left { left: 18%; }
.ch-right { right: 18%; }
.ch-chain { width: 2px; height: 60px; background: rgba(255,215,0,0.4); margin: 0 auto; }
.ch-body { display: flex; gap: 12px; justify-content: center; }
.ch-light {
  width: 8px; height: 12px;
  background: radial-gradient(circle, #FFE5B4, #FFD700);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 2s ease-in-out infinite alternate;
  box-shadow: 0 0 15px rgba(255,215,0,0.6), 0 0 30px rgba(255,215,0,0.3);
}
.ch-light:nth-child(2) { animation-delay: 0.3s; }
.ch-light:nth-child(3) { animation-delay: 0.7s; }
.dance-floor {
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 35%; z-index: 2;
  background: linear-gradient(180deg, rgba(60,40,80,0.4) 0%, rgba(30,20,50,0.6) 100%);
}
.floor-reflection {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(255,215,0,0.05) 0%, transparent 60%);
}
.couple-dance {
  position: absolute;
  bottom: 8%; left: 50%;
  transform: translateX(-50%);
  z-index: 5; opacity: 0;
}
.notes-container  { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.sparkles-container { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.floor-petals {
  position: absolute; bottom: 5%; left: 0;
  width: 100%; height: 10%;
  z-index: 3; pointer-events: none;
}

/* ---- Dinner ---- */
.stars-container { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.moon { position: absolute; top: 10%; right: 15%; z-index: 2; opacity: 0; }
.moon-glow {
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(255,255,240,0.9) 0%, rgba(255,255,200,0.3) 50%, transparent 70%);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(255,255,200,0.4), 0 0 80px rgba(255,255,200,0.2);
}
.dinner-scene-container {
  position: absolute;
  bottom: 10%; left: 50%;
  transform: translateX(-50%);
  z-index: 5; opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dinner-couple-wrap {
  overflow: hidden;
  height: 140px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.figure-dinner {
  width: 220px;
  height: auto;
  object-fit: contain;
  margin-top: -10px;
}
.dinner-table-svg {
  margin-top: -30px;
  position: relative;
  z-index: 2;
}
.shooting-stars { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }

/* ---- Growing old ---- */
.life-tree {
  position: absolute; top: 5%; left: 50%;
  transform: translateX(-50%);
  z-index: 3; opacity: 0;
}
.couple-old {
  position: absolute;
  bottom: 10%; left: 50%;
  transform: translateX(-50%);
  z-index: 5; opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bench-couple-wrap {
  overflow: hidden;
  height: 130px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.figure-old {
  width: 200px;
  height: auto;
  object-fit: contain;
  margin-top: -5px;
}
.bench-svg {
  margin-top: -20px;
  position: relative;
  z-index: 2;
}
.season-particles { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }

/* ---- Final message ---- */
.final-hearts {
  position: absolute; top: 20%; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 40px; z-index: 5;
}
.final-hearts svg { filter: drop-shadow(0 0 15px rgba(255,182,193,0.5)); }
.heart-left, .heart-right { opacity: 0; }
.final-message {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; z-index: 10; opacity: 0;
}
.final-text {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.6rem, 4vw, 3rem);
  color: var(--text);
  margin-bottom: 8px;
  text-shadow: 0 2px 15px rgba(255,255,255,0.5);
}
.her-name {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--rose-gold-1);
  text-shadow: 0 2px 20px rgba(232,180,184,0.5);
}
.final-shimmer {
  position: absolute; inset: 0; z-index: 8;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
}

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