/* =========================================================
   Bliss - Template Undangan Pernikahan Digital (versi Indonesia)
   Tema: ivory (bawaan), sage, blush
   Ganti tema di index.html: <html data-theme="sage">
   ========================================================= */

/* ----- Theme: ivory (cream and gold) ----- */
:root,
[data-theme="ivory"] {
  --bg: #faf6f0;
  --surface: #ffffff;
  --soft: #f3ebdf;
  --text: #3a2f28;
  --muted: #85776c;
  --accent: #b08d57;
  --accent-text: #ffffff;
  --line: rgba(58, 47, 40, 0.12);
}

/* ----- Theme: sage (soft green) ----- */
[data-theme="sage"] {
  --bg: #f4f7f2;
  --surface: #ffffff;
  --soft: #e5ece1;
  --text: #2f3a30;
  --muted: #6b7a6b;
  --accent: #6f8f6a;
  --accent-text: #ffffff;
  --line: rgba(47, 58, 48, 0.12);
}

/* ----- Theme: blush (soft pink) ----- */
[data-theme="blush"] {
  --bg: #fbf5f4;
  --surface: #ffffff;
  --soft: #f4e3e1;
  --text: #3d2c2e;
  --muted: #8b7274;
  --accent: #c07a7d;
  --accent-text: #ffffff;
  --line: rgba(61, 44, 46, 0.12);
}

/* ----- Base ----- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--soft);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, .names, .quote, .signoff {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.15;
}
h2 { font-size: clamp(30px, 6vw, 40px); margin: 0 0 18px; }
h3 { font-size: 24px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* The invitation is a centered card that looks great on phones and computers */
.invitation { max-width: 560px; margin: 0 auto; overflow-x: hidden; overflow-x: clip; background: var(--bg); box-shadow: 0 0 60px rgba(0,0,0,0.06); }

.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }

/* ----- Buttons ----- */
.btn {
  display: inline-block; margin-top: 18px; padding: 13px 28px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent);
  font-weight: 600; letter-spacing: 0.04em; text-decoration: none; transition: filter 0.2s, background 0.2s;
}
.btn:hover, .btn:focus-visible { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--surface); filter: none; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ----- Cover ----- */
.cover { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 28px 64px; }
.cover-image { width: min(260px, 70%); border-radius: 200px 200px 24px 24px; border: 1px solid var(--line); margin-bottom: 28px; }
.names { display: flex; flex-direction: column; align-items: center; margin: 4px 0 10px; font-size: clamp(44px, 13vw, 64px); line-height: 1; }
.names .name { max-width: 100%; overflow-wrap: anywhere; }
.names .and { margin: 4px 0; font-size: 0.6em; font-style: italic; color: var(--accent); }
.names.small { font-size: 36px; }
.date { font-size: 17px; letter-spacing: 0.06em; color: var(--muted); }
.guest { width: 100%; max-width: 340px; margin-top: 26px; padding: 18px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guest-label { margin: 0; font-size: 14px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.guest-name { margin: 4px 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 30px; font-weight: 600; }
.guest-note { margin: 0; color: var(--muted); font-size: 15px; }

/* ----- Sections ----- */
.section { padding: 64px 28px; scroll-margin-top: 10px; }
.soft { background: var(--soft); }
.divider { width: 160px; height: 24px; color: var(--accent); margin: 0 auto 24px; display: block; }
.quote { margin: 0 auto 16px; max-width: 420px; font-size: 28px; font-style: italic; font-weight: 500; }

/* ----- Countdown ----- */
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 420px; margin: 0 auto; }
.countdown div { padding: 16px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.countdown strong { display: block; overflow-wrap: anywhere; font-family: "Cormorant Garamond", Georgia, serif; font-size: 34px; line-height: 1; color: var(--accent); }
.countdown span { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.countdown-done { font-size: 18px; }

/* ----- Couple ----- */
.couple { display: grid; gap: 14px; justify-items: center; }
.person { padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); width: 100%; max-width: 360px; }
.person p { margin: 0; }
.amp { font-family: "Cormorant Garamond", Georgia, serif; font-size: 44px; font-style: italic; color: var(--accent); line-height: 1; }

/* ----- Events ----- */
.events { display: grid; gap: 16px; }
.event { padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.event .time { font-size: 20px; font-weight: 600; color: var(--accent); }
.event .btn { margin-top: 8px; }

/* ----- Gallery ----- */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); }
.gallery img:first-child,
.gallery img:last-child:nth-child(even) { grid-column: span 2; aspect-ratio: 16 / 10; }

/* ----- Dress code ----- */
.swatches { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.swatches span { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }

/* ----- FAQ ----- */
.faq { display: grid; gap: 10px; }
.faq details { padding: 16px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* ----- Footer ----- */
.footer { padding: 56px 28px 72px; }
.signoff { margin: 0; font-size: 24px; font-style: italic; font-weight: 500; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* =========================================================
   Tambahan versi Indonesia: amplop digital, RSVP, musik
   ========================================================= */
.gift-list { display: grid; gap: 12px; max-width: 380px; margin: 22px auto 0; text-align: left; }
.gift { padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.gift .bank { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.gift .number { margin: 4px 0 0; font-size: 22px; font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.gift .holder { margin: 0; color: var(--muted); font-size: 15px; }
.copy { margin-top: 10px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.copy:hover, .copy:focus-visible { background: var(--accent); color: var(--accent-text); }

.rsvp-form { display: grid; gap: 14px; max-width: 380px; margin: 22px auto 0; text-align: left; }
.rsvp-form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.rsvp-form input, .rsvp-form select, .rsvp-form textarea { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus { outline: none; border-color: var(--accent); }
.rsvp-form .btn { width: 100%; margin-top: 4px; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.form-error { margin: 0; color: #c0392b; font-size: 14px; font-weight: 600; }
.form-error:empty { display: none; }

.music-btn { position: fixed; right: 16px; bottom: 16px; z-index: 20; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); font-size: 20px; cursor: pointer; box-shadow: 0 8px 20px rgba(0,0,0,0.18); }
.music-btn[hidden] { display: none; }
.music-btn.playing { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 30; }
.toast.show { opacity: 1; }

/* =========================================================
   Animasi pembuka: foto di bingkai lengkung membesar memenuhi layar,
   nama kalian muncul di atas foto, lalu foto terangkat ke atas
   seperti membuka lembar pertama undangan.
   ========================================================= */
.cover > * { transition: opacity .45s ease, transform .55s cubic-bezier(.3,.7,.2,1); }
.cover.is-opening > *:not(.cover-image) { opacity: 0; transform: translateY(14px); }
.cover.is-opening > :nth-child(3) { transition-delay: .04s; }
.cover.is-opening > :nth-child(4) { transition-delay: .08s; }
.cover.is-opening > :nth-child(5) { transition-delay: .12s; }
.cover.is-opening > :nth-child(6) { transition-delay: .16s; }
.cover.is-opening > :nth-child(7) { transition-delay: .2s; }
.cover.is-opening .cover-image { visibility: hidden; }

.opening { position: fixed; z-index: 40; overflow: hidden; pointer-events: none; background: var(--soft); box-shadow: 0 24px 60px rgba(0,0,0,.18); will-change: top, left, width, height, transform; }
.opening img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform-origin: 50% 40%; }
.opening::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.5) 100%); opacity: 0; transition: opacity .7s ease; }
.opening-names { position: absolute; left: 0; right: 0; bottom: 12%; z-index: 1; margin: 0; padding: 0 24px; text-align: center; color: #fff; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: clamp(40px, 12vw, 58px); line-height: 1.05; text-shadow: 0 2px 18px rgba(0,0,0,.35); opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.opening-names small { display: block; margin-bottom: 10px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; opacity: .9; }
.opening-names i { display: block; font-size: .55em; font-weight: 500; margin: 2px 0; }
.opening.show-names::after, .opening.show-names .opening-names { opacity: 1; }
.opening.show-names .opening-names { transform: none; }

#welcome.rise > * { opacity: 0; transform: translateY(20px); }
#welcome.rise.go > * { opacity: 1; transform: none; transition: opacity .8s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
#welcome.rise.go > :nth-child(2) { transition-delay: .12s; }
#welcome.rise.go > :nth-child(3) { transition-delay: .24s; }
