/* =========================================================
   Design system
   - Colour: brick-red page, blush-pink panels with a coral edge, yuma gold for the glow
   - Type: Amoresa (script, for the big romantic lines) + Libre Baskerville (everything else).
     Amoresa is a paid font: drop Amoresa.woff2 into fonts/ and it is used automatically;
     until then Great Vibes (free, similar formal script) stands in.
   - Spacing: an 8px scale, so every gap is a multiple of 8
   - Type sizes: a 1.25 ratio scale (16, 20, 25, 31, 39, 49)
   ========================================================= */
@font-face {
  font-family: "Amoresa";
  src: url("fonts/Amoresa.otf") format("opentype");
  font-display: swap;
}
:root {
  color-scheme: light;
  --script: "Amoresa", "Great Vibes", cursive;
  --serif: "Libre Baskerville", Georgia, serif;
  --wine: #8c1c16;
  --bg: #fe828c;          /* blush pink page background */
  --bg-pulse: #ffa3ab;    /* lighter blush the heartbeat pulses to */
  --pink: #f8cfcb;
  --pink-light: #fde8e5;
  --coral: #e0533a;
  --cream: #fff4ee;
  --ink: #2b1412;
  --gold: #ffd678;          /* yuma gold */

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px;
  --t1: 16px; --t2: 20px; --t3: 25px; --t4: 31px; --t5: 39px; --t6: 49px;
  --radius: 32px;
}

* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--wine);     /* wine text reads clearly on the blush */
  font: 400 var(--t1)/1.75 var(--serif);
  transition: background-color 1s ease, color 1s ease;
  overflow-x: clip;
}
[hidden] { display: none !important; }
h1 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }

