/* ============================================================
   Untuk Ainy — 10.10 · dari Abiy Riskifa
   "kotak perhiasan di malam hari" — langit malam plum,
   kelopak sakura, dan satu benang emas yang menghubungkan
   Depok ⇄ Jepang di sepanjang halaman.
   ============================================================ */

:root {
  --ink:      #1a1220;
  --ink-2:    #241829;
  --ink-3:    #2d1f33;
  --ivory:    #f3ead9;
  --ivory-dim: rgba(243, 234, 217, .62);
  --rose:     #e79fb2;
  --rose-deep:#b96a86;
  --gold:     #d9b26a;
  --gold-dim: rgba(217, 178, 106, .38);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Great Vibes', cursive;
  --sans:  'Jost', system-ui, sans-serif;
  --ease:  cubic-bezier(.2, .7, .3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(231,159,178,.07), transparent 60%),
    radial-gradient(1000px 600px at 10% 110%, rgba(217,178,106,.05), transparent 60%),
    var(--ink);
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
body:not(.opened) { overflow: hidden; }

::selection { background: var(--rose-deep); color: var(--ink); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #3a2a42; border-radius: 6px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
img { max-width: 100%; }

/* film grain tipis */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 98;
  opacity: .045;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ---- langit & ledakan ---- */
#petals { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#burst  { position: fixed; inset: 0; z-index: 96; pointer-events: none; }

main { position: relative; z-index: 1; }

/* ---- benang emas (kemajuan) ---- */
#thread {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 90; pointer-events: none;
}
#thread i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, transparent, var(--gold));
  box-shadow: 0 0 8px rgba(217,178,106,.6);
}

/* ============================================================
   GERBANG KADO
   ============================================================ */
#gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 600px at 50% 20%, rgba(231,159,178,.06), transparent 60%),
    var(--ink);
  transition: opacity 1.4s var(--ease), visibility 1.4s;
  padding: 1.5rem;
}
#gate.gone { opacity: 0; visibility: hidden; }

.gate-inner { text-align: center; }
.gate-eyebrow { font-family: var(--sans); font-size: .72rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); }
.gate-sub { font-family: var(--serif); font-style: italic; color: var(--ivory-dim); margin: .5rem 0 2.6rem; font-size: 1.15rem; }

#envelope {
  position: relative;
  width: min(340px, 86vw);
  height: 260px;
  perspective: 900px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.5));
}

.env-back {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  z-index: 1;
}

