/* Undangan Arie & Pinky — artboard 1080x1920 dari Canva, diskalakan ke layar */
:root {
  --rose: #B05258;
  --rose-2: #A4595D;
  --pill: #C18280;
  --ink: #443626;
  --s: .4;               /* skala artboard, diatur app.js */
  --fade: .7s;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #C1CE7B; }
body { font: 400 15px/1.6 "Montserrat", system-ui, sans-serif; color: var(--rose); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button { font: inherit; cursor: pointer; }

/* ---------- deck & slide ---------- */
.deck { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
.slide {
  position: absolute; inset: 0; overflow: hidden; background: var(--bg, #C1CE7B);
  opacity: 0; visibility: hidden; transition: opacity var(--fade) ease, visibility 0s linear var(--fade);
}
.slide.is-active { opacity: 1; visibility: visible; transition: opacity var(--fade) ease, visibility 0s; z-index: 1; }
/* sisa layar di luar artboard: versi blur halaman yang sama */
.fill {
  position: absolute; inset: -40px; background: center / cover no-repeat;
  filter: blur(18px) saturate(1.05); transform: scale(1.08);
}
.art {
  position: absolute; left: 50%; top: 50%; width: 1080px; height: 1920px; overflow: hidden;
  transform: translate(-50%, -50%) scale(var(--s)); transform-origin: 50% 50%; background: #fff;
  box-shadow: 0 0 60px rgba(0, 0, 0, .18);
}
.art * { pointer-events: none; }
.art .hit, .art .hit-btn, .art a.cal-link { pointer-events: auto; }

.el { position: absolute; margin: 0; }
.im { overflow: hidden; }
.im img { position: absolute; display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.grp { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; margin: 0; padding: 0; border: 0; background: none; display: block; color: inherit; text-decoration: none; }
.hit { position: absolute; display: block; border-radius: 999px; cursor: pointer; }
.hit-btn { position: absolute; border: 0; padding: 0; background: transparent; border-radius: 999px; cursor: pointer; }
.pill { border-radius: 999px; }
.tx p { margin: 0; white-space: pre-wrap; }
.tx span { font-synthesis: none; }
.brit-gap { visibility: hidden; }
a.grp:focus-visible .hit, button.grp:focus-visible .hit, .hit-btn:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }

/* ---------- animasi (diputar ulang tiap slide aktif) ---------- */
.slide .a-fade, .slide .a-rise, .slide .a-zoom, .slide .a-wipe { opacity: 0; }
.slide .a-tw .c { opacity: 0; }
.slide.play .a-fade { animation: aFade var(--t, .8s) ease var(--d, 0s) forwards; }
.slide.play .a-rise { animation: aRise var(--t, .8s) cubic-bezier(.2, .7, .2, 1) var(--d, 0s) forwards; }
.slide.play .a-zoom { animation: aZoom var(--t, 1s) cubic-bezier(.2, .7, .2, 1) var(--d, 0s) forwards; }
.slide.play .a-tw .c { animation: aFade .01s linear calc(var(--d, 0s) + var(--i) * var(--cps, .012s)) forwards; }
.slide.play .a-wipe { animation: aFade .01s linear var(--d, 0s) forwards; }
.slide.play .a-wipe img { animation: aWipe var(--t, 1s) steps(var(--steps, 60)) var(--d, 0s) both; }
.a-twinkle { animation: aTwinkle 2.6s ease-in-out var(--d, 0s) infinite; }
.a-float img { animation: aFloat 7s ease-in-out infinite; }
.a-glow { animation: aGlow 3.2s ease-in-out infinite; }
.slide.play #openBtn .hit { animation: aPulse 2.2s ease-in-out 2.4s infinite; }

@keyframes aFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aRise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes aZoom { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes aWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes aTwinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.8); } }
@keyframes aFloat { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-14px, 22px) rotate(4deg); } }
@keyframes aGlow { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes aPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 60% { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); } }

/* mode tangkapan layar statis (?shot=N) */
.shot .slide .a-fade, .shot .slide .a-rise, .shot .slide .a-zoom, .shot .slide .a-wipe, .shot .slide .a-tw .c { opacity: 1 !important; animation: none !important; }
.shot .a-wipe img, .shot .a-twinkle, .shot .a-float img, .shot .a-glow { animation: none !important; }
.shot .art { box-shadow: none; }
.shot .slide { transition: none !important; }

