/* Undangan tema "Melati": satu kolom selebar HP, untaian melati (ronce) menggantung di sampul & pembatas.
   Tiga warna lewat html[data-warna]. Sengaja satu tampilan gelap (tak ikut tema perangkat). */
:root {
  --bg: #12241b;
  --permukaan: #1a3127;
  --sorot: #24402f;
  --teks: #f2eee1;
  --redup: #b6c0b1;
  --aksen: #cfae6a;
  --garis: rgba(242, 238, 225, .14);
  --bunga: #f2eee1;
  --kuncup: #e6e1d0;
  --f-hias: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-isi: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-arab: "Amiri", "Traditional Arabic", serif;
  color-scheme: dark;
}
html[data-warna="marun"] { --bg: #2a1317; --permukaan: #3a1d22; --sorot: #4a252b; --redup: #cdb7b4; --aksen: #d8b46e; }
html[data-warna="malam"] { --bg: #0f1a2b; --permukaan: #172539; --sorot: #22334c; --redup: #b3bccb; --aksen: #cdb27a; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--teks);
  font: 15px/1.65 var(--f-isi);
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
  -webkit-font-smoothing: antialiased;
}
body.tertutup { overflow: hidden; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--f-hias); font-weight: 400; text-wrap: balance; margin: 0; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--aksen); outline-offset: 3px; }

.pita-pratinjau {
  position: fixed; z-index: 30; left: 0; right: 0; top: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 16px 6px; text-align: center;
  background: #8a2b1d; color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .02em;
}

/* ---------- Sampul ---------- */
.sampul {
  position: fixed; inset: 0; z-index: 20;
  background: radial-gradient(120% 70% at 50% 0%, var(--sorot), var(--bg) 70%);
  display: grid; grid-template-rows: auto 1fr auto;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 28px) max(16px, env(safe-area-inset-left, 0px));
  text-align: center; overflow: hidden;
  transition: transform 1s cubic-bezier(.7, 0, .2, 1);
}
.sampul.terbuka { transform: translateY(-104%); }
.ronce { display: block; width: 100%; }
.ronce.atas { max-width: 520px; height: 190px; margin-inline: auto; }
.ronce.pembatas { height: 70px; }
.sampul-isi { align-self: center; display: grid; gap: 14px; justify-items: center; padding-block: 8px; }
.label { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--aksen); font-weight: 600; }
.nama-besar { font-size: clamp(50px, 16vw, 84px); font-style: italic; overflow-wrap: anywhere; }
.nama-besar .dan { display: block; font-size: .42em; font-style: normal; color: var(--aksen); margin-block: 2px; }
.tanggal-sampul { font-variant-numeric: tabular-nums; letter-spacing: .3em; color: var(--redup); font-size: 13px; }
.kepada { display: grid; gap: 4px; justify-items: center; margin-top: 8px; max-width: 100%; }
.kepada small { color: var(--redup); font-size: 12px; }
.kepada strong { font-family: var(--f-hias); font-size: 26px; font-weight: 400; line-height: 1.2; overflow-wrap: anywhere; }
.tombol {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--aksen); background: var(--aksen); color: var(--bg);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: transform .15s ease;
}
.tombol:active { transform: scale(.97); }
.tombol.garis { background: transparent; color: var(--aksen); }
.tombol.kecil { min-height: 38px; padding: 0 16px; font-size: 13px; }
.tombol:disabled { opacity: .5; cursor: default; }
.sampul .tombol { justify-self: center; }

/* ---------- Halaman ---------- */
.halaman { max-width: 460px; margin-inline: auto; padding-block: 40px 96px; display: grid; gap: 72px; }
.bagian { display: grid; gap: 22px; text-align: center; justify-items: center; min-width: 0; }
.bagian h2 { font-size: 38px; }
.basmalah { font-family: var(--f-arab); font-size: 28px; line-height: 1.6; direction: rtl; }
.basmalah.kecil { font-size: 22px; }
.ayat { color: var(--redup); max-width: 34ch; font-style: italic; font-family: var(--f-hias); font-size: 19px; line-height: 1.45; }
.ayat cite { display: block; margin-top: 10px; font-style: normal; font-family: var(--f-isi); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--aksen); }
.catatan { font-size: 13px; color: var(--redup); }
.sempit { max-width: 34ch; }

