/* ==========================================================================
   Birthday Surprise — main experience
   Colors come from the theme (set as CSS variables by themes.js).
   ========================================================================== */

:root {
  --background: #14070f; --background-rgb: 20 7 15;
  --primary: #ff5c8a;    --primary-rgb: 255 92 138;
  --secondary: #ffb38a;  --secondary-rgb: 255 179 138;
  --accent: #ffd36e;     --accent-rgb: 255 211 110;
  --text: #fff3f6;       --text-rgb: 255 243 246;
  --script: 'Great Vibes', cursive;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Outfit', system-ui, sans-serif;
  --glass: rgb(var(--text-rgb) / 0.06);
  --glass-strong: rgb(var(--text-rgb) / 0.1);
  --line: rgb(var(--text-rgb) / 0.14);
  --muted: rgb(var(--text-rgb) / 0.68);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 30px 80px -20px rgb(0 0 0 / 0.55);
}

[data-tone='light'] {
  --shadow: 0 30px 70px -25px rgb(var(--primary-rgb) / 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-weight: 300;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 15% 10%, rgb(var(--primary-rgb) / 0.18), transparent 60%),
    radial-gradient(900px 700px at 85% 90%, rgb(var(--secondary-rgb) / 0.14), transparent 60%),
    var(--background);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-intro { overflow: hidden; }
body.gift-hover { cursor: pointer; }

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.script { font-family: var(--script); font-weight: 400; }

/* ---------- layers ---------- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgb(var(--background-rgb) / 0.85) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--background); transition: opacity 0.9s var(--ease), visibility 0.9s;
  letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.72rem; color: var(--muted);
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-orbit { position: relative; width: 72px; height: 72px; }
.loader-orbit span {
  position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent;
  border-top-color: var(--primary); animation: spin 1.4s var(--ease) infinite;
}
.loader-orbit span:nth-child(2) { inset: 10px; border-top-color: var(--accent); animation-duration: 1.9s; animation-direction: reverse; }
.loader-orbit span:nth-child(3) { inset: 22px; border-top-color: var(--secondary); animation-duration: 1.1s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shared bits ---------- */
.eyebrow {
  margin: 0; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.38em; text-transform: uppercase; color: var(--secondary);
}
.hint { margin: 0; font-size: 0.82rem; color: var(--muted); letter-spacing: 0.06em; }
.hint.center { text-align: center; margin-top: 18px; }

.cta {
  position: relative; isolation: isolate; border: 0; cursor: pointer; padding: 18px 44px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: #fff;
  background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--accent)));
  box-shadow: 0 18px 50px -12px rgb(var(--primary-rgb) / 0.75), inset 0 1px 0 rgb(255 255 255 / 0.35);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  pointer-events: auto;
}
.cta:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 24px 60px -10px rgb(var(--primary-rgb) / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.4); }
.cta:active { transform: translateY(0) scale(0.98); }
.cta:disabled { opacity: 0.55; cursor: default; transform: none; }
.cta-glow {
  position: absolute; inset: -3px; z-index: -1; border-radius: inherit; filter: blur(14px); opacity: 0.7;
  background: conic-gradient(from var(--a, 0deg), var(--primary), var(--accent), var(--secondary), var(--primary));
  animation: rotate-glow 4s linear infinite;
}
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes rotate-glow { to { --a: 360deg; } }

