:root {
  --sky1: #93d6ff;
  --sky2: #d9f1ff;
  --snow: #ffffff;
  --blush: #fff3f8;
  --lemon: #fff2bf;
  --ink: #2f3c8f;          /* blueberry, our "black" */
  --ink-soft: #5864ad;
  --pink: #ff5fa2;
  --pink-d: #d93d80;
  --yellow: #ffc93c;
  --blue: #2fa8ff;
  --mint: #3ccf9a;
  --orange: #ff8a3d;
  --grape: #8b6cff;
  --kibble: #a0673a;
  --display: "Bagel Fat One", "Nunito", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, sans-serif;
  --hand: "Gochi Hand", "Nunito", cursive;
  --gut: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --side: clamp(16px, 5vw, 72px);
  --snow-top: 82%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blush);
  color: var(--ink);
  font: 700 15px/1.55 var(--body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--pink); color: #fff; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
button { font: inherit; color: inherit; }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }

/* ---------- top bar ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 6;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: calc(max(0px, env(safe-area-inset-top)) + clamp(50px, 6.4vw, 84px)) var(--side) 0;
}
.mark {
  text-decoration: none; font-weight: 900; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
}
.top nav { display: flex; gap: 4px; background: rgba(255,255,255,.7); padding: 4px; border-radius: 999px; box-shadow: 0 2px 0 rgba(47,60,143,.12); }
.top nav a {
  text-decoration: none; font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  transition: background .2s, color .2s, transform .2s;
}
.top nav a:hover { background: var(--pink); color: #fff; transform: rotate(-3deg); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: max(660px, 100svh);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto auto auto auto 1.25fr;
  padding: 150px var(--side) 40px;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) calc(var(--snow-top) - 2px), var(--snow) var(--snow-top), var(--blush) 100%);
}
.headline, .sub, .cta, .ig, .stats { grid-column: 1; position: relative; z-index: 3; }
.headline { grid-row: 2; }
.sub { grid-row: 3; }
.cta { grid-row: 4; }
.ig { grid-row: 5; }
.stats { grid-row: 6; }

.sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sun {
  position: absolute; right: 16%; top: 18%; width: clamp(160px, 22vw, 320px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff7c8 0 38%, rgba(255,233,140,.55) 39% 56%, rgba(255,233,140,0) 72%);
  animation: sun 9s ease-in-out infinite alternate;
}
@keyframes sun { to { transform: scale(1.06) rotate(8deg); } }
.cloud {
  position: absolute; width: 150px; height: 44px; background: #fff; border-radius: 999px; opacity: .9;
  box-shadow: 0 3px 0 rgba(47,60,143,.08);
  animation: drift 60s linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 64px; height: 64px; left: 22px; top: -30px; }
.cloud::after { width: 48px; height: 48px; left: 74px; top: -20px; }
.c1 { top: 16%; left: 4%; transform: scale(.8); animation-duration: 70s; }
.c2 { top: 9%; left: 46%; transform: scale(.6); animation-duration: 90s; animation-delay: -30s; }
.c3 { top: 30%; left: 70%; transform: scale(1); animation-duration: 80s; animation-delay: -50s; }
@keyframes drift { from { translate: -20vw 0; } to { translate: 120vw 0; } }

.bunting { position: absolute; top: 0; left: 0; width: 100%; height: clamp(54px, 7vw, 90px); z-index: 1; pointer-events: none; }
.bunting .flags path { transform-box: fill-box; transform-origin: 50% 0; animation: flag 2.6s ease-in-out infinite alternate; }
@keyframes flag { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }

.balloons { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.balloon {
  position: absolute; width: 58px; pointer-events: auto; cursor: pointer; border: 0; background: none; padding: 0;
  animation: bob var(--bd, 5s) ease-in-out var(--bdel, 0s) infinite alternate;
  -webkit-tap-highlight-color: transparent;
}
.balloon svg { display: block; width: 100%; height: auto; overflow: visible; }
.balloon.popped { animation: pop .22s ease-out forwards; pointer-events: none; }
.balloon.rise { animation: rise 1.6s cubic-bezier(.2,.8,.3,1) both, bob var(--bd, 5s) ease-in-out 1.6s infinite alternate; }
@keyframes bob { from { transform: translateY(-8px) rotate(-4deg); } to { transform: translateY(10px) rotate(4deg); } }
@keyframes pop { to { transform: scale(1.6); opacity: 0; } }
@keyframes rise { from { transform: translateY(60vh); opacity: 0; } to { transform: none; opacity: 1; } }

.headline {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(54px, 8.4vw, 124px);
  line-height: .9;
  letter-spacing: .005em;
  white-space: nowrap;
  filter: drop-shadow(0 5px 0 var(--ink));
}
.hl { display: block; }
.ch {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: .13em #fff;
  paint-order: stroke fill;
  transform-origin: 50% 80%;
  animation: in .55s cubic-bezier(.3,1.6,.5,1) both, wave 2.8s ease-in-out infinite;
  animation-delay: var(--d), calc(var(--d) + .8s);
}
.ch.sp { width: .25em; }
@keyframes in { from { transform: translateY(.6em) scale(.2) rotate(-25deg); opacity: 0; } }
@keyframes wave { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-.05em) rotate(var(--r, 2deg)); } }
.ch.jump { animation: jump .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes jump { 40% { transform: translateY(-.25em) rotate(-10deg) scale(1.1); } }

.sub { margin: 22px 0 0; max-width: 40ch; font-size: clamp(15px, 1.2vw, 17px); font-weight: 700; color: var(--ink-soft); }

.cta { display: flex; align-items: center; gap: 18px; margin-top: 24px; flex-wrap: wrap; }
.btn {
  -webkit-appearance: none; appearance: none; border: 0; cursor: pointer;
  background: var(--pink); color: #fff;
  font: 900 17px/1 var(--body); letter-spacing: .01em;
  height: 54px; padding: 0 28px; border-radius: 999px;
  box-shadow: 0 6px 0 var(--pink-d), 0 14px 24px -10px rgba(217,61,128,.6);
  transition: transform .1s ease, box-shadow .1s ease;
  touch-action: manipulation;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn .spark { display: inline-block; color: var(--yellow); animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn:hover { transform: translateY(-2px) rotate(-2deg); box-shadow: 0 8px 0 var(--pink-d), 0 18px 26px -10px rgba(217,61,128,.6); }
.btn:active, .btn.press { transform: translateY(6px); box-shadow: 0 0 0 var(--pink-d), 0 6px 12px -8px rgba(217,61,128,.6); }
.btn.press { animation: squish .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes squish { 30% { transform: translateY(6px) scale(1.08, .9); } 100% { transform: none; } }
.link {
  text-decoration: none; font-weight: 900; font-size: 15px;
  display: inline-flex; align-items: center; min-height: 44px;
  background-image: linear-gradient(var(--yellow), var(--yellow)); background-size: 100% 6px; background-position: 0 85%; background-repeat: no-repeat;
  transition: background-size .2s;
}
.link:hover { background-size: 100% 40%; }

.ig {
  justify-self: start;
  margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  text-decoration: none; font-size: 14px; font-weight: 700; color: var(--ink);
}
.ig svg { width: 22px; height: 22px; fill: none; stroke: var(--pink); stroke-width: 2.2; }
.ig svg .dot { fill: var(--pink); stroke: none; }
.ig b { font-weight: 900; }
.ig:hover b { color: var(--pink); }

.stats { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip { background: rgba(255,255,255,.85); border-radius: 999px; padding: 6px 12px; box-shadow: 0 2px 0 rgba(47,60,143,.12); }
.bump { display: inline-block; animation: bump .4s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 40% { transform: scale(1.35); color: var(--pink); } }

/* play area: desktop = whole hero (Lumi lives in the right half), mobile = its own block */
.play { position: absolute; inset: 0; z-index: 2; touch-action: manipulation; pointer-events: none; }
.play canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: auto; -webkit-tap-highlight-color: transparent; }

