/* Pulih — ucapan semoga sembuh, lukisan cat air bergerak: kamar yang hangat dengan jendela lengkung saat hujan.
   Dibuka: penerima mengetuk jendela berembun; embun terhapus melingkar dari titik ketukan, hujan reda, taman di luar
   kembali berwarna dengan pelangi, cahaya matahari masuk, lalu bangau-bangau kertas terbang masuk lewat jendela.
   Isinya surat penyemangat, bangau doa yang dibuka satu per satu (list `wishes`), polaroid di tali jemuran, dan
   balasan. Adegannya lapisan gambar (assets/img/*.webp) yang digerakkan CSS; tanpa JS adegan tidak dipakai dan semua
   isi langsung terbaca. */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/plus-jakarta-sans.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@property --r { syntax: "<percentage>"; inherits: false; initial-value: 160%; }

:root {
  --bg: #f4f1e8; --card: #fffdf7; --ink: #2f3a33; --soft: #66705f; --sage: #6f8d6c; --sage2: #4d684b; --peach: #e7a283; --peach2: #c97a5a;
  --butter: #f2d27a; --line: #e4ddc9;
  --display: "Fraunces", Georgia, serif; --sans: "Plus Jakarta Sans", system-ui, sans-serif; --hand: "Caveat", cursive;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; color: var(--ink); font: 500 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; background: var(--bg); }
img { max-width: 100%; display: block; }
h1, h2, p, figure, ul { margin: 0; }
a { color: var(--sage2); }
:focus-visible { outline: 2px solid var(--peach2); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; }
.js-only { display: none; } .js .js-only { display: block; }

/* ---------- Adegan: .stage berbanding 1536:2752 dan selalu menutup layar; posisi dalam persen.
   Urutan dari belakang: taman di luar (luar.webp) + hujan + embun, semuanya di dalam bukaan jendela (27,8–72,3% ×
   23,5–70,4%) → kamar berlubang jendela (kamar.webp) → sinar matahari → uap teh → bangau terbang.
   Keadaan dasar = sesudah hujan; sebelum dibuka (.js:not(.is-open)) hujan, embun, dan taman kelabu. ---------- */
.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: #cfd8cc; 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.7917)); aspect-ratio: 1536 / 2752; translate: -50% -50%; }
.kamar { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.jendela { position: absolute; left: 27.3%; top: 23%; width: 45.5%; height: 48%; overflow: hidden; }
.luar { position: absolute; left: -40%; top: -16%; width: 180%; height: auto; max-width: none; }
.hujan { position: absolute; inset: -20% 0 0; opacity: 0; background: repeating-linear-gradient(100deg, transparent 0 11px, rgba(255, 255, 255, .5) 11px 12px, transparent 12px 23px); background-size: 46px 90px; }
.kabut { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; --x: 50%; --y: 50%;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .5) 0 1.5%, transparent 2%) 0 0 / 22% 18%, radial-gradient(circle at 60% 70%, rgba(255, 255, 255, .45) 0 1.2%, transparent 1.7%) 0 0 / 17% 23%, linear-gradient(180deg, rgba(222, 230, 232, .86), rgba(205, 214, 218, .9));
  -webkit-mask: radial-gradient(circle at var(--x) var(--y), transparent calc(var(--r) - 14%), #000 var(--r)); mask: radial-gradient(circle at var(--x) var(--y), transparent calc(var(--r) - 14%), #000 var(--r)); }
.embun { font: 600 min(9vmin, 44px)/1 var(--hand); color: rgba(255, 255, 255, .92); rotate: -6deg; text-shadow: 0 1px 0 rgba(120, 140, 150, .35); }
.sinar { position: absolute; left: 20%; top: 26%; width: 80%; height: 64%; background: linear-gradient(160deg, rgba(255, 242, 196, .55), rgba(255, 236, 180, .12) 60%, transparent); clip-path: polygon(14% 0, 58% 0, 100% 100%, 30% 100%); mix-blend-mode: screen; }
.uap { position: absolute; left: 67.5%; top: 60%; width: 4%; height: 6%; }
.uap i { position: absolute; bottom: 0; left: 30%; width: 40%; height: 100%; border-radius: 50%; border-left: 2px solid rgba(255, 255, 255, .7); opacity: 0; }
.kawanan img { position: absolute; left: 44%; top: 40%; width: 12%; height: auto; max-width: none; opacity: 0; }
.bg2 { scale: -1 1; filter: hue-rotate(150deg) saturate(.8); } .bg3 { filter: hue-rotate(60deg); } .bg4 { scale: -1 1; filter: hue-rotate(220deg) saturate(.7); } .bg5 { filter: hue-rotate(30deg) saturate(1.2); }
.bg1 { --tx: 230%; --ty: -380%; } .bg2 { --tx: 260%; --ty: -320%; } .bg3 { --tx: 160%; --ty: 120%; } .bg4 { --tx: 200%; --ty: 60%; } .bg5 { --tx: 60%; --ty: -520%; }

/* Pembukaan: embun terhapus dari titik ketukan (0–2,2 dtk) lalu memudar, hujan berhenti (0,2–1,4), taman kembali
   berwarna (0,6–3), sinar & uap (1,6), bangau terbang (2,2+). */
.js .kabut { transition: --r 2.2s cubic-bezier(.4, 0, .2, 1), opacity 1s ease 2s; }
.js .hujan { transition: opacity 1.2s ease .2s; }
.js .luar { transition: filter 2.4s ease .6s, transform 6s cubic-bezier(.3, 0, .2, 1); }
.js .sinar { transition: opacity 2s ease 1.6s; }
.js:not(.is-open) .kabut { --r: 0%; opacity: 1; }
.js:not(.is-open) .hujan { opacity: 1; }
.js:not(.is-open) .luar { filter: grayscale(.8) brightness(.78) blur(1.5px); transform: scale(1.06); }
.js:not(.is-open) .sinar { opacity: 0; }
.no-anim .kabut, .no-anim .hujan, .no-anim .luar, .no-anim .sinar { transition: none !important; }

/* ---------- Pembuka (layar pertama, di atas adegan) ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 40px 24px 6vh; text-align: center;
  background: linear-gradient(180deg, #e6ece2, var(--bg)); }
.js .hero { background: none; }
.kicker { font: 700 11px/1.4 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--sage2); }
.ketuk { display: none; }
.js:not(.is-open) .ketuk { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 10px; max-width: 480px; margin: 0 auto; padding-bottom: 9vh; cursor: pointer; background: linear-gradient(180deg, transparent 60%, rgba(40, 50, 45, .35)); }
.ketuk .kicker { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.ketuk .hint { padding: 12px 24px; border-radius: 999px; background: rgba(255, 253, 247, .92); color: var(--sage2); font: 700 14px/1 var(--sans); box-shadow: 0 10px 24px rgba(30, 40, 30, .25); }
.memuat .ketuk { pointer-events: none; } .memuat .ketuk .hint { opacity: .55; }
.catatan { position: relative; width: min(100%, 330px); padding: 22px 22px 26px; background: var(--card); border-radius: 4px; box-shadow: 0 16px 34px rgba(40, 50, 40, .22); rotate: -1.5deg; }
.catatan::before { content: ""; position: absolute; left: 50%; top: -12px; width: 96px; height: 24px; translate: -50% 0; rotate: 3deg; background: rgba(231, 162, 131, .55); }
.catatan h1 { margin-top: 6px; font: 500 34px/1.12 var(--display); color: var(--sage2); }
.catatan h1 em { font: 700 46px/1 var(--hand); color: var(--peach2); font-style: normal; }
.mouse { position: absolute; left: 50%; bottom: -46px; width: 20px; height: 32px; margin-left: -10px; border: 2px solid var(--card); border-radius: 12px; opacity: .9; }
.mouse::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--card); }
html:not(.js) .mouse { display: none; }

/* ---------- Isi ---------- */
.content { position: relative; z-index: 1; display: grid; gap: 0; background: var(--bg); background-image: radial-gradient(circle, rgba(111, 141, 108, .12) 0 1.5px, transparent 2px); background-size: 28px 28px; }
.content > section { padding: 56px 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.lbl { font: 700 11px/1.4 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--peach2); }
.content h2 { font: 500 28px/1.2 var(--display); color: var(--sage2); }
.content h2 em { font: 700 34px/1 var(--hand); color: var(--peach2); font-style: normal; }
.hint { font-size: 14px; color: var(--soft); }
.orn { pointer-events: none; }

.surat { padding-top: 40px !important; }
.rangkai { width: 92%; margin-bottom: -26px; position: relative; z-index: 1; }
.kertas { position: relative; width: 100%; padding: 40px 24px 26px; border-radius: 4px; text-align: left; box-shadow: 0 16px 34px rgba(40, 50, 40, .12);
  background: linear-gradient(90deg, transparent 34px, rgba(231, 162, 131, .35) 34px 35px, transparent 35px), repeating-linear-gradient(180deg, transparent 0 33px, rgba(111, 141, 108, .2) 33px 34px), var(--card); }
.msg { padding-left: 22px; font: 500 24px/34px var(--hand); white-space: pre-line; color: var(--ink); }
.sign { font: 700 26px/1.2 var(--hand); color: var(--peach2); text-align: right; }

/* Bangau doa: tiap bangau tombol; diketuk → bangau melipat terbuka jadi kartu doa. Tanpa JS kartunya langsung tampil. */
.bangau { width: 100%; list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bangau li { position: relative; min-height: 140px; display: grid; place-items: center; }
.lipat { display: none; }
.js .lipat { display: grid; place-items: center; width: 100%; height: 100%; padding: 10px; border: 0; border-radius: 20px; background: rgba(255, 253, 247, .65); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); }
.lipat img { width: 82%; }
.bangau li:nth-child(5n+2) img { filter: hue-rotate(150deg) saturate(.8); } .bangau li:nth-child(5n+3) img { filter: hue-rotate(60deg); }
.bangau li:nth-child(5n+4) img { filter: hue-rotate(220deg) saturate(.7); } .bangau li:nth-child(5n) img { filter: hue-rotate(30deg) saturate(1.2); }
.isi-doa { width: 100%; height: 100%; padding: 16px 14px; border-radius: 16px; background: var(--card); box-shadow: 0 10px 22px rgba(40, 50, 40, .1); display: flex; flex-direction: column; justify-content: center; gap: 6px; border-top: 4px solid var(--peach); }
.bangau li:nth-child(even) .isi-doa { border-top-color: var(--sage); }
.isi-doa p { font: 500 15px/1.5 var(--display); }
.isi-doa small { font: 700 18px/1 var(--hand); color: var(--peach2); }
.js .bangau li:not(.terbuka) .isi-doa { display: none; }
.js .bangau li.terbuka .lipat { display: none; }
.hitung { font: 700 22px/1.3 var(--hand); color: var(--sage2); }

/* Album: polaroid dijepit di tali jemuran. */
.tali { position: relative; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 14px; padding-top: 22px; }
.tali::before { content: ""; position: absolute; left: -10px; right: -10px; top: 10px; height: 30px; border-top: 2px solid rgba(102, 112, 95, .5); border-radius: 50% 50% 0 0 / 30px 30px 0 0; rotate: 180deg; }
.tali figure { position: relative; padding: 7px 7px 26px; background: #fff; border-radius: 2px; box-shadow: 0 10px 20px rgba(40, 50, 40, .16); rotate: -2deg; transform-origin: 50% 0; }
.tali figure:nth-child(even) { rotate: 2.5deg; }
.tali figure::before { content: ""; position: absolute; left: 50%; top: -14px; width: 10px; height: 26px; translate: -50% 0; border-radius: 2px; background: linear-gradient(90deg, #c8a77a, #e2c79c); box-shadow: 0 2px 3px rgba(0, 0, 0, .15); }
.tali img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.card { width: auto; margin: 0 16px; border-radius: 20px; background: var(--card); box-shadow: 0 16px 34px rgba(40, 50, 40, .1); }
.reply form { width: 100%; display: grid; gap: 10px; }
.quick { display: grid; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--sage2); color: #fff; cursor: pointer; font: 700 14px/1.2 var(--sans); }
.btn.ghost { background: transparent; color: var(--sage2); border: 1.5px solid var(--sage); }
.reply textarea { width: 100%; min-height: 96px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; font: 500 16px/1.4 var(--sans); color: var(--ink); background: #fff; }

.penutup { padding-bottom: 90px !important; }
.hati { width: 30px; height: 28px; color: var(--peach); }
.penutup p:not(.sign) { font: italic 400 22px/1.4 var(--display); color: var(--sage2); }
.penutup .sign { text-align: center; }
.foot { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 0 16px 90px; text-align: center; font-size: 12px; color: var(--soft); background: var(--bg); }

.music-toggle { position: fixed; right: max(14px, calc(50% - 226px)); bottom: 16px; z-index: 50; width: 46px; height: 46px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--sage2); color: #fff; cursor: pointer; box-shadow: 0 8px 20px rgba(30, 40, 30, .3); }
.music-toggle svg { width: 20px; height: 20px; }
.js:not(.is-open) .music-toggle { display: none; }
.js:not(.is-open) body { overflow: hidden; }

/* ---------- Gerak ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hujan { animation: hujan .45s linear infinite; }
  .js:not(.is-open) .ketuk .hint { animation: denyut 1.6s ease-in-out infinite alternate; }
  .js.is-open .uap i { animation: uap 3.2s ease-out 1.6s infinite; } .uap i:nth-child(2) { left: 0; animation-delay: 2.6s !important; } .uap i:nth-child(3) { left: 55%; animation-delay: 3.4s !important; }
  .js.is-open .kawanan img { animation: terbang 9s cubic-bezier(.4, 0, .6, 1) infinite; }
  .js.is-open .bg1 { animation-delay: 2.2s; } .js.is-open .bg2 { animation-delay: 3s; animation-duration: 10s; } .js.is-open .bg3 { animation-delay: 3.8s; animation-duration: 8s; }
  .js.is-open .bg4 { animation-delay: 4.8s; } .js.is-open .bg5 { animation-delay: 5.6s; animation-duration: 11s; }
  .js.is-open .sinar { animation: denyut 5s ease-in-out 3.6s infinite alternate; }
  .js .catatan { transition: translate 1.2s cubic-bezier(.3, 1.2, .4, 1) 2.2s, opacity .8s ease 2.2s; }
  .js:not(.is-open) .catatan { translate: 0 60px; opacity: 0; }
  .no-anim .catatan { transition: none; }
  .mouse::after { animation: gulir 1.6s ease-in-out infinite; }
  .anim .reveal { transition: opacity .9s cubic-bezier(.2, .7, .2, 1), translate .9s cubic-bezier(.2, .7, .2, 1); }
  .anim .reveal:not(.in) { opacity: 0; translate: 0 30px; }
  .anim .surat:not(.in) .rangkai { scale: .5; opacity: 0; }
  .rangkai { transition: scale 1.2s cubic-bezier(.3, 1.3, .4, 1) .3s, opacity .7s ease .3s; }
  .js .lipat img { animation: kepak 2.4s ease-in-out infinite alternate; }
  .bangau li:nth-child(even) .lipat img { animation-delay: -1.2s; }
  .bangau li.baru .isi-doa { animation: buka .8s cubic-bezier(.3, 1.3, .4, 1) both; }
  .doa.lengkap .bangau li .isi-doa { animation: syukur 1.2s ease both; }
  .anim .album.in .tali figure { animation: jemur 1.4s cubic-bezier(.3, 1.4, .4, 1) both; }
  .tali figure:nth-child(2) { animation-delay: .15s !important; } .tali figure:nth-child(3) { animation-delay: .3s !important; } .tali figure:nth-child(4) { animation-delay: .45s !important; }
  .anim .penutup.in .hati { animation: denyut .9s ease-in-out infinite alternate; }
}
@keyframes hujan { from { background-position: 0 0; } to { background-position: -16px 90px; } }
@keyframes denyut { from { opacity: .7; scale: .97; } to { opacity: 1; scale: 1.03; } }
@keyframes uap { 0% { opacity: 0; transform: translateY(0) scaleY(.6); } 30% { opacity: .8; } 100% { opacity: 0; transform: translateY(-130%) scaleY(1.2) skewX(14deg); } }
@keyframes terbang { 0% { opacity: 0; transform: translate(0, 0) scale(.15) rotate(0); } 10% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1.4) rotate(-8deg); } }
@keyframes kepak { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-6px) rotate(3deg); } }
@keyframes buka { from { opacity: 0; transform: scale(.4) rotate(-10deg); } to { opacity: 1; transform: none; } }
@keyframes syukur { 0%, 100% { transform: none; } 50% { transform: translateY(-6px); } }
@keyframes jemur { from { opacity: 0; transform: translateY(-40px) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes gulir { 0% { translate: 0 0; opacity: 1; } 70% { translate: 0 10px; opacity: 0; } 100% { translate: 0 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; } .js .kabut, .js .hujan, .js .luar, .js .sinar { transition: none; } }

/* Video opsional (field "video"). */
.vk { width: min(100%, 440px); margin: 34px auto; padding: 0 20px; text-align: center; flex-direction: column; align-items: center; justify-content: center; }
.vk-judul { margin: 0 0 12px; font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.vk-layar { position: relative; width: 100%; margin: 0; padding: 10px; border-radius: 20px; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); background: color-mix(in srgb, currentColor 7%, transparent); box-shadow: 0 16px 34px rgba(0, 0, 0, .16); }
.vk-layar video { display: block; width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.vk-layar figcaption { margin-top: 10px; font-size: 14px; font-style: italic; opacity: .75; }
