:root {
  color-scheme: light;
  --paper: #fce9e6;
  --paper-deep: #f8dbd9;
  --coral: #ff7885;
  --coral-dark: #e5536c;
  --ink: #292d32;
  --cream: #fffaf1;
  --white: #fffefb;
  --lilac: #e5d5ef;
  --shadow: 5px 6px 0 rgba(41, 45, 50, 0.88);
  --display: "Fredoka", "Trebuchet MS", sans-serif;
  --script: "Caveat", "Brush Script MT", cursive;
  font-family: var(--display);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
}

button, a, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, label:focus-within {
  outline: 3px solid #8e4c69;
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.intro {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #29252f;
  background-color: #fce9e6;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.68) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.68) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 1;
  transition: opacity 800ms ease, visibility 800ms ease;
}

.intro.is-hiding {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.intro[hidden] { display: none; }

.cake-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-wash {
  position: absolute;
  inset: auto 0 0;
  height: 26%;
  background: linear-gradient(transparent, rgba(252, 233, 230, 0.56));
  pointer-events: none;
}

.intro-note, .intro-credit, .skip-button { position: absolute; z-index: 1; }

.intro-note {
  left: 50%;
  bottom: max(5.2rem, calc(env(safe-area-inset-bottom) + 4.1rem));
  width: min(90vw, 30rem);
  margin: 0;
  transform: translateX(-50%);
  color: #29252f;
  font-weight: 700;
  font-size: clamp(0.8rem, 2.7vw, 1rem);
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.skip-button {
  top: max(1.1rem, env(safe-area-inset-top));
  right: max(1.1rem, env(safe-area-inset-right));
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 2px solid #29252f;
  border-radius: 999px;
  background: #ff7888;
  box-shadow: 3px 3px 0 #29252f;
  color: #29252f;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.skip-button:hover { background: #ffadb3; transform: translateY(-2px); }
.skip-button span { margin-left: 0.35rem; }

.intro-credit {
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  margin: 0;
  color: rgba(41, 37, 47, 0.72);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

.intro-credit a { color: inherit; text-underline-offset: 0.2em; }

.site {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.43) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.43) 1px, transparent 1px);
  background-size: 36px 36px;
  isolation: isolate;
}

.site[hidden] { display: none; }
.site-entering { animation: page-enter 720ms ease both; }
.paper-grid { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }

.bunting {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  width: 100%;
  height: clamp(82px, 13vw, 154px);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 1.2rem;
}

.sound-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.sound-pick, .sound-toggle {
  min-height: 42px;
  padding: 0.58rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.sound-pick span { margin-right: 0.35rem; color: var(--coral-dark); font-size: 1rem; }
.sound-pick:hover, .sound-toggle:not(:disabled):hover { transform: translateY(-2px); box-shadow: 2px 4px 0 var(--ink); }
.sound-toggle[aria-pressed="true"] { background: #f5c4d7; }
.sound-toggle:disabled { opacity: 0.58; cursor: not-allowed; }

.hero {
  position: relative;
  display: grid;
  min-height: 580px;
  grid-template-columns: 1fr 0.96fr;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 2.4rem;
}

.hero-copy { position: relative; z-index: 1; padding: 2rem 0 1rem 0.5rem; }
.eyebrow, .section-kicker, .surprise-overline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.eyebrow-star { color: var(--coral-dark); font-size: 1.1rem; }

.hero h1 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 1rem 0 0.8rem;
  font-size: clamp(4.4rem, 8.8vw, 7.55rem);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.79;
  text-transform: uppercase;
}

.title-happy, .title-birthday {
  paint-order: stroke fill;
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 3px 4px 0 var(--ink);
}
.title-happy { color: var(--white); }
.title-birthday { margin-top: 0.12em; color: var(--coral); }

.date-ribbon {
  display: flex;
  width: min(370px, 100%);
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin: 1.45rem 0 1rem;
  padding: 0.65rem 1.15rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 3px 4px 0 var(--ink);
  font-family: var(--script);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.date-ribbon span:first-child, .date-ribbon span:last-child { color: #b62e50; font-family: var(--display); font-size: 1rem; }

.hero-message { max-width: 410px; margin: 1.1rem 0 0.45rem; font-size: 1rem; line-height: 1.6; }
.sender-note { margin: 0; font-family: var(--script); font-size: 1.55rem; font-weight: 600; }
.sender-note span { color: var(--coral-dark); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.45rem; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.15rem;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 4px 0 var(--ink);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.button:hover { transform: translate(-1px, -2px); box-shadow: 4px 6px 0 var(--ink); }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 2px 0 var(--ink); }
.button-primary { background: var(--coral); }
.button-primary:hover { background: #ff8d98; }
.button-light { background: var(--cream); }
.button-light:hover, .button-outline:hover { background: #fff; }
.button-outline { background: #fff8eb; }

.doodle-star { position: absolute; color: var(--ink); }
.doodle-star-one { top: 17%; right: 9%; font-size: 2rem; transform: rotate(10deg); }
.doodle-star-two { bottom: 16%; right: 6%; font-size: 1.4rem; transform: rotate(-13deg); }

.hero-art {
  position: relative;
  display: grid;
  min-height: 500px;
  place-items: center;
  isolation: isolate;
}

.portrait-frame {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(285px, 36vw, 410px);
  aspect-ratio: 1;
  place-items: center;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: #d7e2e7;
  box-shadow: 7px 8px 0 var(--ink);
  overflow: hidden;
  transform: rotate(2deg);
}

.portrait-inner {
  position: absolute;
  inset: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: 2px dashed rgba(41, 45, 50, 0.38);
  border-radius: 50%;
  background:
    radial-gradient(circle at 25% 24%, rgba(255,255,255,.7) 0 8%, transparent 8.4%),
    radial-gradient(circle at 75% 72%, rgba(255,255,255,.45) 0 11%, transparent 11.5%),
    #cbdde3;
  color: #5e6e77;
  text-align: center;
}
.portrait-sun { color: var(--coral); font-size: clamp(3rem, 7vw, 5.6rem); text-shadow: 2px 3px 0 rgba(41,45,50,.18); }
.portrait-prompt { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.03em; line-height: 1.25; }
.portrait-spark { position: absolute; top: 18%; right: 19%; color: var(--cream); font-size: 1.4rem; }
.portrait-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-image[hidden] { display: none; }
.portrait-caption {
  position: absolute;
  z-index: 2;
  bottom: 16%;
  left: 50%;
  max-width: min(78%, 340px);
  margin: 0;
  padding: 0.3rem 0.8rem 0.38rem;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff8f1;
  box-shadow: 2px 3px 0 var(--ink);
  font-family: var(--script);
  font-size: clamp(0.96rem, 1.7vw, 1.2rem);
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-1deg);
}
.photo-picker { position: absolute; z-index: 3; right: 2%; bottom: 8%; min-height: 42px; padding-inline: 0.9rem; font-size: 0.76rem; }

.name-tag {
  position: absolute;
  z-index: 2;
  bottom: 2%;
  left: 8%;
  width: min(78%, 355px);
  margin: 0;
  padding: 0.45rem 0.8rem 0.55rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 3px 4px 0 var(--ink);
  font-family: var(--script);
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transform: rotate(-1.5deg);
}

.balloon {
  position: absolute;
  z-index: 0;
  width: clamp(53px, 7vw, 82px);
  height: clamp(70px, 9vw, 108px);
  border: 3px solid var(--ink);
  border-radius: 52% 48% 50% 50% / 58% 58% 42% 42%;
  background: var(--coral);
  box-shadow: inset -10px -8px 0 rgba(206, 61, 94, 0.13);
  animation: balloon-drift 5s ease-in-out infinite;
}
.balloon::before {
  position: absolute;
  bottom: -11px;
  left: calc(50% - 6px);
  width: 10px;
  height: 10px;
  background: var(--coral);
  border: 2px solid var(--ink);
  border-top: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  content: "";
}
.balloon::after {
  position: absolute;
  top: 27%;
  left: 23%;
  width: 8px;
  height: 26px;
  border-left: 3px solid var(--ink);
  border-radius: 50%;
  content: "";
}
.balloon span { position: absolute; bottom: -62px; left: 50%; width: 1px; height: 54px; background: var(--ink); transform: rotate(8deg); }
.balloon-one { top: 5%; left: 9%; background: #ff96a0; transform: rotate(-9deg); }
.balloon-two { top: 52%; right: 1%; background: #f55e7d; animation-delay: -1.3s; transform: rotate(8deg); }
.balloon-three { top: 1%; right: 8%; width: clamp(46px, 6vw, 68px); height: clamp(62px, 8vw, 90px); background: #f2abc2; animation-delay: -2.1s; transform: rotate(7deg); }

.art-spark { position: absolute; z-index: 2; color: var(--ink); }
.art-spark-one { top: 18%; right: 2%; font-size: 1.8rem; }
.art-spark-two { bottom: 29%; left: 2%; font-size: 1.7rem; }
.smiley-sticker {
  position: absolute;
  z-index: 2;
  bottom: 13%;
  left: 5%;
  display: grid;
  width: 74px;
  aspect-ratio: 1;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  color: #172d3a;
  font-size: 2.65rem;
  transform: rotate(-12deg);
}
.birthday-seal {
  position: absolute;
  z-index: 2;
  top: 27%;
  right: -2%;
  display: flex;
  width: 75px;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #ed6379;
  box-shadow: 2px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-align: center;
  transform: rotate(8deg);
}
.birthday-seal b { display: grid; width: 23px; height: 23px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--cream); color: #b83253; font-size: 0.8rem; }

.keepsake-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 0.5rem 0 5.5rem; }
.keepsake-card {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  background: var(--cream);
  box-shadow: 3px 4px 0 var(--ink);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.keepsake-card:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: 3px 7px 0 var(--ink); }
.keepsake-memory { background: #fff6f1; }
.keepsake-notes { background: #f4eafa; }
.keepsake-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border: 2px solid var(--ink); border-radius: 14px; background: var(--coral); font-size: 1.6rem; }
.keepsake-memory .keepsake-icon { background: #dce9e5; }
.keepsake-notes .keepsake-icon { background: #e6d6f1; }
.keepsake-card strong, .keepsake-card small { display: block; }
.keepsake-card strong { font-size: 0.96rem; }
.keepsake-card small { margin-top: 0.2rem; color: #68656a; font-size: 0.72rem; }
.keepsake-arrow { margin-left: auto; align-self: flex-start; font-size: 1.05rem; }

.section { padding-block: 3.9rem 4.4rem; }
.section-kicker { color: #76636a; font-size: 0.7rem; }
.section-kicker > span { color: var(--coral-dark); font-size: 0.8rem; }
.section-kicker > i { width: 31px; height: 2px; background: var(--coral-dark); }
.letter-section { padding-top: 0; }

.letter-teaser {
  position: relative;
  display: grid;
  min-height: 330px;
  grid-template-columns: minmax(250px, 0.9fr) 1.1fr;
  align-items: center;
  gap: 3rem;
  margin-top: 1.4rem;
  padding: 2.1rem 7%;
  border: 2.5px solid var(--ink);
  border-radius: 28px;
  background: #fff8f1;
  box-shadow: 5px 6px 0 var(--ink);
  overflow: hidden;
}

.envelope-art {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1.34;
  margin-inline: auto;
  filter: drop-shadow(4px 5px 0 rgba(41,45,50,.18));
  transform: rotate(-3deg);
}
.envelope-body {
  position: absolute;
  inset: 21% 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 0 10% 11%;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(145deg, #ff95a2, #f06c83);
  color: #fff8ef;
  font-family: var(--script);
  font-size: 1.05rem;
  line-height: 0.95;
}
.envelope-body b { font-size: 1.7rem; }
.envelope-body::before, .envelope-body::after { position: absolute; bottom: 0; width: 0; height: 0; border-style: solid; content: ""; }
.envelope-body::before { left: 0; border-width: 0 0 121px 157px; border-color: transparent transparent #e86179 transparent; }
.envelope-body::after { right: 0; border-width: 0 0 121px 157px; border-color: transparent transparent #f47b8b transparent; transform: scaleX(-1); }
.envelope-paper { position: absolute; top: 0; left: 9%; width: 82%; height: 78%; border: 2px solid var(--ink); border-radius: 6px; background: var(--cream); transform: rotate(1deg); }
.envelope-flap { position: absolute; z-index: 1; top: 21%; left: 0; width: 100%; height: 50%; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); background: #ff9ea8; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.envelope-stamp { position: absolute; z-index: 2; top: 37%; right: 13%; display: grid; width: 37px; height: 37px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: #ffeacb; color: #b83253; font-size: 1.2rem; }
.letter-teaser-copy h2 { margin: 0 0 0.7rem; font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 0.96; letter-spacing: -0.04em; }
.letter-teaser-copy h2 em, .section-heading h2 em, .notes-title-row h2 em, .surprise-content h2 em { color: var(--coral-dark); font-family: var(--script); font-size: 1.2em; font-weight: 600; }
.letter-teaser-copy p { max-width: 370px; margin: 0.9rem 0; color: #55535a; line-height: 1.6; }
.text-link { padding: 0; border: 0; background: none; color: var(--coral-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 0.25em; cursor: pointer; }
.text-link span { display: inline-block; margin-left: 0.3rem; transition: transform 180ms ease; }
.text-link:hover span { transform: translateX(4px); }
.letter-doodle { position: absolute; right: 4%; bottom: 8%; color: #e6a3aa; font-size: 2.8rem; transform: rotate(12deg); }

.memories-section { padding-top: 3rem; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.section-heading h2, .notes-title-row h2 { margin: 0.5rem 0 0; font-size: clamp(2.6rem, 5.4vw, 4.5rem); letter-spacing: -0.055em; line-height: 0.98; }
.upload-button { flex: 0 0 auto; }
.section-intro { max-width: 560px; margin: 1rem 0 1.8rem; color: #5c565b; line-height: 1.55; }
.memory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 1.35rem; }
.memory-card {
  position: relative;
  min-width: 0;
  padding: 0.8rem 0.8rem 0.65rem;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: #fffaf1;
  box-shadow: 4px 5px 0 var(--ink);
  transform: rotate(-1.2deg);
}
.memory-card-two { margin-top: 1.5rem; background: #f3e8f2; transform: rotate(1.5deg); }
.memory-card-three { transform: rotate(-0.5deg); }
.memory-card:nth-child(3n) { background: #fff4ec; }
.memory-photo { position: relative; display: grid; width: 100%; aspect-ratio: 1.18; place-items: center; overflow: hidden; background: #e7dfd9; }
.memory-photo img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-photo { align-content: center; gap: 0.25rem; background: repeating-linear-gradient(135deg, #f3d8dd 0 12px, #f7e8e8 12px 24px); color: #a24866; }
.placeholder-photo span { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.placeholder-photo small { color: var(--ink); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.memory-card p { min-height: 1.5em; margin: 0.7rem 0 0.1rem; font-family: var(--script); font-size: 1.45rem; font-weight: 600; text-align: center; }
.tape { position: absolute; top: -9px; left: calc(50% - 40px); width: 80px; height: 21px; background: rgba(255, 199, 169, 0.72); clip-path: polygon(0 0,100% 0,95% 100%,5% 100%); transform: rotate(-4deg); }
.memory-card-two .tape { background: rgba(216, 190, 225, 0.72); transform: rotate(5deg); }
.memory-card-three .tape { background: rgba(255, 208, 143, 0.72); transform: rotate(-1deg); }

.notes-section { padding-top: 2.2rem; }
.notes-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notes-title-row h2 { max-width: 760px; }
.tiny-stamp { display: grid; width: 70px; height: 70px; place-items: center; border: 2px dashed var(--ink); border-radius: 50%; background: #ffb0bc; font-family: var(--script); font-size: 1.4rem; font-weight: 700; transform: rotate(12deg); }
.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.8rem; }
.note-card { position: relative; min-height: 156px; padding: 1.3rem 1.25rem; border: 2px solid var(--ink); border-radius: 18px; box-shadow: 3px 4px 0 var(--ink); }
.note-card > span { position: absolute; top: 0.65rem; right: 0.8rem; font-size: 1.1rem; }
.note-card p { margin: 1rem 0 0; font-family: var(--script); font-size: 1.55rem; font-weight: 600; line-height: 1.08; }
.note-card-pink { background: #ffd4d7; transform: rotate(-1deg); }
.note-card-cream { background: #fff4d9; transform: rotate(0.9deg); }
.note-card-lilac { background: #eadcf1; transform: rotate(-0.5deg); }

.surprise-section {
  position: relative;
  display: grid;
  min-height: 560px;
  place-items: center;
  margin-top: 2.5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 105%, rgba(255, 120, 133, .28), transparent 54%),
    #28243a;
  color: #fff8f1;
}
#fireworks-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.surprise-content { position: relative; z-index: 1; padding-block: 5rem; text-align: center; }
.section-kicker-light { justify-content: center; color: #e8dce9; }
.section-kicker-light > span { color: #ff9eaa; }
.section-kicker-light > i { background: #ff9eaa; }
.surprise-overline { justify-content: center; margin-top: 2.4rem; color: #efcdd6; font-size: 0.74rem; }
.surprise-content h2 { margin: 0.45rem 0 0.7rem; font-size: clamp(3.6rem, 9vw, 7rem); letter-spacing: -0.06em; line-height: 0.9; }
.surprise-content h2 em { color: #ff9eaa; }
.final-message { max-width: 600px; margin: 1rem auto 0.35rem; font-size: 1.05rem; line-height: 1.65; }
.final-signoff { margin: 0; color: #f2dbe3; font-family: var(--script); font-size: 1.7rem; }
.final-signoff span { color: #ff9eaa; }
.surprise-button { margin-top: 1.4rem; }
.audio-status { min-height: 1.2rem; margin: 0.8rem 0 0; color: #d4cbd9; font-size: 0.75rem; }
.surprise-spark { position: absolute; color: #ffe1a5; font-size: 2rem; animation: twinkle 2.3s ease-in-out infinite; }
.surprise-spark-left { top: 35%; left: 12%; }
.surprise-spark-right { top: 27%; right: 14%; animation-delay: -1s; }

.footer { display: flex; min-height: 112px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.55rem 1.5rem; padding-block: 1.4rem; font-size: 0.78rem; }
.footer p { margin: 0; }
.footer p:first-child span { color: var(--coral-dark); }
.footer-replay { padding: 0; border: 0; background: none; color: var(--coral-dark); font-size: 0.78rem; font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.footer-credit { color: #6a6267; }
.footer-credit a { color: inherit; }

.letter-dialog {
  position: fixed;
  width: min(530px, calc(100% - 32px));
  max-width: none;
  max-height: min(90dvh, 760px);
  padding: 2rem 1.6rem 1.6rem;
  border: 2.5px solid var(--ink);
  border-radius: 24px;
  background: #fff8f1;
  box-shadow: 7px 8px 0 var(--ink);
  color: var(--ink);
  overflow: visible;
}
.letter-dialog::backdrop { background: rgba(20, 16, 29, 0.66); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; z-index: 4; top: 0.65rem; right: 0.75rem; display: grid; width: 40px; height: 40px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--coral); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.dialog-envelope { position: relative; min-height: 400px; margin-top: 1rem; padding: 1rem; border: 2px solid #db6e80; border-radius: 12px; background: #f38491; overflow: hidden; }
.dialog-paper { position: relative; z-index: 1; display: flex; min-height: 355px; flex-direction: column; align-items: flex-start; justify-content: center; padding: 1.8rem 1.6rem; border: 1.5px solid #dfd4c5; border-radius: 5px; background: #fffdf5; box-shadow: 2px 3px 8px rgba(41,45,50,.14); animation: paper-rise 850ms cubic-bezier(.18,.9,.3,1) both; }
.dialog-paper-flower { position: absolute; top: 1rem; right: 1.2rem; color: var(--coral); font-size: 2rem; }
.dialog-dear { margin: 0 0 0.7rem; color: #705d62; font-family: var(--script); font-size: 1.4rem; }
.dialog-paper h2 { margin: 0; color: var(--coral-dark); font-size: 2rem; }
.dialog-message { margin: 0.75rem 0; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-signoff { margin: 0.45rem 0 0; font-family: var(--script); font-size: 1.25rem; line-height: 1.1; }
.dialog-signoff span { color: var(--coral-dark); font-size: 1.5rem; font-weight: 700; }
.dialog-envelope-front { position: absolute; z-index: 2; inset: auto 0 0; height: 26%; background: linear-gradient(145deg, #f18491 49%, #e66a7e 50%); clip-path: polygon(0 0, 50% 65%, 100% 0, 100% 100%, 0 100%); pointer-events: none; }
.dialog-flap { position: absolute; z-index: 3; top: 0; left: 0; width: 100%; height: 38%; background: #ffadb3; clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; animation: flap-open 700ms 80ms ease-in forwards; }
.dialog-caption { margin: 1rem 0 0; color: #806b72; font-family: var(--script); font-size: 1.4rem; text-align: center; }
.noscript-note { position: fixed; z-index: 30; right: 1rem; bottom: 1rem; left: 1rem; margin: 0; padding: 1rem; border: 2px solid var(--ink); border-radius: 12px; background: var(--cream); }

@keyframes balloon-drift { 0%,100% { margin-top: 0; } 50% { margin-top: -12px; } }
@keyframes twinkle { 0%,100% { opacity: .45; transform: scale(.9) rotate(-10deg); } 50% { opacity: 1; transform: scale(1.12) rotate(10deg); } }
@keyframes paper-rise { from { transform: translateY(40px) scale(.98); opacity: .3; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes flap-open { to { transform: rotateX(180deg); z-index: 0; } }
@keyframes page-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .shell { width: min(100% - 40px, 700px); }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 0.5rem; padding-top: 2rem; }
  .hero-copy { padding: 0.8rem 0 0; text-align: center; }
  .hero h1 { align-items: center; font-size: clamp(4.5rem, 13vw, 7rem); }
  .eyebrow, .hero-actions { justify-content: center; }
  .date-ribbon, .hero-message { margin-inline: auto; }
  .sender-note { text-align: center; }
  .hero-art { min-height: clamp(390px, 72vw, 510px); }
  .portrait-frame { width: clamp(285px, 54vw, 390px); }
  .photo-picker { right: 10%; bottom: 6%; }
  .name-tag { bottom: 0; left: 12%; }
  .doodle-star-one { top: 5%; right: 14%; }
  .doodle-star-two { bottom: 8%; right: 15%; }
  .keepsake-nav { padding-bottom: 4rem; }
  .letter-teaser { gap: 1.5rem; padding-inline: 5%; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 32px); }
  .topbar { min-height: 78px; padding-top: max(0.5rem, env(safe-area-inset-top)); }
  .brand { gap: 0.45rem; font-size: 0.75rem; }
  .brand-mark { width: 2rem; height: 2rem; font-size: 1rem; }
  .sound-controls { gap: 0.4rem; }
  .sound-pick, .sound-toggle { min-height: 40px; padding: 0.48rem 0.66rem; font-size: 0.7rem; }
  .sound-pick { max-width: 130px; line-height: 1.05; }
  .hero { padding-top: 1.25rem; }
  .eyebrow { font-size: 0.61rem; letter-spacing: 0.07em; }
  .hero h1 { margin-top: 1.1rem; font-size: clamp(4rem, 17vw, 6.2rem); }
  .title-happy, .title-birthday { -webkit-text-stroke-width: 1.5px; text-shadow: 2px 3px 0 var(--ink); }
  .date-ribbon { width: min(330px, 95%); min-height: 46px; margin-top: 1.2rem; font-size: 1.45rem; }
  .hero-message { max-width: 360px; font-size: 0.91rem; }
  .hero-actions { gap: 0.65rem; }
  .button { min-height: 46px; padding: 0.66rem 0.9rem; font-size: 0.78rem; }
  .hero-art { min-height: 375px; margin-top: -0.2rem; }
  .portrait-frame { width: min(78vw, 335px); border-width: 4px; box-shadow: 5px 6px 0 var(--ink); }
  .portrait-caption { bottom: 17%; max-width: 82%; padding: 0.26rem 0.6rem 0.32rem; font-size: 0.92rem; }
  .photo-picker { right: 2%; bottom: 5%; min-height: 40px; font-size: 0.7rem; }
  .name-tag { left: 5%; bottom: 0; width: 74%; font-size: 1.55rem; }
  .balloon-one { top: 1%; left: 2%; }
  .balloon-two { top: 42%; right: -2%; }
  .balloon-three { top: 0; right: 4%; }
  .smiley-sticker { bottom: 10%; left: 1%; width: 58px; border-width: 3px; font-size: 2rem; }
  .birthday-seal { top: 24%; right: -2%; width: 63px; font-size: 0.41rem; }
  .art-spark-one { top: 16%; right: 0; }
  .art-spark-two { bottom: 20%; left: 2%; }
  .keepsake-nav { grid-template-columns: 1fr; gap: 0.7rem; padding-block: 1.4rem 3.5rem; }
  .keepsake-card { min-height: 72px; padding: 0.72rem 0.85rem; }
  .keepsake-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 1.35rem; }
  .section { padding-block: 2.9rem 3.3rem; }
  .letter-section { padding-top: 0; }
  .letter-teaser { min-height: 0; grid-template-columns: 1fr; gap: 0.8rem; padding: 1.4rem 1.1rem 1.8rem; }
  .envelope-art { width: min(79%, 270px); }
  .letter-teaser-copy { text-align: center; }
  .letter-teaser-copy h2 { font-size: 2.3rem; }
  .letter-teaser-copy p { margin-inline: auto; font-size: 0.9rem; }
  .letter-doodle { right: 5%; bottom: 6%; font-size: 1.9rem; }
  .section-heading { align-items: flex-start; }
  .section-heading h2, .notes-title-row h2 { font-size: clamp(2.45rem, 11vw, 3.7rem); }
  .upload-button { min-height: 42px; gap: 0.3rem; padding-inline: 0.65rem; font-size: 0.68rem; }
  .section-intro { margin-top: 0.8rem; font-size: 0.88rem; }
  .memory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.75rem; }
  .memory-card { padding: 0.5rem 0.5rem 0.45rem; }
  .memory-card-two { margin-top: 0.65rem; }
  .memory-card:nth-child(3) { grid-column: 1 / 2; }
  .memory-card p { margin-top: 0.5rem; font-size: 1.2rem; }
  .placeholder-photo small { font-size: 0.58rem; }
  .notes-title-row { align-items: flex-start; }
  .tiny-stamp { width: 56px; height: 56px; flex: 0 0 56px; font-size: 1.1rem; }
  .note-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .note-card { min-height: 112px; padding: 1rem 1.1rem; }
  .note-card p { max-width: 27rem; font-size: 1.4rem; }
  .surprise-section { min-height: 510px; }
  .surprise-content { padding-block: 4rem; }
  .surprise-overline { margin-top: 2rem; font-size: 0.65rem; }
  .surprise-content h2 { font-size: clamp(3.7rem, 16vw, 5.5rem); }
  .final-message { max-width: 350px; font-size: 0.94rem; }
  .surprise-spark-left { left: 4%; }
  .surprise-spark-right { right: 4%; }
  .footer { justify-content: center; padding-block: 1.5rem; text-align: center; }
  .footer p, .footer button { width: 100%; }
  .intro-credit { right: 0; left: 0; text-align: center; font-size: 0.68rem; }
  .intro-note { bottom: max(4.6rem, calc(env(safe-area-inset-bottom) + 4rem)); }
  .letter-dialog { padding: 1.6rem 0.85rem 1rem; }
  .dialog-envelope { min-height: 390px; padding: 0.6rem; }
  .dialog-paper { min-height: 350px; padding: 1.45rem 1.2rem; }
  .dialog-message { font-size: 0.92rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
