/* Tart — ucapan hari jadi (monthsary & anniversary): kue tart 3D di ruang remang; tiap lilin yang dinyalakan
   memunculkan satu alasan dan menerangi ruangan. */
@font-face { font-family: "Playfair Display"; src: url("fonts/playfair-display.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("fonts/playfair-display-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("fonts/montserrat.woff2") format("woff2"); font-weight: 300 600; font-display: swap; }

/* --cake, --frost, --plate, --candle1, --candle2, --accent juga dibaca tart.js untuk warna kue 3D. */
:root { --bg: #170f14; --warm: #b5562b; --ink: #fff3e6; --soft: #c9aea4; --accent: #ff8fab; --card: #2a1a20; --line: #4d2f38; --cake: #6b3f2a; --frost: #ff8fab; --plate: #f6ede4; --candle1: #fff3e0; --candle2: #ffd166; --btn-ink: #2a0f18; --serif: "Playfair Display", Georgia, serif; --sans: "Montserrat", system-ui, sans-serif; }

/* Tone warna (field "tone"): cokelat = bawaan di atas. */
:root[data-tone="stroberi"] { --bg: #1a0f16; --warm: #c2456f; --accent: #ff9dbb; --card: #2c1622; --line: #55293d; --cake: #f48fb1; --frost: #fff3e0; --candle1: #ffffff; --candle2: #ff5d8f; }
:root[data-tone="vanila"] { --bg: #14110c; --warm: #b3832a; --ink: #fff6e3; --soft: #cbbb9c; --accent: #e3b655; --card: #262015; --line: #4a3d22; --cake: #f3e2b8; --frost: #fffaf0; --candle1: #e3b655; --candle2: #ffffff; --btn-ink: #1c1505; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
h2, p, ol { margin: 0; }
h2 { font: 500 30px/1.15 var(--serif); }
em { font-style: italic; color: var(--accent); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.js-only { display: none; }
.js .js-only { display: flex; }

/* Cahaya lilin: lapisan hangat yang makin terang tiap lilin menyala (opacity diatur tart.js; tanpa JS langsung terang). */
.glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(75% 55% at 50% 48%, color-mix(in srgb, var(--warm) 80%, transparent) 0%, color-mix(in srgb, var(--warm) 28%, transparent) 55%, transparent 100%); opacity: .85; transition: opacity .9s ease; }
.js .glow { opacity: 0; }
/* Adegan 3D: kanvas menempel di layar, isi halaman bergulir di atasnya. Tanpa WebGL kanvas tetap tak terlihat. */
.scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .9s ease; }
.gl .scene { opacity: 1; }
main, footer { position: relative; z-index: 1; }
main { max-width: 480px; margin: 0 auto; padding: 0 24px; }

/* Satu layar: kertas alasan di atas, kue di tengah, tombol di bawah. */
.stage { min-height: 100vh; min-height: 100svh; padding: 40px 0 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.js body:not(.done) .stage { cursor: pointer; }
.kicker, .lbl { font-size: 11px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); }
.slip { width: 100%; min-height: 118px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.lead { font: 500 24px/1.3 var(--serif); }
.reasons { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font: italic 400 17px/1.4 var(--serif); color: var(--soft); }
.nth { font-size: 11px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); }
.why { font: italic 500 25px/1.3 var(--serif); overflow-wrap: anywhere; animation: nyala .6s ease both; }
.js .slip > .lbl, .js .slip > .reasons { display: none; } /* dengan JS alasan tampil satu per lilin */

.stagebox { flex: 1 1 auto; width: 100%; min-height: 270px; display: grid; place-items: center; }
.icon { width: 190px; height: 190px; color: var(--cake); }
.gl .icon { visibility: hidden; } /* diganti kue 3D di kanvas */

.final { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.js body:not(.done) .final { display: none; }
.done .final { animation: nyala .9s ease both; }
.count { font: 500 24px/1.2 var(--serif); }
.count b { display: block; font: 500 104px/.9 var(--serif); letter-spacing: -.03em; font-variant-numeric: lining-nums; color: var(--accent); text-shadow: 0 0 36px color-mix(in srgb, var(--accent) 50%, transparent); }
.names { margin-top: 10px; display: inline-flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; overflow-wrap: anywhere; }
.names svg { flex: none; width: 13px; height: 12px; color: var(--accent); }
.since { font-size: 12px; color: var(--soft); }

.controls { flex-direction: column; align-items: center; gap: 10px; }
.done .controls { display: none; }
.progress { font-size: 12px; letter-spacing: .08em; color: var(--soft); font-variant-numeric: tabular-nums; }
.btn { min-height: 50px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--accent); color: var(--btn-ink); font: 600 13px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }

/* Ucapan, foto, dan balasan muncul setelah semua lilin menyala (tanpa JS langsung tampil). */
.content { display: flex; flex-direction: column; gap: 26px; padding: 10px 0 56px; }
.js body:not(.done) .content, .js body:not(.done) footer { display: none; }
.card { padding: 30px 24px; border-radius: 20px; background: color-mix(in srgb, var(--card) 90%, transparent); border: 1px solid var(--line); }
.lbl { margin-bottom: 14px; }
.msg { font: 400 19px/1.6 var(--serif); white-space: pre-line; overflow-wrap: anywhere; }
.sign { margin-top: 20px; font: italic 500 24px/1.1 var(--serif); color: var(--accent); text-align: right; }
.photos { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -24px; padding: 4px 24px 14px; }
.photos figure { flex: none; width: 72%; margin: 0; scroll-snap-align: center; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.photos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.reply h2 { margin-bottom: 18px; }
.note { font-size: 13px; color: var(--soft); }
form { display: flex; flex-direction: column; gap: 12px; }
.quick { display: flex; flex-direction: column; gap: 8px; }
.btn.ghost { min-height: 46px; padding: 0 18px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 500 14px/1.2 var(--sans); letter-spacing: 0; text-transform: none; }
.btn.ghost:hover { border-color: var(--accent); }
textarea { width: 100%; min-height: 96px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); font: 400 14px/1.5 var(--sans); resize: vertical; }
textarea::placeholder { color: var(--soft); }

.music-toggle { position: fixed; top: 14px; right: 14px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 86%, transparent); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.music-toggle svg { width: 20px; height: 20px; }
.music-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--btn-ink); }
footer { padding: 8px 22px 34px; text-align: center; font-size: 12px; color: var(--soft); }

.anim .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.anim .reveal.in { opacity: 1; transform: none; }
@keyframes nyala { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }

@media (max-height: 640px) { .stagebox { min-height: 200px; } .count b { font-size: 80px; } .slip { min-height: 96px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Video unggahan (field video): ditaruh sebelum galeri, bingkai mengikuti warna teks template (currentColor). */
.vk { width: min(100%, 440px); margin: 34px auto; padding: 0 20px; text-align: center; flex-direction: column; align-items: center; justify-content: center; }
.vk-layar { width: 100%; }
.vk-judul { margin: 0 0 12px; font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.vk-layar { position: relative; 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; }
