/* Gemerlap — undangan pesta ulang tahun dewasa/remaja. Hitam pekat, emas berkilau, garis art deco. */
@font-face { font-family: "Playfair Display"; src: url("fonts/playfair-display.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("fonts/playfair-display-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("fonts/montserrat.woff2") format("woff2"); font-weight: 300 600; font-display: swap; }

:root {
  --night: #0c0b09;
  --panel: #13110d;
  --panel-2: #1a1712;
  --ivory: #f4ecda;
  --muted: #bdb096;
  --gold: #d9ae5c;
  --gold-soft: rgba(217, 174, 92, .38);
  --gold-line: rgba(217, 174, 92, .55);
  --gold-grad: linear-gradient(100deg, #a8792a 0%, #f3d995 20%, #c8963d 42%, #fff1c6 58%, #b98a33 78%, #e8c677 100%);
  --serif: "Playfair Display", "Bodoni Moda", Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Debu glitter emas: titik-titik kecil berlapis dengan ukuran ubin berbeda. */
  --glitter:
    radial-gradient(circle, rgba(255, 232, 170, .95) 0 1px, transparent 1.7px) 3px 11px / 47px 61px,
    radial-gradient(circle, rgba(217, 174, 92, .8) 0 .9px, transparent 1.5px) 21px 37px / 71px 53px,
    radial-gradient(circle, rgba(255, 246, 215, .7) 0 1.4px, transparent 2.2px) 37px 5px / 97px 89px,
    radial-gradient(circle, rgba(232, 198, 119, .6) 0 .7px, transparent 1.3px) 11px 23px / 29px 83px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15.5px/1.75 var(--sans);
  color: var(--ivory);
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(217, 174, 92, .16), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgba(217, 174, 92, .1), transparent 70%),
    var(--night);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--glitter);
  opacity: .14;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
img { max-width: 100%; display: block; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; line-height: 1.15; }
.gold, .cover h1, main > section h3, .sign span {
  background: var(--gold-grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

main {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--panel) 0%, var(--night) 100%);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(217, 174, 92, .22), 0 40px 120px rgba(0, 0, 0, .7);
}
@media (min-width: 560px) {
  body { padding: 36px 0; }
}

/* Gerbang sampul: hanya bila JS jalan, isi disembunyikan sampai "Buka undangan". */
.js:not(.opened) main > section:not(.cover),
.js:not(.opened) footer { display: none; }
.opened .open { display: none; }
.js.opened main > section:not(.cover) { animation: muncul .9s ease both; }
html:not(.js) .count { display: none; }

/* ---------- Sampul ---------- */
.cover {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  background:
    radial-gradient(70% 40% at 50% 38%, rgba(217, 174, 92, .2), transparent 70%),
    radial-gradient(90% 30% at 50% 0%, rgba(217, 174, 92, .14), transparent 80%);
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glitter);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .25) 45%, transparent 70%, rgba(0, 0, 0, .5) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .25) 45%, transparent 70%, rgba(0, 0, 0, .5) 100%);
  opacity: .8;
}
.frame { position: absolute; inset: 18px; border: 1px solid var(--gold-line); pointer-events: none; }
.frame::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(217, 174, 92, .22); }
.c { position: absolute; width: 26px; height: 26px; border: 2px solid var(--gold); }
.tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.tr { top: -6px; right: -6px; border-left: 0; border-bottom: 0; }
.bl { bottom: -6px; left: -6px; border-right: 0; border-top: 0; }
.br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }

.sparkles { position: absolute; inset: 0; pointer-events: none; }
.k { position: absolute; width: 18px; height: 18px; animation: kilau 3.4s ease-in-out infinite; }
.k1 { top: 12%; left: 16%; width: 22px; height: 22px; }
.k2 { top: 19%; right: 15%; width: 14px; height: 14px; animation-delay: -1.2s; }
.k3 { top: 46%; left: 6%; width: 12px; height: 12px; animation-delay: -2.1s; }
.k4 { top: 40%; right: 6%; width: 20px; height: 20px; animation-delay: -.6s; }
.k5 { bottom: 14%; left: 20%; width: 14px; height: 14px; animation-delay: -1.7s; }
.k6 { bottom: 19%; right: 18%; width: 24px; height: 24px; animation-delay: -2.8s; }