.ghost-btn {
  cursor: pointer; padding: 12px 22px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
  color: var(--text); font-size: 0.86rem; letter-spacing: 0.04em; backdrop-filter: blur(10px);
  transition: background 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.ghost-btn:hover { background: var(--glass-strong); border-color: rgb(var(--primary-rgb) / 0.6); transform: translateY(-2px); }

.glass {
  background: linear-gradient(145deg, rgb(var(--text-rgb) / 0.09), rgb(var(--text-rgb) / 0.03));
  border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

/* ---------- intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: clamp(28px, 7vh, 72px) 20px clamp(32px, 8vh, 80px); text-align: center; pointer-events: none;
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
}
.intro.leaving { opacity: 0; transform: scale(1.08); filter: blur(8px); }
.intro-top { display: grid; gap: 16px; max-width: 760px; animation: rise 1.4s var(--ease) both 0.3s; }
.intro-title {
  margin: 0; font-family: var(--serif); font-weight: 500; font-style: italic; line-height: 1.15;
  font-size: clamp(1.7rem, 4.4vw, 3.2rem);
  background: linear-gradient(180deg, var(--text), rgb(var(--text-rgb) / 0.65)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro-bottom { display: grid; gap: 14px; justify-items: center; animation: rise 1.4s var(--ease) both 0.8s; }

.countdown { pointer-events: auto; animation: rise 1.2s var(--ease) both 0.6s; }
.countdown-label { margin: 0 0 14px; font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.countdown-grid { display: flex; gap: clamp(8px, 2vw, 18px); justify-content: center; }
.countdown-grid div {
  min-width: clamp(64px, 16vw, 104px); padding: 16px 10px 12px; border-radius: 18px; display: grid; gap: 4px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px);
}
.countdown-grid strong { font-family: var(--serif); font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown-grid span { font-size: 0.66rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted); }

@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* ---------- experience ---------- */
.experience { position: relative; z-index: 5; }

.hero {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 100px 20px 120px; text-align: center; position: relative;
}
.hero-photo {
  margin: 0 0 10px; width: clamp(130px, 22vw, 190px); aspect-ratio: 1; border-radius: 50%; position: relative;
  opacity: 0; transform: scale(0.6) rotate(-10deg); transition: opacity 1.2s var(--ease) 0.2s, transform 1.4s var(--ease) 0.2s;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid rgb(var(--text-rgb) / 0.9); position: relative; z-index: 1; }
.hero-photo-ring {
  position: absolute; inset: -12px; border-radius: 50%;
  background: conic-gradient(from var(--a), var(--primary), var(--accent), var(--secondary), var(--primary));
  animation: rotate-glow 5s linear infinite; filter: blur(2px);
}
.hero-photo-ring::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--background); }
/* Square frame, when her photo was cropped as a square in the admin. */
.hero-photo.square img { border-radius: 28px; }
.hero-photo.square .hero-photo-ring { border-radius: 38px; }
.hero-photo.square .hero-photo-ring::after { border-radius: 32px; }

