/* ==========================================================
   Undangan Digital - base.css
   Mobile-first, responsif. Warna & tipografi diatur per tema
   lewat variabel CSS di themes/<tema>/theme.css
   ========================================================== */

:root {
  --bg: #f7f3ea;
  --bg-alt: #efe9da;
  --surface: #ffffff;
  --text: #2b2b2b;
  --muted: #777;
  --primary: #1f4d3f;
  --primary-contrast: #ffffff;
  --accent: #c9a24b;
  --border: rgba(0, 0, 0, .12);
  --font-display: Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-script: Georgia, serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --cover-shade: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.7));
  --hero-shade: linear-gradient(180deg, rgba(0,0,0,.4), rgba(0,0,0,.65));
  --dock-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
.ico { width: 1.15em; height: 1.15em; flex: none; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

body.is-locked { overflow: hidden; height: 100vh; height: 100dvh; }
body.is-locked .main,
body.is-locked .dock,
body.is-locked .music-btn { display: none; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--primary); color: var(--primary-contrast);
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { padding: .55rem 1.05rem; font-size: .85rem; }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: var(--primary-contrast); }
.btn-block { width: 100%; }

/* ---------- Cover ---------- */
.cover {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; text-align: center; color: #fff;
  overflow: hidden; background: var(--primary);
  transition: transform 1s cubic-bezier(.76, 0, .24, 1), opacity .6s ease .5s;
}
.cover.is-open { transform: translateY(-101%); opacity: 0; pointer-events: none; }
.cover-bg, .hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  background-color: var(--primary);
}
.cover-bg { animation: kenburns 24s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
.cover-shade { position: absolute; inset: 0; background: var(--cover-shade); }
.cover-inner {
  position: relative; z-index: 2; width: 100%; max-width: 560px;
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
}
.eyebrow {
  font-size: .78rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.names { font-family: var(--font-script); font-weight: 400; line-height: 1.05; display: flex; flex-direction: column; align-items: center; }
.names .amp { font-size: .55em; opacity: .9; color: var(--accent); line-height: 1.2; }
.cover-names { font-size: clamp(3rem, 14vw, 5.2rem); }
.cover-date { letter-spacing: .18em; text-transform: uppercase; font-size: .9rem; opacity: .95; }
.cover-guest {
  margin-top: .6rem; padding: 1rem 1.4rem; border-radius: var(--radius);
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: .15rem; width: 100%;
}
.cover-guest .to { font-size: .8rem; opacity: .9; }
.cover-guest .guest-name { font-size: 1.25rem; font-family: var(--font-display); word-break: break-word; }
.cover-guest small { font-size: .7rem; opacity: .75; }
.btn-open { background: var(--accent); color: #1b1b1b; padding: .95rem 1.8rem; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); } 70% { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }

/* ---------- Ornamen sudut ---------- */
.orn { position: absolute; width: clamp(88px, 26vw, 170px); aspect-ratio: 1; color: var(--accent); pointer-events: none; z-index: 1; }
.orn svg { width: 100%; height: 100%; display: block; }
.orn-tl { top: 8px; left: 8px; }
.orn-tr { top: 8px; right: 8px; }
.orn-bl { bottom: 8px; left: 8px; }
.orn-br { bottom: 8px; right: 8px; }
.orn-divider { display: flex; justify-content: center; color: var(--accent); margin: .8rem auto 0; }
.orn-divider svg { width: min(230px, 62%); height: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center; color: #fff; overflow: hidden;
}
.hero-shade { position: absolute; inset: 0; background: var(--hero-shade); }
.hero-inner {
  position: relative; z-index: 2; width: 100%; max-width: 760px;
  padding: 5rem 1.25rem 6rem; display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
}
.hero-names { font-size: clamp(3.2rem, 15vw, 6.4rem); }
.hero-date { letter-spacing: .2em; text-transform: uppercase; font-size: .95rem; }
.bismillah { font-family: var(--font-ar, serif); font-size: clamp(1.4rem, 5vw, 2rem); color: var(--accent); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; width: 100%; max-width: 420px; margin-top: .6rem; }
.countdown > div {
  padding: .8rem .2rem; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
}
.countdown b { font-size: clamp(1.5rem, 7vw, 2.1rem); font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.countdown span { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; opacity: .85; margin-top: .25rem; }
.cd-done { font-family: var(--font-display); font-size: 1.3rem; color: var(--accent); }
.scroll-cue { margin-top: 1.2rem; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .5); display: grid; place-items: center; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- Section ---------- */
.section { position: relative; padding: 4.5rem 1.25rem 4.5rem; background: var(--bg); }
.container { width: 100%; max-width: 1060px; margin: 0 auto; position: relative; }
.container.narrow { max-width: 720px; }
.sec-head { text-align: center; margin-bottom: 2.4rem; }
.sec-head .eyebrow { margin-bottom: .5rem; display: block; }
.sec-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 7vw, 2.8rem); line-height: 1.15; color: var(--primary); }
.prose p { margin-bottom: 1em; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- Mempelai ---------- */
.opening { text-align: center; max-width: 640px; margin: 0 auto 3rem; color: var(--text); }
.couple { display: grid; gap: 2.2rem; align-items: start; justify-items: center; }
.person { text-align: center; max-width: 320px; width: 100%; }
.person .photo { margin: 0 auto 1.3rem; width: min(250px, 72%); aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-alt); }
.person .photo img { width: 100%; height: 100%; object-fit: cover; }
.person-name { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; line-height: 1.25; color: var(--primary); }
.parents { margin-top: .5rem; font-size: .93rem; color: var(--muted); }
.couple-amp { font-family: var(--font-script); font-size: 3.4rem; color: var(--accent); line-height: 1; }

/* ---------- Quote ---------- */
.sec-quote { text-align: center; background: var(--primary); color: var(--primary-contrast); }
.quote-ar { font-family: var(--font-ar, serif); font-size: clamp(1.5rem, 5.4vw, 2.1rem); line-height: 2.1; margin-bottom: 1.4rem; color: var(--accent); }
.quote-text { margin: 0; font-family: var(--font-display); font-style: italic; font-size: clamp(1.05rem, 3.6vw, 1.3rem); line-height: 1.85; }
.quote-src { margin-top: 1.2rem; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* ---------- Acara ---------- */
.sec-events { background: var(--bg-alt); }
.events { display: grid; gap: 1.4rem; }
.event {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem 1.4rem; text-align: center; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
}
.event-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; color: var(--primary); }
.event-date .dow { font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.event-date .dd { font-family: var(--font-display); font-size: 3.4rem; font-weight: 700; }
.event-date .my { font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; }
.event-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--primary); }
.event-time { display: inline-flex; align-items: center; gap: .4rem; margin-top: .4rem; font-weight: 600; }
.event-place { margin-top: .6rem; font-weight: 700; }
.event-addr { color: var(--muted); font-size: .93rem; margin-top: .15rem; }
.event-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.1rem; }
.hashtag { text-align: center; margin-top: 2.2rem; font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); letter-spacing: .06em; }

