/* Pijar — ucapan hari jadi (monthsary & anniversary): langit malam dengan kembang api 3D, satu letusan per bulan/tahun. */
@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; }

/* --fw1…--fw4 dan --star juga dibaca pijar.js untuk warna kembang api. */
:root { --bg: #070b1d; --bg2: #151a3a; --ink: #f7f1e3; --soft: #a9afc9; --accent: #ffd27a; --card: #0e1330; --line: #2c3566; --fw1: #ffd27a; --fw2: #ff6f91; --fw3: #8fd3ff; --fw4: #ffffff; --star: #ffffff; --btn-ink: #1a1304; --serif: "Playfair Display", Georgia, serif; --sans: "Montserrat", system-ui, sans-serif; }

/* Tone warna (field "tone"): malam = bawaan di atas. */
:root[data-tone="merah"] { --bg: #1d0709; --bg2: #3a0d14; --ink: #fff3e2; --soft: #d3a9a4; --accent: #ffc857; --card: #2a0a0e; --line: #5e1b22; --fw1: #ffc857; --fw2: #ff5a5f; --fw3: #ff9f6b; --fw4: #fff1c9; }
:root[data-tone="laut"] { --bg: #04161f; --bg2: #0a2f3d; --ink: #ecfbf8; --soft: #95b9bf; --accent: #7ef0e0; --card: #072029; --line: #17475a; --fw1: #7ef0e0; --fw2: #7aa8ff; --fw3: #c8f7a1; --fw4: #ffffff; --btn-ink: #03211d; }
:root[data-tone="ungu"] { --bg: #150a26; --bg2: #2c1550; --ink: #f8f0ff; --soft: #b6a3d1; --accent: #d7a6ff; --card: #1d0f36; --line: #432670; --fw1: #d7a6ff; --fw2: #ff8fd0; --fw3: #9fd0ff; --fw4: #fff0b8; --btn-ink: #200b3a; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 45%, var(--bg2) 100%) fixed; color: var(--ink); font: 400 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
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: block; }
.js .clock.js-only { display: flex; }

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

.hero { min-height: 100vh; min-height: 100svh; padding: 46px 0 44px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.kicker { padding: 7px 16px; border: 1px solid var(--line); border-radius: 2px; font-size: 11px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); }
.stagebox { flex: 1 1 auto; width: 100%; min-height: 240px; display: grid; place-items: center; }
.icon { width: 170px; height: 170px; color: var(--accent); animation: kelip 1.8s ease-in-out infinite; }
.gl .icon { visibility: hidden; } /* diganti kembang api di kanvas */
.tease { font-size: 40px; line-height: 1.12; }
.count { display: flex; flex-direction: column; align-items: center; }
.count b { font: 500 128px/.9 var(--serif); letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; color: var(--accent); text-shadow: 0 0 34px color-mix(in srgb, var(--accent) 45%, transparent); }
.count span { margin-top: 6px; font: 500 26px/1.2 var(--serif); }
.names { margin-top: 18px; 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(--fw2); }
.since { margin-top: 6px; font-size: 12px; color: var(--soft); }
.hint { margin-top: 22px; min-height: 48px; padding: 0 26px; border: 1px solid var(--accent); border-radius: 2px; background: transparent; color: var(--accent); font: 600 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; cursor: pointer; animation: napas 2.2s ease-in-out infinite; }

/* Cara dibuka "amplop": kembang api tangan diketuk dulu. Tanpa JS sampul dilewati dan semua isi langsung tampil. */
.cover-only { display: none; }
.js body[data-opener="amplop"]:not(.opened) .cover-only { display: block; }
.js body[data-opener="amplop"]:not(.opened) .open-only,
.js body[data-opener="amplop"]:not(.opened) .content,
.js body[data-opener="amplop"]:not(.opened) footer { display: none; }
.js body[data-opener="amplop"]:not(.opened) .hero { cursor: pointer; }
.opened .open-only { animation: naik .9s cubic-bezier(.2, .7, .2, 1) both; }

.content { display: flex; flex-direction: column; gap: 26px; padding-bottom: 60px; }
.card { position: relative; padding: 30px 24px; border-radius: 4px; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); }
.card::before { content: ""; position: absolute; inset: 6px; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 2px; pointer-events: none; }
.lbl { margin-bottom: 16px; font-size: 11px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }

.timer { text-align: center; }
.clock { justify-content: center; }
.clock div { flex: 1 1 0; min-width: 0; padding: 4px 2px; display: flex; flex-direction: column; gap: 6px; }
.clock div + div { border-left: 1px solid var(--line); }
.clock b { font: 500 32px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.clock span { font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); }
.static { font-size: 14px; color: var(--soft); }
.static b { font: 500 32px/1 var(--serif); color: var(--ink); }
.orbs { margin-top: 18px; font-size: 12px; color: var(--soft); }

.msg { font: 400 19px/1.6 var(--serif); white-space: pre-line; overflow-wrap: anywhere; }
.sign { margin-top: 22px; font: italic 500 24px/1.1 var(--serif); color: var(--accent); text-align: right; }

.album h2, .closing h2, .reply h2 { font-size: 32px; line-height: 1.15; }
.album h2 { margin: 14px 0 22px; text-align: center; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photos figure { margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 2px; background: color-mix(in srgb, var(--card) 92%, transparent); }
.photos figure:first-child { grid-column: 1 / -1; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photos figure:first-child img { aspect-ratio: 4 / 3; }

.closing { padding: 44px 0 30px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.closing .mini { width: 26px; height: 24px; color: var(--fw2); animation: kelip 1.8s ease-in-out infinite; }

.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 { min-height: 50px; padding: 0 22px; border: 0; border-radius: 2px; background: var(--accent); color: var(--btn-ink); font: 600 12px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.btn.ghost { min-height: 46px; padding: 0 16px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 500 14px/1.2 var(--sans); letter-spacing: 0; text-transform: none; text-align: left; }
.btn.ghost:hover { border-color: var(--accent); }
textarea { width: 100%; min-height: 96px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 2px; background: color-mix(in srgb, var(--ink) 4%, 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); }

/* Isi muncul saat tergulir ke layar (kelas .anim hanya dipasang bila IntersectionObserver tersedia). */
.anim .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.anim .reveal.in { opacity: 1; transform: none; }

@keyframes kelip { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.92); } }
@keyframes napas { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
@keyframes naik { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

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