.headline {
  margin: 0; font-family: var(--serif); font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; line-height: 0.95;
  font-size: clamp(2.6rem, 10vw, 8.5rem); perspective: 800px; color: var(--text);
}
.headline .word { display: inline-block; white-space: nowrap; margin: 0 0.12em; }
.headline .char {
  display: inline-block; opacity: 0; transform-origin: 50% 100%;
  transform: translateY(0.6em) rotateX(-95deg);
  text-shadow:
    0 1px 0 color-mix(in srgb, var(--primary) 80%, black),
    0 2px 0 color-mix(in srgb, var(--primary) 72%, black),
    0 3px 0 color-mix(in srgb, var(--primary) 64%, black),
    0 4px 0 color-mix(in srgb, var(--primary) 56%, black),
    0 5px 0 color-mix(in srgb, var(--primary) 48%, black),
    0 6px 0 color-mix(in srgb, var(--primary) 40%, black),
    0 10px 18px rgb(0 0 0 / 0.45),
    0 0 50px rgb(var(--primary-rgb) / 0.55);
}
.revealed .headline .char { animation: char-in 1.1s var(--ease) both; animation-delay: calc(var(--i) * 55ms + 150ms); }
@keyframes char-in {
  0% { opacity: 0; transform: translateY(0.6em) rotateX(-95deg); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

.her-name {
  margin: -0.1em 0 0; font-size: clamp(3.2rem, 11vw, 9rem); line-height: 1.1; padding: 0 0.2em;
  background: linear-gradient(100deg, var(--secondary) 0%, var(--accent) 25%, #fff 40%, var(--primary) 60%, var(--secondary) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgb(var(--primary-rgb) / 0.45));
  opacity: 0; transform: scale(0.85); transition: opacity 1.4s var(--ease) 1.1s, transform 1.6s var(--ease) 1.1s;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: -250% 0; } }

.subtitle { margin: 0; max-width: 620px; font-size: clamp(1rem, 1.8vw, 1.25rem); line-height: 1.7; color: var(--muted); }

.age-badge {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 10px 22px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px);
}
.age-badge span { font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.age-badge strong { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); }

.reveal-up { opacity: 0; transform: translateY(24px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.revealed .reveal-up { opacity: 1; transform: none; }
.revealed .eyebrow.reveal-up { transition-delay: 0.1s; }
.revealed .subtitle { transition-delay: 1.8s; }
.revealed .age-badge { transition-delay: 2.1s; }
.revealed .her-name { opacity: 1; transform: none; }
.revealed .hero-photo { opacity: 1; transform: none; }

.scroll-cue {
  position: absolute; bottom: 32px; left: 50%; width: 26px; height: 42px; margin-left: -13px; border-radius: 14px;
  border: 1.5px solid rgb(var(--text-rgb) / 0.45); opacity: 0; transition: opacity 1s 2.6s;
}
.revealed .scroll-cue { opacity: 1; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--text); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- sections ---------- */
.section { position: relative; max-width: 1180px; margin: 0 auto; padding: clamp(80px, 14vh, 150px) 20px; }
.section-head { text-align: center; margin-bottom: clamp(40px, 7vh, 72px); display: grid; gap: 10px; justify-items: center; }
.kicker {
  font-family: var(--serif); font-size: clamp(3rem, 7vw, 5rem); font-weight: 900; line-height: 1; color: transparent;
  -webkit-text-stroke: 1px rgb(var(--primary-rgb) / 0.7); letter-spacing: 0.05em;
}
.section-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: 1.15; max-width: 820px; }
.section-sub { margin: 0; color: var(--muted); font-size: 1rem; }

.reveal { opacity: 0; transform: translateY(50px) scale(0.97); transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* tilt (mouse-follow 3D) */
.tilt { transform-style: preserve-3d; transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.5s var(--ease); }
.tilt:hover { transition: transform 0.12s linear; }

/* ---------- letter ---------- */
.letter-card {
  position: relative; max-width: 820px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) clamp(24px, 6vw, 80px) clamp(32px, 5vw, 56px);
  border-radius: 28px; overflow: hidden;
  background:
    radial-gradient(600px 300px at 100% 0%, rgb(var(--primary-rgb) / 0.16), transparent 70%),
    linear-gradient(160deg, rgb(var(--text-rgb) / 0.1), rgb(var(--text-rgb) / 0.03));
  border: 1px solid var(--line); backdrop-filter: blur(20px); box-shadow: var(--shadow);
}
.letter-card::before {
  content: ''; position: absolute; inset: 14px; border-radius: 18px; border: 1px dashed rgb(var(--accent-rgb) / 0.3); pointer-events: none;
}
.letter-seal {
  position: absolute; top: 22px; right: 26px; width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--primary) 60%, white), var(--primary) 50%, color-mix(in srgb, var(--primary) 50%, black));
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.35), inset 0 -3px 6px rgb(0 0 0 / 0.25);
  transform: translateZ(40px) rotate(-12deg);
}
.letter-seal::after {
  content: ''; position: absolute; inset: 17px; background: rgb(255 255 255 / 0.85);
  clip-path: path('M12 21s-7.5-4.6-10-9.4C.3 8.3 2.3 4 6.2 4c2.2 0 3.6 1.2 4.6 2.6l1.2 1.6 1.2-1.6C14.2 5.2 15.6 4 17.8 4c3.9 0 5.9 4.3 4.2 7.6C19.5 16.4 12 21 12 21z');
}
.letter-body { font-family: var(--serif); font-size: clamp(1.05rem, 1.7vw, 1.28rem); line-height: 1.95; min-height: 8em; white-space: pre-wrap; }
.letter-body .caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; background: var(--primary); vertical-align: -0.15em; animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.letter-sign { margin: 32px 0 0; text-align: right; display: grid; gap: 4px; justify-items: end; }
.letter-sign span { font-size: 0.8rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted); }
.letter-sign strong { font-size: clamp(2rem, 4vw, 2.8rem); color: var(--accent); font-weight: 400; }
.letter-skip { margin-top: 16px; background: none; border: 0; color: var(--muted); font-size: 0.8rem; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; position: relative; max-width: 1040px; }
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: linear-gradient(to bottom, transparent, rgb(var(--primary-rgb) / 0.8) 8%, rgb(var(--accent-rgb) / 0.8) 92%, transparent);
}
.tl-item { position: relative; width: 50%; padding: 0 56px 72px 0; }
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 72px 56px; }
.tl-item::after {
  content: ''; position: absolute; top: 34px; right: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 6px rgb(var(--accent-rgb) / 0.18), 0 0 30px var(--accent);
}
.tl-item:nth-child(even)::after { right: auto; left: -9px; }
.tl-card { border-radius: var(--radius); overflow: hidden; }
.tl-media { aspect-ratio: 16 / 10; overflow: hidden; position: relative; transform: translateZ(30px); }
.tl-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
/* A photo keeps the shape it was cropped to (landscape, square, portrait…). */
.tl-media:has(img) { aspect-ratio: auto; }
.tl-media:has(img) img { height: auto; max-height: 78vh; }
.tl-card:hover .tl-media img { transform: scale(1.06); }
.tl-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--script); font-size: 5rem; color: rgb(255 255 255 / 0.9);
  background: linear-gradient(135deg, var(--primary), var(--secondary) 60%, var(--accent));
}
.tl-body { padding: 24px 26px 28px; transform: translateZ(20px); }
.tl-date {
  display: inline-block; padding: 5px 14px; margin-bottom: 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); background: rgb(var(--accent-rgb) / 0.12); border: 1px solid rgb(var(--accent-rgb) / 0.3);
}
.tl-body h3 { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: 1.55rem; }
.tl-body p { margin: 0; color: var(--muted); line-height: 1.75; white-space: pre-wrap; }

