/* =========================================================
   BIRTHDAY WEBSITE · style.css
   Ubah warna & font di bagian :root di bawah ini.
   ========================================================= */

:root {
  --pink: #F8C8DC;
  --soft: #FCE4EC;
  --cream: #FFF8F5;
  --ink: #59434A;

  --rose: #E8A5BF;
  --rose-deep: #D98BAA;
  --ink-soft: rgba(89, 67, 74, .72);
  --glass: rgba(255, 255, 255, .5);
  --glass-line: rgba(255, 255, 255, .8);

  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Poppins', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 3px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; fill: currentColor; }

/* ---------- background layers ---------- */
.bg { position: fixed; inset: 0; z-index: 0; transition: opacity 1.4s ease; }
.bg--cream { background: radial-gradient(110% 80% at 50% -10%, #fff 0%, var(--cream) 40%, var(--soft) 100%); }
.bg--pink  { background: radial-gradient(100% 75% at 50% 0%, #FDDCE9 0%, var(--pink) 60%, #F2B5CD 125%); opacity: 0; }
body[data-tone="pink"] .bg--pink { opacity: 1; }

#fx-bg, #fx-confetti {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
#fx-bg { z-index: 1; }
#fx-confetti { z-index: 6; }

/* ---------- stage & slides ---------- */
.stage { position: fixed; inset: 0; z-index: 2; }

.slide {
  position: absolute; inset: 0;
  display: flex;
  padding: 78px 22px 108px;
  text-align: center;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .9s var(--ease), transform .9s var(--ease), visibility 0s linear .9s;
}
.slide[data-pos="before"] { transform: translateY(-22px); }
.slide[data-pos="after"]  { transform: translateY(22px); }
.slide[data-pos="active"] {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity .9s var(--ease) .15s, transform .9s var(--ease) .15s, visibility 0s linear 0s;
}
.slide__inner { position: relative; z-index: 1; margin: auto; width: 100%; max-width: 560px; }

/* fade-in bertahap untuk isi setiap section */
.seq > *:nth-child(1) { --i: 0; } .seq > *:nth-child(2) { --i: 1; }
.seq > *:nth-child(3) { --i: 2; } .seq > *:nth-child(4) { --i: 3; }
.seq > *:nth-child(5) { --i: 4; } .seq > *:nth-child(6) { --i: 5; }
.seq > *:nth-child(7) { --i: 6; } .seq > *:nth-child(8) { --i: 7; }
.slide[data-pos="active"] .seq > * {
  animation: fade 1.1s var(--ease) both;
  animation-delay: calc(.3s + var(--i, 0) * .16s);
}
#s6[data-pos="active"] .seq > * { animation-duration: 1.6s; animation-delay: calc(.5s + var(--i, 0) * .8s); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- typography ---------- */
.display {
  font-family: var(--font-head); font-weight: 500;
  font-size: clamp(2.3rem, 9.4vw, 3.9rem);
  line-height: 1.12; letter-spacing: -.01em;
  margin-bottom: 1rem;
}
.display--sm { font-size: clamp(1.75rem, 6.6vw, 2.6rem); }
.title {
  font-family: var(--font-head); font-weight: 500;
  font-size: clamp(1.9rem, 7.6vw, 3rem); line-height: 1.15;
  margin: 1.4rem auto .7rem; max-width: 14em;
}
.sub { font-weight: 300; font-size: clamp(.95rem, 3.6vw, 1.05rem); color: var(--ink-soft); margin-bottom: 1.8rem; }
.lead {
  font-weight: 300; font-size: clamp(.95rem, 3.7vw, 1.06rem);
  line-height: 1.85; max-width: 36em; margin: 0 auto 1rem;
}
.note {
  font-family: var(--font-head); font-style: italic;
  font-size: clamp(1.05rem, 4.2vw, 1.28rem); line-height: 1.8; max-width: 30em; margin: 0 auto;
}

/* ---------- buttons ---------- */
.btn {
  cursor: pointer; font-weight: 500; font-size: .98rem; letter-spacing: .02em;
  padding: .95rem 1.9rem; border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, var(--soft) 100%);
  border: 1px solid rgba(232, 165, 191, .75);
  box-shadow: 0 12px 24px -12px rgba(217, 139, 170, .8), inset 0 1px 0 #fff;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .65; cursor: default; transform: none; }
.btn--ghost { background: var(--glass); margin-top: .4rem; }

/* =========================================================
   1 · OPENING — amplop 3D
   ========================================================= */
.envelope-wrap { padding-top: clamp(64px, 12vh, 110px); }
.envelope {
  --w: min(74vw, 320px);
  position: relative; width: var(--w); height: calc(var(--w) * .66);
  margin: 0 auto; perspective: 1000px; cursor: pointer;
  filter: drop-shadow(0 18px 22px rgba(89, 67, 74, .2));
  animation: bob 5s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.envelope > * { position: absolute; }
.env__back { inset: 0; background: #EEA6C2; border-radius: 6px; }
.env__card {
  left: 7%; right: 7%; top: 8%; bottom: 8%; z-index: 2;
  background: var(--cream); border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: inset 0 0 0 1px rgba(232, 165, 191, .5);
  transition: transform 1.2s var(--ease) .75s;
}
.env__card-text { font-family: var(--font-head); font-style: italic; font-size: 1.15rem; }
.env__card-heart { width: 14px; height: 14px; fill: var(--rose-deep); }
.env__front {
  inset: 0; z-index: 3; border-radius: 6px;
  background: linear-gradient(165deg, #FBD3E3 0%, #F6BDD3 100%);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
.env__flap {
  left: 0; right: 0; top: 0; height: 54%; z-index: 4;
  background: linear-gradient(180deg, #F4B6CE, #F2AAC5);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform .95s cubic-bezier(.4, 0, .2, 1), z-index 0s linear .45s;
}
.env__seal {
  left: 50%; top: 54%; z-index: 5; width: 24%; height: auto; aspect-ratio: 80 / 56;
  transform: translate(-50%, -62%); transition: opacity .4s;
}
.envelope.is-open .env__flap { transform: rotateX(180deg); z-index: 1; }
.envelope.is-open .env__seal { opacity: 0; }
.envelope.is-open .env__card { transform: translateY(-64%); }

/* =========================================================
   2 · GREETING — kue, balon
   ========================================================= */
.cake { width: min(78vw, 300px); margin: 1.2rem auto 1.5rem; cursor: pointer; }
.cake__svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 14px 18px rgba(217, 139, 170, .3)); }
.cake__num { font-family: var(--font-head); font-size: 34px; font-weight: 500; fill: var(--rose-deep); }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.3s ease-in-out infinite alternate; animation-delay: var(--fd, 0s); }
@keyframes flicker { from { transform: scale(1, 1); } to { transform: scale(.88, 1.14); } }

.balloons { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.balloon {
  position: absolute; width: var(--s); height: calc(var(--s) * 1.2);
  border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .9) 0 7%, transparent 8%),
    linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: inset -6px -8px 14px rgba(217, 139, 170, .25);
  opacity: .88; transform-origin: 50% 130%;
  animation: sway var(--d, 6s) ease-in-out infinite alternate;
}
.balloon::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  width: 1px; height: 80px; background: linear-gradient(rgba(89, 67, 74, .35), transparent);
}
.b1 { left: 3%;  top: 30%; --s: 58px; --c1: #FCE4EC; --c2: #F4A9C4; --d: 5.5s; }
.b2 { left: 13%; top: 56%; --s: 44px; --c1: #FFF1E8; --c2: #F6C9B8; --d: 6.5s; }
.b3 { right: 4%; top: 28%; --s: 52px; --c1: #F8C8DC; --c2: #E8A5BF; --d: 6s; }
.b4 { right: 14%; top: 58%; --s: 42px; --c1: #FFFFFF; --c2: #F8C8DC; --d: 7s; }
@keyframes sway { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-16px) rotate(4deg); } }

/* =========================================================
   3 · 16 LITTLE WISHES
   ========================================================= */
.wish-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  max-width: 420px; margin: 1.4rem auto 1rem;
}
.wish {
  appearance: none; cursor: pointer; aspect-ratio: 3 / 4; border-radius: 14px;
  border: 1px solid rgba(232, 165, 191, .55);
  background: linear-gradient(170deg, #fff 0%, var(--soft) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-head); font-size: clamp(1.05rem, 4.6vw, 1.35rem);
  box-shadow: 0 8px 16px -10px rgba(217, 139, 170, .7);
  transition: transform .3s var(--ease), background .4s;
}
.wish:hover { transform: translateY(-3px); }
.wish:active { transform: scale(.96); }
.wish__h { width: 12px; height: 12px; fill: var(--rose); }
.wish.is-opened { background: linear-gradient(170deg, var(--pink), #F4B6CE); }
.wish.is-opened .wish__h { fill: #fff; }
.progress { font-size: .85rem; font-weight: 300; color: var(--ink-soft); }

/* pop-up flip card */
.modal {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  perspective: 1200px; visibility: hidden; opacity: 0;
  transition: opacity .35s, visibility 0s linear .35s;
}
.modal.is-open { visibility: visible; opacity: 1; transition-delay: 0s; }
.modal__scrim {
  position: absolute; inset: 0; background: rgba(89, 67, 74, .3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal__stack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.flip {
  position: relative; width: min(78vw, 300px); aspect-ratio: 3 / 4;
  transform-style: preserve-3d; transform: scale(.7);
  transition: transform .95s var(--ease);
}
.modal.is-open .flip { transform: scale(1); }
.modal.is-flipped .flip { transform: scale(1) rotateY(180deg); }
.flip__face {
  position: absolute; inset: 0; border-radius: 22px; padding: 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 30px 60px -22px rgba(89, 67, 74, .45);
  border: 1px solid rgba(232, 165, 191, .6);
}
.flip__front { background: linear-gradient(160deg, #fff, var(--soft)); }
.flip__back  { background: linear-gradient(160deg, var(--cream), var(--soft)); transform: rotateY(180deg); }
.flip__num { font-family: var(--font-head); font-size: 3.2rem; color: var(--rose-deep); }
.flip__heart { width: 22px; height: 22px; fill: var(--rose); }
.flip__no { font-family: var(--font-head); font-size: 1rem; color: var(--rose-deep); }
.flip__text { font-family: var(--font-head); font-style: italic; font-size: clamp(1.25rem, 5.4vw, 1.55rem); line-height: 1.5; }
.modal__close {
  cursor: pointer; padding: .6rem 1.4rem; border-radius: 999px; font-size: .9rem;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* =========================================================
   4 · LETTER
   ========================================================= */
.seal-btn {
  cursor: pointer; display: inline-flex; align-items: center; gap: .6rem;
  margin-top: .6rem; padding: .7rem 1.5rem .7rem 1rem; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line); font-size: .95rem;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 12px 24px -14px rgba(217, 139, 170, .9);
  transition: transform .25s var(--ease);
}
.seal-btn:hover { transform: translateY(-2px); }
.seal-btn__bow { width: 38px; height: 27px; }

.letter {
  position: relative; margin: 2.8rem auto 0; max-width: 540px; text-align: left;
  background: linear-gradient(180deg, #FFFCF9, #FFF4EE);
  border-radius: 6px;
  padding: 3.6rem clamp(1.4rem, 6vw, 2.7rem) 2.8rem;
  box-shadow: 0 30px 60px -28px rgba(89, 67, 74, .42), 0 0 0 1px rgba(232, 165, 191, .35);
  opacity: 0; transform: translateY(14px) scale(.985);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.letter.is-in { opacity: 1; transform: none; }
.letter__ribbon {
  position: absolute; top: 0; left: 0; right: 0; height: 16px; border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, var(--pink), var(--soft) 50%, var(--pink));
}
.letter__bow { position: absolute; top: -24px; left: 50%; width: 88px; height: 62px; transform: translateX(-50%); }
.letter__flower { position: absolute; width: 34px; height: 34px; }
.lf1 { top: 30px; left: -12px; transform: rotate(-14deg); }
.lf2 { top: 64px; right: -10px; width: 26px; height: 26px; transform: rotate(18deg); }
.lf3 { bottom: -12px; right: 22px; transform: rotate(8deg); }
.letter p { font-size: clamp(.95rem, 3.8vw, 1.02rem); line-height: 1.95; margin-bottom: 1.35rem; }
.letter p:last-child { margin-bottom: 0; }
.letter__first { font-family: var(--font-head); font-style: italic; font-size: clamp(1.3rem, 5.4vw, 1.6rem) !important; line-height: 1.4 !important; }
.letter__ps { text-align: center; }
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   5 · REMINDERS
   ========================================================= */
.reminder {
  position: relative; min-height: 10rem; display: grid; place-items: center; margin: 1.6rem 0 1.2rem;
}
.reminder::before {
  content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 200, 220, .55), transparent 68%); filter: blur(10px);
}
.reminder__text {
  position: relative; font-family: var(--font-head); font-style: italic;
  font-size: clamp(1.55rem, 6.6vw, 2.3rem); line-height: 1.4; max-width: 17em;
  opacity: 0; transition: opacity .8s ease;
}
.reminder__text.is-in { opacity: 1; }
.dots { display: flex; justify-content: center; gap: 8px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(217, 139, 170, .35); transition: all .5s var(--ease); }
.dots i.on { background: var(--rose-deep); width: 20px; border-radius: 6px; }

/* =========================================================
   6 · FINAL
   ========================================================= */
#s6 .display { text-shadow: 0 0 28px rgba(255, 255, 255, .8); }
.signoff { font-family: var(--font-head); font-style: italic; font-size: clamp(1.15rem, 4.6vw, 1.4rem); margin: 1.8rem 0 1.8rem; }

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav {
  position: fixed; z-index: 10; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 6px;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px -16px rgba(89, 67, 74, .45);
  transition: opacity .6s ease, transform .6s var(--ease);
}
body[data-opened="false"] .nav { opacity: 0; pointer-events: none; transform: translate(-50%, 24px); }
.nav__btn {
  cursor: pointer; border: 0; background: transparent; border-radius: 999px;
  padding: .6rem 1rem; font-size: .88rem; font-weight: 500; transition: background .25s, opacity .25s;
}
.nav__btn:hover:not(:disabled) { background: rgba(255, 255, 255, .7); }
.nav__btn:disabled { opacity: .3; cursor: default; }
.nav__dots { list-style: none; display: flex; gap: 2px; }
.nav__dots button {
  cursor: pointer; border: 0; background: transparent; width: 18px; height: 28px;
  display: grid; place-items: center;
}
.nav__dots button::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(217, 139, 170, .4); transition: all .4s var(--ease);
}
.nav__dots li.on button::before { width: 16px; border-radius: 6px; background: var(--rose-deep); }

/* =========================================================
   MUSIC
   ========================================================= */
.music {
  position: fixed; z-index: 12; top: max(14px, env(safe-area-inset-top)); right: 14px;
  display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 14px;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px -16px rgba(89, 67, 74, .5);
}
.music__status { display: flex; align-items: center; gap: 8px; }
.music__text { font-size: .7rem; font-weight: 400; color: var(--ink-soft); white-space: nowrap; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 100%; background: var(--rose-deep); border-radius: 2px; transform-origin: bottom; transform: scaleY(.25); }
.music[data-state="playing"] .eq i { animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.35s !important; }
.eq i:nth-child(3) { animation-delay: -.7s !important; }
.eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

.music__btn {
  cursor: pointer; width: 36px; height: 36px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: var(--ink);
  background: linear-gradient(180deg, #fff, var(--soft)); box-shadow: inset 0 0 0 1px rgba(232, 165, 191, .6);
}
.music[data-state="playing"] .ic-play, .music:not([data-state="playing"]) .ic-pause { display: none; }

.music__hint {
  position: absolute; top: calc(100% + 10px); right: 0; width: 230px; padding: 12px 14px;
  text-align: left; font-size: .78rem; line-height: 1.5;
  background: rgba(255, 255, 255, .85); border: 1px solid var(--glass-line); border-radius: 16px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 30px -18px rgba(89, 67, 74, .5);
}
.music__hint button {
  cursor: pointer; margin-top: 8px; padding: .4rem .9rem; border-radius: 999px; font-size: .78rem; font-weight: 500;
  border: 1px solid rgba(232, 165, 191, .75); background: var(--soft);
}

/* ---------- layar kecil ---------- */
@media (max-width: 400px) {
  .music__text { font-size: .64rem; }
  .nav__btn { padding: .6rem .75rem; }
  .wish-grid { gap: 8px; }
}
@media (min-width: 900px) {
  .slide { padding-top: 90px; }
}

/* ---------- hormati pengaturan reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
}