/* Dongeng — undangan pernikahan bergaya lukisan cat air: sampul foto penuh layar, lalu padang bunga dari dekat;
   pandangan naik sampai kastel di atas bukit terlihat, panji berkibar, jendela berpendar, burung melintas, bunga
   mekar di sudut, lalu kartu judul. Adegannya lapisan gambar (assets/img/*.webp) + hiasan SVG yang digerakkan CSS. */
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("fonts/pinyon-script.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #eef0f8; --bg2: #f8f8fc; --deep: #8a93c4; --deep2: #6a74ad; --ink: #3c4166; --soft: #6c7193; --gold: #c7a04e; --gold-hi: #ecd79a;
  --r1: #f9cdd3; --r2: #f2a3ae; --r3: #e07e8e; --leaf: #9db58b; --leaf2: #7c9a70;
  --sky1: #fdf1e3; --sky2: #e9e6f3; --card: #fffcf7; --line: #dcdff0;
  --display: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", "Cormorant Garamond", cursive;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 19px/1.55 var(--serif); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, ol { margin: 0; }
a { color: var(--deep2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.page { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; min-height: 100vh; overflow: hidden; }
@media (min-width: 560px) { .page { box-shadow: 0 30px 80px rgba(60, 64, 110, .28); } }

/* Adegan: lapisan gambar selebar kolom halaman, di belakang isi; hanya bagian pembuka (.hero) yang tembus pandang.
   .stage berbanding 1116:2000 (ukuran lukisan) dan selalu menutup layar; semua lapisan digambar pada bingkai yang
   sama sehingga di skala 1 bertumpuk menjadi lukisan utuh: langit → bukit + kastel → padang bunga. Itu keadaan dasar.
   Sebelum dibuka (.js:not(.is-open)) langit dan bukit+kastel digeser turun, dan dua lapis bunga dekat (.ly-f2 sedang,
   .ly-f1 besar) memenuhi layar; saat dibuka tiap lapisan bergeser dengan laju berbeda — pandangan naik dari dalam
   bunga ke arah kastel. */
.scene { position: fixed; top: 0; left: 50%; width: min(100%, 480px); height: 100%; transform: translateX(-50%); z-index: 0; pointer-events: none; overflow: hidden; contain: strict; background: var(--sky1); display: none; }
.js .scene { display: block; }
.scene-off .scene { visibility: hidden; }
.stage { position: absolute; left: 50%; top: 50%; height: max(100%, calc(min(100vw, 480px) * 1.7922)); aspect-ratio: 1116 / 2000; translate: -50% -50%; }
.ly { position: absolute; inset: 0; will-change: transform; transform-origin: 50% 45%; }
.ly > img:not(.balon), .fx { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.ly-f2 { transform: translateY(66%); } .ly-f1 { transform: translateY(104%) scale(1.15); }
.js .ly { transition: transform 4.8s cubic-bezier(.6, 0, .2, 1) 1.5s; }
.js:not(.is-open) .ly-sky { transform: translateY(7%) scale(1.06); }
.js:not(.is-open) .ly-main { transform: translateY(36%) scale(1.1); }
.js:not(.is-open) .ly-f3 { transform: translateY(12%); }
.js:not(.is-open) .ly-f2 { transform: translateY(4%); } .js:not(.is-open) .ly-f1 { transform: translateY(2%) scale(1.15); }
.js.no-anim .ly, .js.no-anim .flag, .js.no-anim .wg { transition: none; }
.balon { position: absolute; height: auto; max-width: none; } .balon.b1 { left: 7%; top: 12%; width: 15%; } .balon.b2 { left: 80%; top: 24%; width: 9%; }
.pole { fill: none; stroke: var(--gold); stroke-width: 3.2; stroke-linecap: round; }
.flag { transform-box: fill-box; transform-origin: 0 50%; transition: scale 1s cubic-bezier(.3, 1.6, .5, 1) 5.4s; } .pa { fill: var(--r3); } .pb { fill: var(--gold); }
.flag { transition-delay: 5.8s; } .flag.fl2 { transition-delay: 5.6s; } .flag.fl6 { transition-delay: 6.4s; } .flag.fl3 { transition-delay: 5.8s; } .flag.fl4 { transition-delay: 6s; } .flag.fl5 { transition-delay: 6.2s; }
.js:not(.is-open) .flag { scale: 0 1; }
.wg { mix-blend-mode: screen; transition: opacity 1.6s ease 5.6s; } .js:not(.is-open) .wg { opacity: 0; }
.sun { mix-blend-mode: screen; }
.bw { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; opacity: .6; transform-box: fill-box; transform-origin: 50% 100%; }
.birds { translate: -260px 520px; }
.tw { fill: #fff6d0; transform-box: fill-box; transform-origin: center; }
.petals { position: absolute; inset: 0; }
.petals i { position: absolute; top: -4%; border-radius: 90% 10% 80% 20%; background: linear-gradient(135deg, #fff, var(--r1) 60%, var(--r2)); display: none; }
.kupu { position: absolute; width: 18px; height: 15px; display: none; }
.kupu .wl, .kupu .wr { fill: var(--r2); stroke: #fff; stroke-width: .6; } .kupu .bd { stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; }
.k1 { left: 22%; top: 74%; } .k2 { left: 72%; top: 66%; } .k3 { left: 48%; top: 84%; } .k3 .wl, .k3 .wr { fill: var(--deep); }
.veil { position: absolute; inset: 0; background: #fff8f0; opacity: 0; }
.strip { position: relative; width: calc(100% + 56px); margin: -64px -28px 0; -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 12%, #000 78%, transparent); }
.strip img { display: block; width: 100%; height: auto; }
.petals i:nth-child(1) { left: -3%; width: 11px; height: 6px; animation-duration: 14.3s, 2.7s; animation-delay: -0.6s, -3.8s; opacity: 0.8; }
.petals i:nth-child(2) { left: 87%; width: 14px; height: 7px; animation-duration: 10s, 4s; animation-delay: -9.3s, -0.5s; opacity: 0.8; }
.petals i:nth-child(3) { left: 53%; width: 12px; height: 9px; animation-duration: 10.4s, 3.6s; animation-delay: -1.7s, -3.1s; opacity: 0.9; }
.petals i:nth-child(4) { left: 39%; width: 9px; height: 7px; animation-duration: 11.3s, 3.2s; animation-delay: -13.4s, -0.8s; opacity: 0.6; }
.petals i:nth-child(5) { left: 70%; width: 13px; height: 10px; animation-duration: 9.4s, 2.5s; animation-delay: -2.5s, -0.5s; opacity: 0.6; }
.petals i:nth-child(6) { left: 44%; width: 8px; height: 6px; animation-duration: 14.1s, 4.2s; animation-delay: -9.1s, -0.9s; opacity: 0.9; }
.petals i:nth-child(7) { left: 89%; width: 10px; height: 7px; animation-duration: 11.3s, 4.1s; animation-delay: -6.7s, -1.1s; opacity: 0.7; }
.petals i:nth-child(8) { left: 69%; width: 11px; height: 9px; animation-duration: 13.5s, 4.2s; animation-delay: -13.5s, -3.9s; opacity: 0.9; }
.petals i:nth-child(9) { left: 94%; width: 10px; height: 7px; animation-duration: 12.9s, 4.4s; animation-delay: -11.7s, -1.2s; opacity: 0.6; }
.petals i:nth-child(10) { left: -1%; width: 14px; height: 10px; animation-duration: 11.6s, 4.4s; animation-delay: -9.4s, -1.1s; opacity: 0.7; }
.petals i:nth-child(11) { left: 21%; width: 8px; height: 9px; animation-duration: 10.4s, 3.1s; animation-delay: -5.6s, -0.2s; opacity: 0.8; }
.petals i:nth-child(12) { left: 30%; width: 8px; height: 6px; animation-duration: 15.7s, 2.8s; animation-delay: -2.3s, -4s; opacity: 0.6; }
.petals i:nth-child(13) { left: 3%; width: 11px; height: 10px; animation-duration: 14.5s, 3s; animation-delay: -5.2s, -2.5s; opacity: 0.8; }
.petals i:nth-child(14) { left: 0%; width: 14px; height: 6px; animation-duration: 12.4s, 4.1s; animation-delay: -8.5s, -2s; opacity: 0.9; }

.caps { font: 500 13px/1.4 var(--display); letter-spacing: .34em; text-transform: uppercase; }
.script { font: 400 50px/1.05 var(--script); color: var(--deep2); }
.lead { font-size: 18px; line-height: 1.6; color: var(--soft); max-width: 22em; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 26px; border: 1px solid var(--deep2); border-radius: 12px; background: var(--deep2); color: #fff; text-decoration: none; cursor: pointer; font: 600 13px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; }
.btn-line { background: transparent; color: inherit; border-color: currentColor; }
.btn.copied { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Rangkaian bunga lukisan: dua sudut atas (gambar yang sama, dicerminkan), tepi bawah, dan rangkaian kecil di bawah foto. */
.fl { position: absolute; top: -8px; width: 60%; max-width: none; pointer-events: none; filter: drop-shadow(0 8px 12px rgba(60, 64, 110, .16)); }
.fl.tl { left: -12px; transform-origin: 0 0; } .fl.tr { right: -12px; scale: -1 1; transform-origin: 50% 0; }
.fb { position: absolute; left: 0; bottom: -6px; width: 100%; pointer-events: none; filter: drop-shadow(0 -6px 12px rgba(60, 64, 110, .14)); }
.spray { position: relative; width: 150px; margin: -50px auto 0; pointer-events: none; }

/* ---------- Sampul: foto penuh layar dengan gradasi gelap, nama di atas, tamu dan tombol di bawah ---------- */
.cover { position: relative; min-height: 100vh; min-height: 100svh; padding: 54px 26px 44px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; background: linear-gradient(180deg, var(--bg2), var(--bg) 55%, color-mix(in srgb, var(--deep) 45%, var(--bg))); color: var(--ink); overflow: hidden; }
.cover[hidden] { display: none; }
.cover-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-photo { color: #fff; }
.cover.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 10, 12, .55) 0%, rgba(20, 10, 12, .05) 34%, rgba(20, 10, 12, .1) 56%, rgba(20, 10, 12, .78) 100%); }
.cover.has-photo .cover-art { display: none; }
.cover-art { position: absolute; inset: 0; }
.cover-top, .cover-bottom { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cover .names { font: 500 34px/1.15 var(--display); letter-spacing: .08em; text-transform: uppercase; overflow-wrap: anywhere; }
.names .amp { margin: 0 .25em; font: 400 40px/1 var(--script); text-transform: none; letter-spacing: 0; }
.cover:not(.has-photo) .cover-top { margin-top: 26vh; }
.to { font-size: 16px; line-height: 1.5; opacity: .9; }
.guest-name { font: 600 24px/1.2 var(--serif); overflow-wrap: anywhere; }
.cover .open { margin-top: 10px; min-width: 230px; min-height: 48px; border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .22); color: inherit; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cover:not(.has-photo) .open { border-color: var(--deep2); background: var(--deep2); color: #fff; }

/* Dengan JS: sampul menutup layar sampai tamu menekan "Buka undangan", lalu memudar dan taman terlihat. */
.js .cover { position: fixed; top: 0; bottom: 0; left: 50%; width: min(100%, 480px); transform: translateX(-50%); z-index: 40; overflow-y: auto; transition: opacity .9s ease; }
.js:not(.is-open) body { overflow: hidden; }
.js.is-open .cover { opacity: 0; pointer-events: none; }
.js.no-anim .cover { transition: none; }
html:not(.js) .cover .open { display: none; }

/* ---------- Pembuka: kartu judul berlengkung berbingkai emas di depan taman ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; padding: 44px 20px; display: grid; place-items: center; text-align: center; background: linear-gradient(180deg, var(--sky1), var(--sky2)); }
.js .hero { background: none; align-items: end; padding-bottom: 21vh; }
/* (lama) Kartu judul sengaja pendek dan di bawah supaya menara kastel tetap terlihat di atasnya. */
.js .plaque { min-height: 0; padding: 84px 22px 34px; background: color-mix(in srgb, var(--card) 84%, transparent); }
.frame-art { position: absolute; inset: 0; overflow: hidden; }
.plaque { position: relative; width: 84%; min-height: 62vh; min-height: 62svh; padding: 110px 22px 54px; border-radius: 999px 999px 26px 26px; background: color-mix(in srgb, var(--card) 80%, transparent); border: 1.5px solid var(--gold); outline: 1px solid var(--gold-hi); outline-offset: -9px; box-shadow: 0 20px 50px rgba(60, 64, 110, .2); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.pl-name { font: 500 40px/1.15 var(--display); letter-spacing: .14em; text-transform: uppercase; overflow-wrap: anywhere; }
.pl-name.small { font-size: 22px; margin-top: 10px; }
.pl-and { font: 400 34px/1 var(--script); color: var(--deep2); }
.pl-date { margin-top: 10px; font: 500 15px/1.4 var(--display); letter-spacing: .2em; text-transform: uppercase; }
.mouse { display: block; margin-top: 18px; width: 22px; height: 36px; border: 1.5px solid var(--ink); border-radius: 12px; position: relative; opacity: .7; }
.mouse::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); animation: gulir 1.6s ease-in-out infinite; }

/* ---------- Isi: bagian berlatar biru muda dan periwinkle bergantian ---------- */
main > section:not(.hero) { position: relative; padding: 64px 28px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; background: var(--bg); }
.verse { background: linear-gradient(180deg, var(--bg2), var(--bg)) !important; }
.quote { font: italic 500 21px/1.6 var(--serif); max-width: 20em; }
.source { font: 600 14px/1.4 var(--display); letter-spacing: .14em; }
.couple { display: flex; flex-direction: column; gap: 44px; width: 100%; margin-top: 8px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.portrait { width: 230px; height: 300px; padding: 7px; border: 1.5px solid var(--gold); border-radius: 999px 999px 18px 18px; background: var(--card); display: flex; }
.portrait > * { flex: 1; width: 100%; height: 100%; border-radius: 999px 999px 12px 12px; object-fit: cover; }
.portrait span { display: flex; align-items: center; justify-content: center; background: var(--bg2); font: 400 90px/1 var(--script); color: var(--deep2); }
.person h3 { font: 400 42px/1.05 var(--script); color: var(--deep2); overflow-wrap: anywhere; }
.parents { font-size: 17px; line-height: 1.45; color: var(--soft); max-width: 16em; }
.ig { font-size: 16px; font-weight: 700; color: var(--deep2); }

main > section.count, main > section.rsvp { background: linear-gradient(180deg, var(--deep), var(--deep2)); color: #fff; }
.count .script, .rsvp .script, .count .lead { color: #fff; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; }
.countdown div { padding: 14px 0 12px; border: 1.5px solid rgba(255, 255, 255, .75); border-radius: 14px; display: flex; flex-direction: column; gap: 2px; }
.countdown b { font: 500 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 15px; }
html:not(.js) .countdown { display: none; }

.programme { gap: 26px !important; background: linear-gradient(180deg, var(--bg), var(--bg2)) !important; }
.event { width: 100%; padding: 34px 22px 30px; border-radius: 110px 110px 22px 22px; background: var(--card); border: 1.5px solid var(--gold); outline: 1px solid var(--gold-hi); outline-offset: -8px; box-shadow: 0 18px 40px rgba(60, 64, 110, .12); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.when { font: 600 19px/1.5 var(--serif); }
.where { font-size: 17px; line-height: 1.5; color: var(--soft); max-width: 17em; overflow-wrap: anywhere; }
.where b { display: block; font: 600 12px/1.6 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.dress { font-size: 17px; font-style: italic; color: var(--soft); }

.chapters { list-style: none; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 18px; text-align: left; }
.chapters li { position: relative; padding: 20px 20px 20px 26px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.chapters li::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 2px; background: var(--r2); }
.chapters h3 { font: 400 34px/1.05 var(--script); color: var(--deep2); margin-bottom: 6px; }
.chapters p { font-size: 17px; line-height: 1.55; color: var(--soft); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; border: 4px solid var(--card); box-shadow: 0 10px 22px rgba(60, 64, 110, .14); }
.grid img:nth-child(3n+1) { grid-column: 1 / -1; aspect-ratio: 4 / 3; }

.gift-list { display: grid; gap: 12px; width: 100%; }
.gift-card { padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.bank { font: 600 12px/1.4 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--deep2); }
.number { font-size: 22px; font-weight: 700; letter-spacing: .04em; overflow-wrap: anywhere; }
.holder { font-size: 15px; color: var(--soft); }
.gift-card .btn { flex-shrink: 0; min-height: 42px; padding: 0 16px; }
.address { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line); font-size: 16px; line-height: 1.5; color: var(--soft); text-align: left; }

.note { width: 100%; padding: 14px 16px; border: 1px dashed rgba(255, 255, 255, .7); border-radius: 14px; font-size: 16px; }
.thanks { width: 100%; padding: 22px 18px; border-radius: 18px; background: rgba(255, 255, 255, .16); display: flex; flex-direction: column; gap: 6px; }
.thanks .big { font: 400 38px/1.1 var(--script); }
.form { width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; font-size: 16px; font-weight: 700; }
.field legend { padding: 0 0 6px; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: #fff; color: var(--ink); font: 500 18px/1.4 var(--serif); }
.field textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold-hi); outline-offset: 1px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { position: relative; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1.5px solid rgba(255, 255, 255, .8); border-radius: 12px; font: 600 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; }
.opt input:checked + span { background: #fff; color: var(--deep2); }
.opt input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.rsvp .btn { min-height: 50px; background: #fff; border-color: #fff; color: var(--deep2); }

main > section.wishes-box { align-items: stretch; text-align: left; gap: 0; padding-top: 30px; }
.wishes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.wishes-head h2 { font: 400 36px/1.1 var(--script); color: var(--deep2); }
.wishes-head span { font-size: 15px; color: var(--soft); white-space: nowrap; }
.wishes { list-style: none; margin: 12px 0 0; padding: 0; max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.wishes li { padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.wish-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wish-head b { font-size: 18px; }
.tag { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--gold); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.status { font-size: 14px; font-weight: 700; color: var(--deep2); }
.wish-text { font-size: 17px; line-height: 1.5; color: var(--soft); overflow-wrap: anywhere; }
.wish-reply { margin-top: 6px; padding: 8px 12px; border-left: 2px solid var(--r2); font-style: italic; color: var(--soft); }

main > section.closing { padding-top: 90px; background: linear-gradient(180deg, var(--bg), var(--sky2)); }
.closing .spray { margin-top: -20px; width: 190px; }
.merci { font-size: 54px; }
.thanks-line { font-size: 17px; font-style: italic; color: var(--soft); }
footer { position: relative; padding: 18px 16px 26px; text-align: center; font-size: 14px; color: var(--soft); background: var(--sky2); }

.music-toggle { position: fixed; bottom: 16px; right: max(14px, calc(50% - 226px)); z-index: 50; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--deep2); color: #fff; cursor: pointer; box-shadow: 0 8px 18px rgba(60, 64, 110, .3); }
.music-toggle svg { width: 18px; height: 18px; }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 24px; height: 1.5px; background: #fff; transform: rotate(-45deg); }
html:not(.js) .music-toggle, .js:not(.is-open) .music-toggle { display: none; }

/* ---------- Animasi ---------- */
/* Isi muncul bertahap saat digulir (kelas .rv dipasang dongeng.js): judul turun, foto membesar, mempelai dari kiri/kanan. */
.rv { opacity: 0; translate: 0 26px; }
.rv.script { translate: 0 -22px; }
.rv.portrait, .grid .rv, .rv.event { translate: 0 0; scale: .86; }
.person:nth-child(odd) .rv { translate: -30px 0; } .person:nth-child(even) .rv { translate: 30px 0; }
.rv.in { opacity: 1; translate: 0 0; scale: 1; transition: opacity .9s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), translate .9s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), scale .9s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms); }
@media (prefers-reduced-motion: no-preference) {
  /* Urutan: pandangan naik dari padang bunga (1,3–5,9 dtk) → panji terbentang & jendela berpendar → bunga sudut &
     tepi bawah → kartu judul. Sisanya berulang: kelopak, kupu-kupu, burung, kilau di puncak menara, cahaya matahari. */
  .petals i { display: block; animation-name: gugur, kibar; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite; animation-direction: normal, alternate; }
  .kupu { display: block; } .k1 { animation: terbang1 15s ease-in-out infinite; } .k2 { animation: terbang2 21s ease-in-out infinite; } .k3 { animation: terbang1 19s -6s ease-in-out infinite reverse; }
  .kupu .wl, .kupu .wr { animation: kepak .26s ease-in-out infinite alternate; }
  .flag { animation: panji 1.6s ease-in-out infinite alternate; } .fl2 { animation-delay: -.5s; } .fl3 { animation-delay: -1s; } .fl4 { animation-delay: -.3s; } .fl5 { animation-delay: -.8s; }
  .js.is-open .wg { animation: sinar 2.6s 7.4s ease-in-out infinite alternate; } .wg.w2 { animation-delay: 7.9s; } .wg.w3 { animation-delay: 8.3s; } .wg.w4 { animation-delay: 8.8s; }
  .sun { animation: sinar 7s ease-in-out infinite alternate; }
  .tw { animation: kelip2 2.6s ease-in-out infinite; } .tw.t2 { animation-delay: -.9s; } .tw.t3 { animation-delay: -1.7s; }
  .birds { animation: lintas 24s 5s linear infinite; } .bw { animation: sayap .5s ease-in-out infinite alternate; } .bw.b2 { animation-delay: -.2s; } .bw.b3 { animation-delay: -.35s; }
  .ly-f1 > img { animation: ayun2 5s ease-in-out infinite alternate; transform-origin: 50% 100%; } .ly-f2 > img { animation: ayun2 6.5s ease-in-out infinite alternate-reverse; transform-origin: 50% 100%; } .ly-f3 > img { animation: ayun2 8s ease-in-out infinite alternate; transform-origin: 50% 100%; }
  .b1 { animation: melayang 16s ease-in-out infinite alternate; } .b2 { animation: melayang 22s -6s ease-in-out infinite alternate-reverse; }
  .js.is-open:not(.no-anim) .veil { animation: silau 3s 3s ease-in-out both; }
  .js.is-open:not(.no-anim) .plaque { animation: plakat 1.6s 6.6s cubic-bezier(.2, .7, .2, 1) both; }
  .js.is-open:not(.no-anim) .frame-art .fl { animation: mekar 1.6s 5.8s cubic-bezier(.3, 1.2, .5, 1) both; } .js.is-open:not(.no-anim) .frame-art .fl.tr { animation-name: mekarR; animation-delay: 6s; }
  .js.is-open:not(.no-anim) .frame-art .fb { animation: naik2 1.6s 6.2s cubic-bezier(.2, .7, .2, 1) both; }
  .spray { animation: ayun 6s ease-in-out infinite; transform-origin: 50% 100%; }
  .cover-top { animation: turun 1.2s .2s both; } .cover-bottom { animation: naik 1.2s .5s both; }
  .cover .open { animation: denyut 2.8s 2s ease-in-out infinite; }
}
@keyframes gugur { from { translate: 0 0; } to { translate: 70px 112vh; } }
@keyframes kibar { from { rotate: -50deg; scale: 1 1; } to { rotate: 190deg; scale: .5 1; } }
@keyframes kelip { 0%, 100% { opacity: 0; translate: 0 0; } 50% { opacity: .75; translate: 6px -26px; } }
@keyframes kepak { from { scale: 1 1; } to { scale: .2 1; } }
@keyframes terbang1 { 0%, 100% { translate: 0 0; rotate: 20deg; } 25% { translate: 70px -60px; rotate: -10deg; } 50% { translate: 150px -20px; rotate: 30deg; } 75% { translate: 60px 30px; rotate: -25deg; } }
@keyframes terbang2 { 0%, 100% { translate: 0 0; rotate: -20deg; } 30% { translate: -90px 40px; rotate: 15deg; } 60% { translate: -150px -10px; rotate: -30deg; } 80% { translate: -50px -40px; rotate: 20deg; } }
@keyframes alir { to { stroke-dashoffset: -14; } }
@keyframes riak { from { scale: .4; opacity: .9; } to { scale: 2.6; opacity: 0; } }
@keyframes apung { from { translate: -2px 1px; } to { translate: 2px -1px; } }
@keyframes apung2 { from { translate: -1px 0; rotate: -.25deg; } to { translate: 1px 0; rotate: .25deg; } }
@keyframes melayang { from { translate: -6px 10px; } to { translate: 12px -26px; } }
@keyframes panji { from { transform: skewY(-7deg); } to { transform: skewY(7deg); } }
@keyframes lintas { from { translate: -260px 520px; } to { translate: 1300px 340px; } }
@keyframes sayap { from { scale: 1 1; } to { scale: 1 -.6; } }
@keyframes ayun2 { from { rotate: -.5deg; } to { rotate: .5deg; } }
@keyframes kelip2 { 0%, 100% { scale: .3; opacity: 0; } 50% { scale: 1.1; opacity: .95; } }
@keyframes sinar { from { opacity: .55; } to { opacity: 1; } }
@keyframes napas { from { scale: 1; } to { scale: 1.035; } }
@keyframes silau { 0%, 100% { opacity: 0; } 50% { opacity: .5; } }
@keyframes mekarR { from { opacity: 0; scale: -.3 .3; } to { opacity: 1; scale: -1 1; } }
@keyframes naik2 { from { opacity: 0; translate: 0 50%; } to { opacity: 1; translate: 0 0; } }
@keyframes kabut { from { opacity: .9; } to { opacity: 0; } }
@keyframes toleh { from { rotate: -4deg; } to { rotate: 5deg; } }
@keyframes kibas { from { rotate: -1.2deg; } to { rotate: 1.2deg; } }
@keyframes plakat { from { opacity: 0; translate: 0 26px; scale: .94; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes mekar { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }
@keyframes turun { from { opacity: 0; translate: 0 -18px; } to { opacity: 1; translate: 0 0; } }
@keyframes naik { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes denyut { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } 50% { box-shadow: 0 0 0 9px rgba(255, 255, 255, .18); } }
@keyframes ayun { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes gulir { 0% { translate: 0 0; opacity: 1; } 70% { translate: 0 12px; opacity: 0; } 100% { translate: 0 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .rv { opacity: 1; translate: none; scale: none; } *, *::before, *::after { animation: none !important; } .js .ly, .js .flag, .js .wg { transition: none; } }
.js body.locked { overflow: visible; }

/* ---------- Konsep pembuka Dongeng: tanpa kartu dan tanpa bunga sudut. Judul ada di pita krem bertepi emas yang
   terbentang di bawah kastel, sehingga lukisannya tetap utuh. Selama pembuka digulir (.ready, --p 0→1 dipasang
   dongeng.js) pandangan terus melaju ke gerbang kastel sampai layar memutih, baru masuk ke isi undangan. ---------- */
.hero-pin { display: grid; place-items: end center; width: 100%; }
.js .hero { display: block; padding: 0; }
.js .hero-pin { position: fixed; left: 50%; bottom: 0; width: min(100%, 480px); height: 100vh; height: 100svh; translate: -50% 0; padding: 0 34px 11vh; pointer-events: none; }
.scene-off .hero-pin { visibility: hidden; }
.title-wrap { width: 100%; }
.title { display: flex; flex-direction: column; align-items: center; gap: 14px; isolation: isolate; }
.ribbon { position: relative; width: 100%; padding: 16px 18px 18px; text-align: center; color: var(--ink); background: linear-gradient(180deg, #fffdf6, #fbf1dc); border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); box-shadow: 0 12px 26px rgba(60, 64, 110, .26); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ribbon::before, .ribbon::after { content: ""; position: absolute; top: 14px; z-index: -1; width: 44px; height: 100%; background: linear-gradient(180deg, #f1dfb6, #dcc189); }
.ribbon::before { left: -26px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 34% 50%); } .ribbon::after { right: -26px; clip-path: polygon(0 0, 100% 0, 66% 50%, 100% 100%, 0 100%); }
.ribbon .caps { font-size: 11px; letter-spacing: .3em; color: var(--soft); }
.t-name { font: 400 46px/1.1 var(--script); color: var(--deep2); overflow-wrap: anywhere; padding: 2px 6px 0; }
.t-name .amp { font-size: .8em; color: var(--gold); }
.ribbon .pl-date { margin-top: 2px; font-size: 13px; }
.title .mouse { margin-top: 0; border-color: #fff; opacity: .9; filter: drop-shadow(0 1px 3px rgba(60, 64, 110, .5)); } .title .mouse::after { background: #fff; }
.vc { position: absolute; top: -6px; width: 34%; max-width: none; opacity: .9; pointer-events: none; } .vc.l { left: -8px; } .vc.r { right: -8px; scale: -1 1; }
.verse { padding-top: 120px !important; }

.rays { position: absolute; left: 50%; top: 30%; width: 190%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 255, 255, .3) 0 5deg, transparent 5deg 18deg); -webkit-mask-image: radial-gradient(circle, #000 6%, transparent 42%); mask-image: radial-gradient(circle, #000 6%, transparent 42%); opacity: .7; }
.mist { position: absolute; left: -20%; width: 90%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .75), transparent); filter: blur(6px); } .mist.m1 { top: 49%; } .mist.m2 { top: 54%; left: 40%; width: 80%; }
.fwk { position: absolute; width: 30%; aspect-ratio: 1; border-radius: 50%; opacity: 0; background: repeating-conic-gradient(var(--c, #fff) 0 2.5deg, transparent 2.5deg 22.5deg); -webkit-mask-image: radial-gradient(circle, transparent 22%, #000 26%, transparent 68%); mask-image: radial-gradient(circle, transparent 22%, #000 26%, transparent 68%); }
.fwk.k1 { left: 8%; top: 9%; --c: #fff1b8; } .fwk.k2 { left: 60%; top: 5%; --c: #ffd7df; } .fwk.k3 { left: 35%; top: -2%; width: 26%; --c: #fff; }
.jejak { fill: none; stroke: #fff6cf; stroke-width: 7; stroke-linecap: round; stroke-dasharray: .2 1.4; stroke-dashoffset: .2; filter: drop-shadow(0 0 8px #ffe9a0); opacity: 0; }
.debu { fill: #fff6cf; opacity: 0; transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 5px #ffe08a); }
.terang { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, #fff 0, #fffaf0 60%, var(--bg) 100%); opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .js .hero { min-height: 240vh; min-height: 240svh; }
  .rays { animation: putar2 110s linear infinite; }
  .mist.m1 { animation: hanyut 26s ease-in-out infinite alternate; } .mist.m2 { animation: hanyut 34s ease-in-out infinite alternate-reverse; }
  .js.is-open .fwk { animation: letup 5.4s 6.6s ease-out infinite; } .js.is-open .fwk.k2 { animation-delay: 8.2s; } .js.is-open .fwk.k3 { animation-delay: 9.9s; }
  .js.is-open:not(.no-anim) .jejak { animation: komet 2.6s 5.2s cubic-bezier(.4, 0, .5, 1) both; }
  .js.is-open:not(.no-anim) .debu { animation: debu 1.9s ease-out both; }
  .js.is-open:not(.no-anim) .ribbon { animation: bentang 1.3s 7.3s cubic-bezier(.3, 1.1, .4, 1) both; }
  .js.is-open:not(.no-anim) .ribbon .caps { animation: naik 1s 8s both; } .js.is-open:not(.no-anim) .ribbon .pl-date { animation: naik 1s 8.9s both; }
  .js.is-open:not(.no-anim) .t-name { animation: tulis 1.5s 8.1s ease-out both; }
  .js.is-open:not(.no-anim) .title .mouse { animation: naik 1s 9.6s both; }
  /* Perjalanan gulir: aktif setelah pembukaan selesai. --p = seberapa jauh pembuka sudah digulir. */
  .ready .ly { transition: none; }
  .ready .ly-main { transform-origin: 50% 52%; transform: scale(calc(1 + var(--p, 0) * var(--p, 0) * 5.5)); }
  .ready .ly-sky { transform: scale(calc(1 + var(--p, 0) * .3)); }
  .ready .ly-f3 { transform-origin: 50% 100%; transform: translateY(calc(var(--p, 0) * 85%)) scale(calc(1 + var(--p, 0) * 1.2)); }
  .ready .title-wrap { opacity: calc(1 - var(--p, 0) * 4); translate: 0 calc(var(--p, 0) * -140px); }
  .ready .terang { opacity: calc((var(--p, 0) - .58) * 3.2); }
  .ready .petals, .ready .kupu { opacity: calc(1 - var(--p, 0) * 2.5); }
}
@keyframes putar2 { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes hanyut { from { translate: -8% 0; } to { translate: 14% 0; } }
@keyframes letup { 0% { scale: .1; opacity: 0; } 6% { opacity: .95; } 26% { scale: 1; opacity: 0; } 100% { scale: 1; opacity: 0; } }
@keyframes komet { 0% { stroke-dashoffset: .2; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { stroke-dashoffset: -1; opacity: 0; } }
@keyframes debu { 0% { scale: 0; opacity: 0; } 25% { scale: 1.3; opacity: 1; } 100% { scale: .4; opacity: 0; translate: 0 26px; } }
@keyframes bentang { from { clip-path: inset(-20px 50% -40px 50%); } to { clip-path: inset(-20px -40px -40px -40px); } }
@keyframes tulis { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% -5% -10% 0); } }
@media (prefers-reduced-motion: no-preference) {
  .js.is-open:not(.no-anim) .d1 { animation-delay: 5.50s; } .js.is-open:not(.no-anim) .d2 { animation-delay: 5.65s; } .js.is-open:not(.no-anim) .d3 { animation-delay: 5.80s; } .js.is-open:not(.no-anim) .d4 { animation-delay: 5.95s; } .js.is-open:not(.no-anim) .d5 { animation-delay: 6.10s; } .js.is-open:not(.no-anim) .d6 { animation-delay: 6.25s; } .js.is-open:not(.no-anim) .d7 { animation-delay: 6.40s; } .js.is-open:not(.no-anim) .d8 { animation-delay: 6.55s; } .js.is-open:not(.no-anim) .d9 { animation-delay: 6.70s; } .js.is-open:not(.no-anim) .d10 { animation-delay: 6.85s; } .js.is-open:not(.no-anim) .d11 { animation-delay: 7.00s; } .js.is-open:not(.no-anim) .d12 { animation-delay: 7.15s; } .js.is-open:not(.no-anim) .d13 { animation-delay: 7.30s; } .js.is-open:not(.no-anim) .d14 { animation-delay: 7.45s; } .js.is-open:not(.no-anim) .d15 { animation-delay: 7.60s; }
}
.memuat .cover .open { pointer-events: none; opacity: .55; }
/* Hiasan lukisan di bagian isi: rangkaian di bawah foto, pembatas di bawah tiap judul, buket di penutup. */
.spray { width: 210px; margin-top: -58px; }
main h2.script::after { content: ""; display: block; width: 240px; max-width: 80vw; height: 34px; margin: 4px auto 0; background: url("img/pembatas.webp") center / contain no-repeat; }
.buket { position: relative; width: 230px; margin: -30px auto 0; pointer-events: none; filter: drop-shadow(0 10px 16px rgba(60, 64, 110, .16)); }
@media (prefers-reduced-motion: no-preference) { .buket { animation: ayun 7s ease-in-out infinite; transform-origin: 50% 80%; } }

/* Foto tiap kisah cinta (opsional, sub-field stories.photo): polaroid kecil di atas judul, miring bergantian. */
.kisah-foto { margin: 2px 0 14px; padding: 6px 6px 20px; background: #fff; border-radius: 3px; box-shadow: 0 10px 22px rgba(30, 20, 20, .16); rotate: -1.4deg; }
:nth-child(even) > .kisah-foto { rotate: 1.4deg; }
.kisah-foto img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }

/* Kisah: halaman buku dongeng. Tiap kisah satu halaman ber-"Bab", huruf awal besar, bunga di sudut, tepi penjilidan di kiri. */
main > section.story { overflow: hidden; }
.story::before { content: ""; position: absolute; right: 8px; top: 6px; width: 40px; aspect-ratio: 260 / 422; background: url("img/balon.webp") center / contain no-repeat; opacity: .9; }
.chapters { gap: 24px; counter-reset: bab; }
.chapters li { counter-increment: bab; overflow: hidden; padding: 28px 24px 26px 34px; border-radius: 4px 12px 12px 4px; background: linear-gradient(90deg, rgba(106, 116, 173, .2), transparent 20px), var(--card); box-shadow: 0 12px 24px rgba(70, 76, 120, .14), 5px 5px 0 -1px var(--bg2), 5px 5px 0 0 var(--line); text-align: center; rotate: -.6deg; }
.chapters li:nth-child(even) { rotate: .6deg; }
.chapters li::before { content: "Bab " counter(bab); position: static; display: block; margin-bottom: 8px; font: 600 12px/1.4 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); width: auto; height: auto; border-radius: 0; background: none; }
.chapters li::after { content: ""; position: absolute; right: -18px; top: -14px; width: 92px; aspect-ratio: 700 / 744; background: url("img/sudut.webp") center / contain no-repeat; scale: -1 1; opacity: .85; pointer-events: none; }
.chapters p { text-align: left; }
.chapters p::first-letter { float: left; margin: 5px 7px 0 0; font: 400 46px/.8 var(--script); color: var(--r3); }