/* ---------- gallery ring ---------- */
.ring-stage { --card-w: clamp(170px, 22vw, 240px); height: calc(var(--card-w) * 1.6); perspective: 1600px; display: grid; place-items: center; cursor: grab; touch-action: pan-y; user-select: none; }
.ring-stage.dragging { cursor: grabbing; }
.ring { --r: 400px; position: relative; width: var(--card-w); height: calc(var(--card-w) * 4 / 3); transform-style: preserve-3d; } /* 3:4, the default gallery crop */
.ring-item {
  position: absolute; inset: 0; margin: 0; border-radius: 18px; overflow: hidden; backface-visibility: hidden;
  border: 1px solid var(--line); box-shadow: 0 20px 50px -10px rgb(0 0 0 / 0.6); background: var(--glass);
  transition: box-shadow 0.4s;
}
.ring-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ring-item figcaption {
  position: absolute; inset: auto 0 0; padding: 30px 14px 12px; font-size: 0.85rem; color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.7));
}
.ring-item:hover { box-shadow: 0 0 0 2px var(--primary), 0 20px 60px -10px rgb(var(--primary-rgb) / 0.7); }
.ring-stage.few { height: auto; perspective: none; cursor: default; }
.ring-stage.few .ring { width: auto; height: auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; transform: none !important; }
.ring-stage.few .ring-item { position: relative; inset: auto; width: var(--card-w); aspect-ratio: 3 / 4; cursor: pointer; }
.ring-stage.few .ring-item:nth-child(odd) { transform: rotate(-4deg); }
.ring-stage.few .ring-item:nth-child(even) { transform: rotate(4deg) translateY(16px); }

/* ---------- reasons flip cards ---------- */
.reasons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.reason { perspective: 1000px; height: 250px; cursor: pointer; border: 0; padding: 0; background: none; text-align: left; }
.reason-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.9s var(--ease); }
.reason.flipped .reason-inner { transform: rotateY(180deg); }
.reason-face {
  position: absolute; inset: 0; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 24px;
}
.reason-front {
  background: linear-gradient(150deg, rgb(var(--primary-rgb) / 0.32), rgb(var(--secondary-rgb) / 0.12));
  border: 1px solid rgb(var(--primary-rgb) / 0.35); backdrop-filter: blur(12px);
}
.reason-front .num { font-family: var(--serif); font-size: 3.6rem; font-weight: 900; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--text); }
.reason-front .title { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.reason-front .tap { font-size: 0.72rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted); }
.reason-back {
  transform: rotateY(180deg); justify-content: center; text-align: center;
  background: linear-gradient(150deg, var(--primary), color-mix(in srgb, var(--primary) 50%, var(--accent)));
  color: #fff; font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; box-shadow: var(--shadow);
}

