/* Jawab Hati — ungkapan cinta: merah muda, hati berdenyut, tombol "Nggak" yang kabur. */
@font-face { font-family: "Instrument Serif"; font-style: normal; src: url("fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; font-style: italic; src: url("fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; 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; }

:root { --blush: #ffe4ea; --ink: #3a0a18; --rose: #b0123d; --rose-deep: #8e0f33; --line: #e9a6b6; --soft: #8e4a5c; --serif: "Instrument Serif", Georgia, serif; --sans: "Plus Jakarta Sans", system-ui, sans-serif;
 /* warna hasil tone (dulu ditulis langsung) */ --tn-1: #b0123d;
}

/* Tone warna (field "tone"): merah = bawaan di atas. */
:root[data-tone="hijau"] { --ink: #0a3a21; --rose: #12b061; --rose-deep: #0f8e4d; --line: #a6e9ca; --soft: #4a8e6c; --tn-1: #12b061; }
:root[data-tone="ungu"] { --ink: #210a3a; --rose: #6112b0; --rose-deep: #4d0f8e; --line: #caa6e9; --soft: #6c4a8e; --tn-1: #6112b0; }
:root[data-tone="biru"] { --ink: #0a1f3a; --rose: #1254b0; --rose-deep: #0f468e; --line: #a6c0e9; --soft: #4a668e; --tn-1: #1254b0; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--blush); }
body { margin: 0; background: var(--blush); color: var(--ink); font: 500 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
h1, h2, p { margin: 0; }
a { color: var(--rose-deep); }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.bg-heart { position: fixed; z-index: 0; color: var(--rose); pointer-events: none; }
.bg-heart.h1 { top: -18px; right: -24px; width: 120px; height: 110px; opacity: .18; transform: rotate(18deg); }
.bg-heart.h2 { bottom: 40px; left: -20px; width: 90px; height: 82px; opacity: .14; transform: rotate(-16deg); }
main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 32px 22px; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }
.js p.js-only { display: block; }
.js .date.js-only { display: flex; }

.stage { min-height: 80vh; padding: 20px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.lead { font-size: 15px; font-weight: 600; }
.heart { width: 110px; height: 100px; color: var(--rose); }
.heart.big { width: 110px; height: 100px; }
.pulse { animation: denyut 1.4s ease-in-out infinite; }
.pulse.fast { animation-duration: 1s; }
.quote { font: 400 30px/1.25 var(--serif); }
.btn { min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--rose); color: #fff; font: 700 16px/1.2 var(--sans); cursor: pointer; align-items: center; justify-content: center; }
.btn:hover { background: var(--rose-deep); }

.photos { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.photos figure { margin: 0; width: calc(50% - 5px); border-radius: 22px; background: #fff; border: 2px dashed var(--line); overflow: hidden; }
.photos figure:first-child { width: 100%; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photos figure:first-child img { aspect-ratio: 4 / 3; max-height: 280px; }
.question { font: 400 52px/.98 var(--serif); overflow-wrap: anywhere; }
.question em { font-style: italic; color: var(--rose); }
.msg { font-size: 15px; line-height: 1.55; color: var(--soft); }
.teaser { min-height: 20px; font-size: 15px; font-weight: 600; }
.answers { position: relative; width: 100%; min-height: 70px; text-align: left; }
.js .answers { min-height: 240px; }
.yes { position: absolute; left: 0; top: 20px; min-height: 52px; padding: 0 28px; border-radius: 999px; border: 0; background: var(--rose); color: #fff; font: 800 17px/1.2 var(--sans); cursor: pointer; box-shadow: 0 10px 20px color-mix(in srgb, var(--tn-1) 30%, transparent); z-index: 2; }
.answers form { position: static; }
.no { display: flex; align-items: center; justify-content: center; position: absolute; left: 56%; top: 28px; min-height: 44px; max-width: 42%; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px/1.2 var(--sans); cursor: pointer; z-index: 1; transition: left .2s ease, top .2s ease; }
.hint { font-size: 13px; color: var(--soft); }

.done h2 { font: 400 60px/.95 var(--serif); }
.done h2 em { font-style: italic; color: var(--rose); }
.date { padding: 14px 20px; border-radius: 16px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.date span { font-size: 13px; font-weight: 600; color: var(--soft); }
.date b { font-size: 20px; font-weight: 800; }
.sent-note { font-size: 15px; font-weight: 600; }
.again { min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--rose-deep); font: 700 14px/1 var(--sans); text-decoration: underline; cursor: pointer; }

/* Dengan JS: satu layar per tahap. Tanpa JS semuanya berurutan, layar jawaban hanya setelah terkirim. */
.js body[data-stage="intro"] .stage:not(.intro), .js body[data-stage="ask"] .stage:not(.ask), .js body[data-stage="done"] .stage:not(.done) { display: none; }
html:not(.js) .stage.sent { display: none; }
.stage[hidden] { display: none; }
footer { position: relative; z-index: 1; padding: 8px 16px 24px; text-align: center; font-size: 12px; color: var(--soft); }

.rain { position: fixed; top: -30px; z-index: 5; color: var(--rose); font-style: normal; pointer-events: none; animation: jatuh 3.4s ease-in forwards; }
@keyframes jatuh { to { transform: translateY(110vh) rotate(40deg); opacity: .6; } }
@keyframes denyut { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.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: #fff; color: var(--rose); box-shadow: 0 8px 20px color-mix(in srgb, var(--tn-1) 25%, transparent); cursor: pointer; }
.music-toggle svg { width: 18px; height: 18px; }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 24px; height: 1.5px; background: var(--rose); transform: rotate(-45deg); }
html:not(.js) .music-toggle { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .no { transition: none; }
}

/* ---------- Animasi ---------- */
@media (prefers-reduced-motion: no-preference) {
  .stage { animation: masuk .7s cubic-bezier(.2, .7, .2, 1) both; }
  .stage > * { animation: naik .7s cubic-bezier(.2, .7, .2, 1) both; }
  .stage > :nth-child(2) { animation-delay: .1s; }
  .stage > :nth-child(3) { animation-delay: .2s; }
  .stage > :nth-child(4) { animation-delay: .3s; }
  .stage > :nth-child(5) { animation-delay: .4s; }
  .photos figure { animation: pop .7s cubic-bezier(.34, 1.56, .64, 1) both; }
  .photos figure:nth-child(2) { animation-delay: .12s; }
  .photos figure:nth-child(3) { animation-delay: .24s; }
  .yes { animation: napas 1.8s ease-in-out infinite; }
  .yes:hover { filter: brightness(1.1); }
  .no:active { scale: .9; }
  .bg-heart { animation: melayang 7s ease-in-out infinite; }
  .bg-heart.h2 { animation-delay: -3s; }
  .btn { transition: transform .15s, background .2s; }
  .btn:active { transform: scale(.96); }
}
@keyframes masuk { from { opacity: 0; } to { opacity: 1; } }
@keyframes naik { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes pop { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
@keyframes napas { 0%, 100% { scale: 1; } 50% { scale: 1.06; } }
@keyframes melayang { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
