/* ==========================================================================
   Zambak ve Kurdele
   A pastel sticker-book: a gift box with a ribbon, a pink lily, Lili the
   lily in her pot, a tear-off calendar, a capsule machine of reasons
   (gacha.css), instant photos, a heart-sealed letter and a bouquet.
   ========================================================================== */

/* Layout: one column of chunky, cocoa-outlined props on polka-dot pink, each one a sticker on the page. */
:root {
  /* Palette: cotton candy. Baby blue and pastel pink share the page; indigo ink
     sits well with both. Blue carries the big surfaces, pink the warm details. */
  --page: #e3efff;
  --page-pink: #ffe6f0;
  --paper: #fffbfd;
  --tint: #8ec5ff;
  --tint-soft: #cfe4ff;
  --tint-deep: #6fb0ff;
  --blush: #ff9cc2;
  --blush-soft: #ffd6e6;
  --accent: #3b7fe0;
  --accent-pink: #ee5f95;
  --ribbon: #ee5f95;
  --mint: #bde8d4;
  --butter: #ffe59a;
  --sky: #cfe8ff;
  --lilac: #e2d4ff;
  --ink: #3a3563;
  --ink-soft: #78739e;

  --font-display: "Fredoka", "Varela Round", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-text: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Mali", "Comic Sans MS", cursive;

  --gutter: clamp(16px, 5vw, 40px);
  --pad-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  --pad-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  --space: clamp(88px, 16vw, 150px);
  --ease-out: cubic-bezier(0.22, 0.9, 0.24, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft: cubic-bezier(0.45, 0.05, 0.25, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--page);
}

html.is-locked,
html.is-locked body {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--page);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 2.6px, transparent 3.2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 2.6px, transparent 3.2px),
    linear-gradient(180deg, var(--page-pink) 0%, var(--page) 16%, var(--page-pink) 38%, var(--page) 60%, var(--page-pink) 80%, var(--page) 100%);
  background-position: 0 0, 14px 14px, 0 0;
  background-size: 28px 28px, 28px 28px, 100% 100%;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  overflow-x: hidden;
  overflow-x: clip;
}

button {
  font: inherit;
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px dashed var(--accent);
  outline-offset: 5px;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 25;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Sticker-style lettering: white outline, a pink step below. */
.candy {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-pink);
  letter-spacing: 0.01em;
  text-shadow:
    3px 0 0 #fff, -3px 0 0 #fff, 0 3px 0 #fff, 0 -3px 0 #fff,
    2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff,
    0 7px 0 var(--tint), 0 10px 16px color-mix(in srgb, var(--ink) 22%, transparent);
}

.pill {
  display: inline-block;
  margin: 0;
  padding: 5px 16px 6px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  color: var(--accent-pink);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.pill::after {
  content: " ♡";
}

.sticker-slot {
  position: absolute;
  z-index: 3;
  display: block;
  width: clamp(40px, 11vw, 56px);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Lili
   -------------------------------------------------------------------------- */

.lili {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.lili__plant {
  transform-box: view-box;
  transform-origin: 60px 114px;
  animation: lili-sway 3.4s ease-in-out infinite alternate;
}

.lili__arm--left {
  transform-box: view-box;
  transform-origin: 59px 96px;
  animation: lili-wave 1.1s ease-in-out infinite alternate;
}

.lili__eyes {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: kitten-blink 4.8s ease-in-out infinite;
}

.lili__eyes-happy {
  display: none;
}

.lili.is-happy .lili__eyes {
  display: none;
}

.lili.is-happy .lili__eyes-happy {
  display: inline;
}

.lili.is-happy {
  animation: lili-hop 0.5s ease-out 3;
}

.mascot {
  position: absolute;
  z-index: 4;
}

.speech {
  position: absolute;
  z-index: 1;
  margin: 0;
  padding: 4px 11px 5px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 0.95rem;
  line-height: 1.3;
  white-space: nowrap;
  transform: scale(0);
  transform-origin: 20% 100%;
  transition: transform 0.35s var(--ease-back);
}

.speech::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 18px;
  width: 10px;
  height: 10px;
  margin-top: -4px;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  background: #fff;
  transform: rotate(45deg);
}

.is-talking .speech {
  transform: scale(1);
}

/* --------------------------------------------------------------------------
   Gate: the gift box
   -------------------------------------------------------------------------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding-left: var(--pad-left);
  padding-right: var(--pad-right);
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 55%),
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 2.6px, transparent 3.2px) 0 0 / 28px 28px,
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 2.6px, transparent 3.2px) 14px 14px / 28px 28px,
    linear-gradient(170deg, var(--page-pink), var(--page));
  touch-action: none;
  transition: opacity 0.9s ease 1s, transform 1.4s var(--ease-smooth) 0.85s, visibility 0s linear 2.3s;
}

/* The gate zooms past her as it fades, as if she stepped into the gift. */
.is-open .gate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.2);
}