/* ---------- wishes / balloons ---------- */
.balloon-field { position: relative; height: clamp(360px, 52vh, 480px); margin: 0 auto; max-width: 1000px; }
.balloon {
  --c: var(--primary);
  position: absolute; bottom: 0; width: clamp(84px, 11vw, 120px); aspect-ratio: 0.82; border: 0; padding: 0; cursor: pointer; background: none;
  animation: bob var(--dur, 5s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s);
  transition: transform 0.3s var(--ease);
}
.balloon:hover { --hover: -8px; }
.balloon-body {
  position: absolute; inset: 0; border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  background:
    radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.75) 0 6%, rgb(255 255 255 / 0.15) 14%, transparent 30%),
    radial-gradient(circle at 70% 75%, rgb(0 0 0 / 0.25), transparent 55%),
    var(--c);
  box-shadow: inset -10px -14px 24px rgb(0 0 0 / 0.2), 0 20px 40px -12px color-mix(in srgb, var(--c) 70%, transparent);
  display: grid; place-items: center; padding: 14px; text-align: center;
  font-family: var(--serif); font-weight: 700; font-size: 0.86rem; line-height: 1.2; color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
}
.balloon-body::after {
  content: ''; position: absolute; bottom: -9px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-bottom: 0;
  border-top: 11px solid color-mix(in srgb, var(--c) 80%, black);
}
.balloon-string {
  position: absolute; top: 100%; left: 50%; width: 2px; height: 90px; margin-top: 10px;
  background: linear-gradient(rgb(var(--text-rgb) / 0.6), transparent); transform-origin: top; animation: sway 3s ease-in-out infinite alternate;
}
@keyframes bob { from { transform: translateY(var(--y0, -140px)) rotate(-4deg); } to { transform: translateY(calc(var(--y0, -140px) - 26px)) rotate(4deg); } }
@keyframes sway { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.balloon.popped { animation: pop 0.35s var(--ease) forwards; pointer-events: none; }
@keyframes pop { 0% { transform: translateY(var(--y0)) scale(1); opacity: 1; } 50% { transform: translateY(var(--y0)) scale(1.35); opacity: 0.9; } 100% { transform: translateY(var(--y0)) scale(0.2); opacity: 0; } }

.pop-counter { text-align: center; margin: 10px 0 30px; color: var(--muted); letter-spacing: 0.12em; font-size: 0.85rem; text-transform: uppercase; }
.wish-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.wish-card {
  position: relative; border-radius: var(--radius); padding: 26px; display: grid; gap: 14px; align-content: start;
  animation: card-in 0.9s var(--ease) both;
}
.wish-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: var(--c, var(--primary)); }
@keyframes card-in { from { opacity: 0; transform: perspective(900px) rotateX(-30deg) translateY(40px); } to { opacity: 1; transform: none; } }
.wish-head { display: flex; align-items: center; gap: 14px; }
.wish-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center;
  background: var(--c, var(--primary)); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; border: 2px solid rgb(var(--text-rgb) / 0.25);
}
.wish-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wish-head strong { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.wish-head span { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.wish-card p { margin: 0; line-height: 1.75; color: rgb(var(--text-rgb) / 0.88); white-space: pre-wrap; }

/* ---------- cake ---------- */
.cake-stage { display: grid; place-items: center; padding: 70px 0 30px; perspective: 1000px; }
.cake { position: relative; width: min(340px, 80vw); display: grid; justify-items: center; transform: rotateX(8deg); }
.tier { position: relative; border-radius: 14px 14px 18px 18px / 10px 10px 18px 18px; box-shadow: inset 0 -18px 30px rgb(0 0 0 / 0.18), 0 10px 20px -8px rgb(0 0 0 / 0.4); }
.tier::before {
  content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 28px; border-radius: 50%;
  background: color-mix(in srgb, var(--secondary) 75%, white); box-shadow: inset 0 -4px 8px rgb(0 0 0 / 0.08);
}
.tier-top { width: 52%; height: 64px; background: linear-gradient(90deg, color-mix(in srgb, var(--secondary) 80%, black), var(--secondary) 40%, color-mix(in srgb, var(--secondary) 85%, black)); z-index: 3; }
.tier-mid { width: 76%; height: 76px; margin-top: -4px; background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 75%, black), var(--primary) 40%, color-mix(in srgb, var(--primary) 80%, black)); z-index: 2; }
.tier-mid::before { background: color-mix(in srgb, var(--primary) 70%, white); }
.tier-base { width: 100%; height: 88px; margin-top: -4px; background: linear-gradient(90deg, color-mix(in srgb, var(--secondary) 70%, black), color-mix(in srgb, var(--secondary) 90%, white) 40%, color-mix(in srgb, var(--secondary) 75%, black)); z-index: 1; }
.drip {
  position: absolute; left: 0; right: 0; top: 4px; height: 22px;
  background: radial-gradient(circle at 10px 0, rgb(255 255 255 / 0.9) 9px, transparent 10px) 0 0 / 34px 22px repeat-x;
  opacity: 0.85;
}
.tier-mid .drip { background-image: radial-gradient(circle at 12px 0, color-mix(in srgb, var(--accent) 80%, white) 10px, transparent 11px); background-size: 40px 24px; }
.plate { width: 118%; height: 26px; margin-top: -12px; border-radius: 50%; background: linear-gradient(rgb(var(--text-rgb) / 0.75), rgb(var(--text-rgb) / 0.35)); box-shadow: 0 18px 40px -8px rgb(0 0 0 / 0.55); }
.candles { position: absolute; bottom: calc(100% - 14px); left: 50%; transform: translateX(-50%); display: flex; gap: 12px; z-index: 5; width: 52%; justify-content: center; flex-wrap: wrap-reverse; }
.candle {
  position: relative; width: 11px; height: 54px; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, #fff 0 6px, var(--primary) 6px 12px); box-shadow: inset -2px 0 3px rgb(0 0 0 / 0.2);
}
.candle::before { content: ''; position: absolute; top: -8px; left: 50%; width: 2px; height: 9px; margin-left: -1px; background: #3a2a1a; border-radius: 1px; }
.flame {
  position: absolute; bottom: calc(100% + 6px); left: 50%; width: 14px; height: 26px; margin-left: -7px; border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 80%, #fff 0 18%, #ffe27a 30%, #ff9a3c 60%, rgb(255 80 40 / 0) 75%);
  box-shadow: 0 0 22px 8px rgb(255 190 80 / 0.55), 0 0 60px 20px rgb(255 150 60 / 0.25);
  transform-origin: 50% 90%; animation: flicker 0.18s ease-in-out infinite alternate;
  transition: opacity 0.4s, transform 0.4s;
}
@keyframes flicker { from { transform: scale(1, 1) rotate(-2deg); } to { transform: scale(0.94, 1.08) rotate(2deg); } }
.candle.out .flame { opacity: 0; transform: scale(0.2, 0.5) translateY(6px); animation: none; }
.smoke {
  position: absolute; bottom: calc(100% + 8px); left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: rgb(var(--text-rgb) / 0.35); filter: blur(3px); animation: smoke 1.8s ease-out forwards;
}
@keyframes smoke { to { transform: translate(var(--sx, 10px), -90px) scale(4); opacity: 0; } }
.cake-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 30px; }
.mic-listening { border-color: var(--primary) !important; box-shadow: 0 0 0 4px rgb(var(--primary-rgb) / 0.25); }