/* ---------- Pages ---------- */
.page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: var(--s5) var(--s3);
  animation: pageIn 0.7s cubic-bezier(.2, .8, .3, 1) both;
}
.page.leaving { animation: pageOut 0.45s ease-in forwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes pageOut { to { opacity: 0; transform: translateY(-16px) scale(.98); } }

.frame { width: min(100%, 560px); display: grid; justify-items: center; gap: var(--s4); text-align: center; }
.frame.left { justify-items: start; text-align: left; gap: var(--s3); }
.frame.wide { width: min(100%, 864px); gap: var(--s3); }   /* 720px x 1.2, for the bouquet panel */

.hello { justify-self: start; font-size: var(--t2); }
.script { font: 700 clamp(var(--t5), 9vw, 56px)/1.1 var(--script); transform: rotate(-2deg); }
.serif { font-size: clamp(var(--t4), 6vw, var(--t5)); line-height: 1.25; }

/* ---------- Page 1 ---------- */
#ask .frame { gap: var(--s3); }
.hello { font-size: var(--t2); letter-spacing: .02em; min-height: 1.75em; transition: color 1s; }
.script { font: 400 clamp(44px, 11vw, 72px)/1.15 var(--script); transition: color 1s; }
.glow:not(#askTitle) { text-shadow: 0 0 8px rgba(255, 214, 120, .85), 0 0 22px rgba(255, 214, 120, .5), 0 0 44px rgba(255, 214, 120, .25); }

/* "Hello Joni," typewriter: each letter fades up softly */
.tw { opacity: 0; display: inline-block; white-space: pre; animation: twIn .55s ease-out forwards; }
@keyframes twIn { from { opacity: 0; filter: blur(4px); transform: translateY(4px); } to { opacity: 1; filter: none; transform: none; } }
.hello .caret { display: inline-block; width: 1px; height: 1.1em; margin-left: 2px; vertical-align: -0.2em; background: currentColor; animation: blink 1s steps(1) infinite; }

/* the question, drawn like brush strokes (see writeQuestion in script.js) */
#askTitle { margin-top: var(--s3); width: min(100%, 560px); }
.brush { display: block; width: 100%; height: auto; overflow: visible;
  filter: drop-shadow(0 0 4px rgba(255, 214, 120, .85)) drop-shadow(0 0 11px rgba(255, 214, 120, .5)) drop-shadow(0 0 22px rgba(255, 214, 120, .25)); }
.glyph { fill: currentColor; fill-opacity: 0; stroke: currentColor; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
@keyframes drawStroke { to { stroke-dashoffset: 0; } }
@keyframes fillIn { to { fill-opacity: 1; stroke-width: 4; } }
.written .glyph { fill-opacity: 1; stroke-width: 4; }

/* once the heart has arrived, the heartbeat sets the page colour */
body.bright.pulse { animation: backdiv 1s infinite; }
@keyframes backdiv { 50% { background: var(--bg-pulse); } }

/* page 1 floating emojis sit on a canvas behind everything */
#emojiSky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; transition: opacity .6s; }
#emojiSky.gone { opacity: 0; }
.page { position: relative; z-index: 1; }

/* Soft petal light: four big, soft-edged patches of colour wandering slowly around the screen.
   Radial gradients (instead of a blur filter) keep it light on phone batteries. */
#petalLight { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#petalLight i { position: absolute; left: 0; top: 0; width: 80vmax; height: 80vmax; margin: -40vmax 0 0 -40vmax; border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0%, transparent 62%); opacity: .7;
  animation: var(--path) var(--d) ease-in-out infinite alternate; will-change: transform; }
#petalLight i:nth-child(1) { --c: #ffb38a; --path: wander1; --d: 46s; }
#petalLight i:nth-child(2) { --c: #fff4ee; --path: wander2; --d: 53s; opacity: .55; }
#petalLight i:nth-child(3) { --c: #e8576c; --path: wander3; --d: 61s; }
#petalLight i:nth-child(4) { --c: #ffd0a8; --path: wander4; --d: 39s; }
/* each patch visits a few spots on the screen (vw = % of width, vh = % of height) */
@keyframes wander1 { 0% { transform: translate(5vw, 5vh); } 33% { transform: translate(70vw, 25vh); } 66% { transform: translate(30vw, 80vh); } 100% { transform: translate(90vw, 95vh); } }
@keyframes wander2 { 0% { transform: translate(95vw, 40vh); } 33% { transform: translate(40vw, 10vh); } 66% { transform: translate(10vw, 55vh); } 100% { transform: translate(60vw, 70vh); } }
@keyframes wander3 { 0% { transform: translate(15vw, 100vh); } 33% { transform: translate(85vw, 75vh); } 66% { transform: translate(55vw, 30vh); } 100% { transform: translate(0vw, 20vh); } }
@keyframes wander4 { 0% { transform: translate(80vw, 90vh); } 33% { transform: translate(20vw, 65vh); } 66% { transform: translate(85vw, 5vh); } 100% { transform: translate(35vw, 40vh); } }

/* the character with the rose, between the question and the heart */
.buddy { width: clamp(96px, 17svh, 156px); aspect-ratio: 1; display: grid; place-items: center; opacity: 0; transform: scale(.6); }
.buddy img { width: 100%; height: 100%; object-fit: contain; }
.buddy.shown { opacity: 1; transform: none; transition: opacity .6s ease-out, transform .8s cubic-bezier(.3, 1.5, .5, 1); }
/* once it's in, a gentle sway, like it's holding the rose out to her */
.buddy.shown img { transform-origin: 50% 92%; animation: offer 2.6s ease-in-out .8s infinite, breathe 3.4s ease-in-out 1.2s infinite; }
@keyframes offer { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg) translateY(-2px); } }
/* until the picture is added: a dashed placeholder (only you will ever see this) */
.buddy.missing { border: 2px dashed rgba(140, 28, 22, .4); border-radius: 50%; }
.buddy.missing img { display: none; }
.buddy.missing::after { content: "character\A goes here"; white-space: pre; text-align: center; font: 12px/1.4 var(--serif); color: rgba(140, 28, 22, .6); }

/* the runaway "No": lifted out of the heart and slid around the screen with the translate property,
   so its own :active press (which uses transform) still works without a jump */
.choice.runaway { position: fixed; z-index: 6; margin: 0; background: var(--cream);
  transition: translate .75s cubic-bezier(.22, 1, .36, 1), transform .15s, background .2s, opacity .4s; }
.choice-spacer { visibility: hidden; }