.gate__line {
  margin: 0;
  font-size: clamp(1.9rem, 8.6vw, 2.8rem);
  text-align: center;
}

.gate__line {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-pink);
  text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 0 5px 0 var(--tint);
  animation: pop-in 0.7s var(--ease-back) 0.2s both;
}

.gate__hint {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  animation: pop-in 0.6s var(--ease-back) 0.9s both, breathe 2.4s ease-in-out 1.6s infinite;
}

.gift {
  width: min(70vw, 300px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: gift-wiggle 2.6s ease-in-out 1.2s infinite;
}

.gift__art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gift__lid {
  transform-box: view-box;
  transform-origin: 100px 86px;
}

.gift__bow {
  transform-box: fill-box;
  transform-origin: 50% 60%;
}

.gift.is-open {
  animation: none;
}

.gift.is-open .gift__bow {
  animation: bow-untie 0.45s ease-in forwards;
}

.gift.is-open .gift__lid {
  animation: lid-off 0.9s var(--ease-out) 0.3s forwards;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 40px 120px;
  padding-left: var(--pad-left);
  padding-right: var(--pad-right);
  overflow: hidden;
  text-align: center;
}

/* A puffy cloud band along the bottom of the first screen. */
/* In front of the stage, so the first screen sinks behind the clouds. */
.hero__clouds {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  width: 100%;
  height: clamp(70px, 20vw, 130px);
  translate: 0 calc(var(--hero-p, 0) * -40px);
}

/* Scrolling away, the first screen sinks behind the page, shrinks and fades;
   motion.js sets --hero-p from 0 to 1. */
.hero__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate3d(0, calc(var(--hero-p, 0) * 24vh), 0) scale(calc(1 - var(--hero-p, 0) * 0.14));
  opacity: calc(1 - var(--hero-p, 0) * 0.9);
  will-change: transform, opacity;
}

.hero__lily .lily {
  rotate: calc(var(--hero-p, 0) * 40deg);
}

.hero__lily {
  position: relative;
  width: min(76vw, 400px);
  width: min(76vw, 42svh, 400px);
  aspect-ratio: 1;
}

.hero__lily .lily {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sticker-slot--hero {
  top: 4%;
  right: 0;
  width: clamp(52px, 15vw, 76px);
  rotate: 14deg;
}

.mascot--hero {
  left: -6%;
  bottom: -8%;
  width: 30%;
  translate: calc(var(--hero-p, 0) * -34px) 0;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease 1.6s, transform 0.7s var(--ease-back) 1.6s;
}

/* Longer lines wrap instead of running off narrow phones. */
.mascot--hero .speech {
  bottom: 96%;
  left: 40%;
  width: max-content;
  max-width: min(15rem, 60vw);
  white-space: normal;
}

.is-open .mascot--hero {
  opacity: 1;
  transform: none;
}

/* The config's hero sticker, across from Lili; it bobs and hops when tapped. */
.hero__friend {
  position: absolute;
  z-index: 3;
  right: -9%;
  bottom: -11%;
  width: 36%;
  translate: calc(var(--hero-p, 0) * 34px) 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) rotate(10deg);
  transition: opacity 0.6s ease 1.9s, transform 0.7s var(--ease-back) 1.9s;
  -webkit-tap-highlight-color: transparent;
}

.is-open .hero__friend {
  opacity: 1;
  transform: rotate(6deg);
}

.hero__friend .sticker {
  animation: friend-bob 2.8s ease-in-out infinite alternate;
}

.hero__friend.is-happy .sticker {
  animation: lili-hop 0.5s ease-out 2;
}

.hero__text {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease 1.3s, transform 1s var(--ease-back) 1.3s;
}

.is-open .hero__text {
  opacity: 1;
  transform: none;
}

