/* ============================================================
   ROMANTIC BIRTHDAY WEBSITE — style.css
   Palet warna:
   - Pink pastel  : #FBD3E0
   - Rose gold    : #E8A2B8 / #D98BA4
   - Lavender     : #C9B8E8
   - Cream        : #FFF6EF
   - White        : #FFFFFF
   - Glow gold    : #F3D9A4 / #E9C46A
============================================================ */

/* ---------- CSS VARIABLES (mudah diedit) ---------- */
:root {
  --pink-pastel: #fbd3e0;
  --rose-gold: #d98ba4;
  --rose-gold-deep: #b96a86;
  --lavender: #c9b8e8;
  --cream: #fff6ef;
  --white: #ffffff;
  --gold: #e9c46a;
  --gold-soft: #f3d9a4;
  --text-dark: #5c3a4a;
  --text-soft: #8a6274;

  --font-heading: "Playfair Display", serif;
  --font-body: "Poppins", sans-serif;

  --shadow-soft: 0 10px 40px rgba(185, 106, 134, 0.18);
  --shadow-glow: 0 0 25px rgba(233, 196, 106, 0.45);
  --radius-lg: 24px;
  --radius-md: 18px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  overflow-x: hidden;
  background: var(--cream);
  line-height: 1.7;
}

/* ============================================================
   BACKGROUND: gradient romantis + canvas partikel
============================================================ */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1200px 800px at 15% 10%, rgba(251, 211, 224, 0.9), transparent 60%),
    radial-gradient(1000px 700px at 85% 20%, rgba(201, 184, 232, 0.7), transparent 60%),
    radial-gradient(900px 900px at 50% 100%, rgba(243, 217, 164, 0.5), transparent 65%),
    linear-gradient(160deg, #fff6ef 0%, #fde8ef 45%, #f3ecfa 100%);
}

#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

/* Container hati melayang (diisi oleh script.js) */
#heartContainer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -40px;
  color: var(--rose-gold);
  opacity: 0.5;
  animation: heartRise linear forwards;
  user-select: none;
}

@keyframes heartRise {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.55;
  }
  100% {
    transform: translateY(-110vh) translateX(var(--drift, 30px)) rotate(25deg) scale(1.15);
    opacity: 0;
  }
}

/* ============================================================
   MUSIC BUTTON
============================================================ */
.music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--rose-gold-deep);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.music-btn:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-glow);
}

.music-btn.playing .music-icon {
  display: inline-block;
  animation: musicPulse 1.2s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 16px 36px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--rose-gold), var(--rose-gold-deep));
  box-shadow:
    0 8px 25px rgba(185, 106, 134, 0.35),
    0 0 0 0 rgba(233, 196, 106, 0);
  position: relative;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    0 12px 32px rgba(185, 106, 134, 0.45),
    0 0 28px rgba(233, 196, 106, 0.55); /* glow gold */
}

.btn-large {
  padding: 20px 48px;
  font-size: 1.1rem;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--rose-gold-deep);
  border: 1px solid rgba(217, 139, 164, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-2px);
}

/* ============================================================
   1. HERO SECTION
============================================================ */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 40px 24px 90px;
  perspective: 900px; /* memberi kedalaman 3D untuk shape */
}

.hero-content {
  max-width: 760px;
  animation: heroIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.12;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.hero-name {
  font-style: italic;
  background: linear-gradient(120deg, var(--rose-gold-deep), var(--gold), var(--rose-gold));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 5s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  font-weight: 300;
  color: var(--text-soft);
  max-width: 540px;
  margin: 0 auto 42px;
}

/* --- Floating 3D shapes & bintang di hero --- */
.hero-3d {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-style: preserve-3d;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: float3d 9s ease-in-out infinite;
}

.shape-1 {
  width: 130px;
  height: 130px;
  top: 14%;
  left: 8%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--pink-pastel));
  animation-delay: 0s;
}

.shape-2 {
  width: 90px;
  height: 90px;
  bottom: 20%;
  right: 10%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--lavender));
  animation-delay: -3s;
}