/* the heart panel: rises from the bottom, then beats */
.heart-wrap { --s: min(42vw, 176px, 23svh); opacity: 0; transform: translateY(45vh); margin-top: -8px; }
/* nudged up so the character sits halfway between the question and the top of the heart */
#ask .heart-wrap { position: relative; top: calc(var(--s) * -.22); }   /* pulled up so the character sits evenly between */
.heart-wrap.rise { animation: rise 1.3s cubic-bezier(.16, .84, .24, 1) forwards; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.heart-wrap.shown { opacity: 1; transform: none; }

.heart-beat { position: relative; width: calc(var(--s) * 1.72); height: calc(var(--s) * 1.62); }
.heart-beat.beating { animation: beat 1s infinite; }
@keyframes beat { 0% { transform: scale(1); } 50% { transform: scale(.9); } }

/* the heart: a rotated square plus two circles */
.heart-shape {
  position: absolute; width: var(--s); height: var(--s);
  left: calc(50% - var(--s) * .75); top: calc(50% - var(--s) * .32);
  background: pink; transform: rotate(-45deg); transform-origin: 75% 25%;
  transition: background-color .2s;
}
.heart-shape::before, .heart-shape::after { content: ""; position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: inherit; }
.heart-shape::before { top: calc(var(--s) / -2); left: 0; }
.heart-shape::after { top: 0; left: calc(var(--s) / 2); }

.choices { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: var(--s1); padding-top: calc(var(--s) * .38); }   /* centres the pair on the heart (top of lobes to tip) */
.choice {
  min-height: 46px; min-width: calc(var(--s) * 1.05); padding: 0 var(--s3);
  border: 2px solid var(--coral); border-radius: 999px; background: var(--cream); color: var(--ink);
  font: 700 var(--t1) var(--serif); cursor: pointer; transition: transform .15s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.choice.soft { background: transparent; border-color: rgba(140, 28, 22, .35); font-weight: 400; }
.choice:hover { background: #fff; }
.choice:active { transform: scale(.95); }
.choice:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* "No..." : your shake */
@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.wrong-answer { animation: wrong-shake .4s ease-in-out; }
.wrong-answer .heart-shape { filter: drop-shadow(2px 0 0 #dc2626) drop-shadow(-2px 0 0 #dc2626) drop-shadow(0 2px 0 #dc2626) drop-shadow(0 -2px 0 #dc2626); }

/* "Yes!!!" : squash, then pop */
.heart-beat.clicked { animation: heartPop .8s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes heartPop { 0% { transform: scale(1); } 20% { transform: scale(.88, .84); } 55% { transform: scale(1.22); } 100% { transform: scale(1.12); } }
.mini {
  position: fixed; width: 22px; height: 20px; pointer-events: none; z-index: 5;
  animation: fly 1s ease-out forwards;
}
.mini path { fill: pink; stroke: var(--coral); stroke-width: 6; }
@keyframes fly {
  from { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--r)); opacity: 0; }
}

/* ---------- Option panel (page 2) ---------- */
.panel {
  width: 100%;
  background: var(--pink);
  border: 3px solid var(--coral);
  border-radius: var(--radius);
  color: var(--ink);
}
.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); padding: var(--s3); }
.opt {
  position: relative;
  min-height: 136px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1);
  padding: var(--s3) var(--s1);
  background: var(--cream); color: var(--ink);
  border: 2px solid var(--gold); border-radius: 20px;
  font: 400 var(--t1)/1 var(--serif);
  cursor: pointer;
  animation: glow 2.4s ease-in-out infinite;
  transition: transform .2s, background .2s, opacity .3s;
  -webkit-tap-highlight-color: transparent;
}
.opt:nth-child(2) { animation-delay: .4s; }
.opt:nth-child(3) { animation-delay: .8s; }
.opt:hover { transform: translateY(-2px); }
.opt:active { transform: scale(.97); }
.opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(255, 214, 120, .55), 0 0 18px 4px rgba(255, 214, 120, .25); }
  50%      { box-shadow: 0 0 14px 4px rgba(255, 214, 120, .95), 0 0 36px 12px rgba(255, 214, 120, .45); }
}
/* tile text: weekday on top, big day number, month below */
.opt .wk, .opt .mon { font-size: var(--t1); letter-spacing: .08em; text-transform: uppercase; }
.opt .num { font: 700 clamp(31px, 8vw, var(--t5))/1 var(--serif); }
.opt .check {
  position: absolute; top: -10px; right: -10px;   /* sits on the corner, clear of the text */
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 2px solid var(--gold); display: grid; place-items: center; background: #fff;
}
.opt .check svg { width: 12px; height: 12px; opacity: 0; }
.opt .check { opacity: 0; transition: opacity .2s; }
.opt.picked .check { opacity: 1; }
.opt.picked { background: var(--gold); color: var(--ink);   /* dark text: cream is unreadable on light gold */ animation: picked .6s cubic-bezier(.3, 1.6, .5, 1), glow 2.4s ease-in-out infinite; }
.opt.picked .check { background: var(--ink); border-color: var(--ink); }
.opt.picked .check svg { opacity: 1; }
.options.done .opt:not(.picked) { opacity: .35; }
@keyframes picked { 0% { transform: scale(.94); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- Page 3 ---------- */
.needs { margin: 0; padding-left: var(--s3); display: grid; gap: var(--s1); }
.pill {
  min-height: 52px; padding: 0 var(--s4);
  background: var(--pink); color: var(--ink);
  border: 3px solid var(--coral); border-radius: 999px;
  font: 600 var(--t2) var(--serif); cursor: pointer;
  transition: transform .15s, background .2s;
}
.pill:hover { background: var(--pink-light); }
.pill:active { transform: scale(.96); }
.pill:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.frame.left .pill { margin-top: 0; }
/* the little characters on pages 2 and 3 */
.pal { display: block; height: auto; pointer-events: none; }
.pal-curious { width: clamp(96px, 18svh, 150px); margin: calc(var(--s1) * -1) 0; }
/* page 2: question marks floating above the character's head */
.pal-curious-wrap { position: relative; margin: calc(var(--s1) * -1 + 12px) 0 calc(var(--s1) * -1 - 12px); }   /* nudged down so the character and its question marks sit halfway between the title and the date panel */
.pal-curious-wrap .pal-curious { margin: 0; transform-origin: 50% 96%; animation: breathe 3.4s ease-in-out infinite; }
.qm { position: absolute; font: 700 var(--qs, 26px)/1 var(--serif); color: var(--wine, #8c1c16); pointer-events: none;
  text-shadow: 0 0 10px rgba(255, 214, 120, .6); opacity: 0; animation: qmIn .5s ease-out var(--qd) forwards, qmBob 2.4s ease-in-out calc(var(--qd) + .5s) infinite; }
.qm1 { --qs: 22px; --qd: .5s; left: 6%; top: -6%; rotate: -16deg; }
.qm2 { --qs: 32px; --qd: .8s; left: 42%; top: -22%; rotate: 4deg; }
.qm3 { --qs: 24px; --qd: 1.1s; left: 80%; top: -8%; rotate: 18deg; }
@keyframes qmIn { from { opacity: 0; transform: translateY(6px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes qmBob { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .qm { animation: none; opacity: 1; } }
.plan-foot { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s2); margin-top: var(--s1); }
.pal-raccoon { width: clamp(110px, 22svh, 170px); }
.pal-raccoon { transform-origin: 50% 95%; }
.page:not([hidden]) .pal-raccoon { animation: chunkIn .7s cubic-bezier(.2, .8, .3, 1) var(--after, .8s) backwards, sway 3s ease-in-out calc(var(--after, .8s) + .6s) infinite, breathe 3.4s ease-in-out calc(var(--after, .8s) + .6s) infinite; }
@keyframes sway { 0%, 100% { rotate: 0deg; } 50% { rotate: -3deg; } }

/* Page 3 comes in as two chunks: the heading lines first, then the list and button
   0.2s after the first chunk has finished (0.6s + 0.2s = 0.8s delay).
   "backwards" only applies the start frame during the delay, so the button's :active press still works after. */
.chunk { animation: chunkIn .7s cubic-bezier(.2, .8, .3, 1) .1s backwards; }
#plan p.chunk { animation-delay: .5s; }
#plan .needs.chunk { animation: none; }
#plan .needs li { animation: chunkIn .7s cubic-bezier(.2, .8, .3, 1) calc(.9s + var(--i, 0) * .4s) backwards; }   /* one line at a time */
.chunk.second:not(.needs) { animation-delay: var(--after, .8s); }   /* button and raccoon after the last line (set in fillPlan) */
@keyframes chunkIn { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } }
/* "Okay!" : the same squash-and-pop as the heart on page 1 */
.pill.clicked { animation: heartPop .8s cubic-bezier(.3, 1.4, .5, 1) forwards; }
.link { background: none; border: 0; color: var(--wine); font: 400 var(--t1) var(--serif); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* ---------- Page 4: typewriter + bouquet ---------- */
.typed { max-width: 720px; min-height: 3.75em; transition: opacity .8s ease; }
.typed.gone { opacity: 0; }
.typed .caret { display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -0.12em; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bouquet-panel {
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #ffc3c8 0%, #ffb3b9 55%, #ffa9b0 100%);   /* pastel, a little lighter than the blush page */
  animation: pageIn .8s ease-out both;
}
#bouquetCanvas { display: block; width: 100%; height: min(768px, calc(100svh - 196px)); cursor: default; }   /* as tall as fits without scrolling */

/* phones: give the bouquet panel the screen's full width (8px gutter) so it can grow */
@media (max-width: 600px) {
  /* iPhone: tighter page margins so every page fits on one screen without scrolling */
  .page { padding: var(--s3) var(--s2); }
  #bouquetCanvas { height: calc(100svh - 124px); }
  #flowers { padding-left: var(--s1); padding-right: var(--s1); }
  #flowers .typed { padding: 0 var(--s2); }
}

/* ---------- Photo pop-up ---------- */
.lightbox { position: fixed; inset: 0; z-index: 10; background: rgba(43, 20, 18, .8); display: grid; place-items: center; padding: var(--s3); }
.lightbox figure { margin: 0; display: grid; gap: var(--s2); justify-items: center;   /* same space above and below the Close button */
  background: var(--bg); border: 3px solid var(--coral); border-radius: var(--radius); padding: var(--s2); width: min(100%, 440px); text-align: center; animation: pageIn .3s ease-out; }   /* blush, like page 3, so Close looks like Okay! */
.lightbox img { width: 100%; max-height: 64svh; object-fit: contain; border-radius: 20px; display: block; }   /* the whole photo, not a square crop */
.lightbox figcaption { font: 700 var(--t4)/1.2 var(--script); color: var(--ink); margin: 0; }
.lightbox figcaption[hidden] { display: none; }
#lbClose { margin: 0; }

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .opt { box-shadow: 0 0 14px 4px rgba(255, 214, 120, .8); }
  .tw { opacity: 1; }
  .heart-wrap { opacity: 1; transform: none; }
  .buddy { opacity: 1; transform: none; }
  #petalLight i { animation: none; }
  .wrong-answer { animation: none; }
  .wrong-answer .heart-shape { background-color: #fef2f2; }
}

/* =========================================================
   Small touches
   ========================================================= */
/* character breathing: a slow, tiny squash and stretch (the art itself is unchanged) */
@keyframes breathe { 0%, 100% { scale: 1 1; } 50% { scale: 1.02 .97; } }

/* hearts where she taps */
.tapheart { position: fixed; z-index: 20; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; animation: tapUp 1.1s cubic-bezier(.2, .7, .3, 1) forwards; }
.tapheart svg { width: 100%; height: 100%; fill: #ff5d7a; filter: drop-shadow(0 0 6px rgba(255, 214, 120, .8)); }
@keyframes tapUp { 0% { transform: scale(.2); opacity: 0; } 20% { transform: scale(1.15); opacity: 1; } 100% { transform: translateY(-60px) scale(.7) rotate(var(--r)); opacity: 0; } }
.tapring { position: fixed; z-index: 20; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 2px solid rgba(255, 244, 238, .9); pointer-events: none; animation: tapRing .6s ease-out forwards; }
@keyframes tapRing { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }

/* a glint across Yes!!! and Okay! every few seconds */
#yes, #toFlowers, #lbClose { position: relative; overflow: hidden; isolation: isolate; }
#yes::after, #toFlowers::after, #lbClose::after { content: ""; position: absolute; inset: -2px; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .9) 50%, transparent 70%);
  transform: translateX(-120%); animation: sheen 3.2s ease-in-out 1.5s infinite; }
#toFlowers::after { animation-delay: 2.4s; }
#lbClose::after { animation-delay: 1s; }
@keyframes sheen { 0% { transform: translateX(-120%); } 35%, 100% { transform: translateX(120%); } }

/* a few petals drifting down behind pages 2 to 4 (off on page 1 and once the bouquet starts) */
#petals { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; transition: opacity .8s; }
#petals.off { opacity: 0; visibility: hidden; transition: opacity .8s, visibility 0s .8s; }
#petals i { position: absolute; top: -24px; width: 14px; height: 18px; border-radius: 14px 0 14px 0; opacity: .9;
  background: linear-gradient(135deg, #fff4ee, #ffc2cc); box-shadow: 0 1px 3px rgba(140, 28, 22, .15);
  animation: petalFall var(--d) linear var(--delay) infinite, petalSway calc(var(--d) / 3) ease-in-out var(--delay) infinite alternate; }
@keyframes petalFall { to { top: 110%; rotate: 300deg; } }
@keyframes petalSway { from { translate: -18px 0; } to { translate: 18px 0; } }

/* page dots: the current page stretches into a pill */
#pageDots { position: fixed; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 4; display: flex; gap: 6px; justify-content: center; pointer-events: none; }
#pageDots i { width: 7px; height: 7px; border-radius: 999px; background: rgba(140, 28, 22, .28); transition: width .45s cubic-bezier(.3, 1.4, .5, 1), background .45s; }
#pageDots i.on { width: 22px; background: var(--wine); }

/* page 2: her pick sparkles, the other two days step back */
.options.done .opt:not(.picked) { transform: scale(.94); }
.options.done .opt.picked { z-index: 2; }
.spark { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; pointer-events: none;
  background: #fff; box-shadow: 0 0 6px 2px var(--gold), 0 0 14px 4px rgba(255, 214, 120, .6); animation: spark .9s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes spark { from { transform: rotate(var(--a)) translateY(-30px) scale(.4); opacity: 1; } 30% { opacity: 1; } to { transform: rotate(var(--a)) translateY(-104px) scale(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .buddy.shown img, .pal-curious-wrap .pal-curious { animation: none; }
  #yes::after, #toFlowers::after, #lbClose::after, #petals { display: none; }
}

/* ---------- New first page: "How much do you love me?" ---------- */
#love { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#love .frame { gap: var(--s4); }
#love.leaving { animation-duration: .9s; }                          /* a slower fade into "Hello Joni," */
#loveTitle .pop { display: inline-block; animation: wordPop .55s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(.25s + var(--i) * .14s); }
@keyframes wordPop { 0% { opacity: 0; transform: translateY(14px) scale(.4); } 70% { opacity: 1; } }
.love-heart { width: min(62vw, 230px, 34svh); aspect-ratio: 100 / 90; transform-origin: 50% 60%; }
.love-heart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.love-heart .lh-bg { fill: rgba(255, 244, 238, .22); }
.love-heart .lh-fill { fill: #d6203a; }
.love-heart .lh-line { fill: none; stroke: var(--wine); stroke-width: 3.5; stroke-linejoin: round; }
.love-heart { animation: heartIn .7s cubic-bezier(.3, 1.5, .5, 1) 1.5s backwards; }
@keyframes heartIn { from { opacity: 0; transform: scale(.5); } }
.love-heart.wiggle { animation: wiggle .45s ease-in-out; }
@keyframes wiggle { 0% { transform: scale(1); } 20% { transform: rotate(-7deg) scale(1.07); } 45% { transform: rotate(6deg) scale(1.04); } 70% { transform: rotate(-3deg); } 100% { transform: none; } }
#love.full .love-heart { animation: loveFull .9s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes loveFull { 40% { transform: scale(1.18); } 100% { transform: scale(1.08); } }
#love.full .love-heart svg { filter: drop-shadow(0 0 14px rgba(255, 214, 120, .95)); }
.love-label { margin: 0; min-height: 1.6em; font: 700 var(--t2) var(--serif); color: var(--wine); animation: wordPop .55s cubic-bezier(.3, 1.6, .5, 1) 2s backwards; }
.love-label.swap { animation: wordPop .5s cubic-bezier(.3, 1.6, .5, 1); }
.hello.slow .tw { animation-duration: 1.1s; }                       /* the slow "Hello Joni," after the new first page */
@media (prefers-reduced-motion: reduce) {
  #loveTitle .pop, .love-heart, .love-heart.wiggle, .love-label, .love-label.swap { animation: none; }
}

/* page 1 "combo": a character pops out of the centre and keeps growing past the screen as it fades to transparent */
.love-combo { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; pointer-events: none; visibility: hidden; }
.love-combo img { width: min(100vw, 82svh); max-height: 92svh; object-fit: contain; opacity: 0; }
.love-combo.go { visibility: visible; }
.love-combo.go img { animation: combo 1.4s cubic-bezier(.25, .55, .45, 1) forwards; }
@keyframes combo {
  0%   { opacity: 0;   transform: scale(.08); }
  14%  { opacity: .95; transform: scale(.45); }
  100% { opacity: 0;   transform: scale(2.8); }
}