.hero__name {
  margin: 12px 0 0;
  font-size: clamp(3.2rem, 15vw, 7.2rem);
  line-height: 1.05;
  text-wrap: balance;
}

.hero__lead {
  max-width: 30ch;
  margin: 18px auto 0;
  font-size: clamp(1.05rem, 4.3vw, 1.25rem);
  color: var(--ink-soft);
}

/* Centred with margins: the opening owns the transforms here. */
.scroll-cue {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  width: 150px;
  margin-left: -75px;
  padding: 6px 0;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.6s ease 2.6s;
}

.scroll-cue::after {
  content: " ↓";
}

.is-open .scroll-cue {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  position: relative;
  padding-block: var(--space) 0;
  padding-left: var(--pad-left);
  padding-right: var(--pad-right);
}

.section-head {
  max-width: 34rem;
  margin: 0 auto clamp(32px, 7vw, 56px);
  text-align: center;
}

.section-head__title {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--ink);
  text-wrap: balance;
}

.section-head__sub {
  margin: 10px 0 0;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--ink-soft);
}

/* Scroll reveals: content rises, settles and fades in as it arrives. Keyed on
   .has-motion (set by motion.js), so without JavaScript everything simply shows. */
.has-motion .reveal {
  opacity: 0;
  translate: 0 48px;
  scale: 0.96;
  transition: opacity 0.9s ease, translate 1.2s var(--ease-smooth), scale 1.2s var(--ease-smooth), transform 0.45s ease;
}

.has-motion .reveal.is-visible {
  opacity: 1;
  translate: none;
  scale: none;
}

.has-motion .section-head.reveal {
  opacity: 1;
  translate: none;
  scale: none;
}

.has-motion .section-head.reveal > * {
  opacity: 0;
  translate: 0 26px;
  transition: opacity 0.8s ease, translate 1s var(--ease-smooth);
}

.has-motion .section-head.reveal > :nth-child(2) {
  transition-delay: 0.1s;
}

.has-motion .section-head.reveal > :nth-child(3) {
  transition-delay: 0.2s;
}

.has-motion .section-head.reveal.is-visible > * {
  opacity: 1;
  translate: none;
}

/* Photos are dealt onto the table from alternate sides. */
.has-motion .instax.reveal {
  transition: opacity 0.9s ease, translate 1.3s var(--ease-smooth), rotate 1.3s var(--ease-smooth), scale 1.3s var(--ease-smooth);
}

.has-motion .instax.reveal:nth-child(odd) {
  translate: -70px 40px;
  rotate: -8deg;
}

.has-motion .instax.reveal:nth-child(even) {
  translate: 70px 40px;
  rotate: 8deg;
}

.has-motion .instax.reveal.is-visible {
  translate: none;
  rotate: none;
}

/* --------------------------------------------------------------------------
   Drifting stickers: they float in each section's margins and motion.js moves
   them at their own scroll speed. Content sits above them.
   -------------------------------------------------------------------------- */

.drift {
  position: absolute;
  z-index: 1;
  width: calc(var(--size, 32) * 1px);
  pointer-events: none;
  will-change: transform;
}

.drift__float {
  display: block;
  animation: drift-float 6s ease-in-out infinite alternate;
}

.drift .sticker {
  width: 100%;
  height: auto;
}

@media (max-width: 520px) {
  .drift {
    width: calc(var(--size, 32) * 0.8px);
  }
}

.section-head,
.note-bubble,
.machine,
.coins,
.machine__status,
.instax__meta,
.instax__note,
.envelope-wrap,
.bouquet,
.finale__title,
.finale__line,
.finale__stage,
.footer {
  position: relative;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Days: the tear-off calendar
   -------------------------------------------------------------------------- */

/* Room before the gingham band that follows. */
[data-section="time"] {
  padding-bottom: clamp(64px, 12vw, 110px);
}

.calendar {
  position: relative;
  z-index: 26;
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 40px 20px 22px;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 6px 0 var(--ink);
  text-align: center;
}

.calendar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  border-bottom: 3px solid var(--ink);
  border-radius: 21px 21px 0 0;
  background: var(--accent);
}

.calendar__rings i {
  position: absolute;
  top: -14px;
  width: 14px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
}

.calendar__rings i:nth-child(1) { left: 28%; }
.calendar__rings i:nth-child(2) { right: 28%; }

