/* =====================================================================
   Tampilan undangan — rose gold
   Layout: HP = satu kolom; laptop = panel foto di kiri + kolom undangan di kanan
   Warna bisa diganti di blok :root di bawah ini.
   ===================================================================== */
:root {
  --paper: #fbf2ee;      /* latar utama */
  --paper-2: #f6e6e0;    /* latar bagian selang-seling */
  --blush: #f1dbd3;      /* panel lembut */
  --line: #e6c7bd;       /* garis tipis */
  --card: #fffaf8;       /* kartu */
  --rose: #b76e79;       /* rose gold utama */
  --rose-deep: #8e4f5a;  /* teks aksen */
  --ink: #4b2e33;        /* teks utama */
  --ink-soft: #7d5f63;   /* teks sekunder */
  --sheen: linear-gradient(115deg, #a85d68 0%, #d99a9a 30%, #f4d3c8 48%, #c98585 62%, #9c5561 100%);
  --shadow: 0 14px 36px rgba(142, 79, 90, .14);

  --f-display: "Gilda Display", "Didot", Georgia, serif;
  --f-script: "Mrs Saint Delafield", "Snell Roundhand", "Apple Chancery", cursive;
  --f-body: "Karla", "Segoe UI", system-ui, sans-serif;
  --f-arab: "Amiri", "Traditional Arabic", "Scheherazade New", serif;

  --col: 480px;          /* lebar kolom undangan di laptop */
  color-scheme: light;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.7 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

.eyebrow { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--rose-deep); font-weight: 500; }
.soft { color: var(--ink-soft); }
.small { font-size: .8rem; }
.script { font-family: var(--f-script); font-weight: 400; line-height: 1; }
.sheen {
  background: var(--sheen); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 7s ease-in-out infinite;
}
/* huruf sambung melebar keluar kotaknya; padding supaya kilau tidak terpotong */
.script.sheen { padding: .18em .45em .24em; margin-inline: -.2em; }
@keyframes shine { 50% { background-position: 100% 0; } }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--sheen); background-size: 200% 100%; color: #fff;
  font: 600 .92rem var(--f-body); letter-spacing: .02em; text-decoration: none;
  box-shadow: 0 8px 20px rgba(142, 79, 90, .25);
  transition: background-position .6s, transform .2s;
}
.btn:hover { background-position: 100% 0; transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.line { background: transparent; color: var(--rose-deep); border: 1px solid var(--rose); box-shadow: none; }
.btn.small { padding: 8px 16px; font-size: .84rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Ornamen ---------- */
canvas.bloom { display: block; pointer-events: none; }
.divider { display: flex; justify-content: center; padding-block: 4px; }
.divider canvas { width: 160px; height: 60px; }

/* ---------- Bingkai lengkung (foto / monogram) ---------- */
.arch { border-radius: 999px 999px 12px 12px; padding: 6px; background: var(--sheen); box-shadow: var(--shadow); max-width: 100%; }
.arch > * { width: 100%; height: 100%; object-fit: cover; border-radius: 999px 999px 8px 8px; }
.arch > img { object-position: 50% 30%; }   /* jaga wajah tetap di dalam bingkai */
.arch-sm { width: 150px; height: 200px; }
.arch-md { width: 190px; height: 250px; }
.arch-lg { width: min(300px, 78vw); aspect-ratio: 3 / 4; height: auto; }
.mono {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 50% 35%, #fff 0%, var(--blush) 78%); overflow: hidden;
}
.mono .ini { font-family: var(--f-script); font-size: clamp(3.6rem, 18vw, 5.6rem); line-height: 1; }
.mono canvas { width: 120px; height: 46px; }
.mono .sub { font-family: var(--f-display); font-size: .8rem; letter-spacing: .3em; color: var(--rose-deep); }
.arch-sm .mono .ini { font-size: 3rem; }
.arch-sm .mono canvas, .arch-sm .mono .sub, .arch-md .mono .sub { display: none; }

/* ====================== SAMPUL ====================== */
.cover {
  position: fixed; inset: 0; z-index: 50; background: var(--paper);
  display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden;
  padding: calc(24px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  transition: opacity .9s ease, transform 1.1s ease, filter .9s ease;
}
.cover.gone { opacity: 0; transform: scale(1.05); filter: blur(2px); pointer-events: none; }
.cover-bg, .side-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.cover-bg.has-photo::after, .side-bg.has-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(251, 242, 238, .55) 0%, rgba(251, 242, 238, .82) 55%, var(--paper) 100%);
}
.cover .corner { position: absolute; width: min(260px, 60vw); height: auto; aspect-ratio: 1; }
.cover .tl { top: 0; left: 0; }
.cover .br { bottom: 0; right: 0; transform: rotate(180deg); }
.cover-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 400px; }
.cover .names { font-size: clamp(3.4rem, 15vw, 4.6rem); }
.date-line { font-family: var(--f-display); letter-spacing: .12em; font-size: 1.02rem; }
.guest { display: grid; gap: 2px; width: 100%; padding-block: 14px; border-block: 1px solid var(--line); }
.guest strong { font-family: var(--f-display); font-weight: 400; font-size: 1.5rem; line-height: 1.3; }
.cover.has-photo .arch-sm { display: none; }
.cover.with-photo .arch-sm { width: 186px; height: 248px; }
.cover.with-photo .arch-sm img { object-position: 50% 25%; }