.mempelai { display: grid; gap: 28px; width: 100%; }
.orang { display: grid; gap: 8px; justify-items: center; }
.potret {
  width: 140px; aspect-ratio: 3 / 4; max-width: 100%; border-radius: 70px 70px 10px 10px;
  border: 1px solid var(--aksen); padding: 6px;
}
.potret > * { width: 100%; height: 100%; border-radius: 64px 64px 6px 6px; }
.potret img { object-fit: cover; }
.potret .huruf { display: grid; place-items: center; font-family: var(--f-hias); font-size: 46px; font-style: italic; color: var(--bg); }
.potret.p1 .huruf { background: linear-gradient(160deg, #e9dcc0, #b9a27a); }
.potret.p2 .huruf { background: linear-gradient(160deg, #cfd9c7, #8ea58a); }
.orang h3 { font-size: 30px; font-style: italic; overflow-wrap: anywhere; }
.orang .ortu { color: var(--redup); font-size: 14px; max-width: 30ch; }
.ampersand { font-family: var(--f-hias); font-size: 56px; color: var(--aksen); line-height: 1; }

.hitung { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.hitung div { border: 1px solid var(--garis); border-radius: 12px; padding: 14px 4px 10px; display: grid; gap: 2px; background: var(--permukaan); }
.hitung b { font-family: var(--f-hias); font-weight: 400; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.hitung span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--redup); }

.acara { display: grid; gap: 14px; width: 100%; }
.kartu { background: var(--permukaan); border: 1px solid var(--garis); border-radius: 18px; padding: 24px 20px; display: grid; gap: 10px; justify-items: center; min-width: 0; }
.kartu h3 { font-size: 28px; font-style: italic; }
.kartu .waktu { font-variant-numeric: tabular-nums; }
.kartu .tempat { color: var(--redup); font-size: 14px; max-width: 32ch; overflow-wrap: anywhere; }
.kartu .tempat b { color: var(--teks); font-weight: 500; }

.galeri { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 132px; gap: 8px; width: 100%; }
.galeri .foto { padding: 0; border: 0; background: var(--permukaan); border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.galeri .foto img { width: 100%; height: 100%; object-fit: cover; }
.galeri .foto:first-child { grid-row: span 2; }
.galeri.n1 .foto:first-child, .galeri.n2 .foto { grid-column: span 2; grid-row: span 2; }
.galeri.n2 { grid-auto-rows: 110px; }
.layar-foto { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px; }
.layar-foto img { max-height: 88vh; border-radius: 8px; }
.layar-foto .tutup { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--garis); background: rgba(0, 0, 0, .4); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }

form.rsvp { width: 100%; display: grid; gap: 12px; text-align: left; background: var(--permukaan); border: 1px solid var(--garis); border-radius: 18px; padding: 20px; }
.rsvp label { display: grid; gap: 6px; font-size: 13px; color: var(--redup); }
.rsvp input, .rsvp select, .rsvp textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--garis); background: var(--bg); color: var(--teks); font-size: 16px;
}
.rsvp textarea { min-height: 88px; resize: vertical; }
.pilih-hadir { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pilih-hadir label { position: relative; }
.pilih-hadir input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pilih-hadir span { display: grid; place-items: center; text-align: center; min-height: 44px; padding: 4px; border-radius: 10px; border: 1px solid var(--garis); color: var(--teks); font-size: 14px; cursor: pointer; }
.pilih-hadir input:checked + span { border-color: var(--aksen); background: color-mix(in srgb, var(--aksen) 14%, transparent); color: var(--aksen); font-weight: 600; }
.pilih-hadir input:focus-visible + span { outline: 2px solid var(--aksen); outline-offset: 2px; }
.rsvp .tombol { justify-self: stretch; }
.jebakan { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.terkirim { font-size: 13px; color: var(--aksen); text-align: center; }
.terkirim.salah { color: #f0a08f; }

.rekap { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; font-size: 13px; color: var(--redup); font-variant-numeric: tabular-nums; }
.rekap b { color: var(--teks); font-weight: 600; }
.ucapan { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; text-align: left; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.ucapan li { border-bottom: 1px solid var(--garis); padding-block: 12px; display: grid; gap: 4px; min-width: 0; }
.ucapan .kepala { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ucapan strong { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.ucapan .tanda { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--garis); color: var(--redup); }
.ucapan .tanda.ya { border-color: var(--aksen); color: var(--aksen); }
.ucapan time { font-size: 11px; color: var(--redup); margin-left: auto; }
.ucapan p { font-size: 14px; color: var(--redup); overflow-wrap: anywhere; white-space: pre-line; }
.ucapan .kosong { text-align: center; color: var(--redup); font-size: 13px; border: 0; }

.amplop { width: 100%; display: grid; gap: 12px; }
.rekening { background: var(--teks); color: var(--bg); border-radius: 16px; padding: 18px 96px 18px 20px; display: grid; gap: 2px; text-align: left; position: relative; min-width: 0; }
.rekening .bank { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; opacity: .7; }
.rekening .nomor { font-size: 21px; font-weight: 600; letter-spacing: .05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rekening .an { font-size: 13px; }
.rekening button { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); border: 1px solid var(--bg); background: transparent; color: var(--bg); border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.kado { border: 1px solid var(--garis); border-radius: 16px; padding: 18px 20px; display: grid; gap: 8px; justify-items: center; }
.kado p { color: var(--redup); font-size: 14px; overflow-wrap: anywhere; }

.penutup p { color: var(--redup); max-width: 34ch; }
.penutup .keluarga { font-family: var(--f-hias); font-style: italic; font-size: 26px; color: var(--teks); line-height: 1.3; }
.kaki { text-align: center; font-size: 12px; color: var(--redup); display: grid; gap: 6px; border-top: 1px solid var(--garis); padding-top: 24px; }
.kaki a { color: var(--aksen); text-decoration: none; }

.musik {
  position: fixed; z-index: 15;
  right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--aksen);
  background: var(--permukaan); color: var(--aksen); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.musik svg { width: 20px; height: 20px; }
.musik.main svg { animation: putar 4s linear infinite; }
@keyframes putar { to { transform: rotate(360deg); } }

.untai { animation: ayun 5s ease-in-out infinite alternate; }
@keyframes ayun { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }

@media (prefers-reduced-motion: reduce) {
  .untai, .musik.main svg { animation: none; }
  .sampul { transition: none; }
  html { scroll-behavior: auto; }
}