.calendar__head {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.calendar__days {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(5rem, 26vw, 8rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent-pink);
  text-shadow: 0 5px 0 var(--tint-soft);
}

.calendar__unit {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  padding: 5px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
}

.chip b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chip--pink { background: var(--blush-soft); }
.chip--mint { background: var(--mint); }
.chip--butter { background: var(--butter); }

.calendar__since {
  margin: 14px 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.sticker-slot--calendar {
  top: -22px;
  right: -14px;
  rotate: 14deg;
}

.note-bubble {
  position: relative;
  max-width: 26rem;
  margin: 34px auto 0;
  padding: 14px 18px;
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.45;
  text-align: center;
}

.note-bubble b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Reasons: the capsule machine
   -------------------------------------------------------------------------- */

.gingham {
  padding-bottom: clamp(72px, 14vw, 120px);
  background:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--tint) 22%, transparent) 0 18px, transparent 18px 36px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--blush) 24%, transparent) 0 18px, transparent 18px 36px),
    var(--paper);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

/* --------------------------------------------------------------------------
   Memories: instant photos
   -------------------------------------------------------------------------- */

.instaxes {
  display: grid;
  justify-items: center;
  gap: 64px 32px;
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.instax {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.instax__card {
  position: relative;
  z-index: 26;
  width: min(72vw, 280px);
  margin: 0;
  padding: 14px 14px 54px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 6px 0 var(--ink);
  transform: rotate(var(--tilt, 0deg));
}

.instax--dots .instax__card {
  background: radial-gradient(circle, #fff 2.2px, transparent 2.8px) 0 0 / 14px 14px, var(--tint-soft);
}

.instax--gingham .instax__card {
  background:
    repeating-linear-gradient(0deg, rgba(108, 197, 156, 0.25) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(90deg, rgba(108, 197, 156, 0.25) 0 8px, transparent 8px 16px),
    #f3fbf7;
}

.instax--butter .instax__card {
  background: radial-gradient(circle, #fff 2.2px, transparent 2.8px) 0 0 / 14px 14px, var(--butter);
}

.instax--lilac .instax__card {
  background: radial-gradient(circle, #fff 2.2px, transparent 2.8px) 0 0 / 14px 14px, var(--lilac);
}

.instax__tape {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 2;
  width: 92px;
  height: 26px;
  margin-left: -46px;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.6) 0 6px, transparent 6px 12px), var(--tape, var(--tint-soft));
  opacity: 0.92;
  rotate: -4deg;
}

.instax__photo {
  position: relative;
  aspect-ratio: 46 / 62;
  max-width: 100%;
  overflow: hidden;
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  background: #fff;
}

.instax__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.instax__caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  overflow: hidden;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instax .sticker-slot {
  bottom: 26px;
  right: -18px;
  rotate: 12deg;
}

.instax__meta {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.instax__note {
  max-width: 26ch;
  margin: 0;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

/* "Devamı gelecek": the album's last page, with more pages stacked behind it. */
.soon {
  position: relative;
  z-index: 26;
  width: min(84vw, 360px);
  margin: 0 auto;
}

.instaxes:not([hidden]) + .soon,
.instaxes:not([hidden]) + .ticket {
  margin-top: 72px;
}

/* "İlk buluşmamız": a ticket for the day they first meet. A mask cuts the two notches
   at the perforation, and drop-shadows on the frame trace the ink outline around them. */
.ticket {
  position: relative;
  z-index: 26;
  width: min(88vw, 380px);
  margin: 0 auto 64px;
  rotate: -2deg;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ticket__frame {
  filter:
    drop-shadow(2.5px 0 0 var(--ink))
    drop-shadow(-2.5px 0 0 var(--ink))
    drop-shadow(0 2.5px 0 var(--ink))
    drop-shadow(0 -2.5px 0 var(--ink))
    drop-shadow(0 5px 0 var(--ink));
}

.ticket__shape {
  --cut: 71%;
  position: relative;
  display: grid;
  grid-template-columns: var(--cut) 1fr;
  border-radius: 16px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--tint) 35%, transparent) 1.4px, transparent 1.9px) 0 0 / 14px 14px,
    linear-gradient(90deg, var(--paper) var(--cut), var(--blush-soft) var(--cut));
  -webkit-mask:
    radial-gradient(circle 12px at var(--cut) 0, transparent 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 12px at var(--cut) 100%, transparent 97%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 12px at var(--cut) 0, transparent 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 12px at var(--cut) 100%, transparent 97%, #000) bottom / 100% 51% no-repeat;
}

/* The perforation between the ticket and its stub. */
.ticket__shape::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: var(--cut);
  border-left: 2.5px dashed color-mix(in srgb, var(--ink) 45%, transparent);
}

.ticket__main {
  padding: 16px 14px 18px 18px;
}

.ticket__kicker {
  display: flex;
  justify-content: space-between;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ticket__title {
  margin: 4px 0 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent-pink);
}

.ticket__rows {
  display: grid;
  gap: 4px;
  margin: 0;
}

.ticket__rows div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ticket__rows dt {
  flex: none;
  width: 4.6em;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ticket__rows dd {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ink);
}

.ticket__countdown {
  display: inline-block;
  margin: 10px 0 0;
  padding: 2px 12px 3px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--butter);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
}

.ticket__stub {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  padding: 14px 8px;
}

.ticket__stub-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ticket__stub-count {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.ticket__stub-heart {
  font-size: 1.3rem;
  line-height: 1;
  color: var(--accent-pink);
}

.ticket__body {
  position: relative;
}

/* In the empty lower corner of the ticket, just left of the perforation. */
.ticket__stamp {
  position: absolute;
  right: calc(29% + 8px);
  bottom: 5px;
  z-index: 2;
  padding: 2px 10px 3px;
  border: 3px solid var(--accent-pink);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-pink);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  rotate: -10deg;
}

/* The stamp thumps down a moment after the ticket arrives, and again on a tap. */
.has-motion .ticket.reveal .ticket__stamp {
  opacity: 0;
  scale: 1.8;
  transition: opacity 0.3s ease 0.8s, scale 0.45s var(--ease-back) 0.8s;
}

.has-motion .ticket.reveal.is-visible .ticket__stamp {
  opacity: 1;
  scale: 1;
}

.ticket.is-tapped .ticket__stamp {
  animation: stamp-thump 0.45s var(--ease-back);
}

.ticket__note {
  margin: 20px 0 0;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  text-align: center;
  color: var(--ink-soft);
  rotate: 2deg;
}

.soon__sheet {
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
}

.soon__sheet--far {
  background: var(--lilac);
  rotate: 6deg;
  translate: 12px 10px;
}

.soon__sheet--near {
  background: var(--blush-soft);
  rotate: -4deg;
  translate: -9px 6px;
}

.soon__page {
  position: relative;
  padding: 36px 24px 24px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background:
    repeating-linear-gradient(180deg, transparent 0 1.95em, color-mix(in srgb, var(--accent) 16%, transparent) 1.95em calc(1.95em + 2px)),
    var(--paper);
  box-shadow: 0 6px 0 var(--ink);
  rotate: -1deg;
  text-align: center;
}

.soon__tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 96px;
  height: 26px;
  margin-left: -48px;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.6) 0 6px, transparent 6px 12px), var(--mint);
  opacity: 0.92;
  rotate: 3deg;
}