.env-letter {
  position: absolute; z-index: 2;
  left: 6%; right: 6%; top: 5%; height: 90%;
  background: linear-gradient(180deg, #f7efe0, #efe2cd);
  border-radius: 5px;
  display: grid; place-items: center;
  transition: transform 1s var(--ease) .55s;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.env-letter-heart {
  color: var(--rose-deep);
  font-size: 2rem;
  opacity: .9;
  transition: opacity .4s, transform .8s var(--ease) .8s;
}
#envelope.open .env-letter { transform: translateY(-52%); }
#envelope.open .env-letter-heart { opacity: 1; transform: scale(1.25); }

.env-front {
  position: absolute; z-index: 3;
  left: 0; right: 0; bottom: 0; height: 68%;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  clip-path: polygon(0 100%, 0 10%, 50% 52%, 100% 10%, 100% 100%);
  border-radius: 0 0 8px 8px;
  box-shadow: inset 0 1px 0 rgba(217,178,106,.22);
}

.env-flap {
  position: absolute; z-index: 4;
  left: 0; right: 0; top: 0; height: 58%;
  background: linear-gradient(180deg, #3a2842, var(--ink-3));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 8px 8px 0 0;
  transform-origin: top center;
  transition: transform 1s var(--ease) .15s, opacity .3s .95s;
  box-shadow: inset 0 -1px 0 rgba(217,178,106,.25);
}
#envelope.open .env-flap { transform: rotateX(180deg); opacity: .35; }

.env-seal {
  position: absolute; z-index: 5;
  left: 50%; top: calc(58% - 17px);
  transform: translateX(-50%);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: #f3e2c8; font-size: .95rem; line-height: 1;
  background: radial-gradient(circle at 35% 30%, #e8c98c, #b3853f 70%);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.15);
  transition: opacity .4s, transform .5s var(--ease);
}
#envelope.open .env-seal { opacity: 0; transform: translateX(-50%) scale(1.6); }

.env-writing {
  position: absolute; z-index: 3;
  left: 5%; right: 5%; bottom: 5.5%;
  display: flex; flex-direction: column; align-items: center;
  gap: .22rem;
  transition: opacity .5s;
}
.env-to {
  font-family: var(--sans);
  font-size: .6rem;
  letter-spacing: .32em;
  margin-right: -.32em; /* presisi: hapus spasi trailing */
  text-transform: uppercase;
  color: var(--gold);
  opacity: .92;
}
.env-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 1.8rem);
  line-height: 1.05;
  letter-spacing: .015em;
  color: var(--ivory);
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.env-swash {
  width: 108px; height: 11px;
  color: var(--gold);
  opacity: .85;
  margin-top: .1rem;
}
#envelope.open .env-writing { opacity: 0; }

.gate-hint {
  margin-top: 2.4rem;
  font-family: var(--sans); font-size: .78rem; letter-spacing: .22em;
  color: var(--ivory-dim);
  animation: hintPulse 2.6s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: .45; } 50% { opacity: 1; }
}
.gate-from {
  margin-top: 1rem;
  font-family: var(--script);
  font-size: 1.35rem;
  color: var(--rose);
}

/* ============================================================
   MUSIK
   ============================================================ */
#ytHolder { position: fixed; width: 1px; height: 1px; overflow: hidden; opacity: 0; bottom: 0; }

#musicBtn {
  position: fixed; right: 18px; bottom: 18px; z-index: 95;
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: rgba(45, 31, 51, .82);
  backdrop-filter: blur(6px);
  color: var(--gold);
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
#musicBtn:hover { transform: translateY(-3px); border-color: var(--gold); }
#musicBtn .icon-note { width: 22px; height: 22px; }
#musicBtn .eq { display: none; align-items: flex-end; gap: 3px; height: 18px; }
#musicBtn .eq i { width: 3px; background: var(--gold); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
#musicBtn .eq i:nth-child(2) { animation-delay: .18s; }
#musicBtn .eq i:nth-child(3) { animation-delay: .34s; }
#musicBtn.playing .icon-note { display: none; }
#musicBtn.playing .eq { display: flex; }
@keyframes eq {
  0%, 100% { height: 5px; } 50% { height: 16px; }
}
.hidden { display: none !important; }

/* ============================================================
   TIPOGRAFI DASAR
   ============================================================ */
.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .9;
}
.script { font-family: var(--script); font-weight: 400; }

/* reveal saat scroll */
.rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.rv.on { opacity: 1; transform: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid; place-items: center;
  text-align: center;
  padding: 5rem 1.4rem 4rem;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(560px 420px at 50% 38%, rgba(231,159,178,.09), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 720px; }

.hero h1 { margin-top: 1.3rem; }
.hero .script { display: block; font-size: clamp(2.4rem, 8vw, 4rem); color: var(--rose); }
.hero .name {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(3rem, 11vw, 6rem);
  line-height: .98;
  letter-spacing: .01em;
  margin-top: .4rem;
  text-shadow: 0 4px 40px rgba(0,0,0,.5);
}
.hero .name em { color: var(--rose); font-style: italic; }
.hero .age {
  display: block;
  font-family: var(--script);
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  color: var(--gold);
  margin-top: 1rem;
}

.hero-line { margin-top: 1.6rem; font-size: 1.22rem; color: var(--ivory-dim); font-style: italic; }
.hl { color: var(--rose); font-style: normal; }

/* kartu hitung mundur */
.count-card {
  position: relative;
  margin: 2.8rem auto 0;
  max-width: 430px;
  padding: 2rem 1.6rem 1.5rem;
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  background: rgba(36, 24, 41, .5);
  backdrop-filter: blur(4px);
}
.count-label {
  position: absolute; top: -.62rem; left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--ink);
  padding: 0 14px;
  font-family: var(--sans);
  font-size: .68rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold);
}
.count-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.count-cell b {
  display: block;
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
}
.count-cell span {
  font-family: var(--sans);
  font-size: .62rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--ivory-dim);
}
.count-note { margin-top: 1.1rem; font-family: var(--script); font-size: 1.45rem; color: var(--rose); }
.count-note:empty { display: none; }