.cover-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; animation: muncul 1.2s ease both; }
.eyebrow { font: 500 11.5px/1.5 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.age { margin: 12px 0 2px; font: italic 600 clamp(124px, 40vw, 168px)/1 var(--serif); letter-spacing: -.02em; }
.age .gold { display: inline-block; padding: 0 .06em; animation: kemilau 6s ease-in-out infinite; filter: drop-shadow(0 6px 24px rgba(217, 174, 92, .25)); }
.cover h1 { font: italic 500 clamp(40px, 12vw, 54px)/1.1 var(--serif); overflow-wrap: anywhere; max-width: 100%; padding: 0 4px; }
.rule { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; }
.rule span { width: 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.rule span:last-child { transform: scaleX(-1); }
.rule svg { width: 14px; height: 14px; }
.date { font: 500 13px/1.6 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ivory); }
.to { margin-top: 28px; }
.to p { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.to .guest { margin-top: 4px; font: italic 400 24px/1.3 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ivory); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 30px;
  border: 0;
  border-radius: 2px;
  background: var(--gold-grad);
  background-size: 160% 100%;
  color: #17120a;
  font: 600 12.5px/1.2 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(217, 174, 92, .22);
  transition: background-position .5s ease, transform .2s ease;
}
.btn:hover { background-position: 100% 0; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .music-toggle:focus-visible { outline: 2px solid #fff1c6; outline-offset: 3px; }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold-line); box-shadow: none; }
.btn.small { min-height: 44px; padding: 10px 18px; }
.open { margin-top: 32px; }

/* ---------- Bagian umum ---------- */
main > section:not(.cover) { position: relative; padding: 64px 32px; text-align: center; }
main > section:not(.cover) + section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 120px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
main > section h3 { display: inline-block; font-size: 34px; font-style: italic; margin-bottom: 26px; padding: 0 .08em; }

/* Pengantar */
.intro { padding-top: 72px !important; }
.message { max-width: 360px; margin: 18px auto 0; font: italic 400 20px/1.6 var(--serif); color: var(--ivory); }
.star { margin: 42px auto 0; max-width: 360px; }
.photo { width: 220px; height: 280px; margin: 0 auto 26px; padding: 8px; border: 1px solid var(--gold-line); border-radius: 120px 120px 4px 4px; }
.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 112px 112px 2px 2px; filter: saturate(.92) contrast(1.04); }
.name { font-size: 30px; font-weight: 500; color: var(--ivory); overflow-wrap: anywhere; }
.turning { margin-top: 8px; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.parents { margin-top: 22px; font-size: 14px; color: var(--muted); }
.parents b { font-weight: 500; color: var(--ivory); }

/* Hitung mundur */
.count .eyebrow { margin-bottom: 20px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 360px; margin: 0 auto; border: 1px solid var(--gold-line); }
.countdown div { padding: 16px 4px 12px; }
.countdown div + div { border-left: 1px solid var(--gold-soft); }
.countdown b { display: block; font: 500 32px/1.1 var(--serif); color: var(--ivory); font-variant-numeric: lining-nums tabular-nums; }
.countdown span { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

/* Acara */
.card {
  position: relative;
  max-width: 380px;
  margin: 0 auto;
  padding: 34px 26px 30px;
  background: var(--panel-2);
  border: 1px solid var(--gold-line);
  outline: 1px solid rgba(217, 174, 92, .18);
  outline-offset: 5px;
}
.item + .item { margin-top: 22px; padding-top: 22px; border-top: 1px solid rgba(217, 174, 92, .18); }
.label { font: 600 11px/1.5 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.big { margin-top: 6px; font: 500 22px/1.35 var(--serif); color: var(--ivory); font-variant-numeric: lining-nums; }
.place { margin-top: 6px; font-size: 15.5px; color: var(--ivory); }
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
.actions .btn { width: 100%; }

.dress {
  position: relative;
  max-width: 380px;
  margin: 34px auto 0;
  padding: 30px 24px 26px;
  background:
    linear-gradient(var(--night), var(--night)) padding-box,
    var(--gold-grad) border-box;
  border: 1px solid transparent;
}
.dress::before { content: ""; position: absolute; inset: 0; background: var(--glitter); opacity: .18; pointer-events: none; }
.dk { position: absolute; top: -12px; left: 50%; width: 24px; height: 24px; margin-left: -12px; filter: drop-shadow(0 0 6px var(--night)); }
.theme { position: relative; margin-top: 8px; font: italic 500 24px/1.35 var(--serif); color: var(--ivory); }
.hint { position: relative; margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Galeri */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--gold-soft); }
.grid img:nth-child(3n+1) { grid-column: span 2; aspect-ratio: 4 / 3; }

/* Tanda kasih */
.gifts > p { max-width: 340px; margin: 0 auto 24px; color: var(--muted); }
.gift-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 380px;
  margin: 0 auto;
  padding: 22px 22px;
  text-align: left;
  border: 1px solid var(--gold-line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(217, 174, 92, .16), transparent 60%),
    var(--panel-2);
}
.gift-card .number { margin: 4px 0 2px; font: 500 23px/1.3 var(--serif); letter-spacing: .04em; color: var(--ivory); overflow-wrap: anywhere; font-variant-numeric: lining-nums; }
.holder { font-size: 13.5px; color: var(--muted); }

/* RSVP & ucapan */
.note { max-width: 360px; margin: 0 auto 16px; padding: 16px 18px; border: 1px solid var(--gold-soft); color: var(--ivory); font-size: 14.5px; }
form { display: flex; flex-direction: column; gap: 18px; max-width: 380px; margin: 0 auto; text-align: left; }
form > label, fieldset { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
fieldset { flex-direction: row; flex-wrap: wrap; border: 0; padding: 0; margin: 0; }
legend { margin-bottom: 10px; padding: 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--gold-soft); color: var(--ivory); letter-spacing: .06em; text-transform: none; font-size: 14px; font-weight: 500; cursor: pointer; }
.pill:has(input:checked) { border-color: var(--gold); background: rgba(217, 174, 92, .12); }
.pill input { accent-color: var(--gold); width: 17px; height: 17px; margin: 0; }
input:not([type=radio]), textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--gold-soft);
  border-radius: 0;
  background: var(--panel-2);
  color: var(--ivory);
  font: 400 16px/1.5 var(--sans);
  letter-spacing: 0;
  text-transform: none;
}
input::placeholder, textarea::placeholder { color: #8f8571; }
textarea { min-height: 120px; resize: vertical; }
form .btn { align-self: stretch; }
.wishes { list-style: none; margin: 30px auto 0; padding: 0; max-width: 380px; text-align: left; }
.wishes li { padding: 18px 0; border-top: 1px solid rgba(217, 174, 92, .2); }
.wishes li.pinned { padding: 18px 16px; border: 1px solid var(--gold-line); background: rgba(217, 174, 92, .07); }
.wishes b { font: italic 500 18px/1.3 var(--serif); color: var(--ivory); }
.wishes span { font-size: 12px; color: var(--gold); }
.wishes p { margin-top: 4px; color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; }
.wishes .wish-reply { margin-top: 8px; padding-left: 12px; border-left: 1px solid var(--gold); }

/* Penutup */
.closing { padding-bottom: 48px !important; }
.ck { width: 26px; height: 26px; margin-bottom: 18px; animation: kilau 3.4s ease-in-out infinite; }
.closing > p { max-width: 330px; margin: 0 auto; font: italic 400 19px/1.6 var(--serif); color: var(--ivory); }
.sign { margin-top: 26px !important; font: 500 11.5px/1.6 var(--sans) !important; font-style: normal !important; letter-spacing: .3em; text-transform: uppercase; color: var(--gold) !important; }
.sign span { display: block; width: fit-content; margin: 6px auto 0; padding: 0 .1em; font: italic 500 44px/1.2 var(--serif); letter-spacing: 0; text-transform: none; }

footer { padding: 24px 24px 40px; text-align: center; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
footer a { color: var(--gold); text-decoration: none; font-weight: 600; }

.music-toggle {
  position: fixed;
  right: max(16px, calc(50% - 240px + 16px));
  bottom: 20px;
  z-index: 20;
  width: 50px;
  height: 50px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(12, 11, 9, .85);
  color: var(--gold);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.music-toggle[aria-pressed=true] span { display: inline-block; animation: putar 4s linear infinite; }

@keyframes kilau { 0%, 100% { opacity: .35; transform: scale(.7) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes kemilau { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
@keyframes muncul { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes putar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Amplop: beberapa rekening/e-wallet */
.gift-list { display: grid; gap: 14px; width: 100%; }

/* ---------- Animasi ---------- */
:root { --rv-dur: 1300; }
.rv { opacity: 0; scale: .96; filter: blur(6px) brightness(2.2); }
.rv.in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; filter: blur(0) brightness(1); clip-path: none; transition: opacity 1.3s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms), translate 1.3s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms), scale 1.3s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms), rotate 1.3s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms), filter 1.3s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms), clip-path 1.3s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms); }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; translate: none; scale: none; rotate: none; filter: none; clip-path: none; } }