/* One line, so the typing dots never drop below the words. */
.soon__title {
  margin: 0;
  white-space: nowrap;
  font-family: var(--font-hand);
  font-size: clamp(1.5rem, 7vw, 2.3rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent-pink);
}

/* Three dots that keep "typing", like a story still being written. */
.soon__dots i {
  display: inline-block;
  font-style: normal;
  animation: soon-dot 1.5s ease-in-out infinite;
}

.soon__dots i:nth-child(2) {
  animation-delay: 0.18s;
}

.soon__dots i:nth-child(3) {
  animation-delay: 0.36s;
}

.soon__text {
  margin: 10px 0 0;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink);
}

.soon__next {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 2px dashed color-mix(in srgb, var(--ink) 25%, transparent);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.soon__next-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.soon__next b {
  color: var(--accent);
}

.soon__badge {
  margin-top: 4px;
  padding: 2px 12px 3px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--butter);
  font-size: 0.85rem;
  font-weight: 700;
}

.sticker-slot--soon {
  right: -16px;
  bottom: -18px;
  width: clamp(54px, 15vw, 66px);
  rotate: 10deg;
}

@media (min-width: 760px) {
  .instaxes {
    grid-template-columns: 1fr 1fr;
  }

  .instax:nth-child(even) {
    margin-top: 70px;
  }
}

