/* Botol — ungkapan cinta, lukisan cat air bergerak: pantai tropis saat senja. Begitu halaman dimuat, botol berisi
   surat terbawa ombak dari tengah laut lalu terdampar di pasir. Dibuka: botol bergetar, hati-hati kecil naik, surat
   gulung melayang keluar lalu terurai membawa nama penerima. Isinya: surat di kertas gulung (border-image dari
   gulung.webp), polaroid yang ikut terdampar, lalu pertanyaan (`question`) dengan jawaban Mau / pikir dulu sebagai
   balasan. Tanpa JS adegan tidak dipakai dan semua isi langsung terbaca. */
@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"; font-style: italic; src: url("fonts/cormorant-garamond-italic.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: "Parisienne"; src: url("fonts/parisienne.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #fbefe6; --card: #fffaf3; --ink: #3a2a2e; --soft: #7a6168; --coral: #e2735f; --coral2: #c4553f; --rose: #c94f6d; --sea: #3f9fa3;
  --sand: #f1d3ad; --line: #efd9c9;
  --display: "Cormorant Garamond", Georgia, serif; --sans: "Plus Jakarta Sans", system-ui, sans-serif; --script: "Parisienne", cursive;
  --lebar: min(100vw - 44px, 436px); /* lebar kertas surat: tinggi gulungan border-image dihitung darinya */
}
*, *::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 { margin: 0; }
a { color: var(--coral2); }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; }

/* ---------- Adegan: .stage berbanding 1536:2752 dan selalu menutup layar; posisi dalam persen.
   Matahari di (50%, 45%), garis pantai ±62–70%, pasir di bawahnya. Botol terdampar di (30%, 77%). ---------- */
