/* ==============================
   CSS Variables & Theming
   ============================== */
:root {
  --color-cream: #FFFBF0;
  --color-peach: #FFDAB9;
  --color-pink-soft: #FFC0CB;
  --color-golden: #FFD700;
  --color-sunrise-bg1: #FFEAD9;
  --color-sunrise-bg2: #FFDFD3;
  --color-sunrise-bg3: #FEC8D8;
  
  --text-dark: #5c4452;
  --text-primary: #8C5B67;
  --text-glow: rgba(255, 218, 185, 0.8);
  
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Quicksand', sans-serif;
  --font-cursive: 'Great Vibes', cursive;
}

/* ==============================
   Reset & Base Styles
   ============================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--color-sunrise-bg1), var(--color-sunrise-bg2), var(--color-sunrise-bg3));
  background-size: 400% 400%;
  animation: gradientSunrise 15s ease infinite;
  overflow-x: hidden;
  /* Prevent scrollbar jumping during intro */
  body.no-scroll { overflow: hidden; }
}

html {
  scroll-behavior: smooth;
}

/* Background gradient animation */
@keyframes gradientSunrise {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Typography styles */
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; color: var(--text-primary); }
p { font-size: 1.1rem; line-height: 1.6; }
.cursive-text { font-family: var(--font-cursive); font-size: 3rem; color: #ff8c94; }

/* Helpers */
.hidden { display: none !important; }

/* ==============================
   Buttons & Links
   ============================== */
.btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  padding: 12px 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: inline-block;
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
  color: #fff;
}
.primary-btn:hover { background: linear-gradient(135deg, #ff8a8e 0%, #febfdf 100%); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(255, 154, 158, 0.4); }

.secondary-btn {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  border: 1px solid rgba(255, 154, 158, 0.3);
}
.secondary-btn:hover { background: rgba(255, 255, 255, 0.9); transform: translateY(-3px); }

/* Play toggle button */
.music-btn {
  position: fixed; top: 20px; right: 20px;
  width: 45px; height: 45px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(5px);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}
.music-btn:hover { background: rgba(255, 255, 255, 0.8); }

/* ==============================
   Animations
   ============================== */
.pulse { animation: pulseAnim 2s infinite; }
@keyframes pulseAnim {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 154, 158, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 154, 158, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 154, 158, 0); }
}

.bounce { animation: bounceAnim 2s infinite; }
@keyframes bounceAnim {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.wobble:hover { animation: wobbleAnim 1s ease-in-out; }
@keyframes wobbleAnim {
  0% { transform: translateX(0%); }
  15% { transform: translateX(-5%) rotate(-2deg); }
  30% { transform: translateX(4%) rotate(2deg); }
  45% { transform: translateX(-3%) rotate(-1deg); }
  60% { transform: translateX(2%) rotate(1deg); }
  75% { transform: translateX(-1%) rotate(-0.5deg); }
  100% { transform: translateX(0%); }
}

.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 1s ease, transform 1s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

.delay-1 { transition-delay: 0.3s; }
.delay-2 { transition-delay: 0.6s; }
.delay-3 { transition-delay: 0.9s; }

/* ==============================
   Envelope Intro
   ============================== */
.envelope-screen {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: var(--color-sunrise-bg1);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000;
  transition: opacity 1.5s ease-in-out, visibility 1.5s;
}

.envelope-wrapper {
  position: relative; width: 300px; height: 200px;
  background: #fffafa; border-radius: 5px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  display: flex; justify-content: center; align-items: center;
  flex-direction: column;
}

.envelope-wrapper::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 0; height: 0;
  border-left: 150px solid transparent; border-right: 150px solid transparent; border-bottom: 100px solid #f9f0f0;
  z-index: 2; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; pointer-events: none;
}

.envelope-flap {
  position: absolute; top: 0; left: 0; width: 0; height: 0;
  border-left: 150px solid transparent; border-right: 150px solid transparent; border-top: 100px solid #ffecec;
  transform-origin: top; transition: transform 1s ease-in-out;
  z-index: 4;
}

.heart-seal {
  position: absolute; top: 85px; left: 50%; transform: translateX(-50%);
  color: #ff5f6d; font-size: 2rem; z-index: 5; text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: opacity 0.5s ease; cursor: pointer;
}

.envelope-letter {
  position: absolute; bottom: 0; left: 5%; width: 90%; height: 90%;
  background: #fff; z-index: 3; padding: 20px;
  border-radius: 5px; text-align: center;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 15px;
  transform: translateY(0); transition: transform 1.5s ease-in-out;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.envelope-letter p { font-family: var(--font-cursive); font-size: 1.5rem; color: var(--text-primary); }

/* Activation Class */
.envelope-wrapper.open .envelope-flap { transform: rotateX(180deg); z-index: 1; }
.envelope-wrapper.open .heart-seal { opacity: 0; }
.envelope-wrapper.open .envelope-letter { transform: translateY(-50px); z-index: 4; }
.envelope-screen.hide { opacity: 0; visibility: hidden; }

/* ==============================
   Glassmorphism
   ============================== */
.glass-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 8px 32px rgba(140, 91, 103, 0.1);
}