/* --------------------------------------------------------------------------
   Letter
   -------------------------------------------------------------------------- */

.letter-section {
  padding-bottom: clamp(24px, 6vw, 64px);
}

.envelope-wrap {
  display: grid;
  justify-items: center;
  gap: 20px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.envelope-wrap.is-gone {
  opacity: 0;
  transform: scale(0.96);
}

.envelope {
  position: relative;
  width: min(86vw, 400px);
  aspect-ratio: 1.55;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
}

.envelope > span {
  position: absolute;
  display: block;
}

.envelope__back {
  inset: 0;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--tint);
  box-shadow: 0 6px 0 var(--ink);
}

.envelope__paper {
  left: 8%;
  right: 8%;
  top: 8%;
  height: 78%;
  z-index: 2;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  background: repeating-linear-gradient(180deg, transparent 0 15px, color-mix(in srgb, var(--accent) 25%, transparent) 15px 17px) 0 22px / 100% 60% no-repeat, var(--paper);
  transition: transform 1s var(--ease-out) 0.55s;
}

.envelope__pocket {
  inset: 0;
  z-index: 3;
  border-radius: 14px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 2.4px, transparent 3px) 0 0 / 16px 16px, var(--blush-soft);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  border: 3px solid var(--ink);
}

.envelope__flap {
  left: 0;
  right: 0;
  top: 0;
  height: 60%;
  z-index: 4;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform 0.9s var(--ease-soft) 0.15s, z-index 0s linear 0.6s;
}

.envelope__flap-face {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.envelope__flap-face--outer {
  background: linear-gradient(180deg, var(--tint), var(--tint-deep));
}

.envelope__flap-face--inner {
  background: var(--paper);
  transform: rotateX(180deg);
}

.envelope__seal {
  left: 50%;
  top: 58%;
  z-index: 5;
  width: clamp(58px, 16vw, 74px);
  transform: translate(-50%, -50%);
  transition: transform 0.5s var(--ease-back), opacity 0.35s ease;
}

.envelope:hover .envelope__seal {
  transform: translate(-50%, -50%) scale(1.08) rotate(-8deg);
}

.envelope.is-opening .envelope__seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.4) rotate(-20deg);
}

.envelope.is-opening .envelope__flap {
  z-index: 1;
  transform: rotateX(180deg);
}

.envelope.is-opening .envelope__paper {
  transform: translateY(-42%);
}

.envelope__hint {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  animation: breathe 2.6s ease-in-out infinite;
}

.letter {
  position: relative;
  z-index: 26;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: clamp(34px, 8vw, 56px) clamp(22px, 7vw, 56px) clamp(34px, 8vw, 56px) clamp(34px, 9vw, 72px);
  border: 3px solid var(--ink);
  border-radius: 18px;
  background:
    linear-gradient(90deg, transparent 0 calc(clamp(34px, 9vw, 72px) - 12px), color-mix(in srgb, var(--accent-pink) 45%, transparent) calc(clamp(34px, 9vw, 72px) - 12px) calc(clamp(34px, 9vw, 72px) - 10px), transparent 0),
    repeating-linear-gradient(180deg, transparent 0 2.05em, color-mix(in srgb, var(--accent) 18%, transparent) 2.05em calc(2.05em + 2px)),
    var(--paper);
  box-shadow: 0 6px 0 var(--ink);
  font-family: var(--font-hand);
  font-size: clamp(1.15rem, 4.6vw, 1.3rem);
  line-height: 2.05em;
  transform-origin: 50% 0;
}

.letter.is-open {
  animation: unfold 0.9s var(--ease-back) both;
}

.letter p {
  margin: 0 0 1em;
}

.letter p.letter__signoff {
  margin: 1.4em 0 0;
}

.letter p.letter__signature {
  margin: 0;
  font-size: 1.5em;
  font-weight: 600;
  color: var(--accent);
}

.letter.is-open .letter__greeting,
.letter.is-open .letter__body > p,
.letter.is-open .letter__signoff,
.letter.is-open .letter__signature {
  animation: ink-in 1s var(--ease-soft) both;
  animation-delay: calc(0.5s + var(--i, 0) * 0.45s);
}

.sticker-slot--letter {
  top: -26px;
  right: -14px;
  width: clamp(64px, 18vw, 86px);
  rotate: 10deg;
}