.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: #f6c9a8; 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%; }
.latar { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.kilau i { position: absolute; width: 1.2%; aspect-ratio: 1; background: #fff6dc; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); opacity: 0; }
.kilau i:nth-child(1) { left: 46%; top: 50%; } .kilau i:nth-child(2) { left: 53%; top: 53%; } .kilau i:nth-child(3) { left: 49%; top: 57%; }
.kilau i:nth-child(4) { left: 56%; top: 49%; } .kilau i:nth-child(5) { left: 44%; top: 55%; } .kilau i:nth-child(6) { left: 51%; top: 60%; }
.camar { position: absolute; left: 60%; top: 22%; width: 10%; height: 3%; }
.camar i { position: absolute; width: 30%; height: 60%; border-top: 2px solid rgba(90, 60, 80, .6); border-radius: 50% 50% 0 0; }
.camar i::after { content: ""; position: absolute; left: 95%; top: -2px; width: 100%; height: 100%; border-top: 2px solid rgba(90, 60, 80, .6); border-radius: 50% 50% 0 0; }
.camar i:nth-child(2) { left: 55%; top: 50%; scale: .75; }
.ombak { position: absolute; left: -5%; top: 62%; width: 110%; height: 13%; overflow: visible; }
.ombak path { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ombak .o2 { stroke: rgba(255, 255, 255, .55); }
.botol { position: absolute; left: 28%; top: 75%; width: 42%; rotate: -6deg; }
.botol img { width: 100%; height: auto; max-width: none; }
.botol::after { content: ""; position: absolute; left: 10%; right: 10%; top: 80%; height: 30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(150, 90, 60, .28), transparent); z-index: -1; }
.hati-naik svg { position: absolute; top: 74%; width: 3%; aspect-ratio: 1.1; color: #f5718c; opacity: 0; }
.hati-naik svg:nth-child(1) { left: 40%; } .hati-naik svg:nth-child(2) { left: 50%; color: #ffb3a1; } .hati-naik svg:nth-child(3) { left: 58%; }
.hati-naik svg:nth-child(4) { left: 45%; color: #fff0e0; } .hati-naik svg:nth-child(5) { left: 63%; color: #ffb3a1; }

/* ---------- Layar pertama: surat gulung membawa nama ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; padding: 8vh 24px 40px; text-align: center; background: linear-gradient(180deg, #f7c8a9, var(--bg)); }
.js .hero { background: none; }
.kicker { font: 700 11px/1.4 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--coral2); }
.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: 6vh; cursor: pointer; background: linear-gradient(180deg, transparent 55%, rgba(60, 30, 40, .35)); }
.ketuk .kicker { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.ketuk .hint { padding: 12px 24px; border-radius: 999px; background: rgba(255, 250, 243, .94); color: var(--rose); font: 700 14px/1 var(--sans); box-shadow: 0 10px 24px rgba(60, 20, 30, .3); }
.memuat .ketuk { pointer-events: none; } .memuat .ketuk .hint { opacity: .55; }
.gulungan { width: min(78%, 300px); }
.kertas-judul { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 26px; border-style: solid; border-color: transparent; border-width: calc(.18 * min(78vw - 38px, 300px)) 0 calc(.234 * min(78vw - 38px, 300px));
  border-image: url("img/gulung.webp") 115 0 150 0 fill / calc(.18 * min(78vw - 38px, 300px)) 0 calc(.234 * min(78vw - 38px, 300px)) stretch; }
.kertas-judul h1 { font: 400 46px/1.1 var(--script); color: var(--rose); }
.kertas-judul h1 span { display: block; font: italic 500 18px/1 var(--display); color: var(--soft); }
.sub { font: italic 500 18px/1.3 var(--display); color: var(--ink); }
.dari { font: 400 22px/1.2 var(--script); color: var(--coral2); }
.mouse { position: absolute; left: 50%; bottom: 3vh; 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: pasir senja ---------- */
.content { position: relative; z-index: 1; background: linear-gradient(180deg, var(--bg), #f9e4d2 60%, var(--bg)); }
.content > section { padding: 56px 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.lbl { font: 700 11px/1.4 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--coral2); }
.hint { font-size: 14px; color: var(--soft); }
.orn { pointer-events: none; }
.kertas { width: var(--lebar); padding: 10px 26px; text-align: left; border-style: solid; border-color: transparent; border-width: calc(.18 * var(--lebar)) 0 calc(.234 * var(--lebar));
  border-image: url("img/gulung.webp") 115 0 150 0 fill / calc(.18 * var(--lebar)) 0 calc(.234 * var(--lebar)) stretch; }
.salam { font: 400 34px/1.2 var(--script); color: var(--rose); }
.msg { margin-top: 8px; font: italic 500 20px/1.55 var(--display); white-space: pre-line; color: var(--ink); }
.sign { margin-top: 10px; font: 400 30px/1.2 var(--script); color: var(--coral2); text-align: right; }
.polaroid { position: relative; width: 100%; height: 300px; }
.polaroid figure { position: absolute; width: 56%; padding: 8px 8px 30px; background: #fff; box-shadow: 0 12px 24px rgba(80, 40, 40, .2); }
.polaroid figure:nth-child(1) { left: 2%; top: 10px; rotate: -8deg; } .polaroid figure:nth-child(2) { right: 2%; top: 0; rotate: 7deg; } .polaroid figure:nth-child(3) { left: 22%; top: 70px; rotate: -2deg; }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.polaroid:has(figure:nth-child(3)) { height: 360px; }
.rangkai { width: 92%; }
.tanya { gap: 12px !important; }
.hati-besar { width: 46px; height: 42px; color: var(--rose); }
.question { font: 400 46px/1.15 var(--script); color: var(--rose); }
.tanya h2:not(.question) { font: 500 30px/1.2 var(--display); color: var(--ink); }
.tanya h2 em { font: 400 36px/1 var(--script); color: var(--rose); font-style: normal; }
.tanya form { width: 100%; display: grid; gap: 10px; margin-top: 8px; }
.jawab { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--rose); color: #fff; cursor: pointer; font: 700 15px/1.2 var(--sans); }
.btn svg { width: 16px; height: 15px; }
.btn.ya { box-shadow: 0 10px 22px rgba(201, 79, 109, .35); }
.btn.ghost { background: transparent; color: var(--rose); border: 1.5px solid var(--rose); }
.tanya textarea { width: 100%; min-height: 90px; 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; }
.penutup p:not(.sign) { font: italic 500 22px/1.4 var(--display); color: var(--ink); max-width: 18em; }
.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(--rose); color: #fff; cursor: pointer; box-shadow: 0 8px 20px rgba(80, 20, 40, .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) {
  /* Berulang: ombak mendekat-menjauh, kilau matahari di laut, camar melintas, botol bergoyang di pasir. */
  .ombak .o1 { animation: ombak 5s ease-in-out infinite; } .ombak .o2 { animation: ombak 5s ease-in-out -2.5s infinite; }
  .kilau i { animation: kilau 2.6s ease-in-out infinite; } .kilau i:nth-child(2n) { animation-delay: -1.3s; } .kilau i:nth-child(3n) { animation-delay: -.7s; animation-duration: 3.2s; }
  .camar { animation: camar 22s linear infinite; } .camar i, .camar i::after { animation: kepak .6s ease-in-out infinite alternate; }
  /* Botol datang dari tengah laut lalu terdampar (sekali saat dimuat), sesudah itu bergoyang pelan. */
  .js .botol { animation: datang 3.4s cubic-bezier(.3, .1, .3, 1) both, goyang 3.6s ease-in-out 3.4s infinite alternate; }
  .no-anim .botol { animation: goyang 3.6s ease-in-out infinite alternate; }
  .js.is-open:not(.no-anim) .botol img { animation: getar .6s ease-in-out 2; }
  .js.is-open .hati-naik svg { animation: hati 4.5s ease-out .5s infinite; }
  .hati-naik svg:nth-child(2) { animation-delay: 1.2s !important; } .hati-naik svg:nth-child(3) { animation-delay: 1.9s !important; } .hati-naik svg:nth-child(4) { animation-delay: 2.6s !important; } .hati-naik svg:nth-child(5) { animation-delay: 3.3s !important; }
  .js:not(.is-open) .ketuk .hint { animation: denyut 1.6s ease-in-out infinite alternate; }
  /* Surat keluar dari botol (melayang dari kiri bawah), lalu gulungannya terurai. */
  .js .gulungan { transition: translate 1.3s cubic-bezier(.3, .9, .3, 1) .5s, scale 1.3s cubic-bezier(.3, .9, .3, 1) .5s, rotate 1.3s cubic-bezier(.3, .9, .3, 1) .5s, opacity .5s ease .5s, clip-path 1s cubic-bezier(.5, 0, .2, 1) 1.8s; clip-path: inset(0 0 0 0); }
  .js:not(.is-open) .gulungan { translate: -18% 52vh; scale: .2; rotate: -50deg; opacity: 0; clip-path: inset(40% 0 40% 0); }
  .no-anim .gulungan { transition: none; }
  .js.is-open .gulungan { animation: melayang 5s ease-in-out 3s infinite alternate; }
  .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) .kertas { clip-path: inset(30% 0 30% 0); }
  .kertas { transition: clip-path 1.4s cubic-bezier(.5, 0, .2, 1) .2s; clip-path: inset(0 0 0 0); }
  .anim .kenangan.in .polaroid figure { animation: terdampar 1.1s cubic-bezier(.3, 1.2, .4, 1) both; }
  .polaroid figure:nth-child(2) { animation-delay: .2s !important; } .polaroid figure:nth-child(3) { animation-delay: .4s !important; }
  .anim .tanya.in .hati-besar { animation: debar 1s ease-in-out infinite; }
}
@keyframes ombak { 0%, 100% { transform: translateY(0) scaleX(1); opacity: .9; } 50% { transform: translateY(18%) scaleX(1.04); opacity: .4; } }
@keyframes kilau { 0%, 100% { opacity: 0; scale: .4; } 50% { opacity: 1; scale: 1; } }
@keyframes camar { from { translate: -700% 30%; } to { translate: 600% -70%; } }
@keyframes kepak { from { scale: 1 1; } to { scale: 1 .5; } }
@keyframes datang { 0% { transform: translate(52%, -92%) scale(.35) rotate(8deg); opacity: 0; } 15% { opacity: 1; } 45% { transform: translate(34%, -60%) scale(.55) rotate(-6deg); } 70% { transform: translate(10%, -14%) scale(.86) rotate(5deg); } 100% { transform: none; } }
@keyframes goyang { from { rotate: -6deg; } to { rotate: -3.5deg; } }
@keyframes getar { 0%, 100% { transform: none; } 25% { transform: rotate(-4deg) translateX(-2%); } 75% { transform: rotate(4deg) translateX(2%); } }
@keyframes hati { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -700%) scale(1.2); } }
@keyframes denyut { from { opacity: .75; scale: .97; } to { opacity: 1; scale: 1.03; } }
@keyframes melayang { from { transform: translateY(0) rotate(-.8deg); } to { transform: translateY(-8px) rotate(.8deg); } }
@keyframes terdampar { from { opacity: 0; transform: translateY(-60px) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes debar { 0%, 100% { scale: 1; } 15% { scale: 1.18; } 30% { scale: .96; } 45% { scale: 1.1; } }
@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 .gulungan, .kertas { transition: none !important; } }

/* 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; }
