/* =========================================================
   Undangan Digital — tampilan undangan (dasar + komponen)
   Variabel warna & font diatur per tema di themes.css
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #fbfaf7; --bg-alt: #f2efe8; --surface: #ffffff; --ink: #2a2a2a; --muted: #6f6a62;
  --accent: #8a6d3b; --accent-ink: #fff; --line: rgba(0, 0, 0, .12);
  --cover-overlay: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.65));
  --cover-ink: #fff;
  --f-display: Georgia, serif; --f-script: var(--f-display); --f-body: Georgia, serif;
  --display-weight: 400; --display-case: none; --display-track: 0;
  --radius: 14px; --frame: 999px 999px 18px 18px; --frame-border: 1px solid var(--line);
  --col: 480px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .35);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100vh; }
img, video, iframe { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- Loader & error ---------------- */
.boot { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.boot .spin { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot h1 { font-family: var(--f-display); font-weight: 400; color: var(--ink); margin: 0 0 6px; }

/* ---------------- Sampul / gerbang ---------------- */
.cover {
  position: fixed; inset: 0; z-index: 50; display: flex; pointer-events: auto;
}
.cover__half {
  position: relative; flex: 1; overflow: hidden;
  background: var(--cover-bg, var(--accent));
  transition: transform 1.25s cubic-bezier(.77, 0, .18, 1);
}
.cover__half::before {
  content: ""; position: absolute; inset: 0; width: 200%;
  background: var(--cover-overlay), var(--cover-img, none) center / cover no-repeat, var(--cover-bg, var(--accent));
}
.cover__half--r::before { left: -100%; }
.cover__content {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 28px; color: var(--cover-ink);
  transition: opacity .5s ease, transform .6s ease;
}
.cover__kicker { font-size: .95rem; letter-spacing: .04em; opacity: .9; margin: 0 0 18px; }
.cover__names {
  font-family: var(--f-script); font-weight: var(--display-weight); line-height: 1.05; margin: 0;
  font-size: clamp(3rem, 12vw, 5.2rem); text-transform: var(--names-case, none); letter-spacing: var(--display-track);
}
.cover__names .amp { display: block; font-size: .55em; margin: .1em 0; opacity: .85; }
.cover__date { margin: 18px 0 0; letter-spacing: .12em; font-size: .95rem; }
.cover__guest {
  margin: 44px 0 26px; padding: 16px 24px; min-width: min(300px, 80vw);
  border: 1px solid rgba(255, 255, 255, .45); border-radius: var(--radius);
  background: rgba(255, 255, 255, .08); backdrop-filter: blur(6px);
}
.cover__guest small { display: block; font-size: .85rem; opacity: .85; }
.cover__guest strong { display: block; font-size: 1.3rem; font-weight: 600; margin-top: 4px; line-height: 1.3; }
.cover__guest em { display: block; font-size: .78rem; opacity: .75; font-style: normal; margin-top: 6px; }
.btn-open {
  display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer;
  padding: 14px 30px; border-radius: 999px; font-weight: 600; letter-spacing: .02em;
  background: var(--cover-ink); color: var(--cover-btn-ink, var(--accent));
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  transition: transform .2s ease;
}
.btn-open:hover { transform: translateY(-2px); }
.btn-open svg { width: 18px; height: 18px; }
.cover__orn { position: absolute; z-index: 1; width: 170px; color: var(--cover-ink); opacity: .55; pointer-events: none; }
.cover__orn--tl { top: 0; left: 0; }
.cover__orn--br { bottom: 0; right: 0; transform: rotate(180deg); }

.cover.is-open .cover__content { opacity: 0; transform: scale(.96); }
.cover.is-open .cover__orn { opacity: 0; transition: opacity .4s; }
.cover.is-open .cover__half--l { transform: translateX(-101%); }
.cover.is-open .cover__half--r { transform: translateX(101%); }
.cover.is-gone { display: none; }

/* ---------------- Panggung (desktop split) ---------------- */
.stage { min-height: 100vh; }
.aside { display: none; }
.main { max-width: var(--col); margin: 0 auto; background: var(--bg); position: relative; overflow: hidden; }

@media (min-width: 1024px) {
  .stage { display: grid; grid-template-columns: 1fr var(--col); }
  .aside {
    display: flex; position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-end;
    padding: 64px 72px; color: var(--cover-ink);
    background: var(--cover-overlay), var(--cover-img, none) center / cover no-repeat, var(--cover-bg, var(--accent));
  }
  .aside__kicker { margin: 0 0 10px; opacity: .85; }
  .aside__names {
    font-family: var(--f-script); font-weight: var(--display-weight); text-transform: var(--names-case, none);
    letter-spacing: var(--display-track); font-size: clamp(3.5rem, 6vw, 6rem); line-height: 1; margin: 0;
  }
  .aside__date { margin: 18px 0 0; letter-spacing: .14em; }
  .main { margin: 0; box-shadow: -30px 0 60px -40px rgba(0, 0, 0, .5); }
}

/* ---------------- Section ---------------- */
.sec { position: relative; padding: 76px 28px; text-align: center; }
.sec--alt { background: var(--bg-alt); }
.sec__title {
  font-family: var(--f-display); font-weight: var(--display-weight); text-transform: var(--display-case);
  letter-spacing: var(--display-track); font-size: 2rem; line-height: 1.2; margin: 0 0 8px; color: var(--ink);
}
.sec__lead { color: var(--muted); margin: 0 auto 28px; max-width: 36ch; font-size: .98rem; }
.divider { display: block; width: 132px; height: 28px; margin: 14px auto 22px; color: var(--accent); }
.divider svg { width: 100%; height: 100%; }

/* Hero */
.hero { padding-top: 96px; padding-bottom: 64px; }
.hero__greet { font-style: italic; color: var(--muted); margin: 0 0 6px; }
.hero__kicker { margin: 0; color: var(--muted); letter-spacing: .05em; }
.hero__names {
  font-family: var(--f-script); font-weight: var(--display-weight); text-transform: var(--names-case, none);
  letter-spacing: var(--display-track); font-size: clamp(2.9rem, 13vw, 3.8rem); line-height: 1.08; margin: 14px 0; color: var(--accent);
}
.hero__photo {
  width: 230px; aspect-ratio: 4 / 5; margin: 30px auto 10px; object-fit: cover;
  border-radius: var(--frame); border: var(--frame-border); padding: 6px; background: var(--surface);
}
.hero__date { font-size: 1.05rem; letter-spacing: .12em; margin: 18px 0 0; }
.hero__text { max-width: 34ch; margin: 18px auto 0; color: var(--muted); }

/* Quote */
.quote blockquote { margin: 0 auto; max-width: 34ch; font-style: italic; font-size: 1.08rem; line-height: 1.8; }
.quote cite { display: block; margin-top: 14px; font-style: normal; color: var(--accent); font-weight: 600; }

/* Profil */
.person { margin: 0 auto; max-width: 340px; }
.person + .person-amp { font-family: var(--f-script); font-size: 3.4rem; color: var(--accent); margin: 26px 0; line-height: 1; }
.person__photo {
  width: 200px; aspect-ratio: 4 / 5; object-fit: cover; margin: 0 auto 20px;
  border-radius: var(--frame); border: var(--frame-border); padding: 6px; background: var(--surface);
}
.person__photo--ph { display: grid; place-items: center; font-family: var(--f-script); font-size: 4rem; color: var(--accent); background: var(--bg-alt); }
.person__nick { font-family: var(--f-script); font-weight: var(--display-weight); text-transform: var(--names-case, none); font-size: 2.6rem; line-height: 1.1; margin: 0; color: var(--accent); }
.person__name { font-weight: 600; font-size: 1.1rem; margin: 8px 0 6px; }
.person__parents { color: var(--muted); margin: 0; font-size: .95rem; }
.ig { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .9rem; text-decoration: none; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); }
.ig svg { width: 15px; height: 15px; }

/* Countdown */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 360px; margin: 0 auto 26px; }
.countdown div { padding: 14px 4px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.countdown b { display: block; font-family: var(--f-display); font-size: 1.9rem; font-weight: 500; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .78rem; color: var(--muted); }
.countdown-done { font-family: var(--f-display); font-size: 1.3rem; color: var(--accent); margin-bottom: 20px; }

/* Tombol umum */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 11px 22px; border-radius: 999px; font-size: .92rem; font-weight: 600; text-decoration: none;
  transition: filter .2s ease, transform .2s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Acara */
.event {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 22px 22px; margin: 0 auto 22px; box-shadow: var(--shadow); text-align: center;
}
.event__name { font-family: var(--f-display); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: 1.6rem; margin: 0 0 14px; color: var(--accent); }
.event__date { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 14px; }
.event__day { font-family: var(--f-display); font-size: 2.8rem; line-height: 1; color: var(--ink); }
.event__dm { text-align: left; border-left: 1px solid var(--line); padding-left: 16px; line-height: 1.35; }
.event__dm b { display: block; }
.event__dm span { color: var(--muted); font-size: .9rem; }
.event__time { margin: 0 0 14px; font-weight: 600; }
.event__venue { font-weight: 600; margin: 0; }
.event__addr { color: var(--muted); margin: 4px 0 0; font-size: .93rem; }
.event__note { margin: 14px 0 0; font-size: .88rem; color: var(--muted); font-style: italic; }
.event__map { margin: 18px -8px 16px; border-radius: calc(var(--radius) - 4px); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: var(--bg-alt); }
.event__map iframe { width: 100%; height: 100%; border: 0; }
.event__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.event__actions .btn { padding: 10px 16px; font-size: .86rem; }
.dresscode { margin: 8px auto 0; max-width: 320px; padding: 14px 18px; border: 1px dashed var(--accent); border-radius: var(--radius); font-size: .93rem; }

/* Cerita / timeline */
.timeline { position: relative; text-align: left; max-width: 380px; margin: 0 auto; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--accent); opacity: .5; }
.tl-item { position: relative; padding-bottom: 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -29px; top: 7px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-item__date { font-size: .85rem; color: var(--accent); font-weight: 600; }
.tl-item h3 { font-family: var(--f-display); font-weight: var(--display-weight); text-transform: var(--display-case); font-size: 1.3rem; margin: 2px 0 6px; }
.tl-item p { margin: 0; color: var(--muted); font-size: .95rem; }
.tl-item img { margin-top: 12px; border-radius: var(--radius); }

/* Galeri */
.gallery { columns: 2; column-gap: 8px; }
.gallery button { display: block; width: 100%; margin: 0 0 8px; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: calc(var(--radius) - 4px); overflow: hidden; break-inside: avoid; }
.gallery img { width: 100%; height: auto; transition: transform .5s ease; }
.gallery button:hover img { transform: scale(1.04); }
.gallery button:first-child { column-span: all; }
.video-wrap { margin-top: 18px; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.video-wrap video, .video-wrap iframe { width: 100%; height: 100%; border: 0; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10, 10, 10, .92); display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 86vh; border-radius: 8px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* Kado */
.gift-list { display: grid; gap: 14px; text-align: left; }
.gift {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.gift__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.gift__provider { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; color: var(--accent); }
.gift__chip { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #e7d39c, #b99447); opacity: .85; }
.gift__number { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 1.2rem; letter-spacing: .08em; margin: 0; word-break: break-word; }
.gift--address .gift__number { font-family: inherit; font-size: 1rem; letter-spacing: 0; }
.gift__name { color: var(--muted); margin: 4px 0 14px; font-size: .93rem; }
.gift .btn { padding: 8px 16px; font-size: .85rem; }
.gift-toggle { margin-bottom: 22px; }
.gift-panel[hidden] { display: none; }

/* RSVP & ucapan */
.form { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: calc(var(--radius) - 4px); border: 1px solid var(--line);
  background: var(--bg); outline: none; transition: border-color .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { min-height: 96px; resize: vertical; }
.pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pills label { margin: 0; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span { display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); font-weight: 500; font-size: .88rem; cursor: pointer; transition: all .2s; }
.pills input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form .btn { width: 100%; }
.form-msg { margin: 12px 0 0; font-size: .9rem; text-align: center; }
.form-msg.err { color: #c0392b; }

.rsvp-stats { display: flex; justify-content: center; gap: 10px; margin: 0 0 18px; flex-wrap: wrap; }
.rsvp-stats span { font-size: .82rem; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }

.wishes { margin-top: 26px; text-align: left; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.wish { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wish__av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
.wish__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wish__head b { font-size: .95rem; }
.badge { font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line); }
.badge--hadir { color: #2e7d4f; border-color: rgba(46, 125, 79, .35); background: rgba(46, 125, 79, .08); }
.badge--tidak { color: #b0413e; border-color: rgba(176, 65, 62, .35); background: rgba(176, 65, 62, .08); }
.wish p { margin: 4px 0 2px; font-size: .93rem; white-space: pre-line; word-break: break-word; }
.wish time { font-size: .76rem; color: var(--muted); }
.wishes-empty { color: var(--muted); text-align: center; padding: 20px 0; }

/* Penutup */
.closing { padding-bottom: 120px; }
.closing__text { margin-bottom: 12px; }
.closing__from { margin: 26px 0 0; color: var(--muted); }
.closing__sign { font-family: var(--f-script); font-size: 2.6rem; color: var(--accent); margin: 18px 0 0; line-height: 1.2; text-transform: var(--names-case, none); }
.hashtag { display: inline-block; margin-top: 18px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.credit { padding: 22px; text-align: center; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

/* Musik */
.music {
  position: fixed; z-index: 40; right: 18px; bottom: 86px; width: 48px; height: 48px; border-radius: 50%;
  border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45);
}
.music svg { width: 20px; height: 20px; }
.music.playing svg { animation: spin 4s linear infinite; }
.music[hidden] { display: none; }

/* Navigasi bawah */
.nav {
  position: fixed; z-index: 40; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .35);
  max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none;
}
.nav a { flex: none; display: grid; place-items: center; width: 44px; height: 40px; border-radius: 999px; color: var(--muted); transition: all .2s; }
.nav a.active { background: var(--accent); color: var(--accent-ink); }
.nav svg { width: 19px; height: 19px; }
@media (min-width: 1024px) {
  .nav { left: auto; right: calc(var(--col) / 2); transform: translateX(50%); }
  .music { right: 24px; bottom: 24px; }
}

.toast {
  position: fixed; z-index: 90; left: 50%; top: 22px; transform: translate(-50%, -150%);
  background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 999px; font-size: .9rem;
  transition: transform .35s ease, visibility .35s; pointer-events: none; visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* Gerak masuk yang sangat ringan, hanya untuk hero */
.hero > * { animation: rise .9s ease both; }
.hero > *:nth-child(2) { animation-delay: .1s; }
.hero > *:nth-child(3) { animation-delay: .2s; }
.hero > *:nth-child(4) { animation-delay: .3s; }
.hero > *:nth-child(5) { animation-delay: .4s; }
body.locked .hero > * { animation-play-state: paused; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* Nama / judul panjang */
.hero .hero__names.is-long { font-size: clamp(1.9rem, 8vw, 2.5rem); line-height: 1.15; }
.aside .aside__names.is-long { font-size: clamp(2.4rem, 3.6vw, 3.6rem); line-height: 1.08; }

/* Pengganti inline style dari invite.js */
.cover__names .is-long { display: inline-block; font-size: .62em; line-height: 1.1; }
.cover__spacer { height: 40px; }
.host__desc { margin-top: 10px; }