/* --------------------------------------------------------------------------
   Finale: the bouquet
   -------------------------------------------------------------------------- */

.finale {
  position: relative;
  margin-top: clamp(64px, 12vw, 120px);
  padding-block: 30px 0;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg, transparent, var(--blush-soft) 34%, var(--tint-soft) 100%);
}

.bouquet {
  position: relative;
  width: min(84vw, 380px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.bouquet.is-pulsing {
  animation: pulse 0.6s var(--ease-back);
}

.bouquet__stems {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bouquet__flower {
  position: absolute;
  width: 52%;
  aspect-ratio: 1;
}

.bouquet__flower .lily {
  width: 100%;
  height: 100%;
}

.bouquet__flower--left { left: 2%; top: 22%; }
.bouquet__flower--right { right: 2%; top: 24%; }
.bouquet__flower--center { left: 22%; top: 2%; width: 56%; }

.bouquet__bow {
  position: absolute;
  left: 50%;
  top: 76%;
  width: 36%;
  transform: translate(-50%, -50%);
}

.bouquet__bow svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.finale__title {
  margin: 14px var(--pad-right) 0 var(--pad-left);
  font-size: clamp(2.8rem, 13vw, 5.4rem);
  line-height: 1.05;
}

.finale__line {
  max-width: 26ch;
  margin: 12px auto 0;
  padding-left: var(--pad-left);
  padding-right: var(--pad-right);
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--ink-soft);
}

.finale__stage {
  position: relative;
  display: inline-block;
  margin-top: 30px;
}

.finale__button {
  padding: 14px 26px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--accent-pink);
  box-shadow: 0 5px 0 var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.finale__button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.mascot--finale {
  right: calc(100% + 2px);
  bottom: -10px;
  width: 72px;
}

.mascot--finale .speech {
  bottom: 98%;
  left: 20%;
}

.footer {
  position: relative;
  margin-top: 40px;
  padding: 24px var(--pad-right) calc(80px + env(safe-area-inset-bottom, 0px)) var(--pad-left);
  border-top: 3px solid var(--ink);
  background: var(--tint);
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 1rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Sound toggle
   -------------------------------------------------------------------------- */

.sound-toggle {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease 2s;
}

.is-open .sound-toggle {
  opacity: 1;
  pointer-events: auto;
}

.sound-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-toggle__speaker {
  fill: var(--accent-pink);
}

.sound-toggle__mute,
.sound-toggle.is-muted .sound-toggle__waves {
  display: none;
}

.sound-toggle.is-muted .sound-toggle__mute {
  display: inline;
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes gift-wiggle {
  0%, 80%, 100% { transform: rotate(0deg); }
  85% { transform: rotate(-5deg); }
  90% { transform: rotate(5deg); }
  95% { transform: rotate(-3deg); }
}

@keyframes bow-untie {
  to { opacity: 0; transform: scale(0.2) rotate(45deg); }
}

@keyframes lid-off {
  to { opacity: 0; transform: translate(70px, -150px) rotate(30deg); }
}

@keyframes stamp-thump {
  from { scale: 1.6; }
  to { scale: 1; }
}

@keyframes soon-dot {
  0%, 60%, 100% { translate: 0 0; opacity: 0.35; }
  30% { translate: 0 -6px; opacity: 1; }
}

@keyframes drift-float {
  from { translate: 0 -7px; rotate: -7deg; }
  to { translate: 0 7px; rotate: 7deg; }
}

@keyframes lili-sway {
  from { transform: rotate(-3deg); }
  to { transform: rotate(3deg); }
}

@keyframes lili-wave {
  from { transform: rotate(8deg); }
  to { transform: rotate(-16deg); }
}

@keyframes friend-bob {
  from { translate: 0 0; rotate: -2deg; }
  to { translate: 0 -6px; rotate: 2deg; }
}

@keyframes lili-hop {
  0%, 100% { translate: 0 0; }
  40% { translate: 0 -10px; }
}

@keyframes unfold {
  from { opacity: 0; transform: translateY(-16px) scaleY(0.88); }
  to { opacity: 1; transform: none; }
}

@keyframes ink-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes pulse {
  0% { scale: 1; }
  35% { scale: 1.06; }
  100% { scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.3s !important;
    transition-delay: 0s !important;
  }

  .reveal {
    transform: none;
  }
}
