/* Modern — editorial minimalis: foto besar, nama raksasa Instrument Serif, garis tipis. Tiga warna: sage, batu, malam. */
@font-face { font-family: "Instrument Serif"; font-style: normal; src: url("fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; font-style: italic; src: url("fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root { --ground: #f1efea; --ink: #151515; --muted: #5c5a55; --accent: #4f5e48; --on-accent: #fff; --rule: #cfcbc2; --photo: #d3d8cc; --card: #e4e6dd; --foot-rule: #3a3936; }
:root[data-tone="batu"] { --ground: #f1efea; --ink: #151515; --muted: #5c5a55; --accent: #9a4a2e; --on-accent: #fff; --rule: #cfcbc2; --photo: #dad6cd; --card: #e7e4dd; --foot-rule: #3a3936; }
:root[data-tone="malam"] { --ground: #141414; --ink: #f1efea; --muted: #a9a59d; --accent: #d2bc8c; --on-accent: #141414; --rule: #3a3936; --photo: #2a2927; --card: #1f1f1e; --foot-rule: #cfcbc2; }
:root {
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; counter-reset: sec; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--ground); overflow: hidden; }
@media (min-width: 560px) { .page { box-shadow: 0 0 0 1px var(--rule), 0 30px 80px rgba(0, 0, 0, .18); } }
em { font-style: italic; color: var(--accent); }
.label { font: 700 12px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sec > .label::before, .sec .label-row .label::before { counter-increment: sec; content: counter(sec, decimal-leading-zero) " — "; }
.label.plain { color: inherit; opacity: .85; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.n { font-size: 13px; color: var(--muted); }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); }
.big { font: 400 76px/.9 var(--serif); letter-spacing: -.03em; }
.mid { font: 400 44px/.95 var(--serif); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; text-decoration: none; cursor: pointer; font: 600 14px/1.2 var(--sans); }
.btn svg { width: 20px; height: 20px; }
.btn-ink { background: var(--ink); color: var(--ground); }
.btn-ink:hover { opacity: .88; color: var(--ground); }
.btn-line { border-color: var(--on-accent); color: var(--on-accent); align-self: flex-start; }
.btn-line:hover { background: rgba(255, 255, 255, .12); color: var(--on-accent); }
.btn-block { width: 100%; min-height: 56px; font-size: 16px; }
.btn-sm { padding: 0 16px; }
.btn.copied { background: var(--accent); color: var(--on-accent); }

/* Sampul */
.cover { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--ground); }
.cover[hidden] { display: none; }
.cover-photo { position: relative; flex: 1 1 470px; min-height: 300px; background: var(--photo); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cover-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-label { font: 600 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.cover-top { position: absolute; top: 20px; left: 22px; right: 22px; display: flex; justify-content: space-between; font: 600 12px/1 var(--sans); letter-spacing: .16em; color: var(--ink); mix-blend-mode: normal; text-shadow: 0 0 12px var(--ground); }
.cover-body { padding: 0 22px 26px; display: flex; flex-direction: column; gap: 18px; }
.cover .names { margin: -58px 0 0; position: relative; font: 400 clamp(56px, 22vw, 88px)/.86 var(--serif); letter-spacing: -.03em; overflow-wrap: anywhere; }
.guest { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-block: 1px solid var(--rule); }
.guest span { font: 600 12px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.guest b { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.cover .open { justify-content: space-between; min-height: 56px; padding: 0 22px; font-size: 16px; }

.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 { left: 50%; right: auto; width: 480px; margin-left: -240px; } }

/* Isi */
.hero { padding: 22px 22px 48px; display: flex; flex-direction: column; gap: 28px; }
.mini { font: 700 12px/1 var(--sans); letter-spacing: .16em; }
.hero .big { margin-top: 20px; }
.facts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.facts div { padding: 14px 0 14px 14px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facts div:first-child { padding-left: 0; border-left: 0; }
.facts span { font: 600 12px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts b { font: 400 34px/1 var(--serif); overflow-wrap: anywhere; }
.facts b.city { font-size: 30px; }
.main-photo { height: 300px; background: var(--photo); }
.main-photo img { width: 100%; height: 100%; object-fit: cover; }

.sec { padding: 40px 22px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 28px; }
.person { display: flex; gap: 16px; align-items: flex-end; }
.person.rev { flex-direction: row-reverse; text-align: right; }
.person.rev .who { align-items: flex-end; }
.shot { flex-shrink: 0; width: 140px; height: 180px; background: var(--photo); display: flex; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot span { margin: auto; font: 400 48px/1 var(--serif); color: var(--muted); }
.who { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.who h3 { font: 400 38px/.95 var(--serif); overflow-wrap: anywhere; }
.parents { font-size: 15px; line-height: 1.5; color: var(--muted); }
.ig { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

.count { padding: 36px 22px; background: var(--accent); color: var(--on-accent); display: flex; flex-direction: column; gap: 18px; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.countdown div { display: flex; flex-direction: column; gap: 2px; }
.countdown b { font: 400 48px/1 var(--serif); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 13px; font-weight: 500; }
html:not(.js) .countdown { display: none; }

.events { gap: 4px; }
.events > .label { margin-bottom: 18px; }
.event { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 22px 0; border-top: 1px solid var(--rule); }
.when { display: flex; flex-direction: column; }
.when b { font: 400 40px/1 var(--serif); }
.when span { font-size: 13px; color: var(--muted); }
.info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.info h3 { font: 700 20px/1.3 var(--sans); }
.date { font-size: 15px; font-weight: 600; }
.place { font-size: 15px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.chip { align-self: flex-start; margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.chip svg { width: 16px; height: 16px; }

.gallery { gap: 16px; }
.masonry { columns: 2; column-gap: 8px; }
.masonry img { width: 100%; margin-bottom: 8px; break-inside: avoid; object-fit: cover; background: var(--photo); aspect-ratio: 3 / 4; }
.masonry img:nth-child(3n + 2) { aspect-ratio: 1 / 1; }
.masonry img:nth-child(3n) { aspect-ratio: 4 / 5; }

.gifts { background: var(--card); gap: 14px; }
.gift-card { background: var(--ground); border-radius: 16px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gift-card > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bank { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.number { font-size: 22px; font-weight: 700; letter-spacing: .02em; overflow-wrap: anywhere; }
.holder { font-size: 14px; color: var(--muted); }

.rsvp { gap: 18px; padding-block: 44px; }
.note { padding: 14px 16px; border: 1px dashed var(--rule); border-radius: 12px; font-size: 14px; color: var(--muted); }
.done { border-radius: 16px; background: var(--card); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.done b { font-size: 20px; }
.done 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: 600; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--ground); color: var(--ink); font: 400 16px/1.4 var(--sans); }
.field.row input { width: 96px; text-align: center; font-weight: 700; }
.field textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: 999px; background: var(--card); }
.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: 46px; border-radius: 999px; font-size: 15px; font-weight: 600; }
.opt input:checked + span { background: var(--ink); color: var(--ground); }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.wishes-box { gap: 16px; padding-bottom: 48px; }
.wishes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow-y: auto; }
.wishes li { display: flex; gap: 12px; align-items: flex-start; }
.av { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font: 700 14px/1 var(--sans); font-style: normal; text-transform: uppercase; }
.bubble { flex: 1; min-width: 0; border-radius: 4px 16px 16px 16px; background: var(--card); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.who2 { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.who2 small { font-size: 12px; color: var(--muted); }
.bubble p:not(.who2) { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.wish-reply { margin-top: 4px; padding: 6px 10px; border-left: 2px solid var(--accent); font-style: italic; color: var(--muted); }

.closing { padding: 56px 22px 28px; background: var(--ink); color: var(--ground); display: flex; flex-direction: column; gap: 18px; }
.closing .big em { color: inherit; }
.closing p { font-size: 16px; line-height: 1.6; opacity: .8; }
.sign { padding-top: 18px; border-top: 1px solid var(--foot-rule); font-size: 15px; font-weight: 600; }
footer { padding: 14px 16px 22px; background: var(--ink); color: var(--ground); text-align: center; font-size: 12px; opacity: .9; }
footer a { color: inherit; }

.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(--rule); border-radius: 50%; background: var(--ground); color: var(--ink); 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(--ink); 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 30px; }
.rv.in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; transition: opacity 1s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), translate 1s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), scale 1s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), rotate 1s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), clip-path 1s 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; } }

.shot.rv, .main-photo.rv, .masonry img.rv { clip-path: inset(0 0 99% 0); translate: 0 0; opacity: 1; }
.shot.rv.in, .main-photo.rv.in, .masonry img.rv.in { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: no-preference) {
  .cover-photo img { animation: zum 2.6s cubic-bezier(.2, .7, .2, 1) both; }
  .cover-top { animation: muncul 1s .4s both; }
  .cover .names { animation: naik 1.1s .5s cubic-bezier(.2, .7, .2, 1) both; }
  .guest, .cover .open { animation: muncul 1s 1s both; }
  .btn-ink:hover svg { translate: 4px 0; }
  .btn svg { transition: translate .25s; }
}
@keyframes zum { from { scale: 1.14; } to { scale: 1; } }
@keyframes muncul { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes naik { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }
/* Cover lebih tinggi dari layar (foto sampul + layar pendek): tetap bisa digulir ke tombol "Buka undangan". */
.js body.locked { overflow: visible; }
@media (max-height: 700px) { .cover-photo { display: none; } } /* layar pendek: sampul seperti semula supaya tombol tetap terlihat */
