/* =====================================================================
 *  BASE — tata letak & komponen bersama semua tema.
 *  Warna/font datang dari variabel yang di-set invitation.js per tema;
 *  karakter visual tiap tema ada di themes.css.
 * ===================================================================== */
:root {
  --bg: #F5F0E8; --surface: #FFFFFF; --ink: #222; --muted: #777;
  --accent: #B08D57; --accent-2: #D9C29A; --accent-soft: #EFE6D6;
  --line: rgba(0,0,0,.14); --on-accent: #fff;
  --f-display: Georgia, serif; --f-script: cursive; --f-body: system-ui, sans-serif;
  --pattern: none; --grain: none;
  --maxw: 480px; --ease: cubic-bezier(.16,.84,.28,1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.instant { scroll-behavior: auto; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: var(--f-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100vh; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* panggung: kolom ponsel di tengah, latar luar sedikit lebih gelap */
.stage { position: relative; max-width: var(--maxw); margin: 0 auto; min-height: 100vh; background: var(--bg); }
@media (min-width: 560px) {
  body { background: color-mix(in srgb, var(--bg) 82%, #000); }
  .stage { box-shadow: 0 0 80px rgba(0,0,0,.25); }
}
.invitation { position: relative; overflow: hidden; background: var(--bg); background-image: var(--pattern); }

/* ---------------------------- LOADER ------------------------------- */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; transition: opacity .6s ease, visibility .6s; }
.loader span { width: 34px; height: 34px; border: 1.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.loader.done { opacity: 0; visibility: hidden; }

/* ---------------------------- COVER -------------------------------- */
.cover-host {
  position: fixed; z-index: 60; top: 0; bottom: 0; left: 50%; width: 100%; max-width: var(--maxw);
  transform: translateX(-50%); background: var(--bg); background-image: var(--pattern);
  overflow: hidden; transition: transform 1.1s var(--ease), opacity 1.1s ease;
}
.cover-host.leaving { transform: translateX(-50%) translateY(-100%); }
.cover-host.gone { display: none; }
body:not(.opened) .invitation, body:not(.opened) #dockHost { visibility: hidden; }
.cover {
  position: relative; height: 100%; min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px 28px; gap: 6px;
}
.cv-kicker { margin: 0; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .32em; font-size: .72rem; color: var(--muted); }
.cv-names { margin: .1em 0; font-family: var(--f-script); font-weight: 400; line-height: 1; font-size: clamp(2.8rem, 14vw, 4.2rem); color: var(--ink); }
.cv-names span, .cv-names i { display: block; }
.cv-names i { font-style: normal; font-size: .55em; color: var(--accent); margin: .08em 0; }
.cv-date { margin: 6px 0 0; letter-spacing: .3em; font-size: .85rem; color: var(--ink); }
.cv-guest { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cv-guest-l { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cv-guest-n { font-family: var(--f-display); font-size: 1.3rem; font-weight: 500; }
.cv-guest-s { font-size: .66rem; color: var(--muted); max-width: 26ch; line-height: 1.4; margin-top: 2px; opacity: .8; }
.btn-open {
  margin-top: 20px; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  padding: 12px 28px; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; border-radius: 2px;
  transition: transform .25s ease, background .25s, color .25s;
}
.btn-open:hover { transform: translateY(-2px); }

/* ---------------------------- SECTIONS ----------------------------- */
.sec { position: relative; padding: 88px 26px; text-align: center; }
.sec-in { position: relative; z-index: 2; }
#home { min-height: 100svh; display: flex; align-items: center; justify-content: center; }
.sec-head { margin-bottom: 30px; }
.eyebrow { margin: 0 0 10px; font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.sec-title { margin: 0; font-family: var(--f-script); font-weight: 400; font-size: clamp(2.3rem, 11vw, 3.1rem); line-height: 1.1; color: var(--ink); }
.divider { width: min(62%, 230px); margin: 14px auto 0; }
.divider svg { width: 100%; height: auto; display: block; }
.lead { max-width: 34ch; margin: 0 auto 26px; color: var(--muted); font-size: .95rem; line-height: 1.8; }
.corner { position: absolute; z-index: 1; width: 92px; pointer-events: none; opacity: .9; }
.corner svg { width: 100%; height: auto; display: block; }
.corner.tl { top: 14px; left: 14px; }
.corner.br { bottom: 14px; right: 14px; transform: rotate(180deg); }

/* hero */
.hero-names { margin: 18px 0 8px; font-family: var(--f-script); font-weight: 400; font-size: clamp(3rem, 16vw, 4.6rem); line-height: 1; }
.hero-names span, .hero-names i { display: block; }
.hero-names i { font-style: normal; font-size: .5em; color: var(--accent); }
.hero-date { letter-spacing: .14em; font-size: .9rem; color: var(--muted); margin: 6px 0 0; }
.scroll-hint { margin-top: 46px; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-hint span { width: 1px; height: 38px; background: linear-gradient(var(--accent), transparent); animation: drip 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* quote */
.quote { margin: 0 auto; max-width: 34ch; }
.quote-text { font-family: var(--f-display); font-size: 1.06rem; line-height: 1.85; margin: 0; }
.quote-src { margin: 16px 0 0; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }

/* couple */
.couple { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.person { display: flex; flex-direction: column; align-items: center; max-width: 320px; }
.portrait { position: relative; width: 190px; aspect-ratio: 4/5; margin-bottom: 18px; display: grid; place-items: center; overflow: hidden; background: var(--surface); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .ini { font-family: var(--f-display); font-size: 4.4rem; color: var(--accent); line-height: 1; }
.person-role { margin: 0 0 4px; font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.person-name { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: 1.45rem; line-height: 1.25; }
.person-parents { margin: 8px 0 0; font-size: .88rem; color: var(--muted); line-height: 1.6; }
.person-ig { margin-top: 8px; font-size: .78rem; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
.amp { font-family: var(--f-script); font-size: 3rem; color: var(--accent); line-height: 1; margin: 18px 0; }

/* date */
.bigdate { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
.bd-day { font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.bd-num { font-family: var(--f-display); font-size: 5.6rem; line-height: 1; color: var(--accent); margin: 4px 0; }
.bd-my { font-family: var(--f-display); font-size: 1.1rem; letter-spacing: .08em; }
.countdown { display: flex; justify-content: center; gap: 10px; margin-bottom: 26px; }
.cd { min-width: 66px; padding: 12px 6px; border: 1px solid var(--line); background: var(--surface); }
.cd b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 1.7rem; line-height: 1.1; }
.cd span { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.cd b.tick { animation: tick .4s var(--ease); }
@keyframes tick { from { opacity: .3; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.btn-line {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 18px;
  border: 1px solid var(--accent); color: var(--accent); text-decoration: none; font-size: .76rem;
  letter-spacing: .14em; text-transform: uppercase; transition: background .25s, color .25s;
}
.btn-line:hover { background: var(--accent); color: var(--on-accent); }
.ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* events */
.events { display: flex; flex-direction: column; gap: 18px; }
.event { position: relative; background: var(--surface); border: 1px solid var(--line); padding: 30px 24px; }
.ev-no { margin: 0; font-size: .7rem; letter-spacing: .3em; color: var(--accent); }
.ev-name { margin: 4px 0 10px; font-family: var(--f-script); font-weight: 400; font-size: 2.3rem; line-height: 1.1; }
.ev-date { margin: 0; font-weight: 500; }
.ev-time { margin: 2px 0 14px; color: var(--muted); font-size: .92rem; }
.ev-place { display: inline-flex; gap: 8px; text-align: left; max-width: 30ch; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.ev-place .ic { margin-top: 2px; color: var(--accent); }
.ev-place strong { display: block; color: var(--ink); font-weight: 500; }
.ev-note { font-size: .84rem; color: var(--muted); font-style: italic; }
.ev-stub { display: none; }

/* story */
.story { list-style: none; margin: 0 auto; padding: 0 0 0 26px; max-width: 360px; text-align: left; position: relative; }
.story::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.story li { position: relative; padding-bottom: 30px; }
.story li::before { content: ""; position: absolute; left: -26px; top: 6px; width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--accent); background: var(--bg); }
.st-date { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.st-title { margin: 2px 0 4px; font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; }
.st-text { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.7; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; grid-auto-rows: 70px; }
.g-item { position: relative; padding: 0; border: 0; cursor: zoom-in; overflow: hidden; grid-column: span 3; grid-row: span 3; background: var(--surface); }
.g-item:nth-child(5n+1) { grid-column: span 6; grid-row: span 4; }
.g-item:nth-child(5n+4) { grid-row: span 4; }
.g-item:nth-child(5n+5) { grid-row: span 4; }
.g-item:last-child:nth-child(5n+2), .g-item:last-child:nth-child(5n+4) { grid-column: span 6; grid-row: span 4; }
.g-item img, .g-item video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.g-item:hover img, .g-item:hover video { transform: scale(1.05); }
.g-item.is-video { cursor: pointer; }
.g-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.38); border: 1px solid rgba(255,255,255,.7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: transform .3s; pointer-events: none; }
.g-play svg { width: 18px; height: 18px; margin-left: 3px; }
.g-item:hover .g-play, .film-play:hover .g-play { transform: translate(-50%, -50%) scale(1.1); }
.g-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; font-size: .72rem; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); pointer-events: none; }
/* video unggulan */
.film { position: relative; margin: 0 auto; max-width: 400px; }
.film .tape { display: none; }
.film-frame { position: relative; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.film.r916 { max-width: 270px; } .film.r916 .film-frame { aspect-ratio: 9 / 16; }
.film.r45 { max-width: 330px; } .film.r45 .film-frame { aspect-ratio: 4 / 5; }
.film.r11 { max-width: 340px; } .film.r11 .film-frame { aspect-ratio: 1; }
.film-frame video, .film-frame iframe, .film-play, .film-play img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.film-play { padding: 0; cursor: pointer; background: color-mix(in srgb, var(--accent) 40%, #000); }
.film-play .g-play { width: 62px; height: 62px; } .film-play .g-play svg { width: 24px; height: 24px; }
.film-cap { margin-top: 12px; font-size: .84rem; color: var(--muted); font-style: italic; }
/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.94); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox.open { display: flex; }
.lb-media { display: flex; align-items: center; justify-content: center; }
.lb-media img, .lb-media video { max-width: 92vw; max-height: 80vh; object-fit: contain; display: block; }
.lb-media iframe { width: min(92vw, 900px); aspect-ratio: 16 / 9; max-height: 80vh; border: 0; }
.lb-cap { margin: 0; color: rgba(255,255,255,.8); font-size: .85rem; min-height: 1em; text-align: center; padding: 0 20px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.4rem; cursor: pointer; padding: 10px 16px; opacity: .8; z-index: 2; }
.lb-x { top: 8px; right: 8px; } .lb-nav.prev { left: 0; } .lb-nav.next { right: 0; }
.lightbox.single .lb-nav { display: none; }

/* rsvp */
.form { max-width: 360px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.form > label, .att legend { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.form input:not([type=radio]), .form select, .form textarea {
  font: inherit; font-size: .95rem; letter-spacing: 0; text-transform: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 0; padding: 11px 13px; outline: none; width: 100%;
}
.form textarea { resize: vertical; min-height: 88px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.att { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.att legend { margin-bottom: 6px; }
.att label { flex: 1; }
.att input { position: absolute; opacity: 0; }
.att span { display: block; text-align: center; padding: 9px 4px; border: 1px solid var(--line); font-size: .82rem; cursor: pointer; background: var(--surface); transition: .2s; }
.att input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.att input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-solid { cursor: pointer; border: 0; background: var(--accent); color: var(--on-accent); padding: 13px; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; }
.form-msg { margin: 0; min-height: 1.2em; font-size: .84rem; color: var(--accent); text-align: center; }
.wishes-head { margin: 40px auto 12px; max-width: 360px; text-align: left; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.wishes { max-width: 360px; margin: 0 auto; max-height: 380px; overflow-y: auto; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.wishes:empty { display: none; }
.wish { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); }
.wish-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.wish-h b { font-weight: 600; font-size: .9rem; }
.wish-a { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.wish p { margin: 6px 0 4px; font-size: .9rem; color: var(--muted); line-height: 1.6; }
.wish time { font-size: .7rem; color: var(--muted); opacity: .7; }

/* gift */
.gifts { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.bank { width: min(100%, 330px); text-align: left; padding: 22px; background: var(--surface); border: 1px solid var(--line); }
.bank-top { display: flex; justify-content: space-between; align-items: center; }
.bank-name { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; letter-spacing: .04em; }
.chip { width: 34px; height: 26px; border-radius: 5px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); opacity: .85; }
.bank-num { margin: 22px 0 2px; font-size: 1.35rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.bank-holder { margin: 0; color: var(--muted); font-size: .86rem; }
.btn-copy { margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: none; border: 1px solid var(--line); padding: 7px 12px; font-size: .74rem; letter-spacing: .08em; }
.btn-copy.ok { border-color: var(--accent); color: var(--accent); }

/* closing */
.closing-salam { font-style: italic; color: var(--muted); }
.closing-names { margin: 0; font-family: var(--f-script); font-size: clamp(2.6rem, 13vw, 3.6rem); line-height: 1.1; }
.hashtag { margin-top: 14px; font-size: .74rem; letter-spacing: .24em; color: var(--accent); }
.foot { padding: 26px 20px 110px; text-align: center; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.foot p { margin: 0; }
.bday-age { font-family: var(--f-display); font-size: 1.3rem; color: var(--accent); margin: 6px 0 0; }

/* dock (navigasi bawah) */
.dock {
  position: fixed; z-index: 40; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: min(calc(100% - 24px), calc(var(--maxw) - 24px)); display: flex; justify-content: space-around;
  padding: 7px 6px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px;
}
.dock a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: .58rem; letter-spacing: .06em; color: var(--muted); padding: 4px 0; border-radius: 9px; transition: color .25s, background .25s; }
.dock a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dock .ic { width: 19px; height: 19px; }

/* music */
.music-btn {
  position: fixed; z-index: 45; right: max(14px, calc(50% - var(--maxw) / 2 + 14px)); bottom: 84px;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: var(--surface); color: var(--accent); display: none; align-items: center; justify-content: center; padding: 0;
}
body.opened .music-btn.show { display: flex; }
.music-btn svg { width: 24px; height: 24px; }
.music-btn.playing svg { animation: spin 3.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; }

/* --------------------------- REVEAL -------------------------------- */
.rv { opacity: 0; transform: translateY(22px); transition: opacity 1s ease, transform 1.1s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.person.left.rv { transform: translateX(-30px); } .person.right.rv { transform: translateX(30px); }
.person.rv.in { transform: none; }
html.instant .rv { transition: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
}
