.secret-gift {
  --cream: #fff4dc;
  --gold: #f3bd87;
  --edge: clamp(1.5rem, 7.2vw, 8rem);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color: var(--cream);
  background: #101b14;
  overflow: hidden;
}
.secret-story {
  block-size: 100vh;
  block-size: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  touch-action: pan-y pinch-zoom;
}
.secret-story::-webkit-scrollbar { display: none; }
.secret-story:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.story-scene {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-block-size: 100%;
  padding: calc(5.2rem + var(--safe-top)) var(--edge) calc(clamp(3rem, 11vh, 7.5rem) + var(--safe-bottom));
  overflow: hidden;
}
.story-photo, .story-scene::after {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}
.story-photo {
  z-index: -2;
  object-fit: cover;
  object-position: var(--photo-position, 50% 50%);
}
.story-scene::after {
  z-index: -1;
  content: "";
  background: linear-gradient(0deg, #0a150eea 0%, #0b160f88 36%, #0b160f0c 72%),
    linear-gradient(90deg, #0e1a12a8 0%, #0e1a124f 42%, #0e1a1200 76%),
    linear-gradient(180deg, #0d160e7a, transparent 20%);
}
.story-mast {
  position: fixed;
  inset: calc(.95rem + var(--safe-top)) var(--edge) auto;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .7rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid #f9e3bc5c;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.25;
  text-transform: uppercase;
  text-shadow: 0 1px 7px #10120d;
  pointer-events: none;
}
.story-mast span:last-child { text-align: end; }
.story-mark { color: var(--gold); font-size: 1.6rem; font-weight: 400; }
.story-copy { max-inline-size: min(51rem, 100%); }
.story-kicker {
  color: var(--scene-accent, var(--gold));
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 1px 7px #171b12;
}
.story-copy h1, .story-copy h2 {
  color: var(--cream);
  font-size: clamp(3.7rem, 8.75vw, 9.4rem);
  line-height: .81;
  letter-spacing: -.054em;
  margin: .2em 0 .25em;
}
.story-copy h1 em { color: #ffd7a9; font-weight: 500; }
.story-copy h2 { font-size: clamp(3.5rem, 7.05vw, 7.4rem); }
.story-copy p:where(:not(.story-kicker, .birthday-poem, .story-signature)) {
  font-size: clamp(1rem, 1.53vw, 1.2rem);
  max-inline-size: 29rem;
  line-height: 1.53;
}
.birthday-scene {
  --photo-position: 50% 12%;
  align-items: center;
  padding-block: calc(6rem + var(--safe-top)) calc(5.2rem + var(--safe-bottom));
}
.birthday-scene::after {
  background: linear-gradient(90deg, #16160ef5 0%, #211c13e2 24%, #211b1465 56%, #211b140b 86%),
    linear-gradient(0deg, #151b13a3, #151b1300 45%, #151b1300 70%, #151b1369);
}
.story-copy .birthday-poem {
  color: #ffdbb3;
  font: italic 550 clamp(1.23rem, 2.08vw, 1.78rem)/1.08 var(--serif);
  margin-block-start: clamp(.75rem, 1.7vh, 1.22rem);
  padding-inline-start: .85rem;
  border-inline-start: 1px solid #f3bd8794;
}
.story-gesture {
  position: absolute;
  inset: auto auto calc(.9rem + var(--safe-bottom)) var(--edge);
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--cream);
  font-size: .73rem;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.gesture-line {
  height: 1.6rem;
  width: 1px;
  background: var(--gold);
  transform-origin: top;
  animation: scroll-cue 2s ease-in-out infinite;
}
.touch-hint { display: none; }
.roses-scene { --photo-position: 61% 48%; --scene-accent: #ffd0b6; }
.tulips-scene { --photo-position: 50% 70%; --scene-accent: #ffd0cc; }
.lavender-scene { --photo-position: 49% 58%; --scene-accent: #dbcaff; }
.wisteria-scene { --photo-position: 49% 30%; --scene-accent: #e8c5fe; }
.sunflowers-scene { --photo-position: 46% 55%; --scene-accent: #ffe19b; }
.cosmos-scene { --photo-position: 50% 64%; --scene-accent: #ffcbe2; }
.words-scene { --scene-accent: #ffd5ae; --photo-position: 52% 46%; }
.story-copy .story-farewell { margin-top: .7rem; font-weight: 650; }
.story-copy .story-signature { margin-top: .7rem; font: italic 600 clamp(1.4rem, 3vw, 2rem)/1 var(--serif); color: #ffdbb3; }
.story-credits { font-size: .78rem; color: #ffe6c9; margin-top: .3rem; }
.story-progress {
  position: fixed;
  z-index: 2;
  inset: 50% max(.7rem, calc(var(--edge) * .31)) auto auto;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .54rem;
  padding: .56rem .33rem;
  border-radius: 4rem;
  background: #0c160e5a;
  pointer-events: none;
}
.story-progress span {
  width: .36rem;
  height: .36rem;
  border-radius: 50%;
  background: #fff1d87a;
  transition: transform .25s ease, background .25s ease;
}
.story-progress .is-current { background: #ffe2af; transform: scale(1.45); }
.story-sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .secret-gift.story-enhanced .flower-scene.is-current .story-copy { animation: flower-note .58s .16s var(--cover-transition) both; }
}

@keyframes flower-note { from { opacity: 0; transform: translateY(.8rem); } to { opacity: 1; transform: translateY(0); } }
@keyframes scroll-cue { 0%, 100% { opacity: .45; transform: scaleY(.53); } 50% { opacity: 1; transform: scaleY(1); } }

@media (hover: none) and (pointer: coarse) {
  .touch-hint { display: inline; }
  .desktop-hint { display: none; }
}
@media (max-width: 640px) {
  .secret-gift { --edge: clamp(1.22rem, 6vw, 2.25rem); }
  .story-mast { font-size: .58rem; letter-spacing: .08em; }
  .story-mark { font-size: 1.3rem; }
  .story-scene { padding-bottom: calc(3.9rem + var(--safe-bottom)); padding-right: calc(var(--edge) + .45rem); }
  .story-scene::after { background: linear-gradient(0deg,#0a160ff7 0%,#0a160fb0 29%,#10190f1c 66%), linear-gradient(180deg,#15251988,transparent 23%); }
  .birthday-scene { align-items: end; --photo-position: 50% 49%; padding-block: calc(5.5rem + var(--safe-top)) calc(4.6rem + var(--safe-bottom)); }
  .birthday-scene::after { background: linear-gradient(0deg,#111a12f5 0%,#141910d5 27%,#181a125c 66%, #181a1223 91%),linear-gradient(180deg,#15201772, transparent 23%); }
  .story-copy h1 { font-size: clamp(3.42rem, 12.4vw, 5.65rem); }
  .story-copy h2 { font-size: clamp(3.25rem, 11.6vw, 5.3rem); }
  .story-copy .birthday-poem { font-size: clamp(1.2rem, 5.5vw, 1.66rem); }
  .story-copy p:not(.story-kicker, .birthday-poem, .story-signature) { font-size: 1rem; }
  .story-kicker { font-size: .68rem; }
  .story-progress { right: .32rem; padding: .45rem .2rem; gap: .46rem; }
  .story-progress span { width: .28rem; height: .28rem; }
  .roses-scene { --photo-position: 62% 50%; }
  .wisteria-scene { --photo-position: 50% 42%; }
}
@media (max-height: 600px) {
  .story-mast { top: calc(.3rem + var(--safe-top)); padding-bottom: .35rem; }
  .flower-scene { padding-block: calc(3.35rem + var(--safe-top)) calc(2rem + var(--safe-bottom)); }
  .birthday-scene { padding-block: calc(3.25rem + var(--safe-top)) calc(3.35rem + var(--safe-bottom)); }
  .story-copy h1 { font-size: clamp(3rem, 8.7vw, 4.7rem); }
  .story-copy h2 { font-size: clamp(2.8rem, 7vw, 4.9rem); }
  .story-copy .birthday-poem { font-size: clamp(1.13rem, 3.6vw, 1.45rem); }
  .story-gesture { bottom: calc(.32rem + var(--safe-bottom)); }
}
@media (max-height: 520px) and (min-width: 641px) {
  .birthday-scene .story-copy {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    column-gap: clamp(.8rem, 3vw, 2.6rem);
  }
  .birthday-scene :is(.story-kicker, h1, .birthday-wish) { grid-column: 1; }
  .birthday-scene .birthday-poem { grid-column: 2; grid-row: 2 / 4; align-self: end; }
  .closing-scene .story-copy { display: grid; grid-template-columns: .9fr 1.1fr; column-gap: 1.65rem; align-items: center; }
  .closing-scene .story-kicker { grid-column: 1 / -1; }
  .closing-scene::after { background: linear-gradient(0deg, #0a150ef5, #0b160fbc 55%, #10160f45); }
}
@media (prefers-reduced-motion: reduce) {
  .gesture-line { animation: none; }
}

.chapter-quote {
  margin: .65rem 0 .72rem;
  padding-inline-start: .8rem;
  border-inline-start: 1px solid #f3bd8794;
  color: #ffe0bf;
  font: italic 700 clamp(1.45rem, 2.9vw, 2.6rem)/1.1 var(--serif);
}
.chapter-quote.chat-exchange {
  display: grid;
  gap: .35rem;
  font-size: clamp(1.18rem, 2.4vw, 1.9rem);
  line-height: 1.18;
}
.chat-exchange b {
  margin-inline-end: .22em;
  font: 750 .62em var(--sans);
  color: #ffd09f;
}
.story-copy .pampering-note {
  margin-block-start: .7rem;
  color: #ffdfc4;
  font-style: italic;
  font-weight: 650;
}
.story-kicker strong { color: #fff0d2; font-weight: 850; }
.sunflowers-scene .story-copy h2 { font-size: clamp(1.7rem, 3.1vw, 2.65rem); }
.quote-centerpiece {
  margin-block: .65rem 1rem;
  padding: 0;
  border: 0;
  color: #fff4db;
  font: 850 clamp(2.85rem, 5.1vw, 5.15rem)/.98 var(--sans);
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: 0 .2rem 1.7rem #0e130dc7;
}
.quote-centerpiece strong { font-weight: inherit; }
.closing-scene .story-copy h2 em { color: #ffcfdf; }
.closing-scene::after {
  background: linear-gradient(0deg, #190f1bf0, #1a1722a6 48%, #20162021 89%),
    linear-gradient(90deg, #190f1bbf, transparent 80%);
}
@media (prefers-reduced-motion: no-preference) {
  .secret-gift.story-enhanced .closing-scene.is-current .story-copy {
    animation: flower-note .9s .22s var(--cover-transition) both;
  }
}
@media (max-height: 600px) {
  .chapter-quote:not(.quote-centerpiece) { margin-block: .45rem; font-size: clamp(1.2rem, 3vw, 1.6rem); }
}
@media (max-width: 640px) and (max-height: 600px) {
  .closing-scene.story-scene { padding-block: calc(3rem + var(--safe-top)) calc(1.25rem + var(--safe-bottom)); }
  .closing-scene .story-copy h2 { font-size: clamp(2.2rem, 10vw, 2.9rem); }
  .closing-scene .closing-note p:not(.story-signature) { font-size: .94rem; line-height: 1.35; }
  .closing-scene .story-signature { font-size: 1.23rem; }
}
@media (max-height: 520px) and (min-width: 641px) {
  .birthday-scene .story-kicker { grid-column: 1 / -1; }
  .birthday-scene .story-copy h1 { grid-column: 1; grid-row: 2 / 4; align-self: center; font-size: clamp(3rem, 7vw, 4.2rem); }
  .birthday-scene .birthday-wish { grid-column: 2; grid-row: 2; }
  .birthday-scene .birthday-poem { grid-column: 2; grid-row: 3; align-self: start; }
  .flower-scene:not(.photo-wall-scene) .story-copy h2 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); }
}
@media (max-height: 520px) and (min-width: 641px) {
  .birthday-scene { padding-block: calc(2.5rem + var(--safe-top)) calc(2.1rem + var(--safe-bottom)); }
  .birthday-scene .story-copy .birthday-wish { font-size: .98rem; line-height: 1.4; }
}
@media (max-height: 520px) and (min-width: 641px) {
  .closing-scene.story-scene { padding-block: calc(3rem + var(--safe-top)) calc(1rem + var(--safe-bottom)); }
  .closing-scene .story-copy { grid-template-columns: minmax(0,.7fr) minmax(0,1.3fr); }
  .closing-scene .closing-note p:not(.story-signature) { font-size: .93rem; line-height: 1.32; }
  .closing-scene .story-signature { font-size: 1.35rem; }
}

/* One continuous garden, with chat keepsakes tucked beside the story. */
.story-scene:not(.birthday-scene, .photo-wall-scene, .movie-scene)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: clamp(3rem, 11vh, 7rem);
  background: linear-gradient(#101b14f2, #101b1400);
  pointer-events: none;
}
.story-scene.with-chat {
  grid-template-columns: minmax(0,1fr) clamp(14rem, 28vw, 25rem);
  grid-template-areas: "story keepsake";
  column-gap: clamp(.85rem, 3.2vw, 3.5rem);
}
.with-chat .story-copy { grid-area: story; min-width: 0; }
.chat-clippings {
  position: relative;
  grid-area: keepsake;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: end;
  gap: clamp(.45rem, 1.7vw, 1.5rem);
  min-inline-size: 0;
  width: 100%;
}
.chat-clipping {
  position: relative;
  min-inline-size: 0;
  max-inline-size: 100%;
  margin: 0;
  text-align: center;
}
.chat-clipping:nth-child(2) { margin-block-end: clamp(.45rem, 3vh, 1.5rem); }
.chat-snapshot { display: block; margin-inline: auto; }
.chat-snapshot img {
  max-height: min(29dvh, 17.5rem);
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 23% 11% 20% 7% / 9% 18% 11% 16%;
  filter: drop-shadow(0 .45rem .8rem #040b077e);
}
.chat-snapshot img[src$="/36.webp"] { border-radius: 0; }
.garden-note {
  display: block;
  margin: .45rem 0 .1rem;
  color: #ffdea8;
  text-shadow: 0 1px .4rem #15160e;
  font: italic 700 clamp(1.15rem, 2.45vw, 2rem)/1.05 var(--serif);
  rotate: -7deg;
}
.garden-note i { display: inline-block; margin-inline-start: .24em; color: #ffc3d6; font-style: normal; }
.chat-clippings .garden-note { font-size: clamp(1rem, 1.6vw, 1.45rem); }
.chat-clippings:has([aria-pressed="true"], .is-peeking),
.chat-clipping:has([aria-pressed="true"], .is-peeking) { z-index: 4; }
.secret-gift .story-copy { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .story-scene.is-current .garden-note i { animation: doodle-wiggle .72s ease-out both; }
}
@keyframes doodle-wiggle {
  0% { opacity: 0; transform: translate(-.25em,.12em) rotate(-18deg) scale(.7); }
  62% { transform: rotate(13deg) scale(1.16); }
  100% { opacity: 1; transform: rotate(0); }
}

/* Keep each thumbnail's own silhouette and aspect ratio. */
.story-scene.photo-wall-scene {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-block-size: 100%;
  padding: calc(4.5rem + var(--safe-top)) var(--edge) calc(3rem + var(--safe-bottom));
  background: radial-gradient(ellipse at 26% 35%, #28382a, #101b14 72%);
}
.story-scene.photo-wall-scene::after, .movie-scene::after { display: none; }
.photo-wall-scene .wall-copy { order: -1; margin-bottom: clamp(1.1rem, 3vw, 2.5rem); }
.photo-wall-scene .wall-copy h2 { font-size: clamp(2.7rem, 5.7vw, 6rem); }
.wall-copy .garden-note { rotate: -3deg; margin: .7rem 0 0 .55rem; }
.photo-wall {
  width: 100%;
  column-count: 5;
  column-gap: clamp(.6rem, 2.2vw, 2.1rem);
  padding: .3rem .55rem;
}
.wall-tile, .chat-snapshot {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  transform-origin: center;
  transition: transform .35s cubic-bezier(.22,.75,.22,1), rotate .35s ease, filter .35s ease;
}
.wall-tile {
  display: block;
  width: 100%;
  margin: 0 0 clamp(.7rem, 2.4vw, 2rem);
  break-inside: avoid;
  rotate: -2deg;
}
.wall-tile:nth-child(3n) { rotate: 2.5deg; }
.wall-tile:nth-child(4n) { rotate: 0deg; }
.wall-tile img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: clamp(12rem, 31vw, 22rem);
  margin-inline: auto;
  border-radius: .65rem 1rem .6rem 1.05rem;
  object-fit: contain;
  filter: drop-shadow(0 .35rem .5rem #070d09a8);
}
.wall-tile[data-kind="sticker"] img {
  max-width: 87%;
  max-height: clamp(7rem, 16vw, 13rem);
  border-radius: 0;
}
.wall-tile img:is([src$="/02.webp"],[src$="/14.webp"],[src$="/21.webp"],[src$="/42.webp"],[src$="/43.webp"],[src$="/45.webp"]) {
  border-radius: 30% 9% 25% 10% / 15% 22% 9% 19%;
}
:is(.wall-tile,.chat-snapshot):is(.is-peeking,[aria-pressed="true"]) {
  z-index: 5;
  rotate: 0deg;
  transform: translate(var(--zoom-x, 0px),var(--zoom-y, 0px)) scale(var(--zoom, 2));
  filter: drop-shadow(0 .55rem 1.2rem #020703a6);
}
:is(.wall-tile,.chat-snapshot)[aria-pressed="true"] { cursor: zoom-out; }
:is(.wall-tile,.chat-snapshot):focus-visible { outline: 2px solid #ffdda4; outline-offset: 5px; }

.movie-scene {
  align-content: center;
  gap: clamp(1.35rem, 4vw, 3rem);
  background: radial-gradient(ellipse at 70% 36%, #30263b, transparent 70%), #111b15;
}
.movie-reel {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: clamp(1rem, 3vw, 3.3rem);
  align-items: end;
}
.movie-clip { min-width: 0; text-align: center; }
.movie-clip video {
  display: block;
  width: 100%;
  max-height: 40dvh;
  border-radius: 1.2rem .55rem 1.25rem .65rem;
  object-fit: contain;
  background: #0d1411;
}
.movie-clip figcaption { margin-top: .55rem; color: #ffddb4; font: italic 650 1.1rem/1.1 var(--serif); }
.reel-note { justify-self: end; }

@media (max-width: 850px) { .photo-wall { column-count: 4; } }
@media (max-width: 760px) {
  .story-scene.with-chat {
    grid-template-columns: 1fr;
    grid-template-areas: "keepsake" "story";
    row-gap: .85rem;
    align-content: end;
  }
  .chat-clippings { width: min(100%, 20rem); justify-self: end; }
  .chat-snapshot img { max-height: clamp(5rem, 17dvh, 9.2rem); }
  .quote-centerpiece { font-size: clamp(2.55rem, 10.5vw, 3.7rem); }
}
@media (max-width: 640px) {
  .story-scene.photo-wall-scene { padding-top: calc(3.55rem + var(--safe-top)); }
  .photo-wall { column-count: 3; column-gap: .55rem; padding-inline: .1rem; }
  .wall-tile { margin-bottom: .7rem; }
  .wall-tile img { max-height: 13rem; }
  .wall-tile[data-kind="sticker"] img { max-height: 7.2rem; }
  .movie-reel { grid-template-columns: minmax(0,1fr); gap: 1.6rem; }
  .movie-clip video { max-height: min(40dvh, 20rem); }
}
@media (max-width: 350px) { .photo-wall { column-count: 2; } }
@media (max-height: 520px) and (min-width: 641px) {
  .chat-snapshot img { max-height: 29dvh; }
  .movie-clip video { max-height: 34dvh; }
}
@media (max-height: 520px) and (min-width: 761px) {
  .birthday-scene.with-chat .story-copy { display: block; }
  .birthday-scene.with-chat h1 { font-size: clamp(2.7rem, 5.45vw, 4.1rem); }
  .flower-scene.sunflowers-scene .story-copy h2 { font-size: clamp(1.55rem, 2.65vw, 2rem); }
  .quote-centerpiece { font-size: clamp(2.6rem, 4.25vw, 3.9rem); }
}
.movie-clip video { height: auto; }
.story-mast::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(-1.1rem - var(--safe-top)) calc(0px - var(--edge)) -.55rem;
  background: linear-gradient(#0d1710d6, #0d171092 68%, transparent);
  pointer-events: none;
}
@media (max-height: 520px) and (min-width: 641px) {
  .wall-tile img { max-height: min(56dvh, 16rem); }
}