/* ==============================
   Sections styling
   ============================== */
section { text-align: center; padding: 100px 20px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; z-index: 10; }

/* Hero */
.hero-card { max-width: 700px; margin: 0 auto; animation: cardFloat 6s ease-in-out infinite; }
@keyframes cardFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.hero-small-text { font-size: 0.9rem; letter-spacing: 1px; color: var(--text-primary); margin-bottom: 20px; text-transform: uppercase; font-weight: 500;}
.hero-heading { font-size: 3.5rem; margin-bottom: 30px; letter-spacing: -1px; }
.glow-text { text-shadow: 0 0 20px var(--text-glow), 0 0 40px rgba(255,255,255,0.6); }

.hero-subheading { font-size: 1.2rem; max-width: 500px; margin: 0 auto 20px auto; color: var(--text-dark); line-height: 1.8; }
.hero-buttons { display: flex; gap: 15px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

.secret-text { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.5); font-style: italic; color: var(--text-primary); animation: fadeIn 1s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Reasons Section */
.reasons-section .section-title { font-size: 2.5rem; margin-bottom: 50px; }
.cards-container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; max-width: 1000px; }
.reason-card { flex: 1 1 200px; padding: 30px 20px; text-align: center; transition: transform 0.3s, box-shadow 0.3s; }
.reason-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 15px 35px rgba(255, 154, 158, 0.2); }
.reason-card i { font-size: 2.5rem; margin-bottom: 15px; }

/* Colors for icons */
.text-yellow { color: #f9ca24; }
.text-pink { color: #ff7979; }
.text-blue { color: #7ed6df; }
.text-peach { color: #f0932b; }

/* Memories / Polaroids */
.gallery-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-top: 40px; }
.polaroid-card { 
  background: white; padding: 15px 15px 40px 15px; width: 250px; 
  box-shadow: 0 10px 25px rgba(0,0,0,0.1); transition: transform 0.4s ease;
  transform: rotate(0deg); border: 1px solid #eee;
}
.polaroid-img-wrapper { width: 100%; height: 220px; overflow: hidden; background: #f0f0f0; }
.polaroid-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.polaroid-caption { font-family: var(--font-cursive); font-size: 1.5rem; color: #333; margin-top: 10px; }
.rotate-right { transform: rotate(5deg); }
.rotate-left { transform: rotate(-4deg); }
.polaroid-card:hover { transform: scale(1.1) rotate(0deg) translateY(-10px); z-index: 20; box-shadow: 0 15px 35px rgba(0,0,0,0.15); }

/* Surprise Section */
.surprise-card { max-width: 600px; position: relative; }
.large-btn { font-size: 1.2rem; padding: 15px 35px; margin-top: 20px; }
.surprise-reveal { margin-top: 30px; animation: scaleUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.surprise-reveal h2 { margin-bottom: 15px; font-size: 2rem; color: #ff5f6d; }

@keyframes scaleUp { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

/* Closing Section */
.closing-heading { font-size: 2.5rem; margin-bottom: 40px; }
.closing-actions { display: flex; gap: 20px; outline: none; }
.pujuk-extra-response, .okay-extra-response { margin-top: 40px; padding: 20px; border-radius: 10px; font-size: 1.2rem; font-style: italic; max-width: 500px; text-align: center; animation: fadeIn 1s; }
.pujuk-extra-response { background: rgba(255, 255, 255, 0.6); color: var(--text-primary); border-left: 4px solid #ff7979; }
.okay-extra-response { background: rgba(255, 255, 255, 0.6); color: #2ecc71; border-left: 4px solid #2ecc71; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-heading { font-size: 2.5rem; }
  .hero-subheading { font-size: 1.1rem; }
  .glass-card { padding: 2rem 1.5rem; }
  section { padding: 60px 15px; min-height: auto; margin-bottom: 5vh; }
  .hero-buttons { flex-direction: column; }
  .closing-actions { flex-direction: column; }
}

/* ==============================
   Floating Hearts Background
   ============================== */
#hearts-container, #particles-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1; overflow: hidden; }

.floating-heart { position: absolute; bottom: -5vh; color: rgba(255, 192, 203, 0.5); font-size: 20px; animation: floatUp 15s linear infinite; }
@keyframes floatUp { 
  0% { transform: translateY(0) scale(0.5) rotate(0deg); opacity: 0; }
  20% { opacity: 0.6; }
  80% { opacity: 0.6; }
  100% { transform: translateY(-110vh) scale(1.5) rotate(360deg); opacity: 0; }
}

.sparkle { position: absolute; background: white; border-radius: 50%; opacity: 0; animation: twinkle random(5) linear infinite; }
@keyframes twinkle { 0% { opacity: 0; transform: scale(0.5); } 50% { opacity: 0.8; transform: scale(1); box-shadow: 0 0 10px #fff; } 100% { opacity: 0; transform: scale(0.5); } }

/* Sparkle Burst generated via JS */
.burst-sparkle { position: absolute; background: white; border-radius: 50%; width: 5px; height: 5px; box-shadow: 0 0 10px #fff; pointer-events: none; z-index: 1000; animation: burstAnim 0.8s ease-out forwards; }
@keyframes burstAnim { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); } }