.scroll-hint {
  margin-top: 3rem;
  font-family: var(--sans); font-size: .75rem; letter-spacing: .2em;
  color: var(--ivory-dim); line-height: 2.1;
}
.scroll-hint span { display: inline-block; animation: driftDown 2.4s ease-in-out infinite; color: var(--gold); }
@keyframes driftDown { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

/* ============================================================
   PEMBATAS BENANG EMAS
   ============================================================ */
.letter-wrap { padding: clamp(3rem, 9vw, 6rem) 1.4rem 0; }
.divider { display: flex; align-items: center; gap: 20px; max-width: 680px; margin: 0 auto; }
.divider i { flex: 1; height: 1px; }
.divider i:first-child { background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.divider i:last-child { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.divider .blossom { width: 19px; height: 19px; color: var(--gold); flex: none; }

/* ============================================================
   SURAT
   ============================================================ */
.letter {
  position: relative;
  max-width: 720px;
  margin: 3.2rem auto 0;
  padding: clamp(2.2rem, 6vw, 3.8rem) clamp(1.4rem, 5vw, 3rem);
  background: linear-gradient(165deg, #221727, #1b1420);
  border: 1px solid rgba(217,178,106,.22);
  border-radius: 8px;
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.75);
}
.letter::before {
  content: '♥';
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; line-height: 26px; text-align: center;
  color: var(--ink); font-size: .8rem;
  background: var(--rose-deep);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
}
.letter p { margin-bottom: 1.35rem; font-size: 1.24rem; line-height: 1.95; color: rgba(243,234,217,.86); }
.letter p em { color: var(--ivory); }
.letter-open { font-size: 2.2rem !important; color: var(--rose); margin-bottom: 1.6rem !important; }
.letter-sign { font-size: 2.5rem !important; color: var(--rose); margin: 2.2rem 0 .3rem !important; text-align: right; }
.letter-from { font-family: var(--sans) !important; font-size: .7rem !important; letter-spacing: .25em; text-transform: uppercase; color: var(--ivory-dim); text-align: right; margin-bottom: 0 !important; }

/* ============================================================
   BAB
   ============================================================ */
.bab {
  padding: clamp(4.5rem, 11vw, 7.5rem) 1.4rem;
}
.bab-head { text-align: center; max-width: 660px; margin: 0 auto; }
.bab-head h2 {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: clamp(2rem, 6.4vw, 3.1rem);
  margin-top: 1rem; line-height: 1.15;
}
.bab-intro { margin-top: 1.1rem; font-size: 1.24rem; color: var(--ivory-dim); font-style: italic; }

/* cetakan foto terbingkai */
.print, .phone { position: relative; }
.print {
  background: #efe5d2;
  padding: 10px 10px 2px;
  border-radius: 6px;
  box-shadow: 0 26px 55px -22px rgba(0,0,0,.75);
  transition: transform .5s var(--ease), box-shadow .5s;
}
.print:hover, .print:focus-visible {
  transform: translateY(-7px);
  box-shadow: 0 40px 70px -25px rgba(0,0,0,.8);
}
.print img { width: 100%; display: block; border-radius: 2px; }
.print figcaption {
  font-family: var(--script);
  color: #6d3a52;
  font-size: 1.18rem;
  padding: .55rem .3rem .6rem;
  text-align: center;
  line-height: 1.3;
}

/* jalur stagger (bab kecil) */
.rail { max-width: 780px; margin: 3.4rem auto 0; display: grid; gap: 2.6rem; justify-items: start; }
.rail .print { width: min(340px, 76vw); rotate: -1.4deg; }
.rail .print.right { justify-self: end; rotate: 1.6deg; }

/* galeri mosaik */
.gallery {
  max-width: 1080px; margin: 3.4rem auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 44vw), 1fr));
  gap: 1.7rem;
}
.gallery .print { rotate: 0deg; }
.gallery .print:nth-child(odd)  { rotate: -.7deg; }
.gallery .print:nth-child(even) { rotate: .8deg; }

