/* ==========================================================================
   7th Anniversary — Rose Gold & Coklat
   Palet: cream / coklat / rose gold / emas
   ========================================================================== */

:root {
  --cream:      #FAF5EF;
  --cream-2:    #F3E9DC;
  --choco:      #4A2C2A;
  --choco-soft: rgba(74, 44, 42, 0.72);
  --rose:       #B76E79;
  --rose-soft:  #E4BFBE;
  --gold:       #C9A24B;
  --gold-soft:  #E8D5B5;
  --white:      #FFFDF9;
  --shadow-paper: 0 18px 45px rgba(74, 44, 42, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 162, 75, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 0% 15%, rgba(183, 110, 121, 0.10), transparent 55%),
    var(--cream);
  color: var(--choco);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }
body.no-scroll { overflow: hidden; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   PRELOADER / OPENING
   ========================================================================== */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(700px 500px at 50% 30%, rgba(232, 213, 181, 0.5), transparent 65%),
    var(--cream);
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-inner { text-align: center; padding: 0 24px; animation: rise 1.1s var(--ease) both; }

.ring {
  width: 116px; height: 116px;
  margin: 0 auto 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--rose);
  border-right-color: var(--gold);
  animation: spinRing 1.5s linear infinite;
  display: grid; place-items: center;
  box-shadow: 0 0 34px rgba(183, 110, 121, 0.25);
}
.ring-heart {
  font-size: 40px; color: var(--rose);
  animation: heartBeat 1.4s ease-in-out infinite;
  text-shadow: 0 4px 18px rgba(183, 110, 121, 0.45);
}

.preloader-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  letter-spacing: 0.04em;
  color: var(--choco);
}
.preloader-sub {
  margin: 14px auto 28px;
  max-width: 420px;
  font-size: 1.12rem;
  color: var(--choco-soft);
  font-style: italic;
}

.btn-open {
  font-size: 1.15rem;
  padding: 12px 46px;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(135deg, var(--rose), #A85B66);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  box-shadow: 0 12px 26px rgba(183, 110, 121, 0.4);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-open:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 34px rgba(183, 110, 121, 0.5); }
.btn-open:active { transform: translateY(0) scale(0.98); }

/* ==========================================================================
   MUSIC TOGGLE
   ========================================================================== */
.music-toggle {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 60;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--choco), #6B453F);
  color: var(--gold-soft);
  font-size: 1.5rem;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(74, 44, 42, 0.35);
  transition: transform 0.3s var(--ease), opacity 0.3s;
  animation: popIn 0.6s var(--ease) both;
}
.music-toggle:hover { transform: scale(1.08); }
.music-toggle.playing { animation: spinRing 3s linear infinite; color: #F0C87A; }
.music-toggle.disabled { opacity: 0.45; cursor: not-allowed; }

/* ==========================================================================
   CANVAS (petals + confetti)
   ========================================================================== */
#petals, #confetti {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}
#confetti { z-index: 90; }

/* ==========================================================================
   HERO
   ========================================================================== */
main { position: relative; z-index: 2; }

#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 24px 70px;
}

.hero-chip {
  width: 78px; height: 78px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--gold-soft), var(--gold) 70%);
  box-shadow: 0 10px 28px rgba(201, 162, 75, 0.4);
  cursor: pointer;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  animation: floaty 4.5s ease-in-out infinite;
  margin-bottom: 30px;
}
.hero-chip:hover { transform: scale(1.1) rotate(8deg); box-shadow: 0 14px 36px rgba(201, 162, 75, 0.55); }
.chip-heart { font-size: 32px; color: var(--white); text-shadow: 0 3px 12px rgba(74, 44, 42, 0.35); }

.hero-eyebrow {
  font-style: italic;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.86rem;
  color: var(--rose);
  margin-bottom: 16px;
  animation: fadeUp 1s var(--ease) 0.2s both;
}

.hero-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 5.4rem);
  line-height: 1.08;
  color: var(--choco);
  animation: fadeUp 1s var(--ease) 0.35s both;
}
.hero-title .accent {
  background: linear-gradient(120deg, var(--rose), #C98F58);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-greet {
  margin-top: 24px;
  min-height: 2.4em;
  max-width: 760px;
  white-space: pre-line;
  font-size: clamp(1.1rem, 2.6vw, 1.42rem);
  font-style: italic;
  color: var(--choco-soft);
}
.hero-greet::after { content: "▌"; color: var(--rose); animation: blink 1s step-end infinite; }

.hero-ornament { margin-top: 30px; color: var(--gold); letter-spacing: 0.4em; font-size: 1rem; }

/* ==========================================================================
   SECTION COMMON
   ========================================================================== */
section, footer { padding: 88px 24px; }

.section-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4.6vw, 2.5rem);
  text-align: center;
  color: var(--choco);
}
.section-title::after {
  content: "✦";
  display: block;
  margin: 12px auto 0;
  color: var(--gold);
  letter-spacing: 0.3em;
}
.section-sub {
  text-align: center;
  font-style: italic;
  color: var(--rose);
  margin: 12px auto 54px;
  max-width: 520px;
}

