/* Walimah — pernikahan islami: hijau tua & emas, lengkung mihrab dan pola bintang segi delapan. */
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 400; src: url("fonts/amiri-arabic.woff2") format("woff2"); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 400; src: url("fonts/amiri.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 700; src: url("fonts/amiri-700.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Marcellus"; src: url("fonts/marcellus.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --green: #0f3d33;
  --green-2: #164b3f;
  --ivory: #f7f3ea;
  --sand: #efe8d8;
  --edge: #d9cdb1;
  --gold: #c9a85c;
  --gold-hi: #e3c77f;
  --gold-lo: #7a5f24;
  --ink: #1e2a26;
  --muted: #4f5a55;
  --mint: #d6e2dc;
  --display: "Marcellus", Georgia, serif;
  --serif: "Amiri", Georgia, serif;
 /* warna hasil tone (dulu ditulis langsung) */ --tn-1: #0f3d33;
}

/* Tone warna (field "tone"): hijau-zamrud = bawaan di atas. */
:root[data-tone="marun"] { --green: #3d0f12; --green-2: #4b161a; --ink: #2a1e20; --mint: #e2d6da; --tn-1: #3d0f12; }
:root[data-tone="ungu-tua"] { --green: #2c0f3d; --green-2: #37164b; --ink: #241e2a; --mint: #dad6e2; --tn-1: #2c0f3d; }
:root[data-tone="biru-malam"] { --green: #0f183d; --green-2: #16214b; --ink: #1e222a; --mint: #d6dce2; --tn-1: #0f183d; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--green); }
body { margin: 0; background: var(--green); color: var(--ink); font: 400 19px/1.55 var(--serif); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, p { margin: 0; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.page { max-width: 480px; margin: 0 auto; background: var(--ivory); min-height: 100vh; overflow: hidden; }
@media (min-width: 560px) { .page { box-shadow: 0 0 0 1px rgba(201, 168, 92, .4), 0 30px 80px rgba(0, 0, 0, .45); } }
.caps { font: 400 13px/1.4 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-lo); }
.caps.gold { color: var(--gold-hi); }
.arab { font-family: var(--serif); color: var(--green); line-height: 1.9; }
.lead { font-size: 17px; line-height: 1.6; color: var(--mint); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--green); background: transparent; color: var(--green); text-decoration: none; cursor: pointer; font: 400 13px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; }
.btn-green { background: var(--green); color: var(--ivory); }
.btn-green:hover { background: var(--green-2); color: var(--ivory); }
.btn-line:hover { background: color-mix(in srgb, var(--tn-1) 6%, transparent); }
.btn-block { width: 100%; min-height: 50px; }
.btn.copied { background: var(--gold); border-color: var(--gold); color: var(--green); }

/* Sampul */
.cover { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 34px 26px 0; background: var(--green); overflow: hidden; }
.cover[hidden] { display: none; }
.cover-pattern { position: absolute; top: 0; left: 0; width: 100%; height: 420px; }
.arch { position: relative; margin-top: 56px; width: 100%; background: var(--ivory); border: 2px solid var(--gold); border-bottom: 0; border-radius: 170px 170px 0 0; padding: 62px 22px 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.bismillah { font-size: 30px; line-height: 1.8; color: var(--green); }
.hiasan { width: 160px; height: 14px; color: #b08d3e; }
.cover .names { font: 400 50px/1.05 var(--serif); color: var(--green); overflow-wrap: anywhere; }
.cover .names span { color: #8a6a26; }
.cover-date { font: 400 16px/1.4 var(--display); letter-spacing: .12em; }
.guest { width: 100%; margin-top: 8px; padding: 14px; border-radius: 12px; background: var(--sand); display: flex; flex-direction: column; gap: 2px; }
.guest p:first-child { font-size: 15px; color: var(--muted); }
.guest-name { font-size: 21px; font-weight: 700; overflow-wrap: anywhere; }
.cover .open { margin-top: 10px; }

.js .cover { position: fixed; inset: 0; z-index: 40; overflow-y: auto; transition: transform 1s cubic-bezier(.7, 0, .2, 1), opacity 1s ease; }
.js:not(.is-open) body { overflow: hidden; }
.js.is-open .cover { transform: translateY(-100%); opacity: .6; }
.js.no-anim .cover { transition: none; }
html:not(.js) .cover .open { display: none; }

/* Isi */
.ayat { padding: 36px 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.ayat .arab { font-size: 24px; }
.arti { font-size: 17px; font-style: italic; line-height: 1.6; color: var(--muted); }

.mempelai { padding: 36px 26px; background: var(--green); color: var(--ivory); display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.salam { font-size: 20px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.portrait { width: 120px; height: 150px; border-radius: 60px 60px 6px 6px; border: 2px solid var(--gold); background: var(--green-2); overflow: hidden; display: flex; }
.portrait > * { flex: 1; width: 100%; height: 100%; object-fit: cover; }
.portrait span { display: flex; align-items: center; justify-content: center; font: 400 40px/1 var(--display); color: var(--gold-hi); }
.person h2 { margin-top: 6px; font: 400 30px/1.2 var(--serif); overflow-wrap: anywhere; }
.parents { font-size: 16px; color: var(--mint); }
.ig { font-size: 16px; color: var(--gold-hi); overflow-wrap: anywhere; }
.bintang { width: 28px; height: 28px; color: var(--gold); }

.count { padding: 40px 24px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.countdown div { border-radius: 14px; background: var(--green); color: var(--ivory); padding: 14px 0; display: flex; flex-direction: column; gap: 2px; box-shadow: inset 0 0 0 1px var(--gold); }
.countdown b { font: 400 28px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 15px; }
html:not(.js) .countdown { display: none; }

.events { padding: 44px 24px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.events > .caps { margin-bottom: 0; }
.event { border-radius: 16px; border: 1px solid var(--edge); background: #fff; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.event h2 { font: 400 26px/1.2 var(--serif); color: var(--green); }
.when { font: 400 15px/1.4 var(--display); }
.place { font-size: 17px; color: var(--muted); }
.note-event { font-size: 15px; font-style: italic; color: var(--muted); }
.event .btn { margin-top: 10px; }

.gallery { padding: 0 24px 40px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid img { width: 100%; height: 170px; object-fit: cover; border-radius: 80px 80px 8px 8px; background: #e4dcc8; }
.grid img:nth-child(3n) { grid-column: 1 / -1; height: 220px; border-radius: 8px; }

.doa { margin: 0 24px; padding: 26px 20px; border-radius: 16px; background: var(--sand); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.doa .arab { font-size: 23px; line-height: 1.8; }
.doa .arti { font-size: 16px; line-height: 1.5; }

.gifts { margin-top: 40px; padding: 40px 24px; background: var(--green); color: var(--ivory); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.gift-card { width: 100%; border-radius: 16px; background: var(--ivory); color: var(--ink); padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.bank { font: 400 14px/1.3 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-lo); }
.number { font-size: 22px; font-weight: 700; letter-spacing: .06em; overflow-wrap: anywhere; }
.holder { font-size: 15px; color: var(--muted); }
.gift-card .btn { flex-shrink: 0; padding: 0 16px; min-height: 44px; }

.rsvp { padding: 44px 24px 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.note { width: 100%; padding: 14px 16px; border: 1px dashed var(--gold-lo); border-radius: 12px; font-size: 16px; color: var(--muted); }
.thanks { width: 100%; padding: 26px 18px; border-radius: 16px; border: 1px solid var(--edge); background: #fff; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.thanks .big { font-size: 28px; color: var(--green); }
.form { width: 100%; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; font-size: 17px; font-weight: 700; }
.field legend { padding: 0 0 6px; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--edge); background: #fff; color: var(--ink); font: 400 18px/1.4 var(--serif); }
.field textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tn-1) 18%, transparent); }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt { position: relative; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px; border: 1px solid var(--green); background: #fff; color: var(--green); font-size: 17px; font-weight: 400; text-align: center; }
.opt input:checked + span { background: var(--green); color: var(--ivory); }
.opt input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.wishes-box { padding: 16px 24px 36px; }
.wishes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.wishes-head h2 { font: 400 28px/1.2 var(--serif); color: var(--green); }
.wishes-head span { font-size: 15px; color: var(--muted); white-space: nowrap; }
.wishes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow-y: auto; }
.wishes li { border-radius: 14px; background: #fff; border: 1px solid #e4dcc8; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.wish-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wish-head b { font-size: 18px; }
.tag { padding: 2px 8px; border-radius: 99px; background: var(--sand); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-lo); }
.status { font-size: 14px; font-weight: 700; color: var(--gold-lo); }
.wish-text { font-size: 17px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.wish-reply { margin-top: 6px; padding: 8px 12px; border-radius: 8px; background: var(--sand); font-style: italic; color: var(--muted); }

.closing { padding: 44px 26px 34px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); font-size: 17px; line-height: 1.6; }
.closing .salam { font-size: 20px; color: var(--ink); }
.names-end { font-size: 32px; color: var(--green); }
footer { padding: 4px 16px 26px; text-align: center; font-size: 14px; color: var(--muted); }

.music-toggle { position: fixed; bottom: 16px; right: max(14px, calc(50% - 226px)); z-index: 50; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gold); border-radius: 50%; background: var(--green); color: var(--gold-hi); cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.music-toggle svg { width: 18px; height: 18px; }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 24px; height: 1.5px; background: var(--gold-hi); transform: rotate(-45deg); }
html:not(.js) .music-toggle { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .cover { transition: opacity .3s ease; }
  .js.is-open .cover { transform: none; opacity: 0; }
}

/* Tombol musik muncul setelah undangan dibuka */
.js:not(.is-open) .music-toggle { display: none; }

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

/* ---------- Animasi ---------- */
.rv { opacity: 0; translate: 0 28px; }
.rv.in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; transition: opacity .9s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), translate .9s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), scale .9s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), rotate .9s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), clip-path .9s 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; clip-path: none; } }

@media (prefers-reduced-motion: no-preference) {
  .arch { animation: naik 1.3s cubic-bezier(.2, .7, .2, 1) both; }
  .cover-pattern { animation: napas 6s ease-in-out infinite; }
  .bismillah { animation: muncul 1.2s .7s both; }
  .cover .names { animation: muncul 1.2s 1s both; }
  .cover-date, .guest, .cover .open { animation: muncul 1s 1.3s both; }
  .bintang { animation: putar 16s linear infinite; }
  .btn-green:hover { transform: translateY(-2px); }
}
@keyframes naik { from { translate: 0 80px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes muncul { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes napas { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes putar { to { rotate: 360deg; } }

/* 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 Walimah: lingkaran dengan cincin emas putus-putus. */
.cover-photo { aspect-ratio: 1 / 1; margin: 16px auto 14px; border: 3px solid var(--ivory); border-radius: 50%; box-shadow: 0 0 0 1px var(--gold); outline: 1px dashed var(--gold); outline-offset: 6px; }
@media (max-height: 700px) { .cover-photo { display: none; } } /* layar pendek: sampul seperti semula supaya tombol tetap terlihat */