@media (prefers-reduced-motion: no-preference) {
  .rule { animation: mo-garis 1.6s .5s cubic-bezier(.2,.7,.2,1) both; }
  .card { transition: translate .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s; }
  .card:hover { translate: 0 -5px; }
}
@keyframes mo-denyut { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }
@keyframes mo-ambang { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes mo-ayun { from { rotate: -2.2deg; } to { rotate: 2.2deg; } }
@keyframes mo-putar { to { rotate: 360deg; } }
@keyframes mo-kerlip { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .35; scale: .72; } }
@keyframes mo-kilau { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes mo-geser { from { translate: -26px 0; } to { translate: 26px 0; } }
@keyframes mo-garis { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes mo-naik { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes mo-blur { from { opacity: 0; filter: blur(10px); scale: 1.05; } to { opacity: 1; filter: blur(0); scale: 1; } }
@keyframes mo-pop { from { opacity: 0; scale: .55; rotate: -8deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes mo-nudge { 0%, 100% { translate: 0 0; } 50% { translate: 5px 0; } }
@keyframes mo-hujan { to { background-position: 0 520px, 0 520px, 0 520px, 0 780px, 0 780px; } }

/* Foto sampul (opsional): lengkung seperti jendela; tinggi menyesuaikan layar supaya tombol "Buka undangan" tetap terjangkau. */
.cover-photo { position: relative; z-index: 1; flex: none; display: block; width: auto; height: clamp(96px, 17svh, 150px); aspect-ratio: 4 / 5; margin: 8px auto 6px; border-radius: 999px 999px 16px 16px; overflow: hidden; border: 3px solid rgba(255, 255, 255, 0.85); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); }
.cover-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Cover lebih tinggi dari layar (foto sampul + layar pendek): tetap bisa digulir ke tombol "Buka undangan". */
.js body.locked { overflow: visible; }
/* Bentuk foto sampul khas Gemerlap: lingkaran dengan cincin emas ganda berkilau. */
.cover-photo { aspect-ratio: 1 / 1; margin: 14px auto 10px; padding: 4px; border: 2px solid var(--gold); border-radius: 50%; background: transparent; box-shadow: 0 0 0 5px rgba(217, 174, 92, 0.14), 0 0 30px rgba(217, 174, 92, 0.35); }
.cover-photo img { border-radius: 50%; }
@media (max-height: 700px) { .cover-photo { display: none; } } /* layar pendek: sampul seperti semula supaya tombol tetap terlihat */