.bubble {
  position: absolute; left: 0; top: 0; z-index: 3;
  --tail: 50%;
  background: #fff; color: var(--ink);
  font: 800 14px/1.3 var(--body);
  padding: 9px 14px;
  border: 3px solid var(--ink); border-radius: 16px;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 0 var(--ink);
  will-change: transform;
}
.bubble::after {
  content: ""; position: absolute; top: 100%; left: var(--tail);
  width: 14px; height: 14px; background: #fff;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  transform: translate(-50%, -6px) rotate(45deg); border-bottom-right-radius: 4px;
}
.bubble.pop { animation: bpop .3s cubic-bezier(.3,1.7,.5,1); }
@keyframes bpop { from { scale: .7; } to { scale: 1; } }
.bubble.zzz { letter-spacing: .3em; color: var(--grape); }

/* ---------- shared titles ---------- */
.title {
  font-family: var(--display); font-weight: 400; margin: 0; line-height: .95;
  font-size: clamp(40px, 6vw, 84px);
  filter: drop-shadow(0 4px 0 var(--ink));
}
.title .ch { animation: wave 2.8s ease-in-out infinite; animation-delay: var(--d); }

/* ---------- gallery ---------- */
.gallery {
  position: relative; padding: 96px 0 84px;
  background:
    radial-gradient(circle at 12px 12px, rgba(255,95,162,.12) 3px, transparent 3.5px) 0 0 / 34px 34px,
    var(--blush);
}
.g-head { padding: 0 var(--side); margin-bottom: 26px; }
.g-head p { margin: 14px 0 0; font-size: 15px; color: var(--ink-soft); }
.g-empty { padding: 0 var(--side); color: var(--ink-soft); }
.rows { display: grid; gap: 10px; }
.row { overflow: hidden; padding: 30px 0 34px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.row.dragging, .row.dragging .card { cursor: grabbing; }
.row.dragging .card .frame { transition: none; }
.track { display: flex; width: max-content; gap: var(--gap, 34px); will-change: transform; }

.card {
  --h: 300px;
  flex: none; height: var(--h); position: relative;
  -webkit-tap-highlight-color: transparent; cursor: zoom-in;
}
.frame {
  height: 100%; margin: 0;
  background: #fff; padding: 10px 10px 40px; border-radius: 4px;
  box-shadow: 0 2px 0 rgba(47,60,143,.1), 0 16px 28px -16px rgba(47,60,143,.45);
  transform: rotate(var(--r, 0deg));
  transition: transform .45s cubic-bezier(.3,1.5,.5,1), box-shadow .45s;
  animation: float var(--fd, 6s) ease-in-out var(--fdel, 0s) infinite alternate;
  position: relative;
}
.frame::before { /* washi tape */
  content: ""; position: absolute; z-index: 2; top: -12px; left: 50%; width: 74px; height: 24px;
  background: var(--tape, rgba(255,201,60,.7)); transform: translateX(-50%) rotate(var(--tr, -4deg));
  border-radius: 2px; box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
@keyframes float { from { translate: 0 -4px; } to { translate: 0 5px; } }
.frame figcaption {
  position: absolute; left: 12px; right: 12px; bottom: 8px;
  font: 400 18px/1.2 var(--hand); color: var(--ink);
  display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; overflow: hidden;
}
.frame figcaption .no { color: var(--pink); }
.ph { position: relative; height: 100%; aspect-ratio: var(--ar); overflow: hidden; background: #f1ecf6; border-radius: 2px; }
.ph img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-user-drag: none; user-select: none; pointer-events: none;
}
/* "developing polaroid": faded + milky until the card reaches the middle (or is hovered) */
.ph .mono { filter: saturate(.15) sepia(.25) brightness(1.12) contrast(.82); }
.ph .color { opacity: 0; transition: opacity .55s ease .05s; }
.ph::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,240,248,.3));
  transition: opacity .5s;
}
.card.live .ph .color { opacity: 1; transition: opacity .45s ease; }
.card.live .ph::after { opacity: 0; transition: opacity .3s; }
@media (hover: hover) and (pointer: fine) {
  .card:hover .frame {
    transform: rotate(0deg) translateY(-14px) scale(1.05);
    box-shadow: 0 2px 0 rgba(47,60,143,.1), 0 30px 40px -18px rgba(47,60,143,.5);
  }
}
.card.ghost { visibility: hidden; }

/* ---------- birthday + cake ---------- */
.bday {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px;
  padding: 96px var(--side) 110px;
  background:
    radial-gradient(circle at 20px 20px, rgba(255,138,61,.16) 4px, transparent 4.5px) 0 0 / 44px 44px,
    var(--lemon);
  border-radius: 48px 48px 0 0;
  margin-top: -36px;
}
.kicker { margin: 0 0 14px; font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--orange); }
.title.big { font-size: clamp(54px, 7.4vw, 124px); white-space: nowrap; }
.when { margin: 22px 0 0; font-size: clamp(18px, 1.8vw, 24px); font-weight: 900; font-variant-numeric: tabular-nums; }
.when b { color: var(--pink); }
.note { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); }
.cake-wrap { display: grid; justify-items: center; gap: 8px; }
.cake { position: relative; width: min(360px, 78vw); padding-top: 120px; }
.cake-body { position: relative; }
.cake-svg { display: block; width: 100%; height: auto; position: relative; z-index: 1; }
.candle {
  position: absolute; bottom: 70%; width: 22px; height: 92px; z-index: 0; padding: 0; border: 3px solid var(--ink); border-radius: 8px;
  background: repeating-linear-gradient(-45deg, #fff 0 8px, var(--blue) 8px 16px);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.candle::before { content: ""; position: absolute; left: 50%; top: -12px; width: 3px; height: 12px; background: var(--ink); transform: translateX(-50%); }
.candle:nth-of-type(1) { left: 38%; }
.candle:nth-of-type(2) { left: 56%; background: repeating-linear-gradient(-45deg, #fff 0 8px, var(--mint) 8px 16px); }
.candle::after { content: ""; position: absolute; inset: -30px -20px -6px; } /* bigger tap target */
.flame {
  position: absolute; left: 50%; top: -46px; width: 22px; height: 34px; margin-left: -11px;
  background: radial-gradient(ellipse at 50% 70%, #fff6c2 0 25%, var(--yellow) 45%, var(--orange) 80%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  transform-origin: 50% 90%;
  animation: flicker .18s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(255,201,60,.9));
  transition: opacity .2s, transform .2s;
}
@keyframes flicker { from { transform: rotate(-4deg) scaleY(1); } to { transform: rotate(4deg) scaleY(1.08); } }
.candle.out .flame { opacity: 0; transform: scale(.2) translateY(10px); animation: none; }
.candle.out::before { box-shadow: 0 -6px 8px rgba(120,120,140,.4); }
.cake-hint { margin: 6px 0 0; font: 400 20px/1.2 var(--hand); color: var(--ink-soft); text-align: center; }
.relight {
  border: 3px solid var(--ink); background: #fff; border-radius: 999px; min-height: 44px; padding: 0 18px;
  font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 var(--ink);
}
.relight:active { transform: translateY(4px); box-shadow: none; }

/* ---------- footer ---------- */
.foot {
  position: relative; overflow: hidden;
  background: var(--sky1);
  padding: 96px var(--side) max(30px, env(safe-area-inset-bottom));
  font-size: 14px; font-weight: 800;
}
.foot::before { content: ""; position: absolute; left: 0; right: 0; top: 78px; height: 3px; background: repeating-linear-gradient(90deg, rgba(47,60,143,.2) 0 10px, transparent 10px 18px); }
.foot p { margin: 0; }
.foot a { text-decoration: none; background: #fff; padding: 6px 12px; border-radius: 999px; display: inline-block; margin: 6px 0; }
.foot a:hover { background: var(--pink); color: #fff; }
.trot { position: absolute; left: 0; top: 6px; width: 110px; height: 76px; pointer-events: none; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 50; }
.lb[hidden] { display: none; }
.lb::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(255,240,248,.9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: var(--bd, 1); transition: opacity .35s;
}
.lb-img {
  position: fixed; left: 0; top: 0; margin: 0; transform-origin: 0 0;
  background: #fff; padding: 12px 12px 46px; border-radius: 6px;
  box-shadow: 0 30px 60px -30px rgba(47,60,143,.6);
  touch-action: none;
}
.lb-img img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; border-radius: 2px; }
.lb-img figcaption { position: absolute; left: 14px; right: 14px; bottom: 10px; font: 400 22px/1.2 var(--hand); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-btn {
  position: fixed; z-index: 2; -webkit-appearance: none; appearance: none; cursor: pointer;
  border: 3px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px;
  font: 900 22px/1 var(--body); width: 52px; height: 52px; box-shadow: 0 4px 0 var(--ink);
}
.lb-btn:hover { background: var(--pink); color: #fff; }
.lb-btn:active { transform: translateY(4px); box-shadow: none; }
.lb-close { top: max(14px, env(safe-area-inset-top)); right: var(--gut); font-size: 18px; }
.lb-prev, .lb-next { bottom: max(18px, env(safe-area-inset-bottom)); }
.lb-prev { left: var(--gut); }
.lb-next { right: var(--gut); }
.lb-count {
  position: fixed; z-index: 2; left: 50%; bottom: max(30px, calc(env(safe-area-inset-bottom) + 12px));
  transform: translateX(-50%); margin: 0; font-size: 14px; font-weight: 900;
}
.lb .lb-btn, .lb .lb-count { opacity: var(--ui, 1); transition: opacity .25s; }

/* ---------- mobile ---------- */
@media (max-width: 759px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    min-height: 0;
    padding: 112px var(--gut) 26px;
  }
  .headline, .sub, .play, .cta, .ig, .stats { grid-column: 1; grid-row: auto; }
  .headline { font-size: clamp(50px, 15.5vw, 74px); }
  .sub { margin-top: 14px; font-size: 15px; }
  .play {
    position: relative; inset: auto; pointer-events: auto;
    height: 45svh; min-height: 300px; max-height: 440px;
    margin: 0 calc(-1 * var(--gut));
  }
  .cta { margin-top: 4px; gap: 14px; }
  .ig { margin-top: 6px; }
  .top { padding-left: var(--gut); padding-right: var(--gut); justify-content: center; }
  .mark { display: none; }
  .top nav a { padding: 0 11px; font-size: 12.5px; }
  .sun { right: -10%; top: 30%; }
  .balloon { width: 44px; }
  .gallery { padding: 64px 0 64px; }
  .g-head { padding: 0 var(--gut); margin-bottom: 10px; }
  .card { --h: 220px; }
  .frame { padding: 7px 7px 32px; }
  .frame::before { width: 56px; height: 18px; top: -9px; }
  .frame figcaption { left: 9px; right: 9px; bottom: 6px; font-size: 15px; }
  .track { --gap: 22px; }
  .row { padding: 22px 0 26px; }
  .rows { gap: 0; }
  .bday { grid-template-columns: minmax(0, 1fr); padding: 72px var(--gut) 84px; border-radius: 32px 32px 0 0; text-align: center; }
  .foot { padding-left: var(--gut); padding-right: var(--gut); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame, .cloud, .sun, .balloon, .bunting .flags path, .btn .spark { animation: none !important; }
  .ch { animation: none !important; }
  .flame { animation: none; }
}
