:root {
  color-scheme: dark;

  --bg: #0d0b0e;
  --bg-2: #141017;
  --card: #17131b;
  --card-2: #1d1822;
  --line: #2b2432;

  --pink: #ff8fb1;
  --pink-dim: #c96f8b;
  --peach: #ffb98a;
  --tulip: #93aee0;
  --cream: #f4ece9;
  --muted: #9c8c97;

  --display: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --pad: clamp(20px, 5vw, 40px);
  --gap: clamp(28px, 4vw, 44px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* faint film grain — keeps the dark from looking flat */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--pink), var(--peach));
  z-index: 50;
  transition: width 0.1s linear;
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- confetti ---------- */
/* sits behind the content so a growing pile never fights the text */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* X and Y are animated on separate elements so the fall can accelerate
   under "gravity" while the sideways drift eases off — one combined
   transform can't do both, which is why it looked wrong before */
.confetto {
  position: absolute;
  left: 0;
  top: 0;
  animation: fly-x var(--dur, 2s) cubic-bezier(0.12, 0.62, 0.3, 1) forwards;
}

.confetto > b {
  display: block;
  width: var(--w, 8px);
  height: 13px;
  background: var(--c, #ff8fb1);
  border-radius: var(--r, 0);
  animation: fly-y var(--dur, 2s) linear forwards;
}

@keyframes fly-x {
  0% { transform: translateX(var(--x0)); opacity: 1; }
  72% { opacity: 1; }
  100% { transform: translateX(var(--x2)); opacity: 0.42; }
}

@keyframes fly-y {
  /* up and slowing */
  0% { transform: translateY(var(--y0)) rotate(0deg); animation-timing-function: cubic-bezier(0.16, 0.68, 0.4, 1); }
  /* then falling and speeding up */
  30% { transform: translateY(var(--yp)) rotate(calc(var(--rot) * 0.35)); animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5); }
  100% { transform: translateY(var(--y2)) rotate(var(--rot)); }
}

/* a popped balloon has nothing to throw its confetti upward — it just
   drops, accelerating from the first frame instead of hanging first */
.confetto.spill > b { animation-name: drop-y; }

@keyframes drop-y {
  0% { transform: translateY(var(--y0)) rotate(0deg); }
  100% { transform: translateY(var(--y2)) rotate(var(--rot)); }
}

.confetto.spill > b { animation-timing-function: cubic-bezier(0.5, 0, 0.85, 0.5); }

/* once it lands the animation is torn down — hundreds of finished
   animations kept promoting layers and stalled the balloons */
.confetto.landed { animation: none; opacity: 0.42; }
.confetto.landed > b { animation: none; }

/* ---------- balloons (site-wide, poppable) ---------- */
.balloons {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 45;
}

/* the outer element carries the rise, the inner one carries the dodge —
   otherwise the two transforms would overwrite each other */
.balloon {
  position: absolute;
  bottom: -180px;
  width: 46px;
  height: 58px;
  pointer-events: auto;
  cursor: pointer;
  animation: rise-up linear forwards;
  will-change: transform; /* own layer, so scrolling can't stall the drift */
}