/* ---------- gift: 3 keadaan dalam satu slide ---------- */
.state { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.state.is-on { opacity: 1; visibility: visible; transition: opacity .5s; }
.state:not(.is-on) .hit-btn { pointer-events: none; }
.tab-btn.is-on { box-shadow: 0 0 0 5px rgba(255, 255, 255, .85); }

/* ---------- hitung mundur (tambahan di slide tanggal) ---------- */
.countdown { position: absolute; left: 190px; top: 1640px; width: 700px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.countdown div { background: rgba(255, 255, 255, .62); border-radius: 30px; padding: 16px 0 10px; text-align: center; box-shadow: 0 6px 18px rgba(80, 60, 40, .12); }
.countdown b { display: block; font: 700 60px/1.1 "Playfair Display", serif; color: var(--rose); }
.countdown span { font: 400 24px/1.4 "Montserrat", sans-serif; color: var(--rose-2); letter-spacing: .06em; text-transform: uppercase; }
.countdown-done { position: absolute; left: 140px; width: 800px; top: 1670px; margin: 0; text-align: center; font: 700 40px/1.3 "Montserrat", sans-serif; color: var(--rose); }
.cal-link { position: absolute; left: 390px; width: 300px; top: 1790px; padding: 12px 0; text-align: center; border-radius: 999px; background: var(--pill); color: #fff; font: 400 28px/1.3 "Montserrat", sans-serif; text-decoration: none; }

/* ---------- navigasi ---------- */
.dots { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 20; display: grid; gap: 9px; }
.dots button { width: 9px; height: 9px; padding: 0; border: 1.5px solid #fff; border-radius: 50%; background: rgba(255, 255, 255, .25); box-shadow: 0 0 4px rgba(0, 0, 0, .3); transition: .3s; }
.dots button.is-on { background: #fff; height: 22px; border-radius: 6px; }
.next-hint {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  display: grid; justify-items: center; border: 0; background: none; color: #fff; font-size: 11px; letter-spacing: .08em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45); animation: hint 1.8s ease-in-out infinite;
}
.next-hint svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4)); }
@keyframes hint { 50% { transform: translate(-50%, -6px); } }
body.has-swiped .next-hint span { display: none; }
body.is-locked .dots, body.is-locked .next-hint, body.is-last .next-hint, .shot .dots, .shot .next-hint, .shot .music { display: none !important; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 14px; background: #E0BDBC; color: var(--rose); transition: opacity .6s, visibility 0s .6s; }
.loader p { margin: 0; font: 700 22px "Playfair Display", serif; letter-spacing: .05em; }
.loader__ring { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(176, 82, 88, .25); border-top-color: var(--rose); animation: spin 1s linear infinite; }
.loader.is-done { opacity: 0; visibility: hidden; }

/* ---------- lembar RSVP ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(60, 30, 35, .45); animation: aFade .3s; }
.sheet__panel {
  position: absolute; left: 50%; bottom: 0; width: min(520px, 100%); max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-50%); padding: 26px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
  background: linear-gradient(#cfe6f3, #f6f1ec 180px); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); animation: sheetUp .45s cubic-bezier(.2, .8, .2, 1);
  touch-action: pan-y;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
.sheet__close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 2rem; line-height: 1; color: var(--rose); }
.sheet h2 { margin: 0; text-align: center; font: 700 2.3rem/1.2 "Playfair Display", serif; letter-spacing: .06em; }
.sheet__sub { text-align: center; margin: .3rem 0 1.1rem; font-size: .92rem; }
.form { display: grid; gap: .85rem; padding: 1.1rem; border-radius: 20px; background: rgba(255, 255, 255, .85); box-shadow: 0 6px 20px rgba(80, 100, 120, .14); }
.form label { display: grid; gap: .3rem; font-weight: 700; font-size: .84rem; }
.form input, .form select, .form textarea { width: 100%; padding: .65em .9em; border: 1.5px solid #e6c6c9; border-radius: 12px; font: 400 .95rem "Montserrat", sans-serif; color: var(--ink); background: #fff; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--pill); box-shadow: 0 0 0 3px rgba(193, 130, 128, .22); }
.form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.form legend { font-weight: 700; font-size: .84rem; margin-bottom: .3rem; width: 100%; }
.form .chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35em .9em; border: 1.5px solid #e6c6c9; border-radius: 999px; font-weight: 400; cursor: pointer; }
.form .chip:has(input:checked) { background: var(--pill); border-color: var(--pill); color: #fff; }
.form .chip input { width: auto; margin: 0; accent-color: var(--rose); }
.hp { position: absolute; left: -9999px; }
.btn { padding: .75em; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font-size: .95rem; box-shadow: 0 3px 10px rgba(122, 62, 74, .22); }
.btn:disabled { opacity: .6; }
.form__msg { margin: 0; min-height: 1.2em; text-align: center; font-size: .85rem; }
.form__msg.is-err { color: #b3261e; }
.wishes__stats { text-align: center; font-weight: 700; font-size: .85rem; margin: 1.1rem 0 .6rem; }
.wishes { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.wish { padding: .8rem 1rem; border-radius: 16px; background: #fff; color: var(--ink); font-size: .88rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .05); }
.wish__head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; margin-bottom: .2rem; }
.wish__head b { color: var(--rose); }
.wish__badge { font-size: .68rem; padding: .1em .6em; border-radius: 999px; background: #f2dedf; color: var(--rose); white-space: nowrap; }
.wish p { margin: 0; white-space: pre-line; word-break: break-word; }
.wish time { display: block; margin-top: .2rem; font-size: .72rem; opacity: .65; }
.wishes__empty { text-align: center; font-size: .85rem; opacity: .8; }

/* ---------- musik & toast ---------- */
.music {
  position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; width: 42px; height: 42px;
  display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--pill); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.music svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.music.is-playing svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 70px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: .6em 1.2em; border-radius: 999px; background: #5E3A40; color: #fff; font-size: .85rem; transition: .3s; white-space: nowrap;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  :root { --fade: .01s; }
  .slide .a-fade, .slide .a-rise, .slide .a-zoom, .slide .a-wipe, .slide .a-tw .c { opacity: 1 !important; animation: none !important; }
  .a-twinkle, .a-float img, .a-glow, .next-hint { animation: none !important; }
}