.shape-3 {
  width: 60px;
  height: 60px;
  top: 24%;
  right: 22%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--gold-soft));
  animation-delay: -6s;
}

@keyframes float3d {
  0%, 100% {
    transform: translateY(0) translateZ(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) translateZ(60px) rotate(8deg);
  }
}

.floating-star {
  position: absolute;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(233, 196, 106, 0.8);
  animation: twinkle 3.5s ease-in-out infinite;
  font-size: 1.1rem;
}

.star-1 { top: 18%; right: 12%; animation-delay: 0s; }
.star-2 { top: 40%; left: 12%; animation-delay: 1s; font-size: 0.85rem; }
.star-3 { bottom: 26%; left: 22%; animation-delay: 2s; }
.star-4 { bottom: 34%; right: 26%; animation-delay: 0.5s; font-size: 0.8rem; }

@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}

/* --- Scroll hint --- */
.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

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

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ============================================================
   2. LOVE LETTER OVERLAY + ENVELOPE ANIMATION
============================================================ */
.letter-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(92, 58, 74, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.letter-overlay.active {
  opacity: 1;
  visibility: visible;
}

.envelope-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  width: 100%;
  max-width: 620px;
}

/* --- Amplop --- */
.envelope {
  position: relative;
  width: min(340px, 86vw);
  height: 220px;
  perspective: 1200px;
  transition: transform 0.6s ease;
}

.envelope-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #fdeaf1, var(--pink-pastel));
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.envelope-seal {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-gold), var(--rose-gold-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 18px rgba(233, 196, 106, 0.6);
  z-index: 3;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, #f7c9da, #f2b8ce);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 4;
  border-radius: 10px 10px 0 0;
}

/* --- Kartu surat di dalam amplop --- */
.letter-card {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) translateY(0);
  width: 92%;
  max-height: 150px;
  overflow: hidden;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(92, 58, 74, 0.15);
  z-index: 2;
  transition:
    transform 1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s,
    max-height 1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s,
    width 1s ease 0.5s;
}

/* --- Keadaan amplop TERBUKA --- */
.envelope.open .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.envelope.open .envelope-seal {
  opacity: 0;
  transform: scale(0.4);
}

.envelope.open .letter-card {
  transform: translateX(-50%) translateY(-40px);
  max-height: min(62vh, 520px);
  width: min(560px, 90vw);
  z-index: 5;
  overflow-y: auto;
}

.letter-inner {
  padding: 34px 30px;
}

.letter-heading {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--rose-gold-deep);
  text-align: center;
  margin-bottom: 20px;
}

.letter-text p {
  font-size: 0.95rem;
  font-weight: 300;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.letter-signature {
  font-family: var(--font-heading);
  font-style: italic;
  text-align: right;
  color: var(--rose-gold-deep);
  font-size: 1.05rem;
}

.close-letter {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease 1.2s, transform 0.5s ease 1.2s;
  pointer-events: none;
}

.letter-overlay.active .close-letter {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================================================
   SECTIONS (umum)
============================================================ */
.section {
  padding: 110px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-head {
  text-align: center;
  margin-bottom: 70px;
}

.section-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--rose-gold);
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  color: var(--text-dark);
}

/* --- Reveal on scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ============================================================
   3. MEMORY TIMELINE
============================================================ */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 70px;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(
    to bottom,
    transparent,
    var(--rose-gold) 12%,
    var(--lavender) 88%,
    transparent
  );
  opacity: 0.5;
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 48px;
}

/* Zig-zag kiri kanan */
.timeline-item:nth-child(even) {
  align-self: flex-start;
  text-align: right;
}

.timeline-item:nth-child(odd) {
  align-self: flex-end;
}

