/* Maroko — pernikahan islami bergaya Maroko: hijau teal, terakota, krem; lengkung tapal kuda dan zellige. */
@font-face { font-family: "Aref Ruqaa"; font-weight: 400; src: url("fonts/aref-ruqaa-arabic-400.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: "Aref Ruqaa"; font-weight: 700; src: url("fonts/aref-ruqaa-arabic-700.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: "Aref Ruqaa"; font-weight: 400; src: url("fonts/aref-ruqaa-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Aref Ruqaa"; font-weight: 700; src: url("fonts/aref-ruqaa-700.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Gloock"; src: url("fonts/gloock.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --teal: #12494f;
  --teal-2: #1c5c63;
  --terra: #c8693f;
  --terra-deep: #9c4422;
  --cream: #f4e9d8;
  --paper: #fbf5ea;
  --sand: #e8d7bc;
  --line: #e3d1b2;
  --ink: #2a1e17;
  --muted: #6b5444;
  --gold: #e2b866;
  --display: "Gloock", Georgia, serif;
  --arab: "Aref Ruqaa", serif;
  --sans: "Figtree", system-ui, sans-serif;
 /* warna hasil tone (dulu ditulis langsung) */ --tn-1: #d3e2e0; --tn-2: #12494f;
}

/* Tone warna (field "tone"): toska = bawaan di atas. */
:root[data-tone="biru-malam"] { --teal: #12244f; --teal-2: #1c3163; --tn-1: #d3dbe2; --tn-2: #12244f; }
:root[data-tone="hijau-zamrud"] { --teal: #124f36; --teal-2: #1c6345; --tn-1: #d3e2d8; --tn-2: #124f36; }
:root[data-tone="marun"] { --teal: #4f121c; --teal-2: #631c28; --tn-1: #e2d3d9; --tn-2: #4f121c; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--teal); }
body { margin: 0; background: var(--teal); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
a { color: var(--terra-deep); }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--cream); overflow: hidden; }
@media (min-width: 560px) { .page { box-shadow: 0 30px 80px rgba(0, 0, 0, .45); } }
h2 { font: 400 32px/1.15 var(--display); color: var(--teal); text-align: center; }
.caps { font: 700 12px/1.4 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--terra-deep); }
.caps.light { color: var(--cream); }
.caps.gold { color: var(--gold); }
.arab { font-family: var(--arab); color: var(--teal); line-height: 1.8; }
.lead { font-size: 15px; line-height: 1.6; color: var(--muted); }
.arti { font-size: 16px; font-style: italic; line-height: 1.6; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border: 1px solid transparent; border-radius: 999px; text-decoration: none; cursor: pointer; font: 600 15px/1.2 var(--sans); }
.btn-cream { background: var(--cream); color: var(--teal); }
.btn-cream:hover { background: #fff; color: var(--teal); }
.btn-outline { border-color: var(--cream); color: var(--cream); min-height: 44px; font-size: 14px; }
.btn-outline:hover { background: rgba(244, 233, 216, .12); color: var(--cream); }
.btn-terra { background: var(--terra); color: #fff; }
.btn-terra:hover { background: var(--terra-deep); color: #fff; }
.btn-block { width: 100%; min-height: 54px; font-size: 16px; font-weight: 700; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; font-weight: 700; }
.btn.copied { background: #4a8f6a; }

/* Sampul */
.cover { position: relative; min-height: 100vh; min-height: 100svh; padding: 24px 20px 28px; background: var(--teal); display: flex; flex-direction: column; align-items: center; gap: 22px; overflow: hidden; }
.cover[hidden] { display: none; }
.band { position: absolute; top: 0; left: 0; width: 100%; height: 200px; }
.mihrab { position: relative; width: min(100%, 350px); aspect-ratio: 350 / 640; margin-top: 50px; }
.frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.inner { position: absolute; left: 17%; right: 17%; top: 14%; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.bismillah { font: 400 30px/1.6 var(--arab); color: var(--teal); }
.cover .caps { font-size: 12px; letter-spacing: .3em; }
.cover .names { font: 400 48px/1 var(--display); color: var(--teal); overflow-wrap: anywhere; }
.names span { font-size: 30px; color: var(--terra); }
.hiasan { width: 120px; height: 14px; color: var(--terra); }
.cover-date { font-size: 16px; font-weight: 600; }
.guest { width: 100%; margin-top: 8px; padding: 12px 8px; border-block: 1px solid #d9c4a3; display: flex; flex-direction: column; gap: 2px; }
.guest span { font-size: 13px; color: var(--muted); }
.guest b { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.cover .open { position: relative; }

.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: 44px 28px 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ayat .arab { font-size: 28px; line-height: 1.7; }
.mempelai { padding: 0 20px 44px; display: flex; flex-direction: column; gap: 22px; text-align: center; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.portrait { width: 100%; height: 210px; border-radius: 999px 999px 0 0; border: 6px solid var(--teal); background: var(--sand); overflow: hidden; display: flex; }
.portrait.terra { border-color: var(--terra); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait span { margin: auto; font: 400 44px/1 var(--display); color: var(--muted); }
.person h2 { font-size: 22px; text-align: center; overflow-wrap: anywhere; }
.parents { font-size: 13px; line-height: 1.45; color: var(--muted); }
.ig { font-size: 13px; font-weight: 700; color: var(--terra-deep); overflow-wrap: anywhere; }

.count { padding: 34px 20px; background: var(--terra-deep); color: var(--cream); display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.countdown div { border-radius: 40px 40px 6px 6px; background: var(--cream); color: var(--teal); padding: 16px 0 10px; display: flex; flex-direction: column; gap: 2px; }
.countdown b { font: 400 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 12px; font-weight: 600; color: var(--muted); }
html:not(.js) .countdown { display: none; }

.events { padding: 44px 20px; display: flex; flex-direction: column; gap: 14px; }
.events h2 { margin-bottom: 4px; }
.event { display: flex; gap: 14px; align-items: stretch; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); padding: 16px; }
.pill { flex-shrink: 0; width: 70px; border-radius: 35px 35px 8px 8px; background: var(--teal); color: var(--cream); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 0; }
.pill b { font: 400 22px/1.2 var(--display); }
.pill span { font-size: 11px; font-weight: 600; }
.info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.info h3 { font: 400 22px/1.2 var(--display); color: var(--teal); }
.when { font-size: 15px; font-weight: 700; }
.place { font-size: 14px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.link { margin-top: 4px; font-size: 14px; font-weight: 700; }

.gallery { padding: 0 20px 44px; display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid img { width: 100%; height: 150px; object-fit: cover; border-radius: 999px 999px 4px 4px; background: var(--sand); }

.gifts { padding: 40px 20px; background: var(--teal); color: var(--cream); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.gifts .lead { color: var(--tn-1); }
.gift-card { width: 100%; border-radius: 16px; background: var(--cream); color: var(--ink); padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.bank { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--terra-deep); }
.number { font-size: 21px; font-weight: 700; overflow-wrap: anywhere; }
.holder { font-size: 14px; color: var(--muted); }
.gift-card .btn { flex-shrink: 0; }

.rsvp { padding: 44px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.note { padding: 14px 16px; border: 1px dashed var(--terra); border-radius: 12px; font-size: 14px; color: var(--muted); text-align: center; }
.thanks { border-radius: 18px; background: var(--paper); border: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.thanks b { font: 400 26px/1.2 var(--display); color: var(--teal); }
.thanks p { font-size: 15px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid #d9c4a3; background: var(--paper); color: var(--ink); font: 400 16px/1.4 var(--sans); }
.field.row input { width: 96px; text-align: center; font: 400 22px/1 var(--display); }
.field textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tn-2) 20%, 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: 50px; border-radius: 999px; border: 1px solid var(--teal); background: transparent; color: var(--teal); font-size: 15px; font-weight: 600; text-align: center; }
.opt input:checked + span { background: var(--teal); color: var(--cream); }
.opt input:focus-visible + span { outline: 2px solid var(--terra); outline-offset: 2px; }

.wishes-box { padding: 12px 20px 40px; display: flex; flex-direction: column; gap: 12px; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.head h2 { font-size: 26px; text-align: left; }
.head small { font-size: 13px; color: var(--muted); }
.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: 16px; background: var(--paper); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.who strong { font-size: 15px; }
.who small { font-size: 12px; color: var(--muted); }
.status { font-size: 12px; font-weight: 700; color: var(--terra-deep); }
.wish-text { font-size: 15px; line-height: 1.5; color: #4a3a2f; overflow-wrap: anywhere; }
.wish-reply { margin-top: 4px; padding: 6px 10px; border-radius: 10px; background: var(--sand); font-size: 14px; font-style: italic; }

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

.closing { margin-top: 24px; padding: 48px 24px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 15px; line-height: 1.6; color: var(--muted); }
.closing .salam { font-size: 17px; font-weight: 600; color: var(--ink); }
.names-end { font: 400 34px/1.2 var(--display); color: var(--teal); }
.strip { display: block; width: calc(100% + 48px); height: 40px; margin: 14px -24px 0; }
footer { padding: 12px 16px 24px; text-align: center; font-size: 12px; 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: 0; border-radius: 50%; background: var(--cream); color: var(--teal); box-shadow: 0 8px 20px rgba(0, 0, 0, .3); cursor: pointer; }
.music-toggle svg { width: 18px; height: 18px; }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 24px; height: 1.5px; background: var(--teal); 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) {
  .mihrab { animation: naik 1.4s cubic-bezier(.2, .7, .2, 1) both; }
  .band { animation: napas 7s ease-in-out infinite; }
  .bismillah { animation: muncul 1.2s .8s both; }
  .cover .caps, .cover .names, .hiasan, .cover-date, .guest { animation: muncul 1s 1.1s both; }
  .cover .open { animation: muncul 1s 1.5s both; }
  .pill { transition: transform .4s; }
  .event:hover .pill { transform: translateY(-3px); }
}
@keyframes naik { from { translate: 0 90px; 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: .6; } 50% { opacity: 1; } }

/* 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 Maroko: lengkung tapal kuda berbingkai terakota. */
.cover-photo { aspect-ratio: 5 / 6; border: 0; border-radius: 0; padding: 3px; background: var(--terra); box-shadow: none; clip-path: polygon(50% 0, 72% 4%, 90% 16%, 100% 34%, 100% 52%, 92% 66%, 92% 100%, 8% 100%, 8% 66%, 0 52%, 0 34%, 10% 16%, 28% 4%); }
.cover-photo img { clip-path: polygon(50% 0, 72% 4%, 90% 16%, 100% 34%, 100% 52%, 92% 66%, 92% 100%, 8% 100%, 8% 66%, 0 52%, 0 34%, 10% 16%, 28% 4%); }
@media (max-height: 700px) { .cover-photo { display: none; } } /* layar pendek: sampul seperti semula supaya tombol tetap terlihat */