/* senyum: sorot sinematik */
.spotlight { max-width: 900px; margin: 3.4rem auto 0; text-align: center; }
.spotlight img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 40px 100px -35px rgba(231,159,178,.4), 0 30px 60px -30px rgba(0,0,0,.8);
}
.spotlight figcaption { margin-top: 1.8rem; display: grid; gap: .4rem; }
.spotlight figcaption span:first-child { font-family: var(--script); font-size: 1.9rem; color: var(--rose); }
.spotlight figcaption span:last-child { font-style: italic; color: var(--ivory-dim); font-size: 1.15rem; }

/* dinding video call: bingkai telepon */
.vc-wall {
  max-width: 1080px; margin: 3.4rem auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 40vw), 1fr));
  gap: 1.5rem;
}
.phone {
  background: #0e0a13;
  border: 1px solid rgba(231,159,178,.22);
  border-radius: 26px;
  padding: 10px;
  box-shadow: 0 26px 55px -24px rgba(0,0,0,.8);
  transition: transform .5s var(--ease), border-color .4s;
}
.phone:hover { transform: translateY(-7px); border-color: rgba(231,159,178,.5); }
.phone img { width: 100%; display: block; border-radius: 17px; }
.phone figcaption {
  font-family: var(--script);
  color: rgba(231,159,178,.85);
  font-size: 1.06rem;
  padding: .55rem .2rem .25rem;
  text-align: center;
  line-height: 1.25;
}
.vc-wall .phone:nth-child(even) { rotate: .8deg; }
.vc-wall .phone:nth-child(odd)  { rotate: -.8deg; }

/* dua foto berdampingan */
.duo { max-width: 780px; margin: 3.4rem auto 0; display: grid; gap: 2rem; }
.duo .print { rotate: -1deg; }
.duo .print:nth-child(2) { rotate: 1.4deg; }

/* ---- peta benang emas ---- */
.map { max-width: 900px; margin: 3.6rem auto 0; }
.map svg { width: 100%; height: auto; display: block; border-radius: 18px; box-shadow: 0 40px 90px -40px rgba(0,0,0,.85); }
.map-city { font-family: var(--sans); font-weight: 500; font-size: 15px; letter-spacing: 3.5px; fill: var(--ivory); }
.map-sub  { font-family: var(--sans); font-weight: 300; font-size: 11px; letter-spacing: 1.2px; fill: rgba(243,234,217,.5); }
.map-dist { font-family: var(--sans); font-weight: 300; font-size: 12px; letter-spacing: 2.5px; fill: var(--gold-dim); }
.map-caption {
  text-align: center; margin-top: 1.6rem;
  font-style: italic; font-size: 1.18rem; color: var(--ivory-dim);
}
@media (max-width: 640px) {
  .map-city { font-size: 26px; }
  .map-sub  { font-size: 19px; }
  .map-dist { font-size: 20px; }
}

/* ---- garis waktu mimpi ---- */
.mile { max-width: 560px; margin: 4rem auto 0; position: relative; padding: 1rem 0; }
.mile::before {
  content: '';
  position: absolute; left: 50%; top: 14px; bottom: 14px; width: 1px;
  background: linear-gradient(180deg, var(--gold-dim), var(--gold), var(--gold-dim));
}
.mile-node { position: relative; text-align: center; padding: 1.35rem 0; }
.mile-dot {
  position: relative; z-index: 1;
  display: block; width: 13px; height: 13px; margin: 0 auto .7rem;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--gold);
}
.mile-node b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.45rem; }
.mile-node span:not(.mile-dot) {
  font-family: var(--sans); font-size: .78rem; letter-spacing: .12em;
  color: var(--ivory-dim);
}
.mile-node.next .mile-dot {
  background: var(--gold);
  box-shadow: 0 0 22px rgba(217,178,106,.8);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 10px rgba(217,178,106,.5); }
  50% { box-shadow: 0 0 26px rgba(217,178,106,.95); }
}
.mile-node.next b { color: var(--gold); }
.mile-count { text-align: center; margin-top: 2.2rem; font-family: var(--script); font-size: 1.9rem; color: var(--rose); }