/* ---------- Galeri ---------- */
.sec-gallery { background: var(--bg); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; grid-auto-flow: dense; gap: .5rem; }
.g-item { position: relative; overflow: hidden; border-radius: var(--radius-sm); display: block; background: var(--bg-alt); cursor: zoom-in; }
.g-item:nth-child(5n+1) { grid-row: span 2; }
.g-item:nth-child(7n+4) { grid-column: span 2; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.g-item:hover img { transform: scale(1.07); }

/* ---------- Hadiah ---------- */
.sec-gift { background: var(--bg-alt); }
.gift-note { margin-bottom: 1.8rem; }
.gifts { display: grid; gap: 1rem; }
.gift-card {
  background: var(--surface); border: 1px dashed var(--accent); border-radius: var(--radius);
  padding: 1.5rem 1.2rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .35rem;
}
.gift-bank { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); font-size: .95rem; }
.gift-no { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: .06em; word-break: break-all; }
.gift-name { color: var(--muted); font-size: .92rem; margin-bottom: .6rem; }
.gift-addr { color: var(--text); font-size: .95rem; margin: .2rem 0 .8rem; }

/* ---------- RSVP ---------- */
.sec-rsvp { background: var(--bg); }
.rsvp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1.6rem; }
.rsvp-stats > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem .3rem; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.rsvp-stats b { font-family: var(--font-display); font-size: 1.7rem; color: var(--primary); }
.rsvp-stats span { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rsvp-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.2rem; box-shadow: var(--shadow); display: grid; gap: 1rem; }
.field { display: grid; gap: .4rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-size: .82rem; font-weight: 700; letter-spacing: .04em; color: var(--primary); padding: 0; }
.field input[type=text], .field select, .field textarea {
  width: 100%; padding: .8rem .95rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 162, 75, .25); }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pills label { cursor: pointer; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span {
  display: inline-block; padding: .55rem 1.05rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); font-size: .9rem; font-weight: 600; transition: all .2s;
}
.pills input:checked + span { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-msg { min-height: 1.2em; text-align: center; font-size: .9rem; }
.form-msg.ok { color: #1d7a46; }
.form-msg.err { color: #b3261e; }
.wish-head { margin: 2.4rem 0 1rem; font-family: var(--font-display); font-size: 1.4rem; color: var(--primary); }
.wishes { display: grid; gap: .8rem; max-height: 560px; overflow-y: auto; padding-right: .3rem; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.wish { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .95rem 1.05rem; }
.wish header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; }
.wish p { font-size: .95rem; word-break: break-word; }
.wish time { display: block; margin-top: .4rem; font-size: .75rem; color: var(--muted); }
.badge { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .6rem; border-radius: 999px; }
.b-hadir { background: #dff3e6; color: #17653a; }
.b-tidak { background: #f9e0dd; color: #8e2a20; }
.b-ragu { background: #fbf0cf; color: #7a5a06; }
.wish.is-new { animation: flashin 1.6s ease; }
@keyframes flashin { from { background: rgba(201, 162, 75, .35); transform: translateY(-8px); } to { background: var(--surface); transform: none; } }

/* ---------- Footer ---------- */
.footer { position: relative; padding: 4rem 1.25rem calc(var(--dock-h) + 3.2rem); text-align: center; background: var(--primary); color: var(--primary-contrast); overflow: hidden; }
.closing { max-width: 560px; margin: 1.4rem auto 2rem; opacity: .95; }
.footer-names { font-family: var(--font-script); font-size: clamp(2.4rem, 10vw, 3.6rem); color: var(--accent); line-height: 1.1; }
.footer-tag { margin-top: .4rem; letter-spacing: .08em; opacity: .85; }
.credit { margin-top: 2.2rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; opacity: .55; }

/* ---------- Dock ---------- */
.dock {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: .15rem; padding: .35rem;
  max-width: calc(100vw - 20px);
  background: rgba(255, 255, 255, .86); border: 1px solid var(--border); border-radius: 999px;
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.dock a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 50px; padding: .4rem .55rem; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: .6rem; font-weight: 700; letter-spacing: .03em; transition: all .25s;
}
.dock a .ico { width: 1.35rem; height: 1.35rem; }
.dock a.active { background: var(--primary); color: var(--primary-contrast); }
.dock a:not(.active):hover { color: var(--primary); }

/* ---------- Tombol musik ---------- */
.music-btn {
  position: fixed; z-index: 61; right: 14px; bottom: calc(var(--dock-h) + 22px + env(safe-area-inset-bottom));
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--primary); color: var(--primary-contrast); display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, .28); padding: 0;
}
.music-btn[hidden] { display: none; }
.music-btn .ico { width: 1.3rem; height: 1.3rem; }
.music-btn .m-on { display: none; }
.music-btn.is-playing .m-on { display: grid; }
.music-btn.is-playing .m-off { display: none; }
.music-btn.is-playing { animation: spin-glow 3s linear infinite; }
@keyframes spin-glow { 0% { box-shadow: 0 0 0 0 rgba(201,162,75,.6), 0 8px 22px rgba(0,0,0,.28); } 100% { box-shadow: 0 0 0 14px rgba(201,162,75,0), 0 8px 22px rgba(0,0,0,.28); } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(8, 8, 8, .94); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.lb-close, .lb-nav { position: absolute; border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lb-close { top: max(14px, env(safe-area-inset-top)); right: 14px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-count { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #ddd; font-size: .85rem; letter-spacing: .1em; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 300; left: 50%; bottom: calc(var(--dock-h) + 30px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1c1c1c; color: #fff; padding: .65rem 1.2rem; border-radius: 999px; font-size: .88rem;
  transition: all .35s ease; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Partikel ---------- */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.particles i { position: absolute; top: -8%; display: block; opacity: 0; animation: drift linear infinite; will-change: transform; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: var(--po, .7); }
  90% { opacity: var(--po, .7); }
  100% { transform: translate3d(var(--dx, 40px), 112vh, 0) rotate(var(--rot, 360deg)); opacity: 0; }
}

/* ---------- Animasi masuk ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Tablet & desktop ---------- */
@media (min-width: 720px) {
  body { font-size: 17px; }
  .section { padding: 6rem 2rem; }
  .couple { grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; }
  .events { grid-template-columns: repeat(2, 1fr); }
  .events .event:only-child { grid-column: 1 / -1; max-width: 520px; margin: 0 auto; }
  .gifts { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 190px; gap: .7rem; }
  .rsvp-form { padding: 2rem; }
  .dock a { min-width: 64px; font-size: .66rem; }
}
@media (min-width: 1100px) {
  .gallery { grid-auto-rows: 220px; }
  .dock { bottom: 20px; }
}
@media (max-width: 360px) {
  .dock a { min-width: 44px; padding: .4rem .35rem; }
  .dock a span { font-size: .54rem; }
}
@media (max-height: 640px) and (orientation: landscape) {
  .cover-inner { gap: .6rem; padding-top: 18px; padding-bottom: 18px; }
  .cover-names { font-size: 2.6rem; }
  .cover-names .amp { font-size: .5em; }
  .hero { min-height: 640px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .particles { display: none; }
}
@media print { .dock, .music-btn, .cover, .particles { display: none !important; } .reveal { opacity: 1; transform: none; } body.is-locked .main { display: block; } }

.event-alt { display: block; margin-top: .7rem; font-size: .78rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
