/* Klasik — pernikahan islami klasik: bingkai ganda bersudut wajik, tulisan tangan Pinyon Script. Tiga warna: gading, hijau, marun. */
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("fonts/pinyon-script.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root { --paper: #f5efe3; --panel: #ece3d2; --ink: #2a241c; --muted: #5e5446; --gold: #7d5e27; --orn: #b89a5e; --accent: #2a241c; }
:root[data-tone="hijau"] { --paper: #f2efe6; --panel: #e5e3d6; --ink: #1e2b24; --muted: #4d5a52; --gold: #7a5f28; --orn: #a99363; --accent: #2c4636; }
:root[data-tone="marun"] { --paper: #f6eee7; --panel: #eedfd6; --ink: #2b1a1a; --muted: #5c4a47; --gold: #7d5e27; --orn: #b8956a; --accent: #6b1e28; }
:root {
  --caps: "Cinzel", Georgia, serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 19px/1.55 var(--serif); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
a { color: var(--gold); }
: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; min-height: 100vh; background: var(--paper); overflow: hidden; }
@media (min-width: 560px) { .page { box-shadow: 0 0 0 1px var(--orn), 0 30px 80px rgba(0, 0, 0, .25); } }
.caps { font: 500 12px/1.4 var(--caps); letter-spacing: .4em; text-transform: uppercase; color: var(--gold); }
.caps.light { color: var(--paper); opacity: .85; }
.date-caps { font: 400 15px/1.4 var(--caps); letter-spacing: .2em; text-transform: uppercase; }
.script { font: 400 44px/1.1 var(--script); }
.lead { font-size: 18px; line-height: 1.55; color: var(--muted); }
.garis, .dia { overflow: visible; }
.garis { width: 200px; height: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 28px; border-radius: 999px; border: 1px solid var(--orn); background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; font: 500 12px/1.2 var(--caps); letter-spacing: .22em; text-transform: uppercase; }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-solid { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-solid:hover { filter: brightness(1.2); color: var(--paper); }
.btn-ghost { color: var(--paper); min-height: 44px; padding: 0 20px; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); color: var(--paper); }
.btn-ghost-ink { background: var(--paper); font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.btn-sm { min-height: 44px; padding: 0 22px; }
.btn-block { width: 100%; min-height: 50px; letter-spacing: .3em; }
.btn.copied { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Bingkai ganda */
.frame { padding: 6px; border: 1px solid var(--orn); display: flex; }
.frame-in { position: relative; flex: 1; border: 1px solid var(--orn); display: flex; flex-direction: column; align-items: center; text-align: center; }
.dia { position: absolute; width: 14px; height: 14px; }
.dia.tl { top: -8px; left: -8px; } .dia.tr { top: -8px; right: -8px; } .dia.bl { bottom: -8px; left: -8px; } .dia.br { bottom: -8px; right: -8px; }
.names { font: 400 66px/1 var(--script); overflow-wrap: anywhere; }
.names span { font-size: 40px; color: var(--gold); }

/* Sampul */
.cover { min-height: 100vh; min-height: 100svh; padding: 18px; display: flex; background: var(--paper); }
.cover[hidden] { display: none; }
.cover .frame { flex: 1; }
.cover-in { justify-content: space-between; padding: 44px 26px 34px; gap: 24px; }
.cover-top { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.cover .names { font-size: 64px; margin-top: 4px; }
.mono { width: 112px; height: 112px; border-radius: 50%; border: 1px solid var(--orn); padding: 5px; display: flex; }
.mono span { flex: 1; border-radius: 50%; border: 1px solid var(--orn); display: flex; align-items: center; justify-content: center; font: 400 30px/1 var(--caps); letter-spacing: .08em; }
.mono i { font: normal 400 26px/1 var(--script); color: var(--gold); margin: 0 4px; }
.guest { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.guest .to { font-size: 17px; font-style: italic; color: var(--muted); }
.guest-name { width: 100%; padding: 14px 12px; border-block: 1px solid var(--orn); font-size: 24px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.guest .sorry { font-size: 14px; line-height: 1.4; color: var(--muted); }
.cover .open { padding: 0 28px; }

.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; }
@media (min-width: 560px) { .js .cover { padding-inline: calc(50% - 222px); } }

/* Isi */
.hero { padding: 18px; display: flex; }
.hero .frame { flex: 1; }
.hero-in { padding: 64px 24px 56px; gap: 20px; }
.ayat { margin-top: 8px; font-size: 18px; font-style: italic; line-height: 1.55; color: var(--muted); }

.couple { padding: 48px 32px 40px; display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.salam { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.salam-t { font-size: 20px; font-style: italic; }
.person { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.portrait { width: 132px; height: 168px; border-radius: 66px 66px 6px 6px; border: 1px solid var(--orn); padding: 5px; display: flex; }
.portrait > * { flex: 1; width: 100%; height: 100%; border-radius: 61px 61px 3px 3px; object-fit: cover; }
.portrait span { display: flex; align-items: center; justify-content: center; background: var(--panel); font: 400 40px/1 var(--script); color: var(--gold); }
.person h3 { margin-top: 10px; font: 400 44px/1.1 var(--script); overflow-wrap: anywhere; }
.parents { font-size: 17px; line-height: 1.5; color: var(--muted); }
.parents strong { color: var(--ink); font-weight: 600; }
.ig { font-size: 15px; font-weight: 600; color: var(--gold); overflow-wrap: anywhere; }
.amp { font: 400 54px/1 var(--script); color: var(--gold); }

.count { margin: 0 18px; padding: 36px 20px; background: var(--accent); color: var(--paper); display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; }
.countdown div { padding: 12px 0; border: 1px solid var(--orn); display: flex; flex-direction: column; gap: 2px; }
.countdown b { font: 500 26px/1.2 var(--caps); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 14px; font-style: italic; }
html:not(.js) .countdown { display: none; }

.events { padding: 56px 24px 24px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.events .frame { width: 100%; }
.event { padding: 26px 18px; gap: 10px; }
.event h3 { font: 400 40px/1.1 var(--script); }
.time { font-size: 18px; }
.bar { width: 40px; height: 1px; background: var(--orn); }
.place { font-size: 19px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.event .btn { margin-top: 6px; }

.gallery { padding: 32px 24px 56px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.gallery .script { margin-bottom: 6px; }
.grid { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ph { display: block; border: 1px solid var(--orn); padding: 5px; }
.ph img { width: 100%; height: 196px; object-fit: cover; background: var(--panel); }
.ph:nth-child(5n + 1) { grid-column: 1 / -1; }
.ph:nth-child(5n + 1) img { height: 214px; }
.ph:nth-child(5n) { grid-column: 1 / -1; }
.ph:nth-child(5n) img { height: 150px; }
.quote { margin-top: 8px; font-size: 18px; font-style: italic; line-height: 1.5; color: var(--muted); }

.gifts { padding: 48px 24px; background: var(--panel); display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.gift-card { width: 100%; background: var(--paper); border: 1px solid var(--orn); padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.bank { font: 500 13px/1.3 var(--caps); letter-spacing: .16em; color: var(--gold); text-transform: uppercase; }
.number { font-size: 22px; font-weight: 600; letter-spacing: .04em; overflow-wrap: anywhere; }
.holder { font-size: 15px; color: var(--muted); }
.gift-card .btn { flex-shrink: 0; }

.rsvp { padding: 56px 24px 32px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.note { width: 100%; padding: 14px 16px; border: 1px dashed var(--orn); font-size: 16px; color: var(--muted); }
.thanks { width: 100%; padding: 28px 18px; border: 1px solid var(--orn); display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.thanks .script { color: var(--ink); font-size: 40px; }
.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: 16px; font-weight: 600; }
.field legend { padding: 0 0 6px; }
.field input:not([type="radio"]), .field textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--orn); border-radius: 0; background: var(--paper); 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; box-shadow: 0 0 0 2px var(--orn); }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.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: 1px solid var(--orn); background: var(--paper); font-size: 18px; font-weight: 600; }
.opt input:checked + span { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.opt input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.wishes-box { padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 14px; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.head .script { font-size: 36px; }
.head small { font-size: 16px; color: var(--muted); }
.wishes { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.wishes li { padding: 14px 0; border-top: 1px solid var(--orn); display: flex; flex-direction: column; gap: 4px; }
.who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.who strong { font-size: 18px; font-weight: 600; }
.who small { font-size: 13px; color: var(--muted); }
.status { font-size: 14px; font-weight: 600; color: var(--gold); }
.wish-text { font-size: 17px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.wish-reply { margin-top: 4px; padding: 8px 12px; border-left: 2px solid var(--orn); font-style: italic; }

.closing { padding: 18px; display: flex; }
.closing .frame { flex: 1; }
.end { padding: 44px 24px; gap: 16px; }
.who-we { font-size: 16px; color: var(--muted); }
.script.big { font-size: 48px; overflow-wrap: anywhere; }
.families { font-size: 15px; line-height: 1.5; color: var(--muted); }
footer { padding: 0 0 22px; text-align: center; font-size: 13px; 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(--orn); border-radius: 50%; background: var(--paper); color: var(--gold); cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.music-toggle svg { width: 18px; height: 18px; }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 24px; height: 1.5px; background: var(--gold); 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 20px; }
.rv.in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; 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), 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; clip-path: none; } }

@media (prefers-reduced-motion: no-preference) {
  .cover .frame { animation: bingkai 1.4s cubic-bezier(.2, .7, .2, 1) both; }
  .cover .caps { animation: muncul 1.2s .5s both; }
  .mono { animation: tumbuh 1.4s .6s cubic-bezier(.2, .7, .2, 1) both; }
  .cover .names { animation: muncul 1.6s .9s both; }
  .cover .garis, .date-caps, .guest { animation: muncul 1.2s 1.4s both; }
  .cover .open { animation: muncul 1.2s 1.8s both; }
  .dia { animation: kedip 4s ease-in-out infinite; }
  .btn-solid:hover { translate: 0 -2px; }
}
@keyframes bingkai { from { opacity: 0; scale: .97; } to { opacity: 1; scale: 1; } }
@keyframes tumbuh { from { opacity: 0; scale: .8; } to { opacity: 1; scale: 1; } }
@keyframes muncul { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes kedip { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* 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 Klasik: persegi dengan bingkai garis ganda. */
.cover-photo { margin: 14px auto 12px; padding: 5px; border: 1px solid var(--orn); border-radius: 0; background: transparent; box-shadow: none; outline: 1px solid var(--orn); outline-offset: 4px; }
@media (max-height: 700px) { .cover-photo { display: none; } } /* layar pendek: sampul seperti semula supaya tombol tetap terlihat */