/* ====================== LAYOUT ====================== */
.side { display: none; }
.page { width: 100%; max-width: var(--col); margin: 0 auto; background: var(--paper); position: relative; }
section, .closing {
  padding: 72px max(20px, env(safe-area-inset-right, 0px)) 56px max(20px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; scroll-margin-top: 8px;
}
section.band { background: var(--paper-2); }
.head { display: grid; gap: 2px; justify-items: center; }
.head h2 { font-size: clamp(2.8rem, 12vw, 3.4rem); }
.lead { color: var(--ink-soft); max-width: 36ch; }
.card { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 18px; }

/* Laptop: panel foto di kiri, undangan di kanan */
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: 1fr var(--col); min-height: 100vh; }
  .side { display: flex; position: sticky; top: 0; height: 100vh; align-items: flex-end; justify-content: center; overflow: hidden; background: var(--blush); }
  .side-bg:not(.has-photo) { background: radial-gradient(120% 90% at 50% 20%, #fff 0%, var(--blush) 60%, #e8c4ba 100%); }
  .side .corner { position: absolute; width: min(320px, 38%); height: auto; aspect-ratio: 1; }
  .side .tl { top: 0; left: 0; transform-origin: 0 0; animation: swayTl 7s ease-in-out infinite; }
  .side .br { bottom: 0; right: 0; transform: rotate(180deg); animation: swayBr 8s ease-in-out infinite; }
  .side .arch { width: 210px; height: 280px; margin-bottom: 18px; }
  .side.has-photo .arch, .side.has-photo .corner { display: none; }
  .side.with-photo .arch { width: min(340px, 62%); height: auto; aspect-ratio: 3 / 4; }
  .side-inner { position: relative; align-self: center; text-align: center; padding: 0 40px; display: grid; gap: 10px; justify-items: center; }
  .side .names { font-size: clamp(4rem, 7vw, 6.4rem); }
  .page { margin: 0; box-shadow: -10px 0 40px rgba(142, 79, 90, .08); }
}

/* ====================== BERANDA ====================== */
.hero { position: relative; overflow: hidden; padding-top: 64px; gap: 16px; }
.hero .names { font-size: clamp(3.2rem, 14vw, 4.2rem); }
.date-big { font-family: var(--f-display); font-size: 1.15rem; letter-spacing: .24em; }
.hero .sprig { position: absolute; width: 160px; height: 160px; top: 8px; }
.hero .s1 { left: -14px; }
.hero .s2 { right: -14px; transform: scaleX(-1); }

/* ====================== SALAM & KUTIPAN ====================== */
.intro { padding-top: 24px; }
.salam { font-family: var(--f-display); font-size: 1.05rem; color: var(--rose-deep); }
.quote { margin: 0; width: 100%; padding: 28px 22px; border-radius: 14px; background: var(--blush); display: grid; gap: 10px; position: relative; }
.quote::before { content: "\201C"; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font: 3.6rem/1 var(--f-display); color: var(--rose); }
.quote p { font-family: var(--f-display); font-size: 1.04rem; line-height: 1.75; }
.quote cite { font-style: normal; font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; color: var(--rose-deep); }

/* ====================== MEMPELAI ====================== */
.couple { display: grid; gap: 18px; justify-items: center; width: 100%; }
.person { display: grid; gap: 6px; justify-items: center; }
.person .arch { width: 180px; height: 236px; margin-bottom: 8px; }
.person .nick { font-size: 3.4rem; }
.person h3 { font-size: 1.4rem; line-height: 1.3; }
.person .parents { color: var(--ink-soft); font-size: .95rem; }
.person .parents b { display: block; font-weight: 500; color: var(--ink); }
.ig { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--rose-deep); text-decoration: none; font-size: .86rem; }
.amp { font-family: var(--f-script); font-size: 4.2rem; line-height: .8; }