/* ==========================================================================
   GALERI
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  max-width: 1080px;
  margin: 0 auto;
}

.g-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--gold-soft);
  box-shadow: var(--shadow-paper);
  cursor: pointer;
  animation: fadeUp 0.8s var(--ease) both;
}
.g-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.6s var(--ease);
}
.g-item:hover img { transform: scale(1.09); }

.g-item figcaption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 42px 16px 14px;
  font-style: italic;
  font-size: 0.98rem;
  color: var(--white);
  background: linear-gradient(transparent, rgba(74, 44, 42, 0.82));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.g-item:hover figcaption { opacity: 1; transform: none; }

.g-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--choco);
  background: linear-gradient(150deg, var(--gold-soft), var(--cream-2));
  text-align: center;
  padding: 20px;
}
.pl-heart { font-size: 2rem; color: var(--rose); animation: heartBeat 1.6s ease-in-out infinite; }
.pl-num { font-family: "Playfair Display", Georgia, serif; font-size: 1.05rem; letter-spacing: 0.06em; }
.pl-hint { font-size: 0.85rem; font-style: italic; color: var(--choco-soft); }

/* ==========================================================================
   SURAT CINTA
   ========================================================================== */
.letter-card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gold-soft);
  border-radius: 6px;
  padding: 54px 44px 48px;
  box-shadow: var(--shadow-paper);
}
.letter-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 162, 75, 0.4);
  border-radius: 3px;
  pointer-events: none;
}

.letter-wax {
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  width: 58px; height: 58px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #D98A93, var(--rose) 70%);
  color: var(--white);
  font-size: 24px;
  box-shadow: 0 10px 22px rgba(183, 110, 121, 0.45);
}

.letter-content {
  font-size: clamp(1.08rem, 2.2vw, 1.28rem);
  color: var(--choco);
  white-space: pre-line;
  min-height: 6em;
}
.letter-sign {
  margin-top: 34px;
  text-align: right;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--rose);
}

/* ==========================================================================
   KISAH KITA
   ========================================================================== */
.story-chapters { max-width: 760px; margin: 0 auto; }

.story-chapter {
  background: var(--white);
  border: 1px solid var(--gold-soft);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  padding: 26px 30px 24px;
  box-shadow: 0 14px 34px rgba(74, 44, 42, 0.12);
}
.story-chapter.reveal { transform: translateY(30px); }

.ch-year {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose);
  background: rgba(183, 110, 121, 0.1);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.ch-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--choco);
  margin-bottom: 10px;
}
.ch-text { color: var(--choco-soft); font-size: 1.08rem; }

.ch-ornament {
  text-align: center;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.4em;
  margin: 26px 0 34px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  text-align: center;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
  padding-bottom: 110px;
}
.footer-main {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--choco);
  margin-bottom: 10px;
}
.footer-sub { font-style: italic; color: var(--choco-soft); }

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(46, 26, 24, 0.92);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.35s var(--ease) both;
  padding: 40px 60px;
}
.lb-frame { max-width: min(88vw, 760px); text-align: center; }
.lb-frame img {
  max-height: 76vh;
  width: auto;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(232, 213, 181, 0.4);
  opacity: 0;
  transform: scale(0.96);
  animation: lbIn 0.4s var(--ease) forwards;
}
.lb-frame figcaption {
  margin-top: 16px;
  color: var(--gold-soft);
  font-style: italic;
  font-size: 1.05rem;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  color: var(--gold-soft);
  font-size: 2.3rem;
  line-height: 1;
  transition: transform 0.3s, color 0.3s;
}
.lb-close { top: 18px; right: 26px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: #fff; transform: scale(1.2); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.2); }

/* ==========================================================================
   TOAST
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 92px; left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  background: var(--choco);
  color: var(--gold-soft);
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(74, 44, 42, 0.4);
  font-style: italic;
  animation: toastIn 0.4s var(--ease) both;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes spinRing { to { transform: rotate(360deg); } }
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.14); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  70% { transform: scale(1); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbIn {
  to { opacity: 1; transform: scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .gallery-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding: 6px 4px 18px;
    scrollbar-width: none;
  }
  .gallery-grid::-webkit-scrollbar { display: none; }
  .g-item { flex: 0 0 min(84%, 380px); max-width: 84%; scroll-snap-align: center; }
  .g-item figcaption { opacity: 1; transform: none; }

  .story-chapters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding: 6px 4px 18px;
    scrollbar-width: none;
  }
  .story-chapters::-webkit-scrollbar { display: none; }
  .story-chapter { flex: 0 0 86%; max-width: 86%; scroll-snap-align: center; }
  .ch-ornament { display: none; }
  section, footer { padding: 68px 20px; }
}
@media (max-width: 560px) {
  .letter-card { padding: 44px 26px 40px; }
  .lightbox { padding: 30px 18px; }
  .lb-close { top: 12px; right: 16px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}