.timeline-dot {
  position: absolute;
  top: 26px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(217, 139, 164, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose-gold-deep);
  font-size: 0.85rem;
  box-shadow: 0 0 16px rgba(233, 196, 106, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.timeline-item:nth-child(even) .timeline-dot { right: -20px; }
.timeline-item:nth-child(odd) .timeline-dot { left: -20px; }

/* --- Memory card (glassmorphism + 3D tilt) --- */
.memory-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  transform-style: preserve-3d;
  transition: box-shadow 0.4s ease;
  text-align: left;
}

.memory-card:hover {
  box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.memory-photo {
  height: 160px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--pink-pastel), var(--lavender));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(92, 58, 74, 0.55);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  overflow: hidden;
}

/* Jika kamu memasang <img> di dalam .memory-photo */
.memory-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--rose-gold-deep);
  margin-bottom: 10px;
}

.memory-card p {
  font-size: 0.92rem;
  font-weight: 300;
  color: var(--text-soft);
}

/* Tilt effect di-handle JS via transform inline;
   transisi halus saat mouse keluar */
.tilt-card {
  will-change: transform;
  transition: transform 0.35s ease-out, box-shadow 0.4s ease;
}

/* ============================================================
   4. WISHES SECTION
============================================================ */
.wishes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}

.wish-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.wish-card:hover {
  box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.wish-card-wide {
  grid-column: 1 / -1;
}

.wish-icon {
  display: inline-block;
  font-size: 1.5rem;
  color: var(--rose-gold);
  margin-bottom: 14px;
  text-shadow: 0 0 14px rgba(233, 196, 106, 0.55);
}

.wish-card p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--text-dark);
}

/* ============================================================
   5. SURPRISE SECTION + MODAL
============================================================ */
.surprise-section {
  text-align: center;
}

.surprise-section .section-title {
  margin-bottom: 40px;
}

.surprise-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(92, 58, 74, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.surprise-modal.active {
  opacity: 1;
  visibility: visible;
}

.surprise-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: scale(0.85) translateY(20px);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.surprise-modal.active .surprise-card {
  transform: scale(1) translateY(0);
}

.surprise-heart {
  display: inline-block;
  font-size: 2.4rem;
  color: var(--rose-gold-deep);
  margin-bottom: 18px;
  animation: heartbeat 1.4s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(233, 196, 106, 0.65);
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.2); }
  40% { transform: scale(1); }
  60% { transform: scale(1.15); }
}

.surprise-text {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 28px;
}

/* Canvas confetti di atas segalanya, tidak menghalangi klik */
#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

/* ============================================================
   FOOTER
============================================================ */
.footer {
  text-align: center;
  padding: 50px 24px 60px;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* ============================================================
   RESPONSIVE — Tablet
============================================================ */
@media (max-width: 900px) {
  .section {
    padding: 90px 22px;
  }

  /* Timeline jadi satu kolom */
  .timeline-line {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(even),
  .timeline-item:nth-child(odd) {
    width: 100%;
    align-self: stretch;
    text-align: left;
    padding: 0 0 0 56px;
  }

  .timeline-item:nth-child(even) .timeline-dot,
  .timeline-item:nth-child(odd) .timeline-dot {
    left: 0;
    right: auto;
  }
}

/* ============================================================
   RESPONSIVE — Mobile
============================================================ */
@media (max-width: 600px) {
  .section {
    padding: 72px 18px;
  }

  .section-head {
    margin-bottom: 48px;
  }

  .wishes-grid {
    grid-template-columns: 1fr;
  }

  .wish-card-wide {
    grid-column: auto;
  }

  .btn {
    padding: 14px 30px;
    font-size: 0.95rem;
  }

  .btn-large {
    padding: 16px 36px;
    font-size: 1rem;
  }

  .music-btn {
    top: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
  }

  .letter-inner {
    padding: 26px 20px;
  }

  .envelope.open .letter-card {
    max-height: 58vh;
  }

  .floating-shape {
    opacity: 0.4;
  }

  .shape-1 { width: 90px; height: 90px; }
  .shape-2 { width: 64px; height: 64px; }
}

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

  html {
    scroll-behavior: auto;
  }
}