.balloon-b {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 46% 46%;
  background: currentColor;
  opacity: 0.28;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.balloon:hover .balloon-b { opacity: 0.5; }

.balloon.pop { pointer-events: none; }
.balloon.pop .balloon-b {
  animation: pop-out 0.24s ease forwards;
  transition: none;
}

@keyframes pop-out {
  0% { transform: scale(1); opacity: 0.5; }
  45% { transform: scale(1.35); opacity: 0.35; }
  100% { transform: scale(0.1); opacity: 0; }
}

.balloon-b::after {
  content: "";
  position: absolute;
  top: 99%;
  left: 50%;
  width: 1px;
  height: 70px;
  background: currentColor;
  opacity: 0.55;
}

@keyframes rise-up {
  from { transform: translateY(0) translateX(0) rotate(-4deg); }
  to { transform: translateY(-135vh) translateX(var(--drift, 30px)) rotate(4deg); }
}

/* ---------- lore page effects ---------- */
.tint {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.7s ease, background 0.7s ease;
}

/* only blend while an effect is up — a blended full-screen layer is
   expensive to composite on every scroll */
body[class*="fx-"] .tint { mix-blend-mode: screen; }

body.fx-girly    .tint { opacity: 0.26; background: radial-gradient(circle at 50% 35%, #ff8fb1, transparent 72%); }
body.fx-blush    .tint { opacity: 0.34; background: radial-gradient(circle at 50% 65%, #ff6f9c, transparent 62%); animation: blush-pulse 2.4s ease-in-out infinite; }
body.fx-heat     .tint { opacity: 0.34; background: linear-gradient(0deg, #ff5722, #ff9b3d 45%, transparent 85%); }
/* vanilla doesn't tint — it turns the whole site to cream (below) */
body.fx-vanilla  .tint { opacity: 0.14; background: radial-gradient(circle at 50% 90%, #ffb98a, transparent 62%); mix-blend-mode: normal; }
body.fx-nope     .tint { opacity: 0.30; background: linear-gradient(180deg, #6fa8ff, #93aee0 60%, transparent); }
/* shy — a hot ring closing in from the edges */
body.fx-cute     .tint { opacity: 1; mix-blend-mode: normal; background: radial-gradient(circle at 50% 50%, transparent 34%, rgba(255,111,156,0.30) 82%, rgba(255,111,156,0.5) 100%); }

/* "Not too much now." — the whole page shrinks back, breathing in time
   with the pink glow, and the corners go soft */
body.fx-blush main,
body.fx-blush .landing {
  transform-origin: top center;
  animation: shy-shrink 2.4s ease-in-out infinite;
}

@keyframes shy-shrink {
  0%, 100% { transform: scale(0.945); }
  50% { transform: scale(0.922); }
}

body.fx-blush .db-card,
body.fx-blush .learned-card,
body.fx-blush .moment,
body.fx-blush .cover-card,
body.fx-blush .now-card {
  border-radius: 28px;
  transition: border-radius 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes blush-pulse {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.42; }
}

/* bossy — everything snaps to attention */
body.fx-bossy .app,
body.fx-bossy main { animation: snap 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

body.fx-bossy .db-card,
body.fx-bossy .learned-card,
body.fx-bossy .moment,
body.fx-bossy .lore-cell {
  border-left: 3px solid var(--pink) !important;
  border-radius: 4px !important;
}

@keyframes snap {
  10%, 30%, 50%, 70% { transform: translateX(-5px); }
  20%, 40%, 60% { transform: translateX(5px); }
  80% { transform: translateX(3px); }
  100% { transform: none; }
}

/* nope — everything backs off and cools down */
body.fx-nope main { filter: saturate(0.45); transition: filter 0.7s ease; }
body.fx-nope .db-card,
body.fx-nope .learned-card,
body.fx-nope .moment { transform: scale(0.965); transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }

/* cute — everything ducks away and avoids eye contact */
body.fx-cute .db-card,
body.fx-cute .learned-card,
body.fx-cute .moment,
body.fx-cute .likes-list,
body.fx-cute .track-list,
body.fx-cute .stamp,
body.fx-cute .standout,
body.fx-cute .poem,
body.fx-cute .lore-cell:not(.on) {
  transform: translateY(9px) scale(0.975);
  opacity: 0.62;
  filter: blur(1.4px);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.65s ease, filter 0.65s ease;
}

body.fx-cute .sec-title,
body.fx-cute .wordmark {
  filter: blur(2px);
  opacity: 0.72;
  transition: filter 0.65s ease, opacity 0.65s ease;
}

/* girly — everything goes soft, round and glowing */
body.fx-girly .db-card,
body.fx-girly .learned-card,
body.fx-girly .moment,
body.fx-girly .cover-card,
body.fx-girly .lore-grid {
  border-radius: 30px !important;
  border-color: rgba(255, 143, 177, 0.55) !important;
  box-shadow: 0 10px 34px rgba(255, 143, 177, 0.22);
  transition: border-radius 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.6s ease, border-color 0.6s ease;
}

body.fx-girly .sec-title,
body.fx-girly .end-fact,
body.fx-girly .bday {
  font-style: italic;
  color: #ffd0de;
  transition: color 0.6s ease;
}

body.fx-girly .db-head,
body.fx-girly .moment-date { color: var(--pink); }

body.fx-girly .enter-btn,
body.fx-girly .teaser-btn,
body.fx-girly .dispute-btn { border-radius: 999px; border-color: var(--pink); color: var(--pink); }

/* shayla — her pink and his blue run through everything together */
body.fx-shayla .db-card,
body.fx-shayla .learned-card,
body.fx-shayla .moment,
body.fx-shayla .cover-card,
body.fx-shayla .lore-cell {
  border-color: transparent !important;
  background-image: linear-gradient(var(--card), var(--card)),
    linear-gradient(120deg, var(--pink), var(--tulip));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

body.fx-shayla .sec-title,
body.fx-shayla .standout,
body.fx-shayla .bday,
body.fx-shayla .end-fact,
body.fx-shayla .wordmark {
  background: linear-gradient(100deg, var(--pink) 15%, var(--tulip) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.fx-shayla .progress { background: linear-gradient(90deg, var(--pink), var(--tulip)); }

/* classified — the record gets redacted, line by line */
body.fx-classified .db-line,
body.fx-classified .learned-card,
body.fx-classified .likes-list li,
body.fx-classified .track-list li,
body.fx-classified .moment-line,
body.fx-classified .moment-date,
body.fx-classified .stanza span,
body.fx-classified .preface,
body.fx-classified .tagline,
body.fx-classified .sec-sub,
body.fx-classified .standout,
body.fx-classified .end-fact,
body.fx-classified .poem-last,
body.fx-classified .lore-cell:not(.on) .lore-k,
body.fx-classified .lore-cell:not(.on) .lore-v {
  position: relative;
}

body.fx-classified .db-line::before,
body.fx-classified .learned-card::before,
body.fx-classified .likes-list li::before,
body.fx-classified .track-list li::before,
body.fx-classified .moment-line::before,
body.fx-classified .moment-date::before,
body.fx-classified .stanza span::before,
body.fx-classified .preface::before,
body.fx-classified .tagline::before,
body.fx-classified .sec-sub::before,
body.fx-classified .standout::before,
body.fx-classified .end-fact::before,
body.fx-classified .poem-last::before,
body.fx-classified .lore-cell:not(.on) .lore-k::before,
body.fx-classified .lore-cell:not(.on) .lore-v::before {
  content: "";
  position: absolute;
  /* must cover the text completely — a short bar just leaves words
     poking out the side, which reads as a bug rather than redaction */
  left: -4px;
  right: -4px;
  top: 0.06em;
  bottom: 0.06em;
  background: #07050a;
  border-radius: 2px;
  z-index: 2;
  transform-origin: left center;
  animation: redact 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* stagger the wipe instead, so it strikes through line by line */
body.fx-classified li:nth-child(2n)::before { animation-delay: 0.05s; }
body.fx-classified li:nth-child(3n)::before { animation-delay: 0.1s; }
body.fx-classified .stanza span:nth-child(2n)::before { animation-delay: 0.07s; }
body.fx-classified .stanza span:nth-child(3n)::before { animation-delay: 0.13s; }
body.fx-classified .db-line:nth-child(2n)::before { animation-delay: 0.06s; }

@keyframes redact {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* the one entry she tapped stays legible */
body.fx-classified .lore-cell.on {
  box-shadow: inset 3px 0 0 var(--pink), 0 0 0 1px rgba(255, 143, 177, 0.5), 0 14px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 3;
}

/* heat — a static warm cast (an infinite filter on <main> was far too
   expensive to repaint every frame) */
body.fx-heat main { filter: hue-rotate(-7deg) saturate(1.22); }

/* the type runs down its own box and pools at the bottom as ink.
   JS tags the elements so these stay one short selector each. */
.melting {
  position: relative;
  transform-origin: top center;
  animation: melt-away 2.9s cubic-bezier(0.55, 0, 0.8, 0.35) forwards;
}

@keyframes melt-away {
  0% { transform: translateY(0) scaleY(1) skewX(0deg); filter: blur(0); opacity: 1; }
  45% { transform: translateY(0.22em) scaleY(1.45) skewX(-0.8deg); filter: blur(1.4px); opacity: 0.8; }
  100% { transform: translateY(1.05em) scaleY(2.7) skewX(0.6deg); filter: blur(5px); opacity: 0; }
}

.melting::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.18em;
  height: 0;
  background: currentColor;
  border-radius: 46% 54% 38% 62% / 78% 72% 26% 28%;
  filter: blur(1.1px);
  opacity: 0;
  pointer-events: none;
  animation: pool 2.9s ease-out forwards;
}

@keyframes pool {
  0% { height: 0; opacity: 0; }
  45% { height: 0.06em; opacity: 0.35; }
  100% { height: 0.3em; opacity: 0.9; }
}

/* clicking away lets it run backwards and the page cools off */
.unmelting {
  position: relative;
  transform-origin: top center;
  animation: unmelt 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes unmelt {
  0% { transform: translateY(1.05em) scaleY(2.7) skewX(0.6deg); filter: blur(5px); opacity: 0; }
  100% { transform: none; filter: blur(0); opacity: 1; }
}

.unmelting::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.18em;
  background: currentColor;
  border-radius: 46% 54% 38% 62% / 78% 72% 26% 28%;
  filter: blur(1.1px);
  pointer-events: none;
  animation: unpool 0.55s ease-in forwards;
}

@keyframes unpool {
  0% { height: 0.3em; opacity: 0.9; }
  100% { height: 0; opacity: 0; }
}

/* ---------- vanilla: the whole site turns to cream ---------- */
body.fx-vanilla {
  --bg: #fbf3e6;
  --bg-2: #f6ead8;
  --card: #fffbf4;
  --card-2: #fdf3e5;
  --line: #ecdcc4;
  --cream: #4b3a2b;   /* text flips dark on light */
  --muted: #9a8570;
  --pink: #e0819c;
  --pink-dim: #c4708a;
  --peach: #e8955c;
  --tulip: #8098cc;
}

/* poured, not switched */
body,
.db-card,
.learned-card,
.moment,
.lore-cell,
.lore-grid,
.cover-card,
.track-list li,
.db-note > span {
  transition: background-color 0.85s ease, color 0.85s ease, border-color 0.85s ease;
}

/* a few surfaces hardcode dark values — bring them along */
body.fx-vanilla .moment-img { background: linear-gradient(135deg, #f3e4cf, #ecd7bd 60%, #e6cba9); }
body.fx-vanilla .moment-img .ph { color: #b09a7e; }
body.fx-vanilla .plate { background: #e3d2ba; }
body.fx-vanilla .fineprint,
body.fx-vanilla .sec-foot,
body.fx-vanilla .verdict .v2 { color: #a8917a; }
body.fx-vanilla .fx-toast { background: rgba(255, 251, 244, 0.96); color: #4b3a2b; }
body.fx-vanilla .cover-missing { background: repeating-linear-gradient(45deg, #fdf3e5, #fdf3e5 10px, #f7ead6 10px, #f7ead6 20px); }
body.fx-vanilla .grain { opacity: 0.018; }

/* these three hardcode a light-on-dark text colour, which vanishes on cream */
body.fx-vanilla .likes-list li,
body.fx-vanilla .moment-line,
body.fx-vanilla .stanza { color: #5a4636; }

/* falling petals (tulips) */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 44;
}

.petal {
  position: absolute;
  top: -30px;
  width: 11px;
  height: 15px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0.85;
  animation: fall var(--dur, 9s) linear forwards;
}

@keyframes fall {
  0% { transform: translateY(-30px) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.85; }
  100% { transform: translateY(106vh) translateX(var(--sway, 40px)) rotate(var(--spin, 360deg)); opacity: 0; }
}

/* little hearts rising (girly) */
.heart {
  position: absolute;
  bottom: -24px;
  width: var(--size, 13px);
  height: var(--size, 13px);
  background: #ff8fb1;
  transform: rotate(-45deg);
  opacity: 0;
  animation: rise-heart var(--dur, 8s) linear forwards;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.heart::before { top: -50%; left: 0; }
.heart::after { top: 0; left: 50%; }

@keyframes rise-heart {
  0% { transform: translateY(0) translateX(0) rotate(-45deg) scale(0.6); opacity: 0; }
  15% { opacity: 0.75; }
  100% { transform: translateY(-104vh) translateX(var(--sway, 40px)) rotate(-45deg) scale(1); opacity: 0; }
}

/* the wish: a warm bloom off the cake, then embers drifting up */
.wish-glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 214, 150, 0.55), rgba(255, 170, 90, 0.18) 45%, transparent 70%);
  animation: bloom 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes bloom {
  0% { opacity: 0; transform: scale(0.35); }
  22% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(2.6); }
}

.ember {
  position: absolute;
  width: var(--size, 3px);
  height: var(--size, 3px);
  border-radius: 50%;
  background: #ffd79a;
  box-shadow: 0 0 7px 2px rgba(255, 184, 104, 0.65);
  opacity: 0;
  animation: ember-up var(--dur, 3.4s) ease-out forwards;
}

@keyframes ember-up {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  18% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--sway, 20px), -190px) scale(0.35); }
}

/* the little line that says what just happened */
.fx-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  z-index: 70;
  margin: 0;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(23, 19, 27, 0.94);
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--display);
  font-style: italic;
  font-size: 0.92rem;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fx-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* active lore cell */
.lore-cell.on {
  background: var(--card-2);
  box-shadow: inset 3px 0 0 var(--pink);
}

.lore-cell.on .lore-k { color: var(--pink); }

/* ---------- 01 landing ---------- */
.landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--pad);
  gap: 6px;
}

.kicker {
  position: relative;
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: clamp(0.72rem, 2.6vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--pink);
}

.kicker .nick {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: clamp(1.15rem, 4.5vw, 1.7rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--peach);
}

.kicker .today {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 143, 177, 0.14);
  border: 1px solid rgba(255, 143, 177, 0.4);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--pink);
  vertical-align: 2px;
}

.wordmark {
  position: relative;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(4.5rem, 22vw, 13rem);
  line-height: 0.9;
  margin: 0;
  letter-spacing: -0.04em;
  color: var(--cream);
  cursor: default;
  outline: none;
  transition: letter-spacing 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.5s ease;
}

.wordmark.split {
  letter-spacing: 0.16em;
  color: var(--pink);
}

.tagline {
  max-width: 34ch;
  margin: 22px 0 0;
  font-size: clamp(0.92rem, 2.4vw, 1.05rem);
  line-height: 1.65;
  color: var(--muted);
}

.enter-btn {
  margin-top: 36px;
  background: none;
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  padding: 14px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.enter-btn::after { content: " →"; }
.enter-btn:hover, .enter-btn:focus-visible { border-color: var(--pink); color: var(--pink); }
.enter-btn:active { transform: scale(0.97); }

.fineprint {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5d4f59;
  margin: 0;
}

/* ---------- section shell ---------- */
.sec {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(70px, 11vw, 130px) var(--pad);
}

.sec.wide { max-width: 1180px; }

.sec-num {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--pink-dim);
  margin: 0 0 12px;
}

.sec-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.sec-sub {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 14px 0 0;
  max-width: 46ch;
}

.sec-foot {
  margin: 30px 0 0;
  font-size: 0.85rem;
  color: #6c5c67;
  font-style: italic;
  max-width: 48ch;
}

/* ---------- 02 database ---------- */
.db-grid {
  margin-top: var(--gap);
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.db-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
}

.db-head {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--peach);
  margin: 0 0 14px;
}

.db-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.db-item { margin: 0; }

.db-line {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 7px 0;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: default;
}

.db-line.has-note { cursor: pointer; }

.db-line.has-note::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink);
  margin-left: 8px;
  vertical-align: 3px;
  transition: transform 0.25s ease;
}

.db-line.has-note[aria-expanded="true"]::after { transform: scale(1.7); }
.db-line.has-note:hover, .db-line.has-note:focus-visible { color: var(--pink); outline: none; }

.db-line.flag { color: var(--pink); font-weight: 600; letter-spacing: 0.02em; }

/* height is animated from an explicit pixel value in JS — animating
   grid tracks (and padding at the same time) made opening stutter */
.db-note {
  height: 0;
  overflow: hidden;
  transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.db-note > span {
  display: block;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
  font-style: italic;
  padding: 2px 0 9px 14px;
  border-left: 1px solid var(--line);
}

/* ---------- 03 lore ---------- */
.lore-grid {
  margin: var(--gap) 0 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.lore-cell {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  font: inherit;
  color: inherit;
  background: var(--card);
  padding: 20px 22px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.lore-cell:hover { background: var(--card-2); }
.lore-cell:focus-visible { outline: 2px solid var(--pink); outline-offset: -2px; }

.lore-k {
  display: block;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
  transition: color 0.3s ease;
}

.lore-v {
  display: block;
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--cream);
}

/* ---------- 04 learned ---------- */
.learned-grid {
  margin-top: var(--gap);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.learned-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 2px solid var(--pink-dim);
  border-radius: 12px;
  padding: 20px 22px;
  font-size: 0.98rem;
  line-height: 1.6;
  transition: transform 0.3s ease, border-left-color 0.3s ease;
}

.learned-card:hover { transform: translateY(-3px); border-left-color: var(--pink); }

.stamp {
  margin: 40px auto 0;
  max-width: 30ch;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  line-height: 1.5;
  color: var(--peach);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

/* ---------- 05 likes ---------- */
.likes-list {
  margin: var(--gap) 0 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 34px;
}

.likes-list li {
  break-inside: avoid;
  padding: 11px 0 11px 22px;
  position: relative;
  font-size: 1rem;
  line-height: 1.55;
  color: #e2d6dd;
}

.likes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  width: 9px;
  height: 1px;
  background: var(--pink-dim);
}

@media (max-width: 640px) {
  .likes-list { columns: 1; }
}

.standout {
  margin: 56px auto 0;
  max-width: 20ch;
  text-align: center;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.6rem, 6vw, 2.5rem);
  line-height: 1.3;
  color: var(--cream);
}

/* ---------- 06 moments ---------- */
.moment-strip {
  margin-top: var(--gap);
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.moment {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.moment:hover { transform: translateY(-5px); }

.moment-img {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #241c28, #2e2233 60%, #3a2a37);
  position: relative;
  display: grid;
  place-items: center;
}

.moment-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.moment-img .ph {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b5a66;
}

.moment-body { padding: 16px 18px 20px; }

.moment-date {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--peach);
  margin: 0 0 7px;
}

.moment-line {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: #e2d6dd;
}

.moment-note {
  margin: 10px 0 0;
  font-size: 0.79rem;
  font-style: italic;
  color: var(--muted);
}

/* ---------- soundtrack (last section — ends on the song) ---------- */
.sec.finale {
  border-top: 1px solid var(--line);
  background: radial-gradient(130% 70% at 50% 100%, rgba(255, 143, 177, 0.07), transparent 72%);
  padding-bottom: clamp(110px, 17vw, 180px);
}

.track-list {
  margin: var(--gap) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: t;
  border-top: 1px solid var(--line);
}

.track-list li {
  counter-increment: t;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s ease, background 0.3s ease;
}

.track-list li:hover { padding-left: 12px; background: rgba(255, 143, 177, 0.04); }

.track-list li::before {
  content: counter(t, decimal-leading-zero);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--pink-dim);
  flex: none;
}

.track-title { font-size: 1rem; color: var(--cream); }
.track-artist { font-size: 0.84rem; color: var(--muted); margin-left: auto; text-align: right; }

.cover-slot { margin-top: 46px; text-align: center; }

.teaser-btn {
  background: none;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  padding: 16px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, letter-spacing 0.3s ease;
}

.teaser-btn::after { content: " →"; }
.teaser-btn:hover, .teaser-btn:focus-visible {
  border-color: var(--pink);
  color: var(--pink);
  letter-spacing: 0.1em;
  outline: none;
}

.cover-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.cover-title {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0;
  color: var(--cream);
}

.cover-credit {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink-dim);
  margin: 6px 0 20px;
}

.cover-card audio { width: 100%; }

.cover-card .ratio {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.cover-card .ratio iframe { width: 100%; height: 100%; border: 0; display: block; }

.cover-missing {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, #1d1822, #1d1822 10px, #221c28 10px, #221c28 20px);
  border-radius: 12px;
  padding: 26px 20px;
}

/* ---------- 08 birthday + poem ---------- */
.quiet {
  max-width: 660px;
  padding-top: clamp(90px, 15vw, 170px);
  padding-bottom: clamp(70px, 12vw, 120px);
  background: radial-gradient(120% 60% at 50% 0%, rgba(255, 143, 177, 0.07), transparent 70%);
}

.preface {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
  margin: 0 auto;
  max-width: 52ch;
}

/* ---------- the cake ---------- */
.cake-wrap {
  margin: clamp(46px, 8vw, 76px) 0 0;
  text-align: center;
}

.cake-prompt {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.1rem, 3.6vw, 1.4rem);
  color: var(--peach);
  margin: 0 0 26px;
  transition: opacity 0.5s ease;
}

.cake {
  position: relative;
  display: block;
  margin: 0 auto;
  width: 168px;
  height: 132px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.cake:hover { transform: translateY(-4px); }
.cake:focus-visible { outline: 2px solid var(--pink); outline-offset: 10px; border-radius: 10px; }
.cake.done { cursor: default; }

.plate {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 168px;
  height: 8px;
  border-radius: 50%;
  background: #2a2230;
}

.cake-bot, .cake-mid, .cake-top {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 7px;
}

.cake-bot { bottom: 6px; width: 136px; height: 34px; background: linear-gradient(180deg, #e0899f, #b96b83); }
.cake-mid { bottom: 38px; width: 112px; height: 28px; background: linear-gradient(180deg, #f6d7c2, #e0b199); }
.cake-top { bottom: 64px; width: 88px; height: 24px; background: linear-gradient(180deg, #ffb0c8, #e58aa6); }

.candles {
  position: absolute;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.candle {
  position: relative;
  width: 5px;
  height: 26px;
  border-radius: 2px;
  background: repeating-linear-gradient(45deg, #fff0f4 0 4px, #ffc2d4 4px 8px);
}

.flame {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  width: 9px;
  height: 13px;
  margin-bottom: 3px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 70%, #fff6c8, #ffb347 55%, #ff7a3d);
  box-shadow: 0 0 14px 4px rgba(255, 170, 80, 0.42);
  transform-origin: bottom center;
  animation: flicker 0.9s ease-in-out infinite alternate;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

@keyframes flicker {
  from { transform: translateX(-50%) scale(1) rotate(-3deg); }
  to { transform: translateX(-50%) scale(1.13) rotate(3deg); }
}

.cake.done .flame {
  opacity: 0;
  transform: translateX(-50%) scale(0.3) translateY(-6px);
  animation: none;
}

.smoke {
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 5px;
  height: 5px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: rgba(226, 214, 221, 0.5);
  opacity: 0;
  pointer-events: none;
}

.cake.done .smoke { animation: puff 1.5s ease-out forwards; }

@keyframes puff {
  0% { opacity: 0.7; transform: translate(-50%, 0) scale(0.6); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(2.6); }
}

.cake-hint {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6c5c67;
  margin: 24px 0 0;
  transition: opacity 0.4s ease, color 0.4s ease;
}

.cake-hint.done { color: var(--pink-dim); text-transform: none; letter-spacing: 0.04em; font-style: italic; font-size: 0.85rem; }

.bday {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.1rem, 8vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
  margin: clamp(56px, 10vw, 90px) 0 clamp(56px, 10vw, 90px);
  color: var(--cream);
}

.poem { display: flex; flex-direction: column; gap: clamp(34px, 6vw, 52px); }

.stanza {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.05rem, 3.4vw, 1.3rem);
  line-height: 1.95;
  color: #ece0e5;
  margin: 0;
}

.stanza span { display: block; }

.poem-last {
  font-family: var(--display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  line-height: 1.7;
  color: var(--pink);
  margin: clamp(46px, 8vw, 80px) 0 0;
  text-align: center;
}

/* ---------- 09 ending ---------- */
.ending {
  text-align: center;
  padding-bottom: clamp(90px, 14vw, 150px);
  border-top: 1px solid var(--line);
}

.ending .sec-num { margin-bottom: 18px; }

.end-fact {
  font-family: var(--display);
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 400;
  margin: 0 0 34px;
  color: var(--cream);
}

.dispute-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  padding: 13px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, opacity 0.4s ease;
}

.dispute-btn:hover, .dispute-btn:focus-visible { border-color: var(--pink); color: var(--pink); outline: none; }
.dispute-btn.spent { opacity: 0.25; pointer-events: none; }

.verdict {
  margin-top: 26px;
  min-height: 52px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.verdict.show { opacity: 1; transform: none; }

.verdict p { margin: 0; }

.verdict .v1 {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--pink);
}

.verdict .v2 {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5d4f59;
  margin-top: 8px;
}