/* ---------- finale ---------- */
.finale { position: relative; z-index: 5; min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 80px 20px 120px; text-align: center; }
.finale-line { margin: 0; max-width: 760px; font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 3.4vw, 2.4rem); line-height: 1.5; }
.finale-from { margin: 0 0 24px; font-size: clamp(2.4rem, 6vw, 4rem); color: var(--accent); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 30px;
  background: rgb(var(--background-rgb) / 0.88); backdrop-filter: blur(16px); animation: fade 0.4s var(--ease);
}
.lightbox figure { margin: 0; max-width: min(1100px, 92vw); display: grid; gap: 14px; animation: zoom 0.5s var(--ease); }
.lightbox img { max-height: 78vh; width: auto; margin: 0 auto; border-radius: 16px; box-shadow: var(--shadow); }
.lightbox figcaption { text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.1rem; }
.lightbox-close { position: absolute; top: 20px; right: 20px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; letter-spacing: 0.1em; font-size: 0.8rem; text-transform: uppercase; }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom { from { opacity: 0; transform: scale(0.92); } }

/* ---------- sound toggle ---------- */
.sound-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); cursor: pointer;
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; animation: rise 0.8s var(--ease);
}
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--primary); animation: eq 0.9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -0.3s; } .eq i:nth-child(3) { animation-delay: -0.6s; } .eq i:nth-child(4) { animation-delay: -0.15s; }
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
.sound-toggle[aria-pressed='false'] .eq i { animation: none; transform: scaleY(0.25); background: var(--muted); }

/* ---------- toast-like note ---------- */
.float-note {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translateX(-50%); padding: 12px 22px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--line); backdrop-filter: blur(14px); font-size: 0.9rem; animation: rise 0.5s var(--ease);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .timeline::before { left: 18px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 52px 48px; }
  .tl-item::after, .tl-item:nth-child(even)::after { left: 9px; right: auto; }
  .reason { height: 210px; }
  .sound-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.2s !important; }
  .grain { display: none; }
}