/* ============================================================
   KUE & LILIN
   ============================================================ */
.cake-sec { text-align: center; }
.cake {
  position: relative;
  width: min(300px, 68vw);
  margin: 4.5rem auto 0;
  display: flex; flex-direction: column; align-items: center;
}
.cake-glow {
  position: absolute; inset: -60% -30%;
  background: radial-gradient(closest-side, rgba(255,190,120,.16), transparent);
  pointer-events: none;
}
.tier {
  position: relative;
  border-radius: 12px 12px 8px 8px;
  box-shadow: inset 0 -10px 18px rgba(0,0,0,.18), inset 0 3px 6px rgba(255,255,255,.5);
}
.t1 { width: 58%; height: 54px; background: linear-gradient(180deg, #f6e7d8, #ead0b8); z-index: 3; }
.t2 { width: 86%; height: 68px; background: linear-gradient(180deg, #efdccb, #e2c3ab); margin-top: 5px; z-index: 2; }
.ribbon {
  position: absolute; left: 0; right: 0; top: 50%; height: 6px;
  background: linear-gradient(90deg, transparent, #c9a35f 18% 82%, transparent);
  opacity: .75;
}
.plate {
  width: 106%; height: 16px; margin-top: 9px;
  background: radial-gradient(ellipse at 50% 0%, #3a2a42, #241a2c);
  border-radius: 50%;
  box-shadow: 0 34px 60px -20px rgba(0,0,0,.9);
  z-index: 1;
}

.candles {
  position: absolute; top: -66px; left: 0; right: 0;
  display: flex; justify-content: center; gap: clamp(14px, 6vw, 30px);
  z-index: 4;
}
.candle {
  position: relative;
  width: 34px; height: 66px;
  display: block;
}
.stick {
  display: block; width: 10px; height: 46px; margin: 20px auto 0;
  background: repeating-linear-gradient(48deg, #f4ead9 0 6px, #e7b7c3 6px 12px);
  border-radius: 3px;
  box-shadow: inset -3px 0 5px rgba(0,0,0,.28);
  transition: filter .5s;
}
.candle.tall .stick { height: 58px; }
.flame {
  position: absolute; top: 0; left: 50%;
  width: 15px; height: 23px;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  background: radial-gradient(circle at 50% 68%, #fff8e2 0 16%, #ffd98a 42%, #ff9d5c 70%, rgba(255,120,60,0) 76%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  filter: blur(.3px);
  animation: flicker 1.7s ease-in-out infinite;
  box-shadow: 0 0 26px 7px rgba(255,190,120,.35);
}
.candle:nth-child(2) .flame { animation-delay: .5s; }
.candle:nth-child(3) .flame { animation-delay: .9s; }
@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(-1.5deg); }
  30% { transform: translateX(-50%) scale(1.08, .94) rotate(2deg); }
  60% { transform: translateX(-50%) scale(.95, 1.06) rotate(-2.5deg); }
}
.candle.out .flame { animation: puff .45s ease-out forwards; box-shadow: none; }
@keyframes puff {
  to { transform: translateX(-50%) scale(.15, .3); opacity: 0; }
}
.candle.out .stick { filter: brightness(.55); }
.candle.out::after {
  content: '';
  position: absolute; top: 6px; left: calc(50% - 1px);
  width: 2px; height: 30px;
  background: linear-gradient(transparent, rgba(210,210,220,.4), transparent);
  animation: smoke 1.8s ease-out forwards;
  opacity: 0;
}
@keyframes smoke {
  0% { opacity: 0; transform: translateY(0); }
  25% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-24px) translateX(4px); }
}
.cake.wishes .cake-glow {
  background: radial-gradient(closest-side, rgba(231,159,178,.12), transparent);
  transition: background 1s;
}

.wish {
  margin-top: 3.4rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.wish.on { opacity: 1; transform: none; }
.wish-l1 { font-family: var(--script); font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--rose); }
.wish-l2 { margin-top: 1.2rem; font-size: 1.28rem; font-style: italic; color: var(--ivory-dim); line-height: 1.9; }
.wish-l2 b { color: var(--gold); font-style: normal; }

/* tombol hantu (garis emas) */
.relight, .replay {
  margin-top: 2.4rem;
  font-family: var(--sans); font-size: .78rem;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: .8rem 1.9rem;
  transition: background .35s, border-color .35s, transform .3s var(--ease);
}
.relight:hover, .replay:hover { background: rgba(217,178,106,.1); border-color: var(--gold); transform: translateY(-2px); }

/* ============================================================
   PENUTUP
   ============================================================ */
.closing {
  min-height: 92vh;
  display: grid; place-items: center;
  text-align: center;
  padding: 6rem 1.4rem 5rem;
  position: relative;
}
.closing::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(640px 480px at 50% 55%, rgba(231,159,178,.08), transparent 70%);
  pointer-events: none;
}
.closing-inner { position: relative; max-width: 680px; }
.together { margin-top: 1.4rem; font-style: italic; font-size: 1.35rem; color: var(--ivory-dim); }
.big-count { margin-top: .6rem; }
.big-count b {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(4.2rem, 17vw, 7.5rem);
  color: var(--gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.big-count span {
  font-family: var(--script);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  color: var(--rose);
  margin-left: .7rem;
}
.together-sub { margin-top: 1.1rem; font-style: italic; color: var(--ivory-dim); font-size: 1.15rem; }
.together-sub span { color: var(--gold); font-style: normal; }
.sign { font-family: var(--script); font-size: clamp(2.8rem, 9vw, 4rem); color: var(--ivory); margin-top: 3rem; }
.sign-sub { font-family: var(--sans); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ivory-dim); margin-top: .8rem; }
.credit { font-family: var(--sans); font-size: .66rem; letter-spacing: .2em; color: rgba(243,234,217,.4); margin-top: 3.6rem; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
#lightbox {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  background: rgba(10, 7, 14, .92);
  backdrop-filter: blur(10px);
  padding: 1rem;
}
#lightbox[hidden] { display: none; }
.lb-fig { display: grid; justify-items: center; max-width: 100%; }
.lb-fig img {
  max-width: min(92vw, 900px);
  max-height: 74vh;
  border-radius: 8px;
  box-shadow: 0 50px 120px -30px rgba(0,0,0,.9);
}
.lb-fig figcaption { margin-top: 1.2rem; }
#lbCap { font-family: var(--script); font-size: clamp(1.5rem, 5vw, 2rem); color: var(--rose); }
.lb-btn {
  position: fixed; z-index: 2;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: rgba(26, 18, 32, .72);
  color: var(--ivory);
  font-size: 1.35rem; line-height: 1;
  display: grid; place-items: center;
  transition: border-color .3s, background .3s;
  font-family: var(--sans);
}
.lb-btn:hover { border-color: var(--gold); background: rgba(45, 31, 51, .9); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ============================================================
   RESPONSIF
   ============================================================ */
@media (min-width: 720px) {
  .duo { grid-template-columns: 1fr 1fr; gap: 2.4rem; }
  .rail { gap: 3.2rem; }
  .gallery { gap: 2rem; }
  .count-cell b { font-size: 2.4rem; }
}

/* ============================================================
   GERAKAN DIBATASI (hormati preferensi pengguna)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { transition: none; opacity: 1; transform: none; }
  .flame, .gate-hint, .scroll-hint span, .mile-node.next .mile-dot,
  #musicBtn .eq i { animation: none !important; }
  * { transition-duration: .01ms !important; }
}
