:root {
  --cream: #fff8ed;
  --paper: #fffdf7;
  --ink: #49372f;
  --red: #d94a43;
  --red-dark: #a82e31;
  --pink: #f2c7c5;
  --green: #68835b;
  --green-dark: #3f6147;
  --gold: #d1a442;
  --shadow: 0 24px 70px rgb(88 48 40 / 18%);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  background: var(--cream);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--sans);
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
}

.opening {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--cream);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.opening.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.opening p {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.opening__fruit {
  font-size: 4.5rem;
  animation: opening-bounce 1s ease-in-out infinite alternate;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 clamp(18px, 4vw, 64px);
  color: var(--ink);
  background: rgb(255 248 237 / 72%);
  border-bottom: 1px solid rgb(95 70 59 / 10%);
  backdrop-filter: blur(18px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand__slice {
  position: relative;
  width: 30px;
  height: 17px;
  overflow: hidden;
  background: var(--red);
  border: 4px solid var(--green);
  border-radius: 30px 30px 5px 5px;
}

.brand__slice::before,
.brand__slice::after {
  position: absolute;
  top: 3px;
  width: 3px;
  height: 5px;
  content: "";
  background: var(--ink);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.brand__slice::before { left: 7px; }
.brand__slice::after { right: 7px; }

.topbar__actions {
  display: flex;
  gap: 8px;
}

.topbar button,
.story-controls button,
.start-button,
.magic-button,
.wish-button,
.confetti-button,
.replay-button {
  border: 0;
  cursor: pointer;
}

.topbar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  background: rgb(255 255 255 / 72%);
  border: 1px solid rgb(95 70 59 / 15%);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
}

.topbar button:hover,
.topbar button[aria-pressed="true"] {
  color: white;
  background: var(--red);
  border-color: var(--red);
}

.progress {
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 3px;
  background: rgb(217 74 67 / 10%);
}

.progress span {
  display: block;
  width: 8.333%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chapter-nav {
  position: fixed;
  z-index: 90;
  top: 50%;
  right: clamp(12px, 2vw, 30px);
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.chapter-dot {
  position: relative;
  width: 10px;
  height: 10px;
  padding: 0;
  background: rgb(73 55 47 / 22%);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

.chapter-dot::before {
  position: absolute;
  top: 50%;
  right: 18px;
  width: max-content;
  padding: 5px 9px;
  color: white;
  content: attr(data-label);
  background: var(--ink);
  border-radius: 8px;
  font-size: 0.7rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -50%);
  transition: 0.2s ease;
}

.chapter-dot:hover::before,
.chapter-dot:focus-visible::before {
  opacity: 1;
  transform: translate(0, -50%);
}

.chapter-dot.is-active {
  background: var(--red);
  transform: scale(1.5);
}

.chapter {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
}

.chapter h1,
.chapter h2,
.chapter p,
.chapter figure {
  margin: 0;
}

.chapter h1,
.chapter h2 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

.chapter h2 {
  font-size: clamp(2.5rem, 6vw, 6.8rem);
}

.eyebrow,
.chapter-number {
  color: var(--red);
  font-size: clamp(0.72rem, 1.1vw, 0.92rem);
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scene-heading {
  position: relative;
  z-index: 5;
  max-width: 850px;
  padding: clamp(110px, 13vh, 150px) 8vw 0;
}

.scene-heading h2 {
  margin: 12px 0 18px;
  color: var(--red);
}

.scene-heading > p:last-child,
.split-copy > p:last-child,
.first-steps__copy > p:last-child,
.birthday__copy > p:last-child,
.finale__copy > p:not(.eyebrow):not(.final-date) {
  max-width: 630px;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  line-height: 1.65;
}

.reveal,
.reveal-left,
.reveal-right,
.reveal-up {
  opacity: 0;
  transition: opacity 0.9s ease, transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal { transform: translateY(34px); }
.reveal-left { transform: translateX(-80px) rotate(-5deg); }
.reveal-right { transform: translateX(80px) rotate(5deg); }
.reveal-up { transform: translateY(90px) rotate(2deg); }

.chapter.is-active .reveal,
.chapter.is-active .reveal-left,
.chapter.is-active .reveal-right,
.chapter.is-active .reveal-up {
  opacity: 1;
  transform: none;
}

.chapter.is-active .reveal-left { transition-delay: 0.12s; }
.chapter.is-active .reveal-right { transition-delay: 0.24s; }
.chapter.is-active .reveal-up { transition-delay: 0.34s; }

.hero {
  display: grid;
  place-items: center;
  min-height: 100svh;
  color: white;
  background: var(--green-dark);
}

.hero__photo,
.hero__wash {
  position: absolute;
  inset: -5%;
}

.hero__photo {
  background: url("assets/photos/3Q4A4306.JPG") center 46% / cover no-repeat;
  transform: scale(1.08);
}

.hero__wash {
  z-index: 1;
  background:
    radial-gradient(circle at 65% 35%, transparent 0 20%, rgb(56 77 52 / 22%) 58%, rgb(45 44 34 / 70%) 100%),
    linear-gradient(90deg, rgb(47 45 35 / 72%), rgb(47 45 35 / 5%) 68%);
}

.hero__copy {
  position: relative;
  z-index: 6;
  justify-self: start;
  width: min(700px, 82vw);
  margin-left: clamp(28px, 9vw, 150px);
}

.hero h1 {
  margin: 15px 0 28px;
  font-size: clamp(3.6rem, 8.5vw, 8.8rem);
  text-wrap: balance;
}

.hero h1 em {
  display: block;
  color: #ffe5d3;
  font-size: 0.47em;
  font-weight: 400;
  line-height: 1.22;
}

.hero .eyebrow { color: #ffd5a8; }

.lead {
  max-width: 580px;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.65;
}

.start-button,
.magic-button,
.wish-button,
.confetti-button,
.replay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  margin-top: 30px;
  padding: 0 24px;
  color: white;
  background: var(--red);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgb(159 45 45 / 28%);
  font-weight: 800;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.start-button:hover,
.magic-button:hover,
.wish-button:hover,
.confetti-button:hover,
.replay-button:hover {
  box-shadow: 0 18px 40px rgb(159 45 45 / 36%);
  transform: translateY(-3px);
}

.mascot,
.garland {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  user-select: none;
}

.mascot--hero {
  right: clamp(20px, 5vw, 80px);
  bottom: clamp(38px, 5vh, 80px);
  width: clamp(150px, 22vw, 340px);
  filter: drop-shadow(0 22px 22px rgb(34 44 25 / 28%));
  animation: mascot-float 4s ease-in-out infinite;
}

.garland--hero {
  top: 8vh;
  right: -6vw;
  width: clamp(260px, 34vw, 560px);
  animation: garland-float 6s ease-in-out infinite alternate;
}

.floaters span {
  position: absolute;
  z-index: 4;
  bottom: -80px;
  width: var(--size);
  height: var(--size);
  background: rgb(255 235 218 / 78%);
  border-radius: 50%;
  animation: bubble-rise var(--duration) linear infinite;
  animation-delay: var(--delay);
  left: var(--left);
}

.red-room {
  min-height: max(100svh, 820px);
  background:
    radial-gradient(circle at 82% 18%, rgb(242 199 197 / 60%) 0 12%, transparent 13%),
    linear-gradient(150deg, #fff9ef 0 55%, #f8ded7 100%);
}

.collage {
  position: absolute;
  right: 5vw;
  bottom: 4vh;
  width: min(58vw, 900px);
  height: 70vh;
  min-height: 560px;
}

.photo-card {
  position: absolute;
  overflow: hidden;
  background: white;
  border: 9px solid white;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.photo-card img,
.film-frame img,
.step-sequence img,
.arch-photo img,
.circle-photo img,
.torn-photo img,
.mini-photo img,
.orbit-gallery img,
.polaroid img,
.wish-gallery img,
.birthday-reel img,
.finale__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage .card-a { inset: 0 auto auto 0; width: 58%; height: 58%; transform: rotate(-4deg); }
.collage .card-b { inset: 7% 0 auto auto; width: 42%; height: 45%; transform: rotate(5deg); }
.collage .card-c { inset: auto auto 0 8%; width: 40%; height: 45%; transform: rotate(3deg); }
.collage .card-d { inset: auto 3% 2% auto; width: 45%; height: 46%; transform: rotate(-5deg); }

.collage .card-a img { object-position: 50% 45%; }
.collage .card-b img,
.collage .card-c img,
.collage .card-d img { object-position: 50% 36%; }

.scribble {
  position: absolute;
  z-index: 6;
  color: var(--red);
  font-family: "Comic Sans MS", cursive;
  font-size: clamp(1.3rem, 2.4vw, 2.4rem);
  font-weight: 700;
  transform: rotate(-9deg);
}

.scribble--one { left: 9vw; bottom: 12vh; }
.scribble--one::after { content: "↗"; margin-left: 8px; }

.treasure {
  min-height: max(100svh, 850px);
  color: white;
  background: linear-gradient(135deg, #842b30, #c84643 58%, #df7d68);
}

.split-copy {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 7vw;
  width: min(37vw, 540px);
  transform: translateY(-50%);
}

.split-copy h2 {
  margin: 16px 0 26px;
}

.treasure .chapter-number { color: #ffd5a8; }

.filmstrip {
  position: absolute;
  top: 50%;
  right: -5vw;
  display: flex;
  align-items: stretch;
  gap: 22px;
  width: 62vw;
  padding: 30px;
  background: rgb(88 25 29 / 26%);
  transform: translateY(-50%) rotate(-2deg);
}

.film-frame {
  flex: 0 0 min(17vw, 280px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: white;
  border: 8px solid white;
  box-shadow: 0 18px 40px rgb(57 14 18 / 30%);
  transform: translateY(80px) rotate(var(--tilt, 0deg));
  opacity: 0;
  transition: 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.film-frame:nth-child(1) { --tilt: -4deg; }
.film-frame:nth-child(2) { --tilt: 3deg; }
.film-frame:nth-child(3) { --tilt: -2deg; }
.film-frame:nth-child(4) { --tilt: 4deg; }

.chapter.is-active .film-frame {
  opacity: 1;
  transform: translateY(0) rotate(var(--tilt));
}

.chapter.is-active .film-frame:nth-child(2) { transition-delay: 0.14s; }
.chapter.is-active .film-frame:nth-child(3) { transition-delay: 0.28s; }
.chapter.is-active .film-frame:nth-child(4) { transition-delay: 0.42s; }

.film-frame img { object-position: 50% 35%; }

.rolling-fruit {
  position: absolute;
  z-index: 1;
  font-size: 4rem;
  opacity: 0.28;
}

.fruit-1 { right: 12vw; bottom: 5vh; animation: fruit-roll 9s linear infinite; }
.fruit-2 { top: 15vh; left: 43vw; color: #ffb0a1; animation: fruit-roll 7s linear infinite reverse; }

.little-trip {
  min-height: max(100svh, 860px);
  color: white;
  background: #6c2d31;
}

.little-trip::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(120deg, rgb(90 27 30 / 84%), rgb(106 45 49 / 38%)), url("assets/photos/3Q4A4191.JPG") center / cover;
  filter: blur(2px);
  transform: scale(1.03);
}

.scene-heading--light h2,
.scene-heading--light .chapter-number { color: #ffe1bb; }

.trip-grid {
  position: absolute;
  z-index: 3;
  right: 6vw;
  bottom: 5vh;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  grid-template-rows: 1fr 1fr 0.8fr;
  gap: 18px;
  width: min(58vw, 930px);
  height: 69vh;
  min-height: 570px;
}

.trip-grid .photo-card { position: relative; inset: auto; width: auto; height: auto; }
.trip-main { grid-row: 1 / 3; }
.trip-wide { grid-column: 1 / 3; }
.trip-grid img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }

.road {
  position: absolute;
  z-index: 4;
  left: 3vw;
  bottom: 7vh;
  width: 38vw;
  height: 100px;
  overflow: hidden;
}

.road::before {
  position: absolute;
  inset: 48px 0 auto;
  content: "";
  border-top: 3px dashed rgb(255 225 187 / 65%);
}

.road span {
  position: absolute;
  top: 28px;
  left: -60px;
  width: 58px;
  height: 32px;
  background: #fff3df;
  border-radius: 16px 16px 8px 8px;
  animation: car-drive 7s ease-in-out infinite;
}

.road span::before,
.road span::after {
  position: absolute;
  bottom: -8px;
  width: 16px;
  height: 16px;
  content: "";
  background: var(--ink);
  border-radius: 50%;
}
.road span::before { left: 7px; }
.road span::after { right: 7px; }

.first-steps {
  min-height: max(100svh, 850px);
  background:
    linear-gradient(90deg, transparent 49.8%, rgb(103 131 91 / 12%) 50%, transparent 50.2%),
    var(--cream);
}

.first-steps__copy {
  position: absolute;
  top: 16vh;
  left: 7vw;
  z-index: 4;
  width: min(33vw, 500px);
}

.first-steps__copy h2 { margin: 14px 0 25px; color: var(--red); }

.first-steps__feature {
  display: none;
  margin: 0;
}

.first-steps__feature img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.magic-ring,
.fairy-spark {
  position: absolute;
  pointer-events: none;
}

.step-sequence {
  position: absolute;
  right: 5vw;
  bottom: 8vh;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 1.4vw, 22px);
  width: 63vw;
}

.step-sequence figure {
  position: relative;
  flex: 1;
  height: 55vh;
  min-height: 450px;
  overflow: hidden;
  border-radius: 999px 999px 24px 24px;
  box-shadow: var(--shadow);
  transform: translateY(110px);
  opacity: 0;
  transition: 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.step-sequence figure:nth-child(even) { height: 61vh; }
.step-sequence img { object-position: 50% 40%; }

.step-sequence span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-content: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--red);
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 800;
}

.chapter.is-active .step-sequence figure { opacity: 1; transform: none; }
.chapter.is-active .step-sequence figure:nth-child(2) { transition-delay: 0.12s; }
.chapter.is-active .step-sequence figure:nth-child(3) { transition-delay: 0.24s; }
.chapter.is-active .step-sequence figure:nth-child(4) { transition-delay: 0.36s; }

.mascot--steps {
  left: 3vw;
  bottom: 3vh;
  width: clamp(115px, 15vw, 240px);
  filter: drop-shadow(0 15px 18px rgb(67 64 44 / 20%));
  animation: mascot-peek 4s ease-in-out infinite;
}

.doorway {
  display: grid;
  place-items: center;
  min-height: 100svh;
  background: #fff5dc;
}

.doorway__art {
  position: absolute;
  inset: -4%;
  background: url("assets/illustrations/princess-gate-v2.webp") center 42% / cover no-repeat;
  transform: scale(1.08);
  transition: filter 1s ease, transform 2s ease;
}

.doorway::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: linear-gradient(90deg, rgb(65 47 35 / 62%), transparent 62%);
}

.doorway__glow {
  position: absolute;
  z-index: 2;
  top: 47%;
  left: 52%;
  width: min(37vw, 620px);
  aspect-ratio: 0.78;
  background: rgb(255 247 190 / 25%);
  border-radius: 50% 50% 10% 10%;
  filter: blur(30px);
  transform: translate(-50%, -50%);
  transition: 1.2s ease;
}

.doorway.is-open .doorway__art { filter: saturate(1.08) brightness(1.08); transform: scale(1.15); }
.doorway.is-open .doorway__glow { background: rgb(255 247 190 / 75%); filter: blur(50px); transform: translate(-50%, -50%) scale(1.25); }

.doorway__copy {
  position: absolute;
  z-index: 5;
  left: 7vw;
  width: min(40vw, 560px);
  color: white;
}

.doorway__copy h2 { margin: 14px 0 24px; }
.doorway__copy .chapter-number { color: #ffe0a6; }

.garden-entry {
  min-height: max(100svh, 880px);
  background: linear-gradient(145deg, #fffaf0 0 55%, #eef3e8 100%);
}

.garden-entry .scene-heading h2 { color: var(--green-dark); }

.storybook-art img {
  object-position: 50% 38%;
}

.garden-collage {
  position: absolute;
  right: 4vw;
  bottom: 3vh;
  width: min(62vw, 1000px);
  height: 72vh;
}

.garden-collage figure {
  position: absolute;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.arch-photo {
  inset: 0 auto auto 0;
  width: 46%;
  height: 78%;
  border: 10px solid white;
  border-radius: 220px 220px 32px 32px;
}

.circle-photo {
  top: 4%;
  right: 2%;
  width: 40%;
  aspect-ratio: 1;
  border: 10px solid white;
  border-radius: 50%;
}

.torn-photo {
  right: 4%;
  bottom: 0;
  width: 45%;
  height: 43%;
  border: 10px solid white;
  clip-path: polygon(2% 3%, 98% 0, 100% 93%, 93% 100%, 4% 97%, 0 83%);
}

.mini-photo {
  left: 34%;
  bottom: 2%;
  width: 26%;
  aspect-ratio: 1;
  border: 9px solid white;
  border-radius: 26px;
  transform: rotate(-8deg);
}

.garden-collage img { object-position: 50% 42%; }

.petals span {
  position: absolute;
  z-index: 6;
  top: -30px;
  left: var(--left);
  width: 18px;
  height: 12px;
  background: var(--petal, #f1bbb9);
  border-radius: 70% 20% 70% 20%;
  opacity: 0.7;
  animation: petal-fall var(--duration) linear infinite;
  animation-delay: var(--delay);
}

.flower-friends {
  min-height: max(100svh, 850px);
  background:
    radial-gradient(circle at 80% 25%, #f6deda 0 14%, transparent 15%),
    linear-gradient(145deg, #edf3e7, #fffaf0 62%);
}

.split-copy--green { color: var(--ink); }
.split-copy--green h2 { color: var(--green-dark); }

.orbit-gallery {
  position: absolute;
  top: 50%;
  right: 4vw;
  width: min(58vw, 900px);
  aspect-ratio: 1.25;
  transform: translateY(-50%);
}

.orbit-gallery figure {
  position: absolute;
  overflow: hidden;
  background: white;
  border: 8px solid white;
  border-radius: 50%;
  box-shadow: var(--shadow);
  transform: scale(0.6);
  opacity: 0;
  transition: 0.85s cubic-bezier(0.2, 0.85, 0.2, 1.15);
}

.orbit-center { top: 8%; left: 28%; width: 48%; aspect-ratio: 1; z-index: 3; }
.orbit-one { top: 0; right: 1%; width: 28%; aspect-ratio: 1; }
.orbit-two { bottom: 0; right: 8%; width: 30%; aspect-ratio: 1; }
.orbit-three { bottom: 2%; left: 4%; width: 33%; aspect-ratio: 1; }
.orbit-gallery img { object-position: 50% 38%; }

.chapter.is-active .orbit-gallery figure { opacity: 1; transform: scale(1); }
.chapter.is-active .orbit-one { transition-delay: 0.16s; }
.chapter.is-active .orbit-two { transition-delay: 0.3s; }
.chapter.is-active .orbit-three { transition-delay: 0.44s; }

.scribble--two { right: 8vw; bottom: 8vh; color: var(--green-dark); }

.bloom {
  min-height: max(100svh, 880px);
  color: white;
  background: var(--green-dark);
}

.bloom__backdrop {
  position: absolute;
  inset: -4%;
  background: linear-gradient(90deg, rgb(37 60 42 / 85%), rgb(42 59 43 / 12%)), url("assets/photos/3Q4A4287.JPG") center / cover;
  transform: scale(1.08);
}

.bloom__copy {
  position: absolute;
  z-index: 4;
  top: 17vh;
  left: 7vw;
  width: min(39vw, 600px);
}

.bloom__copy h2 { margin-top: 14px; }
.bloom__copy .chapter-number { color: #ffe0b4; }

.polaroid-stack {
  position: absolute;
  z-index: 5;
  right: 4vw;
  bottom: 5vh;
  width: min(59vw, 930px);
  height: 70vh;
}

.polaroid {
  position: absolute;
  width: 38%;
  padding: 10px 10px 58px;
  color: var(--ink);
  background: white;
  box-shadow: 0 28px 70px rgb(23 38 27 / 35%);
  transform: translateY(120px) rotate(var(--tilt));
  opacity: 0;
  transition: 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.polaroid img { aspect-ratio: 3 / 4; object-position: 50% 42%; }
.polaroid figcaption { padding-top: 15px; font-family: "Comic Sans MS", cursive; text-align: center; }
.polaroid-1 { --tilt: -7deg; top: 0; left: 0; }
.polaroid-2 { --tilt: 5deg; top: 6%; right: 20%; }
.polaroid-3 { --tilt: -3deg; bottom: 0; left: 24%; }
.polaroid-4 { --tilt: 8deg; right: 0; bottom: 2%; }

.chapter.is-active .polaroid { opacity: 1; transform: translateY(0) rotate(var(--tilt)); }
.chapter.is-active .polaroid-2 { transition-delay: 0.14s; }
.chapter.is-active .polaroid-3 { transition-delay: 0.28s; }
.chapter.is-active .polaroid-4 { transition-delay: 0.42s; }

.wish {
  min-height: max(100svh, 850px);
  background: linear-gradient(#fff8e9 0 60%, #efd9ce 100%);
}

.wish__sky {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, #d2a33e 0 2px, transparent 3px),
    radial-gradient(circle at 68% 12%, #d2a33e 0 3px, transparent 4px),
    radial-gradient(circle at 87% 31%, #d2a33e 0 2px, transparent 3px),
    radial-gradient(circle at 41% 26%, #f1bbb9 0 5px, transparent 6px);
  background-size: 180px 180px, 260px 260px, 230px 230px, 300px 300px;
  opacity: 0.55;
}

.wish .scene-heading { max-width: 960px; }
.wish .scene-heading h2 { color: var(--green-dark); }

.wish-gallery {
  position: absolute;
  right: 6vw;
  bottom: 9vh;
  left: 6vw;
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 1.25fr;
  gap: 22px;
  height: 55vh;
}

.wish-gallery figure {
  overflow: hidden;
  border: 9px solid white;
  border-radius: 36px 36px 160px 160px;
  box-shadow: var(--shadow);
  transform: translateY(90px);
  opacity: 0;
  transition: 0.9s ease;
}

.wish-gallery figure:nth-child(2) { border-radius: 160px; }
.wish-gallery img { object-position: 50% 40%; }
.chapter.is-active .wish-gallery figure { opacity: 1; transform: none; }
.chapter.is-active .wish-gallery figure:nth-child(2) { transition-delay: 0.15s; }
.chapter.is-active .wish-gallery figure:nth-child(3) { transition-delay: 0.3s; }

.wish-button {
  position: absolute;
  z-index: 7;
  right: 7vw;
  top: 17vh;
  background: var(--green-dark);
}

.spark {
  position: fixed;
  z-index: 200;
  width: 12px;
  height: 12px;
  background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  pointer-events: none;
  animation: spark-burst 1.2s ease-out forwards;
}

.birthday {
  display: grid;
  place-items: center;
  min-height: max(100svh, 850px);
  color: white;
  background:
    radial-gradient(circle at 20% 20%, rgb(255 199 191 / 26%), transparent 22%),
    linear-gradient(135deg, #a6333a, #d95850 60%, #ef9b79);
}

.birthday__copy {
  position: absolute;
  z-index: 4;
  top: 15vh;
  left: 7vw;
  width: min(43vw, 650px);
}

.birthday__copy h2 { margin: 14px 0 22px; }
.birthday__copy .chapter-number { color: #ffe1a8; }

.garland--party {
  top: -8vh;
  right: -6vw;
  width: min(47vw, 720px);
  opacity: 0.72;
  transform: rotate(7deg);
  animation: garland-float 5s ease-in-out infinite alternate;
}

.birthday-reel {
  position: absolute;
  z-index: 3;
  right: 4vw;
  bottom: 8vh;
  display: flex;
  gap: 14px;
  width: 63vw;
  height: 56vh;
  perspective: 1000px;
}

.birthday-reel figure {
  flex: 1;
  overflow: hidden;
  background: white;
  border: 8px solid white;
  border-radius: 30px;
  box-shadow: 0 24px 50px rgb(84 25 29 / 32%);
  transform: rotateY(60deg) translateX(80px);
  opacity: 0;
  transition: 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.birthday-reel img { object-position: 50% 42%; }
.chapter.is-active .birthday-reel figure { opacity: 1; transform: none; }
.chapter.is-active .birthday-reel figure:nth-child(2) { transition-delay: 0.12s; }
.chapter.is-active .birthday-reel figure:nth-child(3) { transition-delay: 0.24s; }
.chapter.is-active .birthday-reel figure:nth-child(4) { transition-delay: 0.36s; }

.confetti-button {
  position: absolute;
  z-index: 7;
  left: 7vw;
  bottom: 11vh;
  color: var(--red-dark);
  background: #fff3dc;
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.finale {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  min-height: max(100svh, 820px);
  padding: 100px 8vw 60px;
  background: #fff9eb;
}

.finale__frame {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/illustrations/closing-frame.png") center / cover;
  opacity: 0.68;
}

.finale__photo {
  width: min(42vw, 660px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 12px solid white;
  border-radius: 48% 48% 24px 24px;
  box-shadow: var(--shadow);
}

.finale__photo img { object-position: 50% 42%; }

.finale__copy {
  position: relative;
  z-index: 3;
  max-width: 650px;
  padding-left: 5vw;
}

.finale__copy h2 {
  margin: 14px 0 25px;
  color: var(--green-dark);
}

.bedtime-peek {
  position: absolute;
  z-index: 4;
  right: 1.5vw;
  bottom: 18vh;
  width: clamp(120px, 11vw, 190px);
  margin: 0;
  padding: 7px 7px 12px;
  color: var(--green-dark);
  background: white;
  border-radius: 999px 999px 18px 18px;
  box-shadow: var(--shadow);
  transform: rotate(4deg);
}

.bedtime-peek img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 999px 999px 12px 12px;
}

.bedtime-peek figcaption {
  padding: 9px 5px 0;
  font-family: var(--serif);
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: center;
}

.final-date {
  margin-top: 28px !important;
  color: var(--red);
  font-weight: 850;
  letter-spacing: 0.18em;
}

.replay-button { background: var(--green-dark); }

.mascot--finale {
  right: 2vw;
  bottom: 1vh;
  width: clamp(100px, 13vw, 220px);
  filter: drop-shadow(0 18px 18px rgb(73 55 47 / 20%));
  animation: mascot-float 4s ease-in-out infinite;
}

.story-controls {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 6px;
  background: rgb(255 248 237 / 82%);
  border: 1px solid rgb(73 55 47 / 12%);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgb(73 55 47 / 12%);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  transition: opacity 0.28s ease, transform 0.32s ease;
}

.story-controls button {
  display: grid;
  place-content: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--green-dark);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
}

.story-controls button:hover { background: var(--red); transform: scale(1.08); }
.story-controls p { min-width: 56px; margin: 0; font-size: 0.76rem; font-weight: 800; text-align: center; }

.toast {
  position: fixed;
  z-index: 300;
  top: 92px;
  left: 50%;
  padding: 10px 16px;
  color: white;
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: 0.3s ease;
}

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

.swipe-hint { display: none; }

@keyframes opening-bounce {
  to { transform: translateY(-12px) rotate(8deg) scale(1.05); }
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-18px) rotate(2deg); }
}

@keyframes mascot-peek {
  0%, 100% { transform: translateX(-18%) rotate(-5deg); }
  50% { transform: translateX(0) rotate(2deg); }
}

@keyframes garland-float {
  to { transform: translateY(18px) rotate(3deg); }
}

@keyframes bubble-rise {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  10% { opacity: 0.6; }
  100% { transform: translateY(-115vh) scale(1.2); opacity: 0; }
}

@keyframes fruit-roll {
  to { transform: translateX(100px) rotate(360deg); }
}

@keyframes car-drive {
  0% { transform: translateX(0); }
  45%, 55% { transform: translateX(22vw); }
  100% { transform: translateX(0); }
}

@keyframes petal-fall {
  to { transform: translate(12vw, 110vh) rotate(540deg); opacity: 0; }
}

@keyframes spark-burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.5) rotate(360deg); }
}

@media (max-width: 980px) {
  .chapter-nav { display: none; }
  .control-label { display: none; }
  .topbar button { width: 42px; padding: 0; justify-content: center; }
  .scene-heading { padding-left: 6vw; }
  .scene-heading h2 { font-size: clamp(2.6rem, 8vw, 5rem); }
  .collage { right: 3vw; width: 64vw; }
  .split-copy { left: 5vw; width: 35vw; }
  .trip-grid { right: 3vw; width: 63vw; }
  .first-steps__copy { left: 5vw; }
  .step-sequence { right: 3vw; width: 68vw; }
  .doorway__copy { left: 5vw; width: 46vw; }
  .garden-collage { right: 2vw; width: 67vw; }
  .orbit-gallery { right: 2vw; width: 63vw; }
  .polaroid-stack { right: 2vw; width: 64vw; }
  .birthday-reel { right: 2vw; width: 68vw; }
}

@media (max-width: 720px) {
  html { scroll-snap-type: y proximity; }
  body { overscroll-behavior-y: contain; }
  .topbar { height: 62px; padding: 0 14px; }
  .brand { font-size: 0.72rem; }
  .chapter { min-height: max(100svh, 760px); }
  .hero__wash { background: linear-gradient(0deg, rgb(42 47 35 / 85%), transparent 88%); }
  .hero__copy { align-self: end; width: auto; margin: 0 24px 120px; }
  .hero h1 { font-size: clamp(3.2rem, 15vw, 5rem); }
  .lead { font-size: 0.95rem; }
  .mascot--hero { right: 8px; bottom: 20px; width: 125px; }
  .garland--hero { top: 7vh; right: -22vw; width: 78vw; opacity: 0.74; }
  .scene-heading { padding: 90px 24px 0; text-align: center; }
  .scene-heading > p:last-child { margin-inline: auto; }
  .chapter .reveal,
  .chapter .reveal-left,
  .chapter .reveal-right,
  .chapter .reveal-up,
  .chapter .film-frame,
  .chapter .step-sequence figure,
  .chapter .orbit-gallery figure,
  .chapter .polaroid,
  .chapter .wish-gallery figure,
  .chapter .birthday-reel figure {
    opacity: 1;
    transform: none;
    transition-duration: 0.35s;
  }
  .collage { right: 16px; bottom: 7vh; left: 16px; width: auto; height: 59vh; min-height: 450px; }
  .collage .card-a { width: 56%; height: 54%; }
  .collage .card-b { width: 42%; height: 43%; }
  .collage .card-c { width: 42%; height: 43%; }
  .collage .card-d { width: 45%; height: 46%; }
  .scribble--one { display: none; }
  .treasure { padding: 92px 0 80px; }
  .split-copy,
  .split-copy--green,
  .first-steps__copy,
  .bloom__copy,
  .birthday__copy {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    padding: 0 24px;
    text-align: center;
    transform: none;
  }
  .split-copy h2,
  .first-steps__copy h2,
  .bloom__copy h2,
  .birthday__copy h2 { font-size: clamp(2.6rem, 11vw, 4.2rem); }
  .split-copy > p:last-child,
  .first-steps__copy > p:last-child,
  .birthday__copy > p:last-child { margin-inline: auto; font-size: 0.95rem; }
  .filmstrip {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 100%;
    margin-top: 50px;
    padding: 22px 22px 30px;
    overflow-x: auto;
    scroll-padding-inline: 22px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    transform: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filmstrip::-webkit-scrollbar,
  .step-sequence::-webkit-scrollbar,
  .birthday-reel::-webkit-scrollbar { display: none; }
  .film-frame { flex: 0 0 72vw; scroll-snap-align: center; }
  .swipe-hint {
    display: block;
    margin: 12px auto 0 !important;
    padding: 0 24px;
    color: rgb(255 255 255 / 78%);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
  }
  .first-steps .swipe-hint { color: var(--green-dark); }
  .swipe-hint span { display: inline-block; margin-left: 5px; animation: hint-nudge 1.2s ease-in-out infinite; }
  .little-trip { padding-top: 1px; }
  .little-trip .scene-heading { position: relative; }
  .trip-grid {
    position: absolute;
    right: 16px;
    bottom: 8vh;
    left: 16px;
    width: auto;
    height: 57vh;
    min-height: 450px;
  }
  .road { display: none; }
  .first-steps {
    min-height: auto;
    padding: 62px 0 110px;
    background:
      radial-gradient(circle at 15% 29%, rgb(242 199 197 / 40%), transparent 19%),
      radial-gradient(circle at 88% 42%, rgb(209 164 66 / 20%), transparent 22%),
      var(--cream);
  }
  .first-steps__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100svh - 62px);
    padding-top: 48px;
    padding-bottom: 58px;
  }
  .first-steps__feature {
    position: relative;
    z-index: 5;
    display: block;
    width: 100vw;
    max-width: none;
    height: 100svh;
    aspect-ratio: auto;
    margin: 0;
    overflow: hidden;
    scroll-snap-align: start;
    filter: none;
    isolation: isolate;
  }
  .first-steps__feature::before {
    display: none;
  }
  .first-steps__feature::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(115deg, transparent 28%, rgb(255 255 255 / 42%) 46%, transparent 64%);
    border-radius: 0;
    mix-blend-mode: screen;
    pointer-events: none;
    transform: translateX(-130%);
    animation: story-shimmer 4.8s ease-in-out infinite;
  }
  .first-steps__feature img {
    border-radius: 0;
    object-position: 50% 50%;
    animation: princess-alive 6s ease-in-out infinite;
  }
  .first-steps__feature:focus-visible { outline: 4px solid var(--gold); outline-offset: 12px; }
  .first-steps__feature.is-sparkling img { animation: princess-twirl 0.85s ease-in-out, princess-alive 6s 0.85s ease-in-out infinite; }
  .magic-ring {
    z-index: 7;
    left: 50%;
    bottom: 4%;
    width: 46%;
    aspect-ratio: 3 / 1;
    border: 2px solid rgb(255 226 143 / 80%);
    border-radius: 50%;
    box-shadow: 0 0 18px #ffe6a0;
    transform: translateX(-50%);
    animation: magic-ring 2.8s ease-out infinite;
  }
  .magic-ring--two { animation-delay: 1.4s; }
  .fairy-spark {
    z-index: 8;
    color: #ffd96f;
    font-size: 1.4rem;
    filter: drop-shadow(0 0 7px #fff3b0);
    animation: fairy-float 3.2s ease-in-out infinite;
  }
  .fairy-spark--one { top: 18%; left: -7px; }
  .fairy-spark--two { top: 42%; right: -8px; animation-delay: -1.1s; }
  .fairy-spark--three { right: 12%; bottom: 8%; animation-delay: -2.1s; }
  .step-sequence {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    margin-top: 72px;
    padding: 0 20px 24px;
    overflow-x: auto;
    scroll-padding-inline: 20px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .step-sequence figure,
  .step-sequence figure:nth-child(even) { flex: 0 0 72vw; height: 470px; min-height: 0; scroll-snap-align: center; }
  .mascot--steps { display: none; }
  .doorway::after { background: linear-gradient(0deg, rgb(65 47 35 / 78%), transparent 74%); }
  .doorway__art { background-position: 50% 36%; }
  .doorway__copy { left: 24px; right: 24px; bottom: 105px; width: auto; text-align: center; }
  .doorway__copy h2 { font-size: clamp(2.8rem, 12vw, 4.5rem); }
  .garden-entry { padding-top: 1px; }
  .garden-collage { right: 14px; bottom: 7vh; left: 14px; width: auto; height: 57vh; }
  .flower-friends { padding: 90px 0 80px; }
  .orbit-gallery { position: relative; top: auto; right: auto; width: calc(100vw - 24px); margin: 35px auto 0; transform: none; }
  .scribble--two { display: none; }
  .bloom { padding: 90px 0 80px; }
  .bloom__copy { z-index: 6; }
  .polaroid-stack { position: relative; right: auto; bottom: auto; width: calc(100vw - 20px); height: 610px; margin: 40px auto 0; }
  .polaroid { width: 46%; padding-bottom: 44px; }
  .polaroid-2 { right: 4%; }
  .polaroid-3 { left: 5%; }
  .polaroid-4 { right: 2%; }
  .wish { min-height: 960px; }
  .wish-gallery { right: 14px; bottom: 110px; left: 14px; grid-template-columns: 1fr 1fr; height: 58vh; }
  .wish-gallery figure:nth-child(3) { grid-column: 1 / 3; height: 230px; }
  .wish-button { top: auto; right: 50%; bottom: 82px; transform: translateX(50%); white-space: nowrap; }
  .wish-button:hover { transform: translate(50%, -3px); }
  .birthday { display: block; min-height: 980px; padding: 92px 0 28px; }
  .garland--party { top: 3vh; right: -25vw; width: 88vw; opacity: 0.42; }
  .birthday-reel {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    height: 510px;
    margin-top: 40px;
    padding: 0 20px 24px;
    overflow-x: auto;
    scroll-padding-inline: 20px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .birthday-reel figure { flex: 0 0 72vw; scroll-snap-align: center; }
  .confetti-button { position: relative; left: auto; bottom: auto; margin: 26px auto 72px; white-space: nowrap; transform: none; }
  .confetti-button:hover { transform: translateY(-3px); }
  .swipe-hint--light { color: #fff2dd; }
  .finale { display: block; padding: 90px 24px 120px; text-align: center; }
  .finale__photo { width: min(82vw, 480px); height: 54vh; margin: 0 auto 34px; }
  .finale__photo.storybook-art img { object-position: 50% 38%; }
  .finale__copy { padding-left: 0; }
  .finale__copy h2 { font-size: clamp(2.8rem, 12vw, 4.5rem); }
  .finale__copy > p { margin-inline: auto; }
  .bedtime-peek {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(72vw, 360px);
    margin: 42px auto 10px;
    padding: 9px 9px 16px;
    transform: rotate(-2deg);
  }
  .bedtime-peek figcaption { padding-top: 12px; font-size: 0.88rem; line-height: 1.4; }
  .mascot--finale { right: -15px; bottom: 52px; width: 118px; }
  .story-controls { bottom: 10px; }
  body.controls-hidden .story-controls,
  body.immersive-art .story-controls {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(100% + 28px));
  }
  body.immersive-art .topbar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-100%);
  }
}

@keyframes hint-nudge {
  50% { transform: translateX(7px); }
}

@keyframes princess-alive {
  0%, 100% { transform: scale(1.01) translateY(0); }
  50% { transform: scale(1.045) translateY(-5px); }
}

@keyframes princess-twirl {
  0%, 100% { transform: scale(1.01) rotate(0); }
  35% { transform: scale(1.055) rotate(-1.5deg); }
  70% { transform: scale(1.055) rotate(1.5deg); }
}

@keyframes story-shimmer {
  0%, 45% { transform: translateX(-130%); }
  75%, 100% { transform: translateX(130%); }
}

@keyframes fairy-border {
  50% { filter: hue-rotate(18deg) brightness(1.08); }
}

@keyframes magic-ring {
  0% { opacity: 0; transform: translateX(-50%) scale(0.55); }
  35% { opacity: 0.9; }
  100% { opacity: 0; transform: translateX(-50%) scale(1.45); }
}

@keyframes fairy-float {
  0%, 100% { opacity: 0.45; transform: translateY(7px) rotate(-8deg) scale(0.8); }
  50% { opacity: 1; transform: translateY(-10px) rotate(8deg) scale(1.15); }
}

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