/* ====================== HITUNG MUNDUR ====================== */
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.count div { background: var(--card); border: 1px solid var(--line); border-radius: 999px 999px 10px 10px; padding: 18px 2px 10px; }
.count b { display: block; font: 400 1.9rem/1.1 var(--f-display); color: var(--rose-deep); font-variant-numeric: tabular-nums; }
.count span { font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.done-msg { font-family: var(--f-display); font-size: 1.1rem; color: var(--rose-deep); }

/* ====================== ACARA ====================== */
.events { display: grid; gap: 16px; width: 100%; }
.event { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 30px 20px 26px; display: grid; gap: 12px; justify-items: center; position: relative; overflow: hidden; }
.event::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); border-radius: 10px; pointer-events: none; }
.event h3 { font-family: var(--f-script); font-size: 3rem; line-height: 1; }
.event .rows { display: grid; gap: 8px; width: 100%; max-width: 300px; text-align: left; }
.event .row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: .95rem; }
.event .row svg { color: var(--rose); margin-top: 3px; }
.event .place { font-weight: 600; display: block; }
.event .addr { color: var(--ink-soft); font-size: .9rem; }
.extra { display: grid; gap: 10px; width: 100%; }
.extra .pill { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--blush); font-size: .92rem; }
.extra .pill b { font-weight: 600; color: var(--rose-deep); }

/* ====================== KISAH ====================== */
.story { list-style: none; margin: 0; padding: 0; width: 100%; text-align: left; position: relative; display: grid; }
.story::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 1px; background: var(--rose); }
.story li { position: relative; padding: 0 0 26px 42px; }
.story li:last-child { padding-bottom: 0; }
.story li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); border: 1px solid var(--rose); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 7px #e3a9a6; }
.story time { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--rose-deep); font-weight: 600; }
.story h3 { font-size: 1.25rem; margin: 2px 0 4px; }
.story p { color: var(--ink-soft); }

/* ====================== GALERI ====================== */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 100%; }
.gallery button { all: unset; cursor: pointer; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 4; max-width: 100%; background: var(--blush); position: relative; }
.gallery button:nth-child(3n + 1) { grid-column: span 2; aspect-ratio: 16 / 10; }
/* gambar melebar (landscape) tampil selebar galeri dengan rasio aslinya */
.gallery button.wide { grid-column: span 2; aspect-ratio: var(--ar, 3 / 2); }
.gallery button.tall:nth-child(3n + 1) { grid-column: auto; aspect-ratio: 3 / 4; }
.gallery button:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery button:hover img { transform: scale(1.04); }
.gallery .empty { cursor: default; border: 1px solid var(--line); }
.gallery .empty .mono { width: 100%; height: 100%; }
.gallery .empty .mono canvas { width: 110px; height: 44px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(60, 35, 40, .94); display: flex; align-items: center; justify-content: center; padding: calc(56px + env(safe-area-inset-top, 0px)) 16px calc(56px + env(safe-area-inset-bottom, 0px)); }
.lightbox img { max-height: 100%; max-width: 100%; border-radius: 8px; object-fit: contain; }
.lightbox button { position: absolute; border: 0; cursor: pointer; background: rgba(255, 255, 255, .92); color: var(--ink); border-radius: 50%; width: 42px; height: 42px; font-size: 1.5rem; line-height: 1; display: grid; place-items: center; }
.lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: calc(10px + env(safe-area-inset-left, 0px)); }
.lb-nav.next { right: calc(10px + env(safe-area-inset-right, 0px)); }

/* ====================== RSVP & UCAPAN ====================== */
.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.tally div { background: var(--blush); border-radius: 12px; padding: 12px 4px; }
.tally b { display: block; font: 400 1.6rem/1.2 var(--f-display); color: var(--rose-deep); font-variant-numeric: tabular-nums; }
.tally span { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.form { display: grid; gap: 16px; text-align: left; }
.form label, .form legend { display: grid; gap: 6px; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.form legend { padding: 0; margin-bottom: 6px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input, textarea, select { font: 400 1rem var(--f-body); letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; }
textarea { min-height: 100px; resize: vertical; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label { display: block; text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 500; color: var(--ink); background: var(--paper); transition: background .2s, border-color .2s; }
.choice input:checked + label { border-color: var(--rose); background: var(--blush); color: var(--rose-deep); }
.choice input:focus-visible + label { outline: 2px solid var(--rose); outline-offset: 2px; }
.form .btn { width: 100%; }
.status { font-size: .9rem; color: var(--rose-deep); text-align: center; min-height: 1.4em; }
.wishes-card { padding-block: 16px; text-align: left; display: grid; gap: 4px; }
.wishes-count { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; text-align: center; padding-bottom: 8px; }
.wishes { display: grid; max-height: 460px; overflow-y: auto; overscroll-behavior: contain; }
.wish { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding-block: 14px; border-top: 1px solid var(--line); }
.wish .av { width: 38px; height: 38px; border-radius: 50%; background: var(--sheen); color: #fff; display: grid; place-items: center; font: 400 1.05rem var(--f-display); }
.wish .body { min-width: 0; display: grid; gap: 2px; }
.wish .who { font-weight: 600; font-size: .95rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wish .tag { font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rose-deep); font-weight: 600; background: var(--blush); padding: 1px 8px; border-radius: 999px; }
.wish p { color: var(--ink-soft); font-size: .94rem; overflow-wrap: anywhere; }
.wish time { font-size: .74rem; color: var(--ink-soft); opacity: .8; }
.wishes-empty { text-align: center; color: var(--ink-soft); padding: 18px 0 8px; border-top: 1px solid var(--line); }
.more { justify-self: center; margin-top: 8px; }

/* ====================== TANDA KASIH ====================== */
.gifts { display: grid; gap: 12px; width: 100%; }
.gift { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 6px; text-align: left; position: relative; overflow: hidden; }
.gift::after { content: ""; position: absolute; right: -36px; top: -36px; width: 120px; height: 120px; border-radius: 50%; background: var(--sheen); opacity: .16; }
.gift .bank { font-weight: 600; letter-spacing: .16em; text-transform: uppercase; font-size: .76rem; color: var(--rose-deep); }
.gift .num { font: 400 1.45rem/1.3 var(--f-display); letter-spacing: .08em; font-variant-numeric: tabular-nums; user-select: all; overflow-wrap: anywhere; }
.gift .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.copy { display: inline-flex; gap: 6px; align-items: center; background: var(--blush); border: 1px solid var(--line); color: var(--rose-deep); border-radius: 999px; padding: 7px 14px; font: 600 .82rem var(--f-body); cursor: pointer; }
.copy svg { width: 15px; height: 15px; }

/* ====================== PENUTUP ====================== */
.closing { padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
.closing .thanks { font-size: 3.4rem; margin-top: 8px; }
.closing .family { font-family: var(--f-display); font-size: clamp(.92rem, 3.9vw, 1.12rem); max-width: 36ch; text-wrap: balance; line-height: 1.6; }
.closing .sign { font-size: 2.6rem; margin-top: 10px; }
.invite-also { display: grid; gap: 8px; margin-top: 10px; }
.invite-also ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--ink-soft); }

/* ====================== NAVIGASI & MUSIK ====================== */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: rgba(255, 250, 248, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: var(--shadow); max-width: calc(100% - 96px);
}
.nav a { display: grid; place-items: center; width: 44px; height: 40px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; transition: background .3s, color .3s; }
.nav a.active { background: var(--sheen); color: #fff; }
.nav svg { width: 20px; height: 20px; }
.music {
  position: fixed; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 41;
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--sheen); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(142, 79, 90, .3);
}
.eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { display: block; width: 3px; height: 6px; border-radius: 2px; background: #fff; }
.eq i:nth-child(2) { height: 12px; } .eq i:nth-child(3) { height: 9px; } .eq i:nth-child(4) { height: 14px; }
.music.on .eq i { animation: eq 1s ease-in-out infinite alternate; }
.music.on .eq i:nth-child(2) { animation-duration: .7s; animation-delay: -.2s; }
.music.on .eq i:nth-child(3) { animation-duration: .9s; animation-delay: -.5s; }
.music.on .eq i:nth-child(4) { animation-duration: .6s; animation-delay: -.1s; }
@keyframes eq { from { height: 4px; } to { height: 18px; } }
.music:not(.on) .eq { opacity: .55; }
.music:not(.on)::after { content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 2px; margin: -1px 0 0 -14px; background: #fff; border-radius: 2px; transform: rotate(-45deg); box-shadow: 0 0 0 1px rgba(142, 79, 90, .35); }
@media (max-width: 420px) { .nav { left: calc(12px + env(safe-area-inset-left, 0px)); transform: none; } }
@media (min-width: 960px) { .nav { left: calc(100% - var(--col) / 2); } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(78px + env(safe-area-inset-bottom, 0px)); z-index: 70; background: var(--ink); color: #fff; padding: 8px 18px; border-radius: 999px; font-size: .86rem; }
@media (min-width: 960px) { .toast { left: calc(100% - var(--col) / 2); } }
.petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 35; }

/* ====================== ANIMASI SAAT SCROLL ====================== */
[data-a] { transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1), filter .9s, clip-path 1.8s cubic-bezier(.45, .05, .25, 1); transition-delay: var(--d, 0s); }

html.anim [data-a]:not(.in) { opacity: 0; }
html.anim [data-a="up"]:not(.in) { transform: translateY(32px); }
html.anim [data-a="down"]:not(.in) { transform: translateY(-20px); }
html.anim [data-a="left"]:not(.in) { transform: translateX(-40px); }
html.anim [data-a="right"]:not(.in) { transform: translateX(40px); }
html.anim [data-a="zoom"]:not(.in) { transform: scale(.85); filter: blur(4px); }
html.anim [data-a="bloom"]:not(.in) { transform: scale(.4) rotate(-25deg); }
html.anim [data-a="fade"]:not(.in) { filter: blur(6px); }
/* efek tulisan tangan: judul bersambung terbuka dari kiri ke kanan (yang dipantau bloknya, yang dianimasikan judulnya) */
html.anim [data-a="write"]:not(.in) { opacity: 1; }
html.anim [data-a="write"] h2 { clip-path: inset(-25% -5% -25% 0); transition: clip-path 1.8s cubic-bezier(.45, .05, .25, 1) .2s; }
html.anim [data-a="write"]:not(.in) h2 { clip-path: inset(-25% 100% -25% 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* foto terakhir yang sendirian di barisnya dibuat lebar penuh */
.gallery button:last-child:nth-child(3n + 2) { grid-column: span 2; aspect-ratio: 16 / 10; }

/* ---------- Animasi pembuka sampul ---------- */
/* bunga pojok bergeser masuk lalu diam */
.cover .tl { transform-origin: 0 0; }
body.ready .cover .tl { animation: bloomInTl 1.8s cubic-bezier(.2, .8, .2, 1) .15s both, swayTl 7s ease-in-out 2s infinite; }
.cover .br { transform-origin: 50% 50%; }
body.ready .cover .br { animation: bloomInBr 1.8s cubic-bezier(.2, .8, .2, 1) .35s both, swayBr 8s ease-in-out 2.2s infinite; }
@keyframes bloomInTl {
  from { opacity: 0; transform: translate(-35%, -35%) rotate(-14deg) scale(.85); }
  to   { opacity: 1; transform: none; }
}
@keyframes bloomInBr {
  from { opacity: 0; transform: translate(35%, 35%) rotate(194deg) scale(.85); }
  to   { opacity: 1; transform: rotate(180deg); }
}
/* isi sampul muncul berurutan */
.cover-inner > * { opacity: 0; }
body.ready .cover-inner > * { opacity: 1; animation: coverUp .9s cubic-bezier(.2, .7, .2, 1) both; }
body.ready .cover-inner > :nth-child(1) { animation-delay: .5s; }
body.ready .cover-inner > :nth-child(2) { animation-delay: .65s; }
body.ready .cover-inner > :nth-child(3) { animation-delay: .8s; }
body.ready .cover-inner > :nth-child(4) { animation-delay: .95s; }
body.ready .cover-inner > :nth-child(5) { animation-delay: 1.1s; }
body.ready .cover-inner > :nth-child(6) { animation-delay: 1.25s; }
@keyframes coverUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
body.ready .cover-inner > .names { animation-name: coverUp, shine; animation-duration: .9s, 7s; animation-iteration-count: 1, infinite; animation-timing-function: cubic-bezier(.2, .7, .2, 1), ease-in-out; }

/* ---------- Setelah "Buka Undangan": bunga di beranda datang seperti di sampul ---------- */
.hero .sprig { opacity: 0; }
body.opened .hero .s1 { transform-origin: 0 0; animation: bloomInTl 1.8s cubic-bezier(.2, .8, .2, 1) .45s both, swayTl 7s ease-in-out 2.3s infinite; }
body.opened .hero .s2 { transform-origin: 50% 50%; animation: bloomInTr 1.8s cubic-bezier(.2, .8, .2, 1) .65s both, swayTr 8s ease-in-out 2.5s infinite; }
@keyframes bloomInTr {
  from { opacity: 0; transform: scaleX(-1) translate(-35%, -35%) rotate(-14deg) scale(.85); }
  to   { opacity: 1; transform: scaleX(-1); }
}
@media (prefers-reduced-motion: reduce) { .hero .sprig, .cover-inner > * { opacity: 1; } .loader { display: none; } }

/* ---------- Bunga bergoyang pelan setelah diam ---------- */
@keyframes swayTl { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(2deg); } }
@keyframes swayBr { 0%, 100% { transform: rotate(180deg); } 50% { transform: rotate(182deg); } }
@keyframes swayTr { 0%, 100% { transform: scaleX(-1) rotate(0); } 50% { transform: scaleX(-1) rotate(2deg); } }

/* ---------- Zoom perlahan pada foto (aktif otomatis saat foto diisi) ---------- */
.cover-bg.has-photo, .side-bg.has-photo { animation: kenburns 24s ease-in-out infinite alternate; }
.gallery img { animation: kenburns 20s ease-in-out infinite alternate; }
.gallery button:nth-child(even) img { animation-direction: alternate-reverse; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }

/* ====================== LAYAR MUAT ====================== */
.loader {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 30%, #fff 0%, var(--paper) 55%, var(--blush) 100%);
  transition: opacity .8s ease, visibility .8s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-inner { display: grid; justify-items: center; gap: 14px; }
.loader .arch-sm { width: 120px; height: 160px; animation: breathe 2.4s ease-in-out infinite; }
.loader .ini { font-size: 2.6rem; }
.loader-bloom { width: 150px; height: 52px; }
.loader-bar { width: 160px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 8%; background: var(--sheen); transition: width .4s ease; }
@keyframes breathe { 0%, 100% { transform: scale(1); box-shadow: var(--shadow); } 50% { transform: scale(1.04); box-shadow: 0 18px 44px rgba(142, 79, 90, .24); } }

/* ====================== KARTU TAMU (QR) ====================== */
.qr-card { width: 100%; max-width: 320px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px 20px; display: grid; justify-items: center; gap: 10px; position: relative; }
.qr-card::before { content: ""; position: absolute; inset: 8px; border: 1px dashed var(--line); border-radius: 12px; pointer-events: none; }
.qr-box { width: 200px; height: 200px; padding: 10px; background: #fff; border-radius: 12px; display: grid; place-items: center; }
.qr-box canvas, .qr-box img { width: 180px !important; height: 180px !important; }
.qr-name { font: 400 1.35rem/1.3 var(--f-display); }
.small-lead { font-size: .88rem; }
.event .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ====================== DOA ====================== */
.doa { margin: 0; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 30px 22px 24px; display: grid; gap: 12px; justify-items: center; position: relative; }
.doa::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); border-radius: 10px; pointer-events: none; }
.doa .arab { font-family: var(--f-arab); font-size: clamp(1.55rem, 7vw, 1.9rem); line-height: 2.1; color: var(--rose-deep); text-align: center; }
.doa canvas { width: 140px; height: 48px; }
.doa .latin { font-family: var(--f-display); font-style: italic; font-size: 1rem; color: var(--ink); }
.doa .arti { color: var(--ink-soft); font-size: .95rem; max-width: 34ch; }
.doa figcaption { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--rose-deep); font-weight: 600; }

/* ====================== PETA DI KARTU ACARA ====================== */
.event .map { width: 100%; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--blush); position: relative; }
.event .map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
