/* Undangan Alif & Pudya — tema "Jawa Modern".
   Latar, teks, dan logo memakai palet situs lama (navy, teal, beige, sky);
   emas hanya untuk garis ornamen (gebyok, cincin monogram, batik). */
:root {
  /* "light dark" + blok prefers-color-scheme berisi warna yang sama = trik situs lama
     supaya Chrome tidak menggelapkan paksa. */
  color-scheme: light dark;
  --navy: #2f4156;
  --navy-2: #3d5470;
  --teal: #567c8d;
  --beige: #f5efeb;
  --langit: #c8d9e6;
  --putih: #ffffff;
  --emas: #c9a45c;          /* garis ornamen saja */
  --garis: #c8d9e6;
  --teks: #2f4156;
  --teks-pudar: #4f6878;
  --serif: "Cormorant Garamond", Georgia, serif;
  --nama: "Allura", "Segoe Script", cursive;
  --script: "Pinyon Script", "Segoe Script", cursive;
  --arab: "Scheherazade New", "Traditional Arabic", serif;
  --batik: url("assets/hias/batik-truntum.svg");
}
@media (prefers-color-scheme: dark) {
  :root { --navy: #2f4156; --teal: #567c8d; --beige: #f5efeb; --langit: #c8d9e6; --putih: #ffffff; --teks: #2f4156; }
  html, body { background-color: #c8d9e6; color: #2f4156; }
}
option { background: #f5efeb; color: #2f4156; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Jangan pakai scroll-behavior: smooth (ScrollTrigger salah mengukur posisi). */
body {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--teks);
  background: var(--langit);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
body::before { /* batik emas samar di luar kolom (layar lebar) */
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: .07;
  background: var(--navy); -webkit-mask: var(--batik) 0 0 / 92px; mask: var(--batik) 0 0 / 92px;
}
body.locked { overflow: hidden; }
img { display: block; max-width: none; }

/* Kolom tengah gaya undangan HP, juga di tablet/PC */
main { position: relative; max-width: 480px; margin: 0 auto; background: var(--beige); box-shadow: 0 0 50px rgba(47,65,86,.15); overflow: hidden; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .08em;
  padding: 10px 30px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn-beige { background: var(--beige); color: var(--navy); }
.btn-beige:hover { background: var(--putih); }
.btn-navy { background: var(--navy); color: var(--beige); }
.btn-navy:hover { background: var(--navy-2); }
.btn-garis { background: transparent; color: var(--beige); border-color: rgba(245,239,235,.6); }
.btn-garis:hover { background: var(--beige); color: var(--navy); }
.btn[hidden] { display: none; }

/* ---------- Lapisan hias & paralaks ----------
   Tiap gambar diposisikan dengan --x/--y (% dari section), --w (% lebar),
   jangkar --ax/--ay, rotasi --r, cermin --sx. GSAP hanya memakai transform,
   jadi tidak menimpa properti individual ini. */
.lapis, .batik { position: absolute; inset: 0; pointer-events: none; }
.batik { inset: -80px 0; opacity: .07; background: var(--navy); -webkit-mask: var(--batik) 0 0 / 92px; mask: var(--batik) 0 0 / 92px; }
.batik-emas { background: var(--emas); opacity: .08; }
.lapis > .pos {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: auto;
  translate: calc(var(--ax, .5) * -100%) calc(var(--ay, .5) * -100%);
  rotate: var(--r, 0deg);
  scale: var(--sx, 1) 1;
  transform-origin: calc(var(--ax, .5) * 100%) calc(var(--ay, .5) * 100%);
}
/* GSAP menganimasikan <img> di dalam .pos (bukan .pos-nya): GSAP 3.12 menggabungkan
   translate/rotate CSS ke transform dan jangkar persen jadi hilang. */
.pos > img { display: block; width: 100%; height: auto; transform-origin: calc(var(--ax, .5) * 100%) calc(var(--ay, .5) * 100%); }
/* :where() = spesifisitas rendah, supaya .hero-isi/.gulir (absolute) tetap menang */
.section > :where(:not(.lapis, .batik)) { position: relative; }

/* ---------- Tipografi bersama ---------- */
.section { position: relative; padding: 84px 30px; text-align: center; }
.tanggal { font-weight: 600; font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: var(--navy); }
.judul-script { font-family: var(--script); font-weight: 400; font-size: 44px; line-height: 1.25; color: var(--teal); margin-bottom: 22px; }
.salam-script { font-family: var(--script); font-size: 27px; line-height: 1.45; }
.nama-script { font-family: var(--nama); font-weight: 400; line-height: 1; }
.nama-script.small { font-size: 50px; margin-top: 6px; }
.logo { width: 140px; margin: 0 auto 30px; }
.logo.small { width: 84px; margin: 30px auto 0; }
.logo-mask {
  display: block;
  aspect-ratio: 480 / 437;
  background: var(--warna-logo, var(--navy));
  -webkit-mask: url("assets/logo.png") center / contain no-repeat;
  mask: url("assets/logo.png") center / contain no-repeat;
}
.arabic { font-family: var(--arab); direction: rtl; line-height: 2; }
.intro { margin-bottom: 26px; }
.kecil { font-weight: 600; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; margin-top: 22px; }

/* ---------- Cover ---------- */
.cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  color: var(--putih);
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, #46607c 0%, #2f4156 55%, #1f2c3b 100%);
}
.cover[hidden] { display: none; }
.cover .batik { inset: 0; }
.tirai { position: absolute; top: 0; left: 50%; translate: -50% 0; width: min(100%, 520px); height: 100%; pointer-events: none; }
.tirai .ronce { position: absolute; top: 0; left: calc(var(--x) * 1%); width: calc(var(--w) * 1%); margin-left: calc(var(--w) * -.5%); transform-origin: 50% 0; }
.tirai .garlan { position: absolute; top: -1.2%; left: -3%; width: 106%; transform-origin: 50% 0; }
.cover-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16vh 24px 6vh;
  gap: 18px;
}
.monogram { position: relative; width: clamp(170px, 52vw, 220px); aspect-ratio: 1; --warna-logo: var(--putih); }
.monogram .cincin { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--emas); stroke-width: 1.4; overflow: visible; }
.monogram .cincin .tipis { stroke-width: .7; opacity: .7; }
.monogram .logo-mask { position: absolute; inset: 21% 17%; }
.sugeng { font-weight: 500; font-size: 14px; letter-spacing: .45em; padding-left: .45em; text-transform: uppercase; color: var(--langit); }
.guest p { font-size: 16px; opacity: .85; }
.guest .guest-name { font-style: italic; font-weight: 500; font-size: 28px; line-height: 1.25; opacity: 1; margin-top: 2px; overflow-wrap: anywhere; }
@media (max-height: 640px) { .cover-inner { gap: 10px; padding-top: 12vh; } .monogram { width: 150px; } }
/* HP lanskap: monogram kecil, sapaan dirapatkan supaya tombol buka tetap di layar */
@media (max-height: 420px) {
  .cover-inner { gap: 6px; padding: 8vh 24px 4vh; }
  .monogram { width: 104px; }
  .guest p { font-size: 14px; }
  .guest .guest-name { font-size: 22px; }
  .cover .btn { padding: 7px 26px; }
}

/* Gunungan transisi buka */
.kayon { position: fixed; inset: 0; z-index: 60; pointer-events: none; display: none; }
.kayon img { position: absolute; bottom: 4vh; left: 50%; width: min(72vw, 360px); margin-left: calc(min(72vw, 360px) / -2); transform-origin: 50% 100%; }

/* Kelopak jatuh (diisi animasi.js) */
.kelopak-wrap { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; max-width: 480px; margin: 0 auto; }
.kelopak-wrap img { position: absolute; top: 0; left: 0; width: 14px; }

/* ---------- Pembuka (bingkai gebyok) ---------- */
.hero { aspect-ratio: 540 / 960; padding: 0; }
.hero .gebyok { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-isi {
  position: absolute;
  left: 17%; right: 17%; top: 34%; bottom: 20%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.hero-label { font-family: var(--script); font-size: clamp(26px, 8vw, 34px); color: var(--teal); }
.nama-hero { font-family: var(--nama); font-weight: 400; font-size: clamp(58px, 18vw, 84px); line-height: 1; color: var(--navy); }
.nama-hero span { display: block; }
.nama-hero .amp { font-family: var(--script); font-size: .72em; color: var(--teal); margin: 6px 0 10px; }
.hero .tanggal { font-size: clamp(13px, 3.8vw, 16px); letter-spacing: .2em; line-height: 1.7; margin-top: 8px; }
.gulir { position: absolute; left: 50%; bottom: 1.6%; translate: -50% 0; color: var(--navy); opacity: .7; animation: melayang 2.4s ease-in-out infinite; }
@keyframes melayang { 50% { transform: translateY(6px); } }

/* ---------- Pengantar ---------- */
.pengantar { padding: 96px 44px 90px; }
.kutipan p { font-style: italic; font-size: 19px; line-height: 1.7; }
.kutipan cite { display: block; margin-top: 14px; font-style: normal; font-size: 15px; color: var(--teks-pudar); }

/* ---------- Blok gelap ---------- */
.gelap { background: var(--navy); color: var(--putih); --warna-logo: var(--putih); }
/* Blok salam & penutup teal seperti situs lama; teks di atas teal selalu putih (kontras AA) */
.salam, .penutup { background: var(--teal); --langit: var(--putih); }
.gelap .tanggal { color: var(--langit); }
.gelap .judul-script { color: var(--putih); }
.salam { padding: 190px 40px 90px; }
.bismillah { font-size: 30px; color: var(--putih); margin-bottom: 10px; }
.salam .salam-script { color: var(--putih); margin-bottom: 18px; }
.pembuka { font-style: italic; font-size: 20px; line-height: 1.6; margin-bottom: 22px; }
.pos > .ronce, .pos > .garlan { transform-origin: 50% 0; }

/* ---------- Mempelai ---------- */
.mempelai { padding: 96px 30px; }
.couple { display: grid; gap: 6px; }
.person h3 { font-family: var(--nama); font-weight: 400; font-size: 66px; line-height: 1.05; color: var(--navy); }
.person .fullname { font-weight: 600; font-size: 16px; letter-spacing: .04em; }
.person .ig { font-size: 15px; color: var(--teks-pudar); }
.couple-amp { font-family: var(--script); font-size: 44px; color: var(--teal); line-height: 1.2; }

/* ---------- Acara ---------- */
.acara { padding: 80px 26px 84px; }
.gunungan-kecil { width: 62px; margin: 0 auto 14px; }
.garis { width: 180px; color: var(--emas); margin: -8px auto 28px; display: block; }
.events { display: grid; gap: 16px; margin-bottom: 28px; }
.event {
  border: 1px solid rgba(201,164,92,.45);
  border-radius: 16px;
  padding: 22px 18px;
  background: rgba(255,255,255,.05);
}
.event .ikon { width: 42px; height: 42px; margin: 0 auto 6px; color: var(--emas); }
.event .ikon svg { width: 100%; height: 100%; }
.event h3 { font-family: var(--script); font-weight: 400; font-size: 32px; line-height: 1.3; color: var(--langit); }
.event .place { font-weight: 600; font-size: 19px; }
.event .addr, .event .day, .event .time { font-size: 17px; }
.event .time { font-weight: 600; }
.countdown-wrap { margin-top: 50px; padding-top: 38px; border-top: 1px solid rgba(201,164,92,.3); }
.sub-judul { font-family: var(--script); font-size: 32px; color: var(--langit); margin-bottom: 18px; }
.cd-pesan { margin-bottom: 18px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 26px; }
.countdown[hidden] { display: none; }
.countdown div { border: 1px solid rgba(201,164,92,.45); border-radius: 12px; padding: 10px 4px; }
.countdown span { display: block; font-weight: 500; font-size: clamp(24px, 7.5vw, 32px); line-height: 1.15; color: var(--langit); }
.countdown small { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }

/* ---------- Tanda kasih (mockup kartu bank dari situs lama) ---------- */
.kado { padding: 90px 30px; }
.kado-teks { font-size: 19px; max-width: 300px; margin: 0 auto; }
.kado-kecil { font-size: 16px; color: var(--teks-pudar); margin-top: 12px; }
.gifts { display: grid; gap: 20px; margin-top: 26px; justify-items: center; }
.gift {
  --kb-latar: linear-gradient(135deg, #3d5470, #2f4156);
  --kb-aksen: var(--emas);
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1.586;
  padding: 6% 7%;
  border-radius: 16px;
  background: var(--kb-latar);
  color: #fff;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  text-align: left;
  box-shadow: 0 18px 34px -16px rgba(20, 35, 60, .65), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.gift::before, .gift::after { content: ""; position: absolute; pointer-events: none; border-radius: 50%; }
.gift::before { width: 85%; aspect-ratio: 1; top: -48%; right: -30%; background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%); }
.gift::after { width: 58%; aspect-ratio: 1; top: -40%; right: -26%; border: 3px solid var(--kb-aksen); box-shadow: 0 0 0 9px rgba(255, 255, 255, .07), 0 0 0 10px rgba(255, 255, 255, .14); }
.gift > * { position: relative; z-index: 1; }
.bank-bri { --kb-latar: linear-gradient(135deg, #1b6fcb 0%, #00529c 48%, #003670 100%); --kb-aksen: #f58220; }
.bank-mandiri { --kb-latar: linear-gradient(135deg, #10508f 0%, #003d79 50%, #00264f 100%); --kb-aksen: #fdb913; }
.kb-atas { display: flex; justify-content: space-between; align-items: center; }
.kb-bank { font-family: system-ui, sans-serif; font-weight: 500; font-size: 26px; font-size: 8.5cqi; line-height: 1; letter-spacing: .02em; font-style: italic; }
.bank-mandiri .kb-bank { text-transform: lowercase; font-style: normal; letter-spacing: -.01em; }
.kb-nirkontak { width: 22px; width: 7cqi; aspect-ratio: 1; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; opacity: .85; }
.kb-chip {
  width: 44px; width: 14cqi; aspect-ratio: 1.3; margin-top: 6cqi; border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 32%, rgba(120, 90, 20, .35) 33% 35%, transparent 36% 64%, rgba(120, 90, 20, .35) 65% 67%, transparent 68%),
    linear-gradient(0deg, transparent 46%, rgba(120, 90, 20, .35) 47% 53%, transparent 54%),
    linear-gradient(135deg, #f6e3a1, #d4af5a 55%, #b8913c);
}
.kb-num { align-self: center; font-weight: 600; font-size: 22px; font-size: 7.4cqi; font-variant-numeric: tabular-nums lining-nums; letter-spacing: .06em; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.kb-bawah { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.kb-nama { display: grid; line-height: 1.25; min-width: 0; }
.kb-nama small { font-family: system-ui, sans-serif; font-size: 11px; font-size: 3.4cqi; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.kb-nama span { font-family: system-ui, sans-serif; font-weight: 500; font-size: 15px; font-size: 4.8cqi; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gift button { font-family: system-ui, sans-serif; font-size: 14px; font-size: 4.2cqi; padding: .45em 1.1em; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; flex-shrink: 0; }
.gift button:active { background: rgba(255, 255, 255, .3); }

/* ---------- RSVP ---------- */
.rsvp { background: var(--putih); border-top: 1px solid var(--garis); padding: 84px 26px; }
.rsvp-form { display: grid; gap: 14px; text-align: left; margin-bottom: 36px; }
.rsvp-form label { font-weight: 600; font-size: 16px; color: var(--teks-pudar); display: grid; gap: 6px; }
.rsvp-form label[hidden] { display: none; }
.rsvp-form input, .rsvp-form select, .rsvp-form textarea {
  font: inherit; font-weight: 500; font-size: 18px; color: var(--teks);
  padding: 9px 12px; border: 1px solid var(--garis); border-radius: 10px; background: var(--beige);
}
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.rsvp-form .btn { justify-self: center; margin-top: 4px; }
.form-msg { text-align: center; font-size: 16px; min-height: 1.4em; color: var(--navy); }
.wishes-head { font-weight: 600; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--teks-pudar); margin-bottom: 12px; }
.wishes { list-style: none; display: grid; gap: 10px; max-height: 460px; overflow-y: auto; text-align: left; padding-right: 4px; }
.wishes li { background: var(--beige); border-left: 3px solid var(--teal); border-radius: 8px; padding: 12px 14px; }
.wishes .w-name { font-weight: 600; color: var(--navy); word-break: break-word; overflow-wrap: anywhere; }
.wishes .w-badge { font-size: 13px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--garis); margin-left: 6px; vertical-align: middle; }
.wishes .w-text { margin-top: 2px; white-space: pre-line; word-break: break-word; overflow-wrap: anywhere; }
.wishes .w-time { font-size: 14px; color: var(--teks-pudar); margin-top: 4px; }

/* ---------- Penutup ---------- */
.penutup { padding: 150px 36px 50px; }
.judul-matur { font-family: var(--script); font-weight: 400; font-size: 56px; line-height: 1.3; color: var(--putih); margin-bottom: 18px; }
.penutup .salam-script { color: var(--langit); }
.penutup .nama-script { color: var(--putih); }
.tutup-lakon { height: 230px; margin-top: 30px; }
.tutup-lakon img { position: absolute; bottom: 0; left: 50%; width: 150px; margin-left: -75px; transform-origin: 50% 100%; }
.kaki { margin-top: 16px; font-weight: 600; font-size: 14px; letter-spacing: .3em; color: var(--langit); }

/* ---------- Musik & toast ---------- */
.music-btn {
  position: fixed; right: 16px; bottom: 18px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--beige); background: var(--navy); color: var(--beige);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(47,65,86,.35);
}
.music-btn[hidden] { display: none; }
.music-btn.playing svg { animation: putar 4s linear infinite; }
.music-btn.muted { opacity: .55; }
@keyframes putar { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px);
  background: var(--navy); color: var(--putih); font-size: 16px;
  padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .3s; pointer-events: none; z-index: 70;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mode animasi (animasi.js) ----------
   Tanpa GSAP / reduced-motion: semuanya tampil statis. Dengan GSAP: isi cover
   disembunyikan sampai timeline pembuka berjalan (cegah kedip). */
html.js-anim .cover-inner > *, html.js-anim .tirai > * { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .gulir, .music-btn.playing svg { animation: none; }
}
/* Tanpa GSAP: cover memudar lewat CSS (app.js menyembunyikannya setelah 2,1 dtk) */
.cover.opened { pointer-events: none; }
html:not(.js-anim) .cover { transition: opacity .9s ease; }
html:not(.js-anim) .cover.opened { opacity: 0; }
