/* =============================================================================
   Guided storybook gift  -  full-screen scenes, bottom nav only, no top bar
   Envelope moments, polaroids, scrapbook cards  -  Lora + Great Vibes
   ============================================================================= */
:root {
  --cream: #fff8f5;
  --blush: #ffe4ec;
  --rose-soft: #ffc8d8;
  --rose: #f8a4bc;
  --pink-deep: #e87a9a;
  --lavender: #e8e0f4;
  --lavender-deep: #cfc0e8;
  --paper: #fffef9;
  --warm-white: #ffffff;
  --text: #5c3d4a;
  --text-soft: #8a6575;
  --accent-red: #e07088;
  --shadow-soft: 0 8px 32px rgba(232, 122, 154, 0.18);
  --shadow-lift: 0 12px 40px rgba(200, 120, 150, 0.22);
  --shadow-inner-paper: inset 0 0 60px rgba(255, 220, 230, 0.35);
  --gift-border: rgba(248, 164, 188, 0.55);
  --gift-inner: rgba(255, 255, 255, 0.65);
  --ribbon: linear-gradient(135deg, #f8a4bc, #e8b4e8);
  --font-display: "Great Vibes", "Segoe Script", cursive;
  /* Lora: literary / letter-like  -  not geometric UI sans */
  --font-body: "Lora", Georgia, "Times New Roman", serif;
  --radius: 22px 18px 24px 20px;
  --radius-sm: 16px 12px 18px 14px;
  --radius-btn: 10px 22px 14px 18px;
  /* Responsive shell: wide on desktop, padded; readable line length separate */
  --layout-max: 1200px;
  --content-pad-x: clamp(1rem, 4vw, 2.75rem);
  --content-pad-y: clamp(1rem, 2.5vw, 1.75rem);
  --readable-max: 42rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  min-height: 100dvh;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: radial-gradient(ellipse 120% 80% at 50% -10%, var(--blush), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 30%, rgba(232, 224, 244, 0.7), transparent 45%),
    radial-gradient(ellipse 70% 50% at 0% 80%, rgba(255, 228, 236, 0.9), transparent 50%),
    radial-gradient(circle at 20% 40%, rgba(255, 210, 225, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 85% 70%, rgba(232, 220, 248, 0.4) 0%, transparent 40%),
    var(--cream);
  line-height: 1.65;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* very soft notebook hint  -  kept subtle so it never feels like a UI grid */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: radial-gradient(circle, rgba(232, 122, 154, 0.35) 1px, transparent 1px);
  background-size: 24px 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 10000;
  padding: 0.6rem 1rem;
  background: var(--rose-soft);
  color: var(--text);
  border-radius: 10px;
  font-weight: 700;
}

.skip-link:focus {
  left: 1rem;
}

/* ---------- Particles layer ---------- */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  opacity: 0.45;
  animation: drift 14s ease-in-out infinite;
  color: var(--rose);
  font-size: 12px;
  filter: drop-shadow(0 0 6px rgba(248, 164, 188, 0.5));
}

.particle--sparkle {
  color: #ffb8c8;
  font-size: 14px;
  opacity: 0.55;
  animation: drift 12s ease-in-out infinite, twinkle 3s ease-in-out infinite;
  will-change: opacity;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(8px, -20px) rotate(8deg);
  }
  66% {
    transform: translate(-6px, 12px) rotate(-6deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  .particle--sparkle {
    animation: none;
  }
  body::after {
    opacity: 0.03;
  }
}

/* ---------- Layout  -  full-screen scenes, bottom dock only ---------- */
.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Soft “open book” spine shadow on the left  -  guided storybook, not a website chrome */
.page-wrap--storybook {
  box-shadow: inset 6px 0 36px rgba(90, 50, 65, 0.04);
  background: linear-gradient(
    165deg,
    var(--page-paper, #fffefb),
    color-mix(in srgb, var(--page-tint, transparent) 55%, #fffefb)
  );
}

/* soft vignette  -  intimate, like holding a page, not a fullscreen app */
.page-wrap::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 75% 65% at 50% 48%, transparent 35%, rgba(255, 228, 236, 0.45) 100%);
}

/* Guided journey  -  no top menu; only Next / Back */
.journey-progress {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(138, 101, 117, 0.65);
  text-align: center;
  margin: 0 0 1.25rem;
  letter-spacing: 0.06em;
  line-height: 1.45;
}

.journey-progress__step {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(120, 82, 102, 0.8);
}

.journey-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 2px dashed rgba(248, 164, 188, 0.38);
  position: relative;
  z-index: 3;
}

/* Fixed bottom bar  -  each scene’s only “navigation” (aligned to same max-width as content) */
.journey-nav--dock {
  position: fixed;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: 0;
  margin: 0;
  box-sizing: border-box;
  width: min(100%, var(--layout-max));
  max-width: var(--layout-max);
  padding: 0.75rem var(--content-pad-x) calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 2px dashed rgba(248, 164, 188, 0.45);
  background: linear-gradient(180deg, rgba(255, 252, 250, 0.97), rgba(255, 245, 248, 0.98));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -8px 32px rgba(248, 164, 188, 0.12);
  z-index: 85;
  margin-top: 0;
  padding-top: 0.75rem;
}

.journey-nav--dock::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -40%);
  width: min(5rem, 28vw);
  height: 10px;
  background: linear-gradient(90deg, transparent, rgba(248, 164, 188, 0.55), transparent);
  border-radius: 4px;
  opacity: 0.65;
  pointer-events: none;
}

.journey-nav--start {
  justify-content: center;
}

.journey-nav--start .journey-next {
  margin-left: 0;
}

.journey-nav__back {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-style: italic;
  color: rgba(138, 101, 117, 0.75);
  text-decoration: none;
  border-bottom: 1px dotted rgba(232, 122, 154, 0.35);
  padding-bottom: 0.1rem;
  transition: color 0.2s, border-color 0.2s;
}

.journey-nav__back:hover {
  color: var(--pink-deep);
  border-bottom-color: rgba(232, 122, 154, 0.55);
}

.journey-nav__back:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 3px;
}

.journey-nav .journey-next {
  margin-left: auto;
}

.journey-nav--end {
  justify-content: space-between;
}

.journey-nav--end .journey-next {
  margin-left: 0;
}

body.journey-exit .page-wrap {
  animation: journeyFadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes journeyFadeOut {
  to {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
    filter: blur(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.journey-exit .page-wrap {
    animation: none;
    opacity: 0.85;
  }
}

.is-typewriting::after {
  content: "|";
  animation: caretBlink 0.8s step-end infinite;
  opacity: 0.65;
  margin-left: 1px;
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

/* One full-screen “scene” per page  -  scroll inside, controls fixed at bottom */
main.scene {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(175deg, var(--gift-inner) 0%, rgba(255, 250, 252, 0.94) 45%, rgba(255, 242, 248, 0.92) 100%);
  border: none;
  border-radius: 0;
  box-shadow: inset 0 0 80px rgba(255, 220, 230, 0.25);
  overflow: hidden;
}

.scene__content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: var(--content-pad-y) var(--content-pad-x)
    calc(5.25rem + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 1;
}

.scene__footer-note {
  text-align: center;
  font-size: 0.82rem;
  font-style: italic;
  color: rgba(138, 101, 117, 0.75);
  margin: 2rem 0 0;
  line-height: 1.5;
}

body[data-page="home"] .scene__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - 5.5rem);
  min-height: calc(100svh - 5.5rem);
  padding-top: clamp(1.5rem, 4vh, 2.5rem);
}

.home-tease {
  margin: 0.65rem auto 0;
  max-width: 16rem;
  width: 100%;
}

.home-tease-inner {
  position: relative;
  min-height: 3rem;
  width: 100%;
}

.home-tease__btn {
  position: absolute;
  transition: left 0.18s ease-out, top 0.18s ease-out;
  font-size: 0.88rem;
  padding: 0.38rem 0.85rem;
}

.home-tease__hint {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  font-style: italic;
  text-align: center;
  color: var(--text-soft);
  min-height: 1.3em;
}

@media (prefers-reduced-motion: reduce) {
  .home-tease__btn {
    position: relative;
    left: auto !important;
    top: auto !important;
    transition: none;
  }
}

/* satin ribbon across the top of the scene */
main.scene::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 14px;
  background: linear-gradient(90deg, transparent, rgba(248, 164, 188, 0.5) 15%, rgba(255, 200, 220, 0.95) 50%, rgba(232, 200, 230, 0.55) 85%, transparent);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 3px 8px rgba(232, 112, 136, 0.2);
  pointer-events: none;
  z-index: 2;
}

/* soft scallop / lace hint at bottom of scene (above content scroll) */
main.scene::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: radial-gradient(circle at 10px 0, transparent 8px, rgba(255, 228, 236, 0.5) 9px);
  background-size: 20px 12px;
  background-repeat: repeat-x;
  opacity: 0.6;
  pointer-events: none;
  border-radius: 0 0 20px 20px;
}

/* floating corner stickers (injected by script.js) */
.gift-box__stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}

.gift-sticker {
  position: absolute;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 600;
  color: var(--pink-deep);
  background: linear-gradient(145deg, #fff, #ffe8f0);
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(200, 120, 140, 0.2);
  border: 1px dashed rgba(248, 164, 188, 0.65);
  transform: rotate(-12deg);
  opacity: 0.92;
}

.gift-sticker--tl {
  top: 1.25rem;
  left: 0.85rem;
}
.gift-sticker--tr {
  top: 1.5rem;
  right: 0.85rem;
  transform: rotate(8deg);
}
.gift-sticker--bl {
  bottom: 2.5rem;
  left: 1rem;
  transform: rotate(6deg);
}
.gift-sticker--br {
  bottom: 2.25rem;
  right: 1rem;
  transform: rotate(-10deg);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  color: var(--pink-deep);
  text-align: center;
  margin: 0 0 0.75rem;
  line-height: 1.15;
  position: relative;
  z-index: 2;
  font-weight: 400;
  text-shadow: 0 2px 20px rgba(248, 164, 188, 0.25);
}

.page-title::before {
  content: "";
  display: block;
  width: min(12rem, 70%);
  height: 2px;
  margin: 0 auto 0.85rem;
  background: linear-gradient(90deg, transparent, rgba(248, 164, 188, 0.65), transparent);
  opacity: 0.85;
}

.page-title::after {
  content: "·  ♥  ·";
  display: block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.45em;
  color: rgba(232, 122, 154, 0.42);
  margin-top: 0.55rem;
}

.page-lede {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--text-soft);
  max-width: min(var(--readable-max), 100%);
  margin: 0 auto 2.25rem;
  font-size: 1.08rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
}

/* ---------- Buttons  -  soft ribbons, not startup pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  font-style: italic;
  padding: 0.9rem 1.75rem;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.25s;
  color: var(--text);
  letter-spacing: 0.03em;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 4px;
}

.btn--primary {
  background: linear-gradient(165deg, #f8b0c8 0%, #e8a4c4 45%, #dda0c0 100%);
  color: #fffefd;
  box-shadow: 0 4px 20px rgba(232, 122, 154, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn--primary:hover {
  transform: translateY(-3px) rotate(-0.5deg);
  box-shadow: 0 8px 28px rgba(232, 122, 154, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.55);
  border: 2px dashed rgba(248, 164, 188, 0.55);
  color: var(--pink-deep);
  box-shadow: inset 0 0 20px rgba(255, 240, 246, 0.5);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.88);
  border-style: solid;
  border-color: rgba(248, 164, 188, 0.65);
}

.btn--yes {
  background: linear-gradient(135deg, #f8a4bc, #e8a4d4);
  color: #fff;
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-btn);
  font-style: normal;
}

.btn--yes.attractive {
  transform: scale(1.05);
  box-shadow: var(--shadow-lift);
}

.btn--no {
  background: rgba(255, 255, 255, 0.85);
  border: 2px dashed rgba(232, 122, 154, 0.45);
  color: var(--text-soft);
  position: absolute;
  transition: left 0.18s ease-out, top 0.18s ease-out;
  border-radius: 14px 10px 16px 12px;
  font-style: normal;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

/* ---------- Cards / paper ---------- */
.paper-card {
  position: relative;
  background: linear-gradient(165deg, #fffefb 0%, #fff8fa 50%, #fff5f8 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(248, 164, 188, 0.4);
  overflow: visible;
}

/* washi tape strip */
.paper-card::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 18%;
  width: 42%;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.65) 0 5px,
    rgba(255, 200, 218, 0.55) 5px 10px,
    rgba(232, 220, 240, 0.45) 10px 14px
  );
  border-radius: 3px;
  opacity: 0.9;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transform: rotate(-1.5deg);
}

.paper-card--no-tape::before {
  display: none;
}

/* ---------- Home  -  book cover (first page of the gift) ---------- */
.hero.book-cover {
  text-align: center;
  padding: 2.25rem 1.35rem 2.75rem;
  position: relative;
  z-index: 2;
  border-radius: 6px 10px 12px 8px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 242, 248, 0.5) 100%);
  border: 3px double rgba(248, 164, 188, 0.45);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px rgba(255, 255, 255, 0.6), inset 0 0 50px rgba(255, 220, 230, 0.2);
}

.book-cover__spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(200, 130, 155, 0.12), transparent);
  border-radius: 4px 0 0 4px;
  pointer-events: none;
}

.hero.book-cover::before {
  content: "♥";
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-size: 1.15rem;
  opacity: 0.32;
  transform: rotate(12deg);
}

.hero.book-cover::after {
  content: "✨";
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-size: 1rem;
  opacity: 0.38;
}

.hero__gift {
  margin: 0 auto 1.75rem;
  width: min(300px, 92vw);
  height: 210px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 14px 28px rgba(180, 100, 130, 0.18));
}

.hero__envelope-preview {
  width: 216px;
  height: 138px;
  background: linear-gradient(180deg, #ffe8f0 0%, #ffc8d8 55%, #ffb8cc 100%);
  border-radius: 10px 10px 14px 14px;
  box-shadow: var(--shadow-soft), inset 0 -6px 16px rgba(232, 100, 130, 0.12);
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.95);
  transform: rotate(-1.5deg);
}

.hero__envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58%;
  background: linear-gradient(145deg, #ffd8e8, #ffb0c8 60%, #f8a0b8);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.35) inset;
}

.hero__ribbon {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  background: var(--ribbon);
  border-radius: 50%;
  box-shadow: 0 5px 16px rgba(232, 122, 154, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  z-index: 2;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 3.8rem);
  color: var(--pink-deep);
  margin: 0 0 0.75rem;
}

.hero__subtitle {
  margin: 0 auto 2rem;
  max-width: min(36rem, 100%);
  color: var(--text-soft);
  font-size: 1.12rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

/* ---------- Open me  -  envelope ritual (seal → flap → note inside) ---------- */
.open-me {
  width: 100%;
  max-width: min(40rem, 100%);
  margin: 0 auto;
  text-align: center;
}

.open-me__panel {
  padding: 2rem 1.5rem;
}

.open-me__headline {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--pink-deep);
  margin: 0 0 0.75rem;
}

.open-me__sub {
  color: var(--text-soft);
  margin: 0 0 2rem;
  font-size: 1rem;
}

.open-me__envelope-wrap {
  perspective: 900px;
  margin-bottom: 1.5rem;
}

.open-me__envelope {
  width: 240px;
  height: 158px;
  margin: 0 auto;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s ease, filter 0.5s ease;
}

.open-me__shadow {
  position: absolute;
  bottom: -12px;
  left: 8%;
  right: 8%;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(80, 40, 55, 0.2), transparent 70%);
  filter: blur(6px);
  z-index: 0;
}

.open-me__envelope.is-seal-breaking {
  transform: translateY(-4px) scale(1.02);
}

.open-me__envelope.is-seal-breaking .open-me__heart-seal,
.open-me__heart-seal.is-broken {
  opacity: 0;
  transform: translateX(-50%) scale(0.4) rotate(-18deg);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.open-me__heart-seal {
  position: absolute;
  bottom: 26%;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 45%), var(--ribbon);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  z-index: 4;
  box-shadow: 0 4px 14px rgba(232, 112, 136, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.open-me__envelope.is-open .open-me__flap {
  transform: rotateX(-132deg);
  transform-origin: top center;
}

.open-me__envelope.is-open {
  filter: drop-shadow(0 16px 32px rgba(232, 122, 154, 0.28));
}

.open-me__envelope.is-open .open-me__card {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

.open-me__base {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76%;
  background: linear-gradient(180deg, #fff0f6, #ffd6e4);
  border-radius: 0 0 14px 14px;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255, 255, 255, 0.95);
  z-index: 1;
}

.open-me__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56%;
  background: linear-gradient(145deg, #ffd8e8, #ffb8d0);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transition: transform 0.95s cubic-bezier(0.33, 0.65, 0.25, 1);
  border-radius: 10px 10px 0 0;
  z-index: 3;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.45);
}

.open-me__card {
  position: absolute;
  bottom: 10%;
  left: 10%;
  right: 10%;
  height: 48%;
  background: linear-gradient(180deg, #fffef9, #fff5f0);
  border-radius: 6px;
  border: 1px solid rgba(248, 164, 188, 0.35);
  z-index: 2;
  opacity: 0;
  transform: translateY(12px) rotate(-2deg);
  transition: opacity 0.55s ease 0.15s, transform 0.65s cubic-bezier(0.34, 0.7, 0.35, 1) 0.12s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0.65rem 0.75rem;
  pointer-events: none;
}

.open-me__card-line {
  height: 5px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(248, 164, 188, 0.25), rgba(232, 180, 200, 0.15));
}

.open-me__card-line--short {
  width: 62%;
}

.open-me__letter-peek {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.65s ease, opacity 0.5s ease, margin 0.5s ease;
  margin-bottom: 0;
}

.open-me__letter-peek.is-visible {
  max-height: 120px;
  opacity: 1;
  margin-bottom: 1rem;
}

.open-me__peek-paper {
  background: linear-gradient(180deg, #fffefb, #fff8f4);
  border: 1px dashed rgba(248, 164, 188, 0.5);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), 0 6px 20px rgba(200, 120, 140, 0.12);
}

.open-me__peek-line {
  margin: 0;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-soft);
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  .open-me__envelope.is-seal-breaking {
    transform: none;
  }
  .open-me__heart-seal.is-broken {
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
  }
  .open-me__letter-peek {
    transition: none;
  }
  .open-me__letter-peek.is-visible {
    max-height: none;
  }
}

.open-me__question {
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.open-me__hint {
  min-height: 1.5em;
  color: var(--accent-red);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.open-me__actions {
  position: relative;
  min-height: 100px;
  margin-bottom: 1rem;
}

.open-me__actions-inner {
  position: relative;
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.open-me__next {
  margin-top: 0.5rem;
}

.open-me__next[hidden] {
  display: none !important;
}

/* ---------- Letters page  -  one envelope per “page turn” ---------- */
.letters-stage {
  position: relative;
}

.letters-stage__progress {
  text-align: center;
  font-size: 0.92rem;
  font-style: italic;
  font-weight: 500;
  color: rgba(120, 82, 102, 0.88);
  margin: 0 0 1.1rem;
  min-height: 1.45em;
  letter-spacing: 0.02em;
}

.letters-stage__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px dashed rgba(248, 164, 188, 0.4);
}

.letters-stage__nav .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.letters-stage__chapter-hint {
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--accent-red);
  margin: 1rem 0 0;
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

/* Plain paper fallback if envelope UI is invisible or fails to paint */
.letters-fallback {
  max-width: 24rem;
  margin: 0 auto 1rem;
  padding: 1.4rem 1.35rem 1.5rem;
  text-align: left;
  box-shadow: var(--shadow-soft), inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.letters-fallback[hidden] {
  display: none !important;
}

.letters-fallback__note {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-soft);
  margin: 0 0 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed rgba(248, 164, 188, 0.45);
  line-height: 1.5;
}

.letters-fallback__title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  margin: 0 0 0.5rem;
  color: var(--pink-deep);
  line-height: 1.2;
}

.letters-fallback__date {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0 0 0.65rem;
}

.letters-fallback__preview {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-soft);
  margin: 0 0 1rem;
  line-height: 1.55;
}

.letters-fallback__body {
  margin: 0;
}

.letters-fallback__p {
  margin: 0 0 0.9rem;
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.7;
}

.letters-fallback__p:last-child {
  margin-bottom: 0;
}

.letters-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

.letters-grid.letters-grid--story {
  display: block;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .letters-grid:not(.letters-grid--story) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .letters-grid:not(.letters-grid--story) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.envelope-card {
  text-align: center;
  padding: 1.25rem 1rem 1.5rem;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, filter 0.25s;
  filter: drop-shadow(0 6px 12px rgba(232, 122, 154, 0.18));
  transition-delay: calc(var(--stagger, 0) * 0.07s);
  animation: cardPeekIn 0.65s ease backwards;
  animation-delay: calc(var(--stagger, 0) * 0.1s);
}

.envelope-card.is-story-active {
  animation: storyPageIn 0.55s ease both;
}

@keyframes storyPageIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .envelope-card.is-story-active {
    animation: none;
  }
}

@keyframes cardPeekIn {
  from {
    opacity: 0;
    transform: translateY(12px) rotate(-2deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .envelope-card {
    animation: none;
  }
}

.envelope-card:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: var(--shadow-lift);
  filter: drop-shadow(0 10px 20px rgba(232, 122, 154, 0.25));
}

.envelope-card:focus-visible {
  outline: 3px solid var(--accent-red);
  outline-offset: 4px;
}

.envelope-card__visual {
  width: 100%;
  max-width: 180px;
  height: 120px;
  margin: 0 auto 1rem;
  position: relative;
}

.envelope-card__body {
  height: 70%;
  bottom: 0;
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #fff0f5, #ffd6e4);
  border-radius: 0 0 10px 10px;
  border: 2px solid #fff;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.6);
}

.envelope-card__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(135deg, #ffe0ec, #ffc0d8);
  clip-path: polygon(0 0, 50% 85%, 100% 0);
  border-radius: 8px 8px 0 0;
}

.envelope-card__title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin: 0 0 0.35rem;
  color: var(--pink-deep);
}

.envelope-card__preview {
  font-size: 0.88rem;
  color: var(--text-soft);
  margin: 0;
}

.envelope-card__date {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0 0 0.5rem;
}

.letter-sheet {
  margin-top: 1rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.55s ease, opacity 0.45s ease;
  text-align: left;
}

.envelope-card.is-expanded .letter-sheet {
  max-height: 800px;
  opacity: 1;
}

.envelope-card.is-expanded .letter-sheet__inner {
  animation: letterUnfold 0.65s ease;
}

@keyframes letterUnfold {
  from {
    opacity: 0;
    transform: perspective(400px) rotateX(-6deg) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: perspective(400px) rotateX(0) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .envelope-card.is-expanded .letter-sheet__inner {
    animation: none;
  }
}

.letter-sheet__inner {
  background: linear-gradient(180deg, #fffef9, #fff5f8);
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 164, 188, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  margin-top: 0.75rem;
  transform-origin: top center;
}

.letter-sheet__inner p {
  margin: 0 0 0.85rem;
  font-size: 0.98rem;
  color: var(--text);
}

.letter-sheet__inner p:last-child {
  margin-bottom: 0;
}

/* ---------- Memories  -  surprise sticky notes ---------- */
.memories-surprises {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.sticky-note {
  position: relative;
  max-width: 12rem;
  transform: rotate(-2.5deg);
}

.sticky-note:nth-child(even) {
  transform: rotate(2deg);
}

.sticky-note__teaser {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #fff9e6, #fff3c8);
  color: var(--text);
  border-radius: 4px 8px 6px 10px;
  box-shadow: 3px 4px 0 rgba(200, 170, 120, 0.25), 0 0 0 1px rgba(255, 220, 180, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: left;
}

.sticky-note__teaser:hover {
  transform: scale(1.03);
  box-shadow: 4px 6px 0 rgba(200, 170, 120, 0.3);
}

.sticky-note.is-open .sticky-note__teaser {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.sticky-note__body {
  padding: 0.65rem 0.75rem 0.85rem;
  background: #fffef8;
  border-radius: 0 0 8px 8px;
  box-shadow: 3px 5px 0 rgba(200, 170, 120, 0.2);
  border: 1px solid rgba(255, 210, 160, 0.5);
  border-top: none;
}

.sticky-note__body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}

/* ---------- Memories scrapbook ---------- */
.scrapbook {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .scrapbook {
    grid-template-columns: repeat(2, 1fr);
  }
}

.scrap-card {
  padding: 1.1rem 1rem 1.15rem;
  background: var(--lavender);
  border-radius: 3px 14px 10px 5px;
  transform: rotate(-1deg);
  box-shadow: var(--shadow-soft), 2px 3px 0 rgba(180, 140, 170, 0.12);
  position: relative;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.scrap-card::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 12px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #f8f4ff, #b8a8d8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}

.scrap-card:hover {
  transform: rotate(0deg) translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lift);
}

.scrap-card:nth-child(even) {
  transform: rotate(1.5deg);
  background: var(--blush);
}

.scrap-card:nth-child(even):hover {
  transform: rotate(0deg) translateY(-4px) scale(1.01);
}

.scrap-card__washi {
  position: absolute;
  top: -6px;
  left: 20%;
  right: 20%;
  height: 18px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.5) 0 6px,
    rgba(248, 164, 188, 0.4) 6px 12px
  );
  border-radius: 2px;
  opacity: 0.85;
}

.scrap-card__sticker {
  position: absolute;
  background: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--pink-deep);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.scrap-card__sticker--tr {
  top: 12px;
  right: 12px;
  transform: rotate(8deg);
}

.scrap-card__sticker--bl {
  top: auto;
  right: auto;
  bottom: 14px;
  left: 14px;
  transform: rotate(-7deg);
}

.polaroid-sm {
  position: relative;
  background: linear-gradient(145deg, #ffffff, #fffafd);
  padding: 0.55rem 0.55rem 2.1rem;
  box-shadow: 4px 7px 0 rgba(200, 130, 150, 0.18), 0 2px 8px rgba(180, 100, 120, 0.1);
  margin-bottom: 0.85rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  transform: rotate(-0.8deg);
}

.polaroid-sm::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 12px;
  width: 28px;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.75) 0 4px,
    rgba(248, 200, 218, 0.55) 4px 8px
  );
  border-radius: 2px;
  opacity: 0.9;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.polaroid-sm img {
  width: 100%;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--cream);
  border-radius: 2px;
}

.scrap-card__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 0.25rem;
  color: var(--pink-deep);
}

.scrap-card__date {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
}

.scrap-card__text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  white-space: pre-line;
}

.scrap-card__text:empty {
  display: none;
}

/* ---------- Gallery polaroids ---------- */
.gallery-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.gallery-grid--storybook {
  position: relative;
  padding: 1.25rem 0.5rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 245, 236, 0.55), rgba(255, 250, 252, 0.3));
  box-shadow: inset 0 0 0 1px rgba(248, 200, 180, 0.25);
}

.gallery-grid--storybook::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

.polaroid {
  position: relative;
  background: linear-gradient(145deg, #ffffff, #fffafd);
  padding: 0.65rem 0.65rem 2.25rem;
  border-radius: 4px;
  box-shadow: var(--shadow-soft), 3px 5px 0 rgba(232, 180, 195, 0.25);
  transition: transform 0.25s, box-shadow 0.25s;
  transform: rotate(var(--tilt, 0deg));
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.polaroid::after {
  content: "♥";
  position: absolute;
  top: -6px;
  right: 14px;
  font-size: 0.85rem;
  color: var(--rose);
  opacity: 0.65;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
  pointer-events: none;
}

.polaroid:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: var(--shadow-lift), 4px 8px 0 rgba(232, 180, 195, 0.2);
}

.polaroid:nth-child(3n + 1) {
  --tilt: -2deg;
}
.polaroid:nth-child(3n + 2) {
  --tilt: 1.5deg;
}
.polaroid:nth-child(3n) {
  --tilt: 2deg;
}

.polaroid button {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
}

.polaroid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--cream);
}

.polaroid figcaption {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-soft);
  padding: 0 0.25rem;
  line-height: 1.45;
}

/* ---------- Videos ---------- */
.video-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.video-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: visible;
  background: linear-gradient(180deg, #fffefb, #fff5f9);
  border: 2px solid rgba(248, 164, 188, 0.45);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.video-card::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 12px;
  background: linear-gradient(90deg, transparent, rgba(255, 210, 225, 0.9), transparent);
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
  opacity: 0.85;
}

.video-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: var(--shadow-lift), 0 0 32px rgba(248, 164, 188, 0.22);
}

.video-card__thumb {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--lavender);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
}

.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card__play {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(255, 248, 245, 0.35);
  cursor: pointer;
  font-size: 2.5rem;
  color: var(--pink-deep);
  transition: background 0.2s, transform 0.25s ease, box-shadow 0.25s ease;
  animation: playPulse 2.8s ease-in-out infinite;
  border-radius: inherit;
}

.video-card__play:hover {
  background: rgba(255, 248, 245, 0.55);
  animation: none;
  transform: scale(1.06);
  box-shadow: inset 0 0 0 2px rgba(248, 164, 188, 0.35);
}

@keyframes playPulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(248, 164, 188, 0);
  }
  50% {
    box-shadow: inset 0 0 24px rgba(248, 164, 188, 0.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-card__play {
    animation: none;
  }
}

.video-card__play:focus-visible {
  outline: 3px solid var(--accent-red);
  outline-offset: -3px;
}

.video-card__body {
  padding: 1rem 1.1rem 1.25rem;
}

.video-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.35rem;
  color: var(--pink-deep);
}

.video-card__caption {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-soft);
  white-space: pre-line;
}

/* ---------- Funny moments ---------- */
.funny-grid {
  display: grid;
  gap: 1.25rem;
}

.funny-card {
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  position: relative;
  border-left: 5px solid var(--rose);
  background: linear-gradient(90deg, rgba(255, 240, 248, 0.5), rgba(255, 252, 250, 0.95));
}

.funny-card::before {
  content: "☺";
  position: absolute;
  bottom: 0.65rem;
  left: 0.85rem;
  font-size: 1.1rem;
  opacity: 0.35;
}

.funny-card__title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  margin: 0 0 0.5rem;
  color: var(--pink-deep);
}

.funny-card__text {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  white-space: pre-line;
}

/* ---------- Final page ---------- */
.final-wrap {
  position: relative;
  width: 100%;
  max-width: min(42rem, 100%);
  margin: 0 auto;
  text-align: center;
}

.final-envelope {
  margin: 0 auto 2rem;
  width: 260px;
  cursor: pointer;
  perspective: 600px;
}

.final-envelope__inner {
  position: relative;
  height: 170px;
  transition: transform 0.3s;
}

.final-envelope:hover .final-envelope__inner {
  transform: scale(1.02);
}

.final-envelope.is-open .final-envelope__flap {
  transform: rotateX(-118deg);
  transform-origin: top center;
}

.final-envelope__base {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72%;
  background: linear-gradient(180deg, #ffeef5, #ffc8d8);
  border-radius: 0 0 14px 14px;
  border: 3px solid #fff;
  box-shadow: var(--shadow-soft);
}

.final-envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52%;
  background: linear-gradient(135deg, #ffd8e8, #ffb8d0);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transition: transform 0.65s ease;
  z-index: 2;
  border-radius: 10px 10px 0 0;
}

.final-envelope__seal {
  position: absolute;
  bottom: 32%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 2rem;
}

.final-letter {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.7s ease, opacity 0.5s ease;
}

.final-envelope.is-open + .final-letter,
.final-letter.is-visible {
  max-height: min(92vh, 2600px);
  opacity: 1;
  margin-top: 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.final-letter__paper {
  padding: 2rem 1.75rem;
  text-align: left;
}

.final-letter__paper h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  text-align: center;
  margin: 0 0 1rem;
  color: var(--pink-deep);
}

.final-letter__paper .lead {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin: 0 0 1rem;
  text-align: center;
}

.final-letter__paper p {
  margin: 0 0 1rem;
  color: var(--text);
}

.tap-hint {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 0 0 1rem;
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Hidden looped MP3 (see initSiteAudio in script.js) */
.site-audio--hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-style: italic;
  position: relative;
  margin-top: 0.75rem;
  line-height: 1.7;
}

.site-footer::before {
  content: "";
  display: block;
  max-width: 200px;
  height: 10px;
  margin: 0 auto 1rem;
  background: repeating-linear-gradient(
    90deg,
    rgba(248, 164, 188, 0.4) 0 8px,
    rgba(255, 255, 255, 0.6) 8px 16px
  );
  border-radius: 2px;
  opacity: 0.75;
}

.site-footer a {
  color: var(--pink-deep);
  font-weight: 700;
}

/* ---------- Modals (light) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none !important;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(92, 61, 74, 0.45);
  backdrop-filter: blur(4px);
}

.modal__box {
  position: relative;
  z-index: 1;
  max-width: min(900px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: linear-gradient(180deg, #ffffff, #fff8fb);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  border: 3px solid rgba(248, 164, 188, 0.45);
}

.modal:not([hidden]) .modal__backdrop {
  animation: modalBackdropIn 0.38s ease forwards;
}

.modal:not([hidden]) .modal__box {
  animation: modalBoxIn 0.42s cubic-bezier(0.34, 1.15, 0.64, 1) forwards;
}

@keyframes modalBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalBoxIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal:not([hidden]) .modal__backdrop,
  .modal:not([hidden]) .modal__box {
    animation: none;
  }
}

.modal__box::before {
  content: "♥";
  position: absolute;
  top: 0.5rem;
  right: 3rem;
  font-size: 0.9rem;
  opacity: 0.35;
  pointer-events: none;
}

.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--blush);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal__close:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

.modal__box img {
  max-width: 100%;
  height: auto;
  max-height: 75vh;
  display: block;
  border-radius: 8px;
}

.modal__box .modal__cap {
  margin: 0.75rem 0 0;
  text-align: center;
  color: var(--text-soft);
}

.modal--video .modal__box {
  width: min(800px, 100%);
}

.modal--video video {
  width: 100%;
  max-height: 65vh;
  border-radius: 8px;
  background: #000;
}

.modal--video .modal__vid-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 2.5rem 0.5rem 0;
  color: var(--pink-deep);
}

.modal--video .modal__cap {
  white-space: pre-line;
}

/* ---------- Page transition helper ---------- */
html.page-enter main {
  animation: pageIn 0.45s ease;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(18px) translateZ(0) rotate(0.35deg) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.page-enter main {
    animation: none;
  }
}

/* =============================================================================
   Romantic “magic” layer  -  tasteful motion, cursor, bursts, emphasis
   Global + page accents. Respects prefers-reduced-motion where duplicated in JS.
   ============================================================================= */

.particles--lush .particle {
  opacity: 0.38;
}

.particle--star {
  color: #f0c8e0;
  font-size: 11px;
  opacity: 0.42;
  animation: driftSlow 16s ease-in-out infinite, twinkle 4s ease-in-out infinite;
}

.particle--petal {
  font-size: 13px;
  opacity: 0.32;
  animation: driftPetals 22s ease-in-out infinite, twinkle 5s ease-in-out infinite;
}

@keyframes driftSlow {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-10px, -24px) rotate(12deg);
  }
}

@keyframes driftPetals {
  0%,
  100% {
    transform: translate(0, 0) rotate(-4deg);
  }
  33% {
    transform: translate(12px, 18px) rotate(6deg);
  }
  66% {
    transform: translate(-8px, 10px) rotate(-8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .particle--star,
  .particle--petal {
    animation: none;
    opacity: 0.25;
  }
}

/* Soft pink cursor glow (desktop) */
.magic-cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(
    circle,
    rgba(248, 180, 200, 0.22) 0%,
    rgba(255, 220, 235, 0.08) 42%,
    transparent 68%
  );
  transform: translate(var(--gx, 50vw), var(--gy, 50vh));
  transition: opacity 0.3s ease;
}

.magic-trail-spark {
  position: fixed;
  left: 0;
  top: 0;
  margin: -6px 0 0 -4px;
  pointer-events: none;
  z-index: 6;
  font-size: 10px;
  color: rgba(248, 164, 188, 0.85);
  animation: trailFade 0.65s ease forwards;
  text-shadow: 0 0 8px rgba(255, 200, 220, 0.9);
}

@keyframes trailFade {
  to {
    opacity: 0;
    transform: translate(0, -14px) scale(0.6);
  }
}

.magic-burst {
  position: fixed;
  left: 0;
  top: 0;
  margin: -8px 0 0 -8px;
  pointer-events: none;
  z-index: 150;
  font-size: 13px;
  color: var(--pink-deep);
  animation: burstOut 0.8s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
  text-shadow: 0 0 10px rgba(255, 190, 210, 0.95);
}

@keyframes burstOut {
  from {
    opacity: 1;
    transform: rotate(var(--burst-a, 0deg)) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: rotate(var(--burst-a, 0deg)) translateY(calc(-1 * var(--burst-r, 28px))) scale(0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .magic-cursor-glow,
  .magic-trail-spark,
  .magic-burst {
    display: none !important;
  }
}

/* Intro  -  cover shimmer + heading glow after typewriter */
.hero--magic {
  position: relative;
  overflow: hidden;
}

.hero--magic::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 48%,
    rgba(255, 220, 235, 0.2) 52%,
    transparent 58%
  );
  animation: coverShimmer 8s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.55;
}

@keyframes coverShimmer {
  0%,
  100% {
    transform: translateX(-12%) rotate(6deg);
  }
  50% {
    transform: translateX(18%) rotate(6deg);
  }
}

.magic-glow-title {
  animation: titleGlowIn 1.2s ease forwards;
  text-shadow: 0 0 40px rgba(248, 164, 188, 0.35);
}

@keyframes titleGlowIn {
  from {
    text-shadow: 0 0 0 transparent;
    filter: blur(1px);
  }
  to {
    text-shadow: 0 2px 28px rgba(232, 122, 154, 0.25), 0 0 48px rgba(255, 200, 220, 0.35);
    filter: none;
  }
}

.magic-subtle-in {
  animation: subFadeUp 0.9s ease forwards;
}

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

@media (prefers-reduced-motion: reduce) {
  .hero--magic::after {
    animation: none;
    opacity: 0.2;
  }
  .magic-glow-title,
  .magic-subtle-in {
    animation: none;
  }
}

/* Hover emphasis  -  envelopes, polaroids, final envelope */
.magic-hover-glow {
  transition: filter 0.35s ease, box-shadow 0.35s ease, transform 0.3s ease;
}

.magic-hover-glow:hover {
  filter: drop-shadow(0 0 14px rgba(248, 164, 188, 0.45));
}

.envelope-card.magic-hover-glow:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift), 0 0 28px rgba(248, 164, 188, 0.25);
}

.envelope-card.is-expanded .letter-sheet__inner {
  box-shadow: 0 0 24px rgba(248, 164, 188, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

/* Polaroids  -  zoom + caption reveal */
.polaroid button img {
  transition: transform 0.45s cubic-bezier(0.34, 1.1, 0.64, 1);
}

.polaroid:hover button img {
  transform: scale(1.05);
}

.polaroid figcaption {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.polaroid:hover figcaption {
  opacity: 1;
  transform: translateY(-2px);
}

/* Primary journey CTAs  -  soft inviting pulse */
.journey-nav--dock .btn--primary {
  animation: ctaPulse 4s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%,
  100% {
    box-shadow: 0 4px 20px rgba(232, 122, 154, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow: 0 6px 28px rgba(248, 164, 188, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }
}

.journey-nav--dock .btn--primary:hover {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .journey-nav--dock .btn--primary {
    animation: none;
  }
}

/* Buttons  -  gentle bounce on hover (not bottom dock  -  it has its own pulse) */
.scene__content .btn--primary:not(:disabled):hover {
  animation: btnSoftBounce 0.55s ease;
}

@keyframes btnSoftBounce {
  0% {
    transform: translateY(-3px) rotate(-0.5deg);
  }
  40% {
    transform: translateY(-5px) rotate(-0.5deg);
  }
  70% {
    transform: translateY(-2px) rotate(-0.5deg);
  }
  100% {
    transform: translateY(-3px) rotate(-0.5deg);
  }
}

/* Final page  -  emotional backdrop + shine on letter */
.final-wrap--magic {
  position: relative;
  padding: 1.5rem 1rem 2rem;
  border-radius: 16px;
  background: radial-gradient(ellipse 90% 70% at 50% 0%, rgba(255, 228, 240, 0.55), transparent 55%),
    linear-gradient(180deg, rgba(255, 252, 254, 0.4), transparent);
}

.final-wrap--magic::before,
.final-wrap--magic::after {
  content: "♥";
  position: absolute;
  font-size: 1.1rem;
  opacity: 0.22;
  animation: cornerHeartFloat 5s ease-in-out infinite;
  pointer-events: none;
}

.final-wrap--magic::before {
  top: 0.5rem;
  left: 0.75rem;
}

.final-wrap--magic::after {
  bottom: 1rem;
  right: 0.85rem;
  animation-delay: 1.2s;
}

@keyframes cornerHeartFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.2;
  }
  50% {
    transform: translateY(-6px) scale(1.08);
    opacity: 0.35;
  }
}

.final-letter__paper--glow {
  position: relative;
  overflow: hidden;
}

.final-letter__paper--glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 42%,
    rgba(255, 255, 255, 0.45) 48%,
    rgba(255, 230, 245, 0.25) 52%,
    transparent 58%,
    transparent 100%
  );
  animation: paperShine 2.8s ease-out 0.3s forwards;
  pointer-events: none;
}

@keyframes paperShine {
  from {
    transform: translateX(-100%) skewX(-12deg);
    opacity: 0;
  }
  15% {
    opacity: 0.7;
  }
  to {
    transform: translateX(120%) skewX(-12deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .final-wrap--magic::before,
  .final-wrap--magic::after {
    animation: none;
  }
  .final-letter__paper--glow::after {
    animation: none;
  }
}

/* Scroll fade-up  -  slightly stronger than base .reveal */
.reveal.is-visible {
  transition: opacity 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.65s ease;
}

/* ---------- First letter scene (page 3) ---------- */
.scene__content--letter {
  max-width: min(var(--readable-max), 100%);
}

.first-letter-scene {
  text-align: left;
  padding: 1.5rem 1.35rem 1.85rem;
}

.first-letter__lede {
  margin: 0 0 1.1rem;
  text-align: center;
}

.first-letter__title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.45rem);
  color: var(--pink-deep);
  margin: 0 0 1.35rem;
  text-align: center;
  line-height: 1.2;
  font-weight: 400;
}

.first-letter__body {
  margin: 0;
}

.first-letter__line {
  margin: 0 0 1.05rem;
  font-size: 1.06rem;
  line-height: 1.78;
  color: var(--text);
  min-height: 1.4em;
}

.first-letter__signature {
  margin: 2rem 0 0;
  text-align: right;
  font-style: italic;
  color: var(--text-soft);
  font-size: 1.08rem;
  opacity: 0;
  transition: opacity 1s ease;
}

.first-letter__sig--in {
  opacity: 1;
}

/* ---------- Scene flow helpers (layered reveals) ---------- */
.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;
}

.scene-layer {
  position: relative;
  z-index: 1;
}

.scene-layer--fg {
  z-index: 2;
  pointer-events: none;
}

.scene-layer--fg button,
.scene-layer--fg a {
  pointer-events: auto;
}

body.journey-locked a.journey-next[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.journey-next--locked {
  filter: grayscale(0.15);
}

/* Home  -  Continue appears after intro */
.hero__continue-wrap {
  min-height: 3.25rem;
  margin-top: 0.5rem;
}

.hero__continue-wrap .journey-next {
  animation: homeContinueIn 0.65s ease forwards;
}

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

/* First letter  -  envelope + paper layers */
.first-letter__envelope-stage {
  margin-bottom: 1.5rem;
}

.first-env {
  width: 240px;
  height: 158px;
  margin: 0 auto;
  position: relative;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: filter 0.35s ease;
}

.first-env:hover {
  filter: drop-shadow(0 0 18px rgba(248, 164, 188, 0.45));
}

.first-env__shadow {
  position: absolute;
  bottom: -12px;
  left: 8%;
  right: 8%;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(80, 40, 55, 0.18), transparent 70%);
  filter: blur(6px);
  z-index: 0;
}

.first-env__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56%;
  background: linear-gradient(145deg, #ffd8e8, #ffb8d0);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transition: transform 0.95s cubic-bezier(0.33, 0.65, 0.25, 1);
  border-radius: 10px 10px 0 0;
  z-index: 3;
}

.first-env__base {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76%;
  background: linear-gradient(180deg, #fff0f6, #ffd6e4);
  border-radius: 0 0 14px 14px;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255, 255, 255, 0.95);
  z-index: 1;
}

.first-env__seal {
  position: absolute;
  bottom: 26%;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 45%), var(--ribbon);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  z-index: 4;
  box-shadow: 0 4px 14px rgba(232, 112, 136, 0.4);
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.first-env.is-seal-breaking .first-env__seal,
.first-env__seal.is-broken {
  opacity: 0;
  transform: translateX(-50%) scale(0.35) rotate(-14deg);
}

.first-env.is-open .first-env__flap {
  transform: rotateX(-132deg);
}

.first-env.is-open {
  filter: drop-shadow(0 16px 28px rgba(232, 122, 154, 0.28));
}

.first-letter__teaser {
  text-align: center;
  font-style: italic;
  color: var(--text-soft);
  margin: 0 0 1rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.first-letter__open-btn {
  display: block;
  margin: 0 auto 1rem;
}

.first-letter__paper-shell {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: max-height 0.75s ease, opacity 0.55s ease, transform 0.65s ease;
}

.first-letter__paper-shell.is-unfolded {
  max-height: 2000px;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.first-letter-scene--hidden {
  display: none !important;
}

/* Memories  -  scrapbook cover */
.memories-cover {
  text-align: center;
  padding: 2rem 1.25rem 2.5rem;
  width: 100%;
  max-width: min(36rem, 100%);
  margin: 0 auto;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.75), rgba(255, 242, 248, 0.5));
  border: 3px double rgba(248, 164, 188, 0.45);
  border-radius: 8px 12px 10px 14px;
  box-shadow: var(--shadow-soft), inset 0 0 40px rgba(255, 220, 230, 0.2);
}

.memories-cover__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  color: var(--pink-deep);
  margin: 0 0 0.75rem;
}

.memories-cover__lede {
  font-style: italic;
  color: var(--text-soft);
  margin: 0 0 1.5rem;
  line-height: 1.65;
}

.memories-cover.is-opened {
  animation: coverFade 0.5s ease forwards;
}

@keyframes coverFade {
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}

.memories-stage[hidden] {
  display: none !important;
}

.scrap-card--stagger {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.scrap-card--stagger.is-stagger-visible {
  opacity: 1;
  transform: none;
}

.scrap-card__photo-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.scrap-card__img-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  font-style: italic;
  color: #fff;
  background: linear-gradient(transparent, rgba(60, 30, 45, 0.65));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  border-radius: 0 0 4px 4px;
}

.scrap-card--has-photo:hover .scrap-card__img-caption,
.scrap-card--has-photo:focus-within .scrap-card__img-caption,
.scrap-card--has-photo.is-caption-shown .scrap-card__img-caption {
  opacity: 1;
  transform: translateY(0);
}

.scrap-card__lb {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}

.scrap-card__lb:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 2px;
}

.scrap-card__caption-btn {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  text-decoration: underline;
  color: var(--text-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  font-family: inherit;
}

.scrap-card__caption-btn:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .scrap-card__caption-btn {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Gallery / videos intro */
.gallery-intro,
.videos-intro,
.funny-intro {
  text-align: center;
  width: 100%;
  max-width: min(40rem, 100%);
  margin: 0 auto 1.5rem;
}

.gallery-intro[hidden],
.videos-intro[hidden],
.funny-intro[hidden] {
  display: none !important;
}

.polaroid--stagger {
  opacity: 0;
  transform: translateY(16px) rotate(var(--tilt, 0deg));
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.34, 1.1, 0.64, 1);
}

.polaroid--stagger.is-stagger-visible {
  opacity: 1;
  transform: translateY(0) rotate(var(--tilt, 0deg));
}

.video-card--stagger,
.funny-card--stagger {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.video-card--stagger.is-stagger-visible,
.funny-card--stagger.is-stagger-visible {
  opacity: 1;
  transform: none;
}

.final-body-line {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.55s ease, transform 0.5s ease;
}

.final-body-line.is-line-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .first-env.is-open .first-env__flap {
    transform: rotateX(-132deg);
  }
  .memories-cover.is-opened {
    animation: none;
    opacity: 0;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
  }
  .hero__continue-wrap .journey-next {
    animation: none;
    opacity: 1;
  }
  .final-body-line {
    opacity: 1;
    transform: none;
  }
  .scrap-card--stagger,
  .polaroid--stagger,
  .video-card--stagger,
  .funny-card--stagger {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .whisper-toast {
    transition: none;
  }
}

/* ---------- Phase 2: per-page atmosphere ---------- */
body[data-page="home"] {
  --page-tint: rgba(255, 240, 248, 0.35);
  --page-paper: #fffefb;
}

body[data-page="open-me"] {
  --page-tint: rgba(255, 228, 240, 0.4);
  --page-paper: #fff8fc;
}

body[data-page="first-letter"] {
  --page-tint: rgba(248, 236, 255, 0.3);
  --page-paper: #fffafe;
}

body[data-page="memories"] {
  --page-tint: rgba(255, 245, 220, 0.45);
  --page-paper: #fffaf3;
}

body[data-page="gallery"] {
  --page-tint: rgba(240, 248, 255, 0.35);
  --page-paper: #fbfdff;
}

body[data-page="videos"] {
  --page-tint: rgba(30, 20, 40, 0.06);
  --page-paper: #faf8ff;
}

body[data-page="funny"] {
  --page-tint: rgba(255, 230, 250, 0.5);
  --page-paper: #fff7fb;
}

body[data-page="final"] {
  --page-tint: rgba(235, 240, 255, 0.4);
  --page-paper: #f9f8ff;
}

/* ---------- Memories spreads (scroll-snap) ---------- */
.scrapbook--spreads {
  display: block;
  max-width: 100%;
}

.memories-spreads-shell {
  margin: 0 auto;
  width: 100%;
  max-width: min(56rem, 100%);
}

.memories-spreads {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: 12px;
  border: 1px solid rgba(248, 164, 188, 0.35);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.95), rgba(255, 245, 250, 0.5));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
}

.memories-spreads--stacked {
  flex-direction: column;
  overflow: visible;
  scroll-snap-type: none;
}

.memories-spread {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-height: 12rem;
  box-sizing: border-box;
  padding: 0.75rem 0.5rem 1rem;
}

.memories-spreads--stacked .memories-spread {
  flex: none;
  width: 100%;
  border-bottom: 1px dashed rgba(248, 164, 188, 0.25);
}

.memories-spreads--stacked .memories-spread:last-child {
  border-bottom: none;
}

.memories-spread__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5rem;
  min-height: 10rem;
}

.memories-spread__inner .scrap-card--layered {
  flex: 1 1 16rem;
  max-width: 100%;
}

@media (min-width: 640px) {
  .memories-spread__inner .scrap-card--layered:first-child:not(:only-child) {
    margin-right: -2.25rem;
    z-index: 2;
    transform: rotate(-2.2deg);
  }

  .memories-spread__inner .scrap-card--layered:nth-child(2) {
    margin-top: 1.25rem;
    margin-left: -1rem;
    z-index: 1;
    transform: rotate(2.4deg);
  }
}

.memories-spreads-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.memories-spreads-shell:has(.memories-spreads--stacked) .memories-spreads-nav {
  display: none;
}

.memories-spreads-nav__btn {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 164, 188, 0.5);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.memories-spreads-nav__btn[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(255, 228, 240, 0.95), rgba(255, 240, 250, 0.9));
  color: var(--pink-deep);
  box-shadow: 0 2px 10px rgba(232, 140, 160, 0.2);
}

.memories-spreads-nav__btn:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 2px;
}

/* Washi tape variants on scrap cards */
.scrap-card__tape {
  position: absolute;
  height: 14px;
  border-radius: 2px;
  opacity: 0.88;
  pointer-events: none;
  z-index: 3;
}

.scrap-card__tape--a {
  top: -5px;
  left: 12%;
  right: 38%;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.65) 0 5px,
    rgba(248, 200, 218, 0.55) 5px 10px
  );
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.scrap-card__tape--b {
  top: 10px;
  right: -4px;
  width: 42%;
  transform: rotate(-4deg);
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 250, 230, 0.9) 0 4px,
    rgba(220, 200, 255, 0.35) 4px 8px
  );
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.scrap-card--layered {
  box-shadow: var(--shadow-soft), 4px 6px 0 rgba(180, 130, 150, 0.12), 0 12px 28px rgba(120, 80, 100, 0.08);
}

/* Fade-in utility */
.reveal-fade {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-fade.is-fade-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Whisper toast */
.whisper-toast {
  position: fixed;
  bottom: 1.35rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 120;
  max-width: min(22rem, 92vw);
  padding: 0.65rem 1.1rem;
  font-size: 0.92rem;
  font-style: italic;
  text-align: center;
  color: var(--text);
  background: rgba(255, 252, 254, 0.96);
  border: 1px solid rgba(248, 164, 188, 0.45);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.whisper-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .whisper-toast {
    transition: none;
    transform: translateX(-50%);
  }
}

/* Hidden secret hits */
.page-secret-hit {
  position: absolute;
  z-index: 4;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(200, 120, 150, 0.35);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.page-secret-hit:hover,
.page-secret-hit:focus-visible {
  color: var(--pink-deep);
  transform: scale(1.08);
}

.page-secret-hit:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 2px;
}

.page-secret-hit.is-secret-found {
  color: rgba(248, 164, 188, 0.5);
}

.hero.book-cover {
  position: relative;
}

.page-secret-hit--ribbon {
  top: 18%;
  right: 10%;
}

.open-me.paper-card {
  position: relative;
}

.page-secret-hit--open-corner {
  bottom: 0.75rem;
  left: 0.75rem;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.85rem;
}

.first-letter__envelope-stage {
  position: relative;
}

.page-secret-hit--letter {
  top: 0;
  right: 0;
  width: 1.65rem;
  height: 1.65rem;
}

.memories-cover {
  position: relative;
}

.page-secret-hit--cover {
  bottom: 0.65rem;
  right: 0.65rem;
}

.page-secret-hit--gallery,
.page-secret-hit--videos,
.page-secret-hit--funny {
  top: 4.25rem;
  right: 0.5rem;
}

.page-secret-hit--final {
  bottom: -0.25rem;
  right: 0.5rem;
}

/* ---------- Responsive: mobile / tablet / desktop ---------- */
@media (min-width: 480px) {
  .hero.book-cover {
    padding: 2.5rem 1.75rem 3rem;
  }
}

@media (min-width: 768px) {
  .gallery-grid {
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .video-grid {
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .funny-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .memories-spreads-shell {
    max-width: min(64rem, 100%);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  /* Home: wide immersive cover  -  text column + gift */
  body[data-page="home"] .hero.book-cover {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 2rem 3rem;
    align-items: center;
    text-align: left;
    padding: 2.75rem 2.25rem 3.25rem;
  }

  body[data-page="home"] .hero.book-cover .hero__title {
    grid-column: 1;
    grid-row: 1;
    text-align: left;
  }

  body[data-page="home"] .hero.book-cover .hero__subtitle {
    grid-column: 1;
    grid-row: 2;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
  }

  body[data-page="home"] .home-tease {
    grid-column: 1;
    grid-row: 3;
    margin-left: 0;
    margin-right: 0;
  }

  body[data-page="home"] .page-secret-hit--ribbon {
    grid-column: 1;
    grid-row: 4;
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    margin-top: 0.5rem;
  }

  body[data-page="home"] .hero__gift {
    grid-column: 2;
    grid-row: 1 / span 4;
    margin: 0;
    align-self: center;
    justify-self: center;
  }
}

@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .memories-spreads-shell {
    max-width: min(72rem, 100%);
  }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  body[data-page="home"] .hero.book-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  body[data-page="home"] .hero.book-cover .hero__title,
  body[data-page="home"] .hero.book-cover .hero__subtitle {
    text-align: center;
  }

  body[data-page="home"] .hero__gift {
    grid-column: auto;
    grid-row: auto;
    margin: 0 auto 1.75rem;
  }
}

/* ---------- 15-page story: paper scenes, beach, latte, little things ---------- */
.scene--viewport .scene__content {
  justify-content: center;
}

.story-paper {
  width: 100%;
  max-width: min(40rem, 100%);
  margin: 0 auto;
}

.story-paper__body {
  margin-top: 1rem;
}

.story-paper__p {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.story-paper__p:last-child {
  margin-bottom: 0;
}

.scene__content--beach-photo {
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding-left: clamp(0.75rem, 3vw, 1.5rem);
  padding-right: clamp(0.75rem, 3vw, 1.5rem);
}

body[data-page="beach-scene"] .scene--beach-immersive {
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

body[data-page="beach-scene"] .scene--beach-immersive .scene__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---------- Beach hero (photo + atmosphere) ---------- */
.beach-hero {
  --beach-sand-band: 28%;
  position: relative;
  width: 100%;
  flex: 1;
  min-height: min(58vh, 520px);
  margin: 0 auto;
  border-radius: clamp(12px, 3vw, 22px);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(255, 200, 220, 0.35),
    0 12px 48px rgba(180, 120, 150, 0.22),
    0 4px 24px rgba(255, 240, 245, 0.5);
  opacity: 0;
  animation: beach-hero-reveal 1.35s cubic-bezier(0.33, 1, 0.48, 1) 0.08s forwards;
}

@keyframes beach-hero-reveal {
  from {
    opacity: 0;
    transform: scale(0.985);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.beach-hero__glow-ring {
  position: absolute;
  inset: -20%;
  background: radial-gradient(
    ellipse 70% 55% at 50% 45%,
    rgba(255, 230, 210, 0.5) 0%,
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
  animation: beach-glow-breathe 10s ease-in-out infinite;
}

@keyframes beach-glow-breathe {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.04);
  }
}

/* Subtle “camera” zoom on the whole scene */
.beach-hero__camera {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
  transform-origin: 50% 52%;
  animation: beach-camera-soft 40s ease-in-out infinite alternate;
}

@keyframes beach-camera-soft {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.03);
  }
}

.beach-hero__layers {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Layer heights: sky (top) → ocean (middle) → sand (bottom) */
.beach-hero__layer--sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38%;
  z-index: 1;
  overflow: hidden;
  animation: beach-parallax-sky 32s ease-in-out infinite alternate;
}

@keyframes beach-parallax-sky {
  0% {
    transform: translate3d(-1.2%, 0, 0);
  }
  100% {
    transform: translate3d(1.2%, 0, 0);
  }
}

.beach-hero__sky-tone {
  position: absolute;
  inset: -6%;
  background: linear-gradient(
    168deg,
    #7eb3e0 0%,
    #b9daf5 38%,
    #e8f4ff 62%,
    #c5e3f2 100%
  );
  background-size: 120% 120%;
  animation: beach-sky-drift 22s ease-in-out infinite alternate;
}

@keyframes beach-sky-drift {
  0% {
    background-position: 10% 20%;
  }
  100% {
    background-position: 90% 80%;
  }
}

.beach-hero__clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.beach-hero__cloud {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.75;
  animation: beach-cloud-soft 26s ease-in-out infinite;
}

.beach-hero__cloud--1 {
  width: clamp(52px, 16vw, 120px);
  height: clamp(24px, 7vw, 48px);
  top: 10%;
  left: 6%;
  animation-duration: 34s;
}

.beach-hero__cloud--2 {
  width: clamp(44px, 13vw, 100px);
  height: clamp(20px, 6vw, 40px);
  top: 18%;
  right: 10%;
  animation-duration: 28s;
  animation-delay: -6s;
  opacity: 0.55;
}

.beach-hero__cloud--3 {
  width: clamp(32px, 9vw, 72px);
  height: clamp(14px, 4vw, 28px);
  top: 6%;
  left: 44%;
  animation-duration: 38s;
  animation-delay: -12s;
  opacity: 0.48;
}

@keyframes beach-cloud-soft {
  0%,
  100% {
    transform: translate3d(-4%, 0, 0);
  }
  50% {
    transform: translate3d(6%, 4px, 0);
  }
}

.beach-hero__sun {
  position: absolute;
  top: 8%;
  right: 12%;
  width: clamp(48px, 11vw, 76px);
  height: clamp(48px, 11vw, 76px);
  pointer-events: none;
}

.beach-hero__sun-halo {
  position: absolute;
  inset: -50%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 248, 220, 0.9) 0%,
    rgba(255, 210, 160, 0.28) 45%,
    transparent 72%
  );
  filter: blur(6px);
  animation: beach-sun-warm 6s ease-in-out infinite;
}

@keyframes beach-sun-warm {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.beach-hero__sun-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  height: 62%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, #fffaf0, #ffd8a8 60%, #f5b080 100%);
  box-shadow:
    0 0 32px rgba(255, 215, 170, 0.75),
    0 0 64px rgba(255, 190, 140, 0.35);
}

/* Sea layer — band between sky and sand */
.beach-hero__layer--sea {
  position: absolute;
  top: 38%;
  left: 0;
  right: 0;
  height: 34%;
  z-index: 2;
  overflow: hidden;
  animation: beach-parallax-sea 24s ease-in-out infinite alternate;
}

@keyframes beach-parallax-sea {
  0% {
    transform: translate3d(1.5%, 0, 0);
  }
  100% {
    transform: translate3d(-2%, 0, 0);
  }
}

.beach-hero__ocean-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    188deg,
    rgba(120, 185, 215, 0.5) 0%,
    #3d8db5 42%,
    #256a8a 78%,
    #1a4d66 100%
  );
  background-size: 130% 130%;
  animation: beach-ocean-pulse 16s ease-in-out infinite alternate;
}

@keyframes beach-ocean-pulse {
  0% {
    background-position: 0% 40%;
  }
  100% {
    background-position: 100% 60%;
  }
}

.beach-hero__ocean-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    102deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 44%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.08) 56%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: beach-shimmer-sweep 9s ease-in-out infinite;
  mix-blend-mode: soft-light;
  opacity: 0.75;
  pointer-events: none;
}

@keyframes beach-shimmer-sweep {
  0% {
    background-position: -40% 0;
  }
  100% {
    background-position: 140% 0;
  }
}

/* Soft blend between water and sand */
.beach-hero__shore-blend {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(55, 120, 155, 0.12) 35%,
    rgba(130, 165, 185, 0.28) 58%,
    rgba(205, 185, 160, 0.55) 82%,
    rgba(215, 195, 170, 0.75) 100%
  );
}

.beach-hero__waves {
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: 0;
  height: 36%;
  pointer-events: none;
}

.beach-hero__wave {
  position: absolute;
  left: 0;
  width: 130%;
  height: clamp(12px, 2.5vw, 20px);
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.26) 0 18px,
    rgba(255, 255, 255, 0.06) 18px 34px
  );
  border-radius: 50%;
  opacity: 0.5;
}

.beach-hero__wave--1 {
  bottom: 18%;
  animation: beach-wave-move 5s ease-in-out infinite;
}

.beach-hero__wave--2 {
  bottom: 8%;
  opacity: 0.38;
  animation: beach-wave-move 6.2s ease-in-out infinite reverse;
  animation-delay: 0.4s;
}

.beach-hero__wave--3 {
  bottom: 0;
  opacity: 0.3;
  animation: beach-wave-move 7.5s ease-in-out infinite;
  animation-delay: 0.9s;
}

@keyframes beach-wave-move {
  0%,
  100% {
    transform: translateX(-5%) scaleY(1);
  }
  50% {
    transform: translateX(6%) scaleY(1.15);
  }
}

/* Shoreline foam — between ocean and sand */
.beach-hero__foam {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: calc(var(--beach-sand-band) - 2px);
  height: clamp(10px, 2.2vw, 18px);
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.22) 55%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border-radius: 50% 50% 0 0 / 100% 60% 0 0;
  opacity: 0.88;
  filter: blur(0.6px);
  box-shadow:
    0 -3px 14px rgba(255, 255, 255, 0.35),
    inset 0 2px 8px rgba(255, 255, 255, 0.25);
  animation: beach-foam-shimmer 5s ease-in-out infinite;
}

@keyframes beach-foam-shimmer {
  0%,
  100% {
    opacity: 0.82;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.95;
    transform: scaleX(1.02);
  }
}

/* Second foam line — softer shoreline swell */
.beach-hero__foam--edge {
  bottom: calc(var(--beach-sand-band) + 2px);
  height: clamp(6px, 1.4vw, 12px);
  opacity: 0.55;
  filter: blur(1.2px);
  animation: beach-foam-edge 7s ease-in-out infinite;
  box-shadow: 0 -2px 16px rgba(255, 255, 255, 0.28);
}

@keyframes beach-foam-edge {
  0%,
  100% {
    transform: translateX(-2%) scaleX(1);
    opacity: 0.45;
  }
  50% {
    transform: translateX(3%) scaleX(1.06);
    opacity: 0.65;
  }
}

/* Sand — bottom ~28% of scene, warm + subtle grain */
.beach-hero__layer--sand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--beach-sand-band);
  min-height: 110px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #e9d5b6 0%,
    #dcc7a2 35%,
    #d2b892 70%,
    #c4a67a 100%
  );
  box-shadow: inset 0 8px 24px rgba(255, 250, 245, 0.35);
}

.beach-hero__sand-grain {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image: repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 2px,
      rgba(180, 150, 120, 0.06) 2px,
      rgba(180, 150, 120, 0.06) 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px 4px
    );
  background-size: 100% 100%, 6px 6px;
  mix-blend-mode: multiply;
}

/* Figures — slow walk along the sand + tap to read note */
.beach-hero__layer--figures {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(46%, 420px);
  min-height: 200px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 clamp(0.25rem, 2vw, 1rem) 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  pointer-events: none;
  overflow: visible;
}

.beach-hero__walk-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 112%;
  max-width: 56rem;
  margin-left: -6%;
  min-height: min(46%, 420px);
  animation: beach-walk-slow 56s ease-in-out infinite;
}

@keyframes beach-walk-slow {
  0%,
  100% {
    transform: translateX(-4%);
  }
  50% {
    transform: translateX(4%);
  }
}

.beach-hero__footprints {
  position: absolute;
  left: 6%;
  right: auto;
  bottom: clamp(10px, 3.5%, 22px);
  width: min(42%, 220px);
  height: clamp(36px, 9vw, 56px);
  z-index: 0;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0.32rem 0.55rem;
  padding: 0 0.25rem;
  opacity: 0.85;
}

.beach-hero__print {
  display: block;
  width: clamp(7px, 1.6vw, 11px);
  height: clamp(4px, 1vw, 6px);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(95, 75, 58, 0.35) 0%,
    rgba(95, 75, 58, 0.12) 70%,
    transparent 100%
  );
  opacity: 0;
  animation: beach-print-cycle 22s ease-in-out infinite;
  transform: rotate(-18deg);
}

.beach-hero__print:nth-child(1) {
  animation-delay: 0s;
}
.beach-hero__print:nth-child(2) {
  animation-delay: 1.8s;
}
.beach-hero__print:nth-child(3) {
  animation-delay: 3.6s;
}
.beach-hero__print:nth-child(4) {
  animation-delay: 5.4s;
}
.beach-hero__print:nth-child(5) {
  animation-delay: 7.2s;
}
.beach-hero__print:nth-child(6) {
  animation-delay: 9s;
}
.beach-hero__print:nth-child(7) {
  animation-delay: 10.8s;
}
.beach-hero__print:nth-child(8) {
  animation-delay: 12.6s;
}
.beach-hero__print:nth-child(9) {
  animation-delay: 14.4s;
}
.beach-hero__print:nth-child(10) {
  animation-delay: 16.2s;
}

@keyframes beach-print-cycle {
  0%,
  15% {
    opacity: 0;
    transform: scale(0.85) rotate(-18deg);
  }
  35%,
  55% {
    opacity: 0.5;
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1) rotate(-18deg);
  }
}

.beach-hero__figure-stack {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(92vw, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin: 0 auto;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  pointer-events: auto;
  animation: beach-figure-alive 18s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.beach-hero__figure-stack:focus-visible {
  outline: 2px solid rgba(200, 140, 160, 0.55);
  outline-offset: 5px;
  border-radius: 12px;
}

.beach-hero__figure-stack:hover .beach-hero__img {
  filter: drop-shadow(0 4px 20px rgba(55, 40, 48, 0.28));
}

/* Soft shadow on the sand, under the feet */
.beach-hero__figure-shadow {
  position: absolute;
  bottom: clamp(4px, 1.2%, 10px);
  left: 50%;
  width: min(52%, 260px);
  height: clamp(12px, 3vw, 22px);
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(55, 42, 48, 0.38) 0%,
    rgba(55, 42, 48, 0.12) 55%,
    transparent 72%
  );
  filter: blur(8px);
  z-index: 0;
  pointer-events: none;
  animation: beach-feet-shadow 1.9s ease-in-out infinite;
}

@keyframes beach-feet-shadow {
  0%,
  100% {
    transform: translateX(-50%) scaleX(1);
    opacity: 0.85;
  }
  50% {
    transform: translateX(-50%) scaleX(0.88);
    opacity: 0.65;
  }
}

/* Walk motion: horizontal drift + subtle squash from feet — no upward float */
@keyframes beach-figure-alive {
  0%,
  100% {
    transform: translateX(0) scaleY(1);
  }
  25% {
    transform: translateX(5px) scaleY(1.014);
  }
  50% {
    transform: translateX(11px) scaleY(1);
  }
  75% {
    transform: translateX(5px) scaleY(1.01);
  }
}

.beach-hero__figure {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
}

.beach-hero__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(42vh, 360px);
  min-height: 0;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 4px 18px rgba(55, 40, 48, 0.22));
}

.beach-hero__whisper {
  position: absolute;
  left: 50%;
  bottom: 16%;
  z-index: 8;
  max-width: min(19rem, 90vw);
  padding: 0.65rem 1.15rem;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.45;
  color: rgba(82, 58, 72, 0.96);
  text-align: center;
  background: rgba(255, 252, 250, 0.94);
  border-radius: 16px;
  box-shadow:
    0 6px 28px rgba(110, 75, 95, 0.12),
    0 0 0 1px rgba(255, 215, 225, 0.45);
  transform: translate3d(-50%, 12px, 0);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.85s cubic-bezier(0.33, 1, 0.48, 1),
    transform 0.85s cubic-bezier(0.33, 1, 0.48, 1);
}

.beach-hero__whisper--in {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.beach-hero__hint {
  margin: 0.35rem auto 0.15rem;
  max-width: 22rem;
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
  color: rgba(138, 101, 117, 0.52);
  letter-spacing: 0.02em;
}

/* Sparkles + soft hearts */
.beach-hero__sparkles {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.beach-hero__sparkle {
  position: absolute;
  font-size: clamp(7px, 1.6vw, 13px);
  color: rgba(255, 255, 255, 0.5);
  text-shadow: 0 0 10px rgba(255, 240, 250, 0.6);
  animation: beach-sparkle-drift ease-in-out infinite;
  opacity: 0.85;
}

.beach-hero__sparkle--heart {
  color: rgba(255, 190, 210, 0.35);
  font-size: clamp(8px, 1.8vw, 12px);
}

@keyframes beach-sparkle-drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.35;
  }
  50% {
    transform: translate(6px, -14px) scale(1.15);
    opacity: 0.85;
  }
}

/* Copy — delayed reveal driven by JS + fallback */
.beach-copy {
  flex-shrink: 0;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(1rem, 3vh, 1.75rem) 0.5rem 0.5rem;
}

.beach-copy__line {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  color: var(--pink-deep);
  line-height: 1.35;
  min-height: 1.4em;
}

.beach-copy__line.is-typewriting::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.85em;
  margin-left: 2px;
  background: rgba(200, 120, 150, 0.45);
  animation: beach-caret 0.8s step-end infinite;
  vertical-align: -0.05em;
}

@keyframes beach-caret {
  50% {
    opacity: 0;
  }
}

.beach-copy__sub {
  margin: 0.85rem 0 0;
  font-size: clamp(0.98rem, 2.6vw, 1.12rem);
  color: rgba(120, 85, 100, 0.92);
  font-style: italic;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 1s cubic-bezier(0.33, 1, 0.48, 1),
    transform 1s cubic-bezier(0.33, 1, 0.48, 1);
}

.beach-copy__sub--in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .beach-hero,
  .beach-hero__glow-ring,
  .beach-hero__camera,
  .beach-hero__layer--sky,
  .beach-hero__sky-tone,
  .beach-hero__cloud,
  .beach-hero__sun-halo,
  .beach-hero__layer--sea,
  .beach-hero__ocean-body,
  .beach-hero__ocean-shimmer,
  .beach-hero__wave,
  .beach-hero__foam,
  .beach-hero__foam--edge,
  .beach-hero__layer--figures,
  .beach-hero__walk-track,
  .beach-hero__figure-stack,
  .beach-hero__figure-shadow,
  .beach-hero__figure,
  .beach-hero__print,
  .beach-hero__sparkle {
    animation: none !important;
  }

  .beach-hero {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .beach-hero__camera,
  .beach-hero__walk-track {
    transform: none !important;
  }

  .beach-hero__layer--sky,
  .beach-hero__layer--sea,
  .beach-hero__layer--figures {
    transform: none !important;
  }

  .beach-hero__print {
    opacity: 0.26;
  }

  .beach-copy__sub {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@keyframes beach-leave-fade {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html.page-leave-beach main.scene--beach-immersive {
    animation: beach-leave-fade 0.42s ease forwards;
  }
}

/* Latte page  -  sticker story (mad → happy), no fake 3D scene */
.latte-page--stickers {
  position: relative;
  z-index: 2;
  max-width: min(26rem, 100%);
  margin: 0 auto;
  padding: 0.5rem 0.75rem 1rem;
  text-align: center;
}

.latte-sticker-scene {
  position: relative;
  margin: 0 auto 1rem;
  min-height: clamp(240px, 48vw, 400px);
  width: 100%;
}

.latte-sticker-float {
  position: absolute;
  inset: -10% -8%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.latte-float-heart {
  position: absolute;
  font-size: clamp(12px, 2.8vw, 18px);
  color: rgba(248, 140, 175, 0.35);
  animation: latte-float-drift linear infinite;
  filter: drop-shadow(0 0 6px rgba(255, 190, 210, 0.45));
}

@keyframes latte-float-drift {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.35;
  }
  50% {
    transform: translate(6px, -18px) rotate(8deg);
    opacity: 0.6;
  }
}

.latte-sticker-stack {
  position: relative;
  z-index: 1;
  min-height: clamp(220px, 44vw, 380px);
  margin: 0 auto;
  max-width: min(360px, 92vw);
}

.latte-sticker-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, 360px);
  transform: translate(-50%, -50%);
  transition:
    opacity 0.75s cubic-bezier(0.25, 0.8, 0.25, 1),
    transform 0.75s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.latte-sticker-panel--mad {
  z-index: 2;
}

.latte-sticker-panel--happy {
  z-index: 1;
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.96);
  pointer-events: none;
}

.latte-sticker-scene--happy .latte-sticker-panel--mad {
  opacity: 0;
  transform: translate(-54%, -50%) scale(0.94);
  pointer-events: none;
}

.latte-sticker-scene--happy .latte-sticker-panel--happy {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  z-index: 3;
}

.latte-sticker-scene--happy .latte-sticker-panel--happy .latte-sticker-img {
  animation: latte-happy-pop 0.68s cubic-bezier(0.34, 1.35, 0.55, 1) 0.08s both;
}

@keyframes latte-happy-pop {
  0% {
    transform: scale(0.9);
    opacity: 0.88;
  }
  65% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.latte-sticker-bubble {
  display: inline-block;
  margin: 0 auto 0.5rem;
  padding: 0.45rem 0.85rem;
  max-width: 12rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text);
  background: rgba(255, 252, 254, 0.92);
  border: 1px solid rgba(248, 180, 200, 0.5);
  border-radius: 18px 18px 18px 6px;
  box-shadow: 0 4px 18px rgba(232, 140, 160, 0.12);
}

.latte-sticker-bubble--happy {
  border-radius: 18px 18px 6px 18px;
  color: var(--pink-deep);
  background: rgba(255, 248, 252, 0.95);
}

.latte-sticker-img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(90, 50, 65, 0.18));
}

.latte-sticker-panel--pop .latte-sticker-img--mad {
  animation: latte-sticker-pop 0.7s cubic-bezier(0.34, 1.4, 0.55, 1) both;
}

@keyframes latte-sticker-pop {
  0% {
    transform: scale(0.82);
    opacity: 0;
  }
  70% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.latte-sticker-img--shake {
  animation: latte-sticker-shake 2.8s ease-in-out infinite;
}

@keyframes latte-sticker-shake {
  0%,
  100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(-1.2deg);
  }
  30% {
    transform: rotate(1deg);
  }
  45% {
    transform: rotate(-0.8deg);
  }
  60% {
    transform: rotate(0.6deg);
  }
  75% {
    transform: rotate(-0.4deg);
  }
}

.latte-sticker-glow {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 70%;
  height: 45%;
  margin-left: -35%;
  margin-top: -22%;
  background: radial-gradient(ellipse, rgba(255, 200, 220, 0.55) 0%, transparent 72%);
  opacity: 0;
  z-index: -1;
  pointer-events: none;
  filter: blur(20px);
  transition: opacity 0.6s ease;
}

.latte-sticker-scene--happy .latte-sticker-glow {
  opacity: 1;
  animation: latte-happy-glow-pulse 2.5s ease-in-out infinite;
}

@keyframes latte-happy-glow-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.latte-sticker-copy {
  margin: 0.5rem auto 0.75rem;
  max-width: 22rem;
}

.latte-sticker-line {
  margin: 0.35rem 0;
  min-height: 1.5em;
  font-size: 1.1rem;
  color: var(--text);
}

.latte-sticker-line--soft {
  font-style: italic;
  color: var(--text-soft);
  font-size: 1.02rem;
}

.latte-sticker-copy--happy .latte-sticker-line {
  color: var(--pink-deep);
}

.latte-sticker-btn {
  position: relative;
  z-index: 3;
  margin: 0.6rem auto 0.5rem;
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.latte-sticker-scene--reduced .latte-sticker-panel--happy {
  transition-duration: 0.01ms;
}

/* Phone: keep text + button above fixed nav; easier taps */
body[data-page="latte"] .scene__content {
  padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
}

.latte-sticker-copy,
.latte-sticker-copy--happy {
  position: relative;
  z-index: 2;
}

@media (max-width: 480px) {
  .latte-sticker-scene {
    min-height: clamp(200px, 42vw, 320px);
  }

  .latte-sticker-stack {
    min-height: clamp(190px, 40vw, 300px);
  }

  .latte-sticker-line {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .latte-sticker-img--shake,
  .latte-sticker-panel--pop .latte-sticker-img--mad,
  .latte-sticker-scene--happy .latte-sticker-panel--happy .latte-sticker-img {
    animation: none !important;
  }

  .latte-float-heart {
    animation: none !important;
    opacity: 0.3;
  }

  .latte-sticker-glow {
    animation: none !important;
  }
}

.little-things-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem auto 0;
  max-width: 38rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.little-things__item {
  margin: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.little-things__item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.little-things__teaser {
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 2px dashed rgba(248, 164, 188, 0.55);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.little-things__teaser:hover,
.little-things__teaser:focus-visible {
  border-color: var(--rose);
  outline: none;
}

.little-things__reveal {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(248, 164, 188, 0.25);
}

.little-things__reveal p {
  margin: 0;
  line-height: 1.65;
  color: var(--text-soft);
  white-space: pre-line;
}

.little-things__item.is-open .little-things__teaser {
  border-style: solid;
  background: rgba(255, 248, 252, 0.95);
}

/* ---------- Romantic password gate (index.html) ---------- */
body.gate-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(255, 210, 230, 0.95), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(248, 220, 240, 0.65), transparent 45%),
    radial-gradient(ellipse 70% 45% at 0% 80%, rgba(255, 228, 236, 0.9), transparent 50%),
    linear-gradient(180deg, #fff5f9 0%, #ffeef5 45%, #fce8f0 100%);
}

body.gate-body::before {
  opacity: 0.055;
}

.gate__float-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.gate__fh {
  position: absolute;
  font-size: clamp(14px, 3vw, 22px);
  color: rgba(248, 140, 170, 0.35);
  animation: gate-float-heart 12s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 182, 200, 0.45));
}

.gate__fh--1 {
  left: 8%;
  top: 18%;
  animation-delay: 0s;
}

.gate__fh--2 {
  right: 12%;
  top: 28%;
  animation-delay: 2s;
  font-size: clamp(12px, 2.5vw, 18px);
}

.gate__fh--3 {
  left: 18%;
  bottom: 22%;
  animation-delay: 4s;
}

.gate__fh--4 {
  right: 22%;
  bottom: 35%;
  animation-delay: 1s;
  opacity: 0.5;
}

.gate__fh--5 {
  left: 42%;
  top: 8%;
  animation-delay: 3.5s;
}

.gate__fh--6 {
  right: 6%;
  bottom: 12%;
  animation-delay: 5s;
}

@keyframes gate-float-heart {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.35;
  }
  50% {
    transform: translate(10px, -24px) scale(1.08);
    opacity: 0.55;
  }
}

.gate {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.gate__glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(255, 200, 220, 0.55) 0%,
    rgba(255, 230, 240, 0.2) 38%,
    transparent 62%
  );
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.gate--success .gate__glow {
  opacity: 1.25;
  transform: scale(1.08);
}

.gate__panel {
  position: relative;
  width: 100%;
  max-width: min(26rem, 100%);
  padding: clamp(1.75rem, 5vw, 2.5rem) clamp(1.35rem, 4vw, 2rem) clamp(2rem, 5vw, 2.75rem);
  text-align: center;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.82),
    rgba(255, 248, 252, 0.72)
  );
  border: 1px solid rgba(248, 180, 200, 0.45);
  border-radius: 28px 22px 32px 24px;
  box-shadow:
    0 4px 40px rgba(232, 140, 170, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 -2px 24px rgba(255, 200, 220, 0.15) inset;
  backdrop-filter: blur(8px);
}

.gate__envelope-wrap {
  perspective: 900px;
  margin: 0 auto 1.5rem;
  width: min(200px, 58vw);
}

.gate__envelope {
  position: relative;
  width: 100%;
  aspect-ratio: 1.2 / 1;
  transform-style: preserve-3d;
  transition: filter 0.6s ease, transform 0.6s ease;
}

.gate--success .gate__envelope {
  filter: drop-shadow(0 0 28px rgba(255, 160, 190, 0.75));
  transform: translateY(-4px) scale(1.02);
}

.gate__envelope-shadow {
  position: absolute;
  inset: auto 8% -8px 8%;
  height: 18px;
  background: radial-gradient(ellipse, rgba(90, 50, 70, 0.2), transparent 70%);
  border-radius: 50%;
}

.gate__envelope-base {
  position: absolute;
  left: 0;
  right: 0;
  top: 22%;
  bottom: 0;
  background: linear-gradient(168deg, #fff8fb 0%, #ffe8f2 100%);
  border-radius: 6px 6px 14px 14px;
  border: 1px solid rgba(248, 164, 188, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.gate__envelope-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 56%;
  background: linear-gradient(185deg, #ffd0e0, #ffb8d4 55%, #ffc2d6);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: 50% 0%;
  transition: transform 0.9s cubic-bezier(0.45, 0.05, 0.2, 1);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.35) inset;
}

.gate-envelope--open .gate__envelope-flap {
  transform: rotateX(-176deg);
}

.gate__envelope-shine {
  position: absolute;
  left: 12%;
  top: 28%;
  width: 28%;
  height: 22%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), transparent);
  border-radius: 40%;
  pointer-events: none;
  opacity: 0.7;
}

.gate__envelope-seal {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--pink-deep);
  background: radial-gradient(circle at 35% 35%, #fff 0%, #ffd0e0 45%, #ffb0cc 100%);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(232, 100, 130, 0.35);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.gate-envelope--open .gate__envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2) rotate(25deg);
}

.gate__line {
  margin: 0 auto;
  max-width: 22rem;
  line-height: 1.65;
  color: var(--text);
}

.gate__line--1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 5vw, 2.15rem);
  color: var(--pink-deep);
  margin-bottom: 0.65rem;
  text-shadow: 0 2px 24px rgba(255, 180, 200, 0.45);
}

.gate__line--2 {
  font-style: italic;
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.gate__form {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.gate__input-wrap {
  position: relative;
  width: 100%;
  max-width: 18rem;
}

.gate__input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid rgba(248, 164, 188, 0.45);
  border-radius: 999px;
  outline: none;
  box-shadow: 0 2px 16px rgba(248, 164, 188, 0.12);
  transition:
    border-color 0.25s ease,
    box-shadow 0.35s ease,
    background 0.25s ease;
}

.gate__input::placeholder {
  color: rgba(138, 101, 117, 0.45);
  letter-spacing: 0.02em;
}

.gate__input:focus {
  border-color: rgba(248, 140, 175, 0.85);
  box-shadow:
    0 0 0 4px rgba(255, 200, 220, 0.45),
    0 4px 24px rgba(248, 164, 188, 0.22);
}

.gate__input--lit {
  box-shadow:
    0 0 0 1px rgba(255, 192, 210, 0.6),
    0 4px 20px rgba(255, 160, 190, 0.2);
}

.gate__input-glow {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 200, 220, 0.5), transparent 68%);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gate__input:focus + .gate__input-glow,
.gate__input--lit + .gate__input-glow {
  opacity: 0.85;
}

.gate__status {
  min-height: 1.5em;
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  color: var(--text-soft);
  font-style: italic;
}

.gate__status[data-gate-error="1"] {
  color: #c06078;
}

.btn--gate {
  margin-top: 0.35rem;
  padding: 0.75rem 2.25rem;
  font-size: 1.05rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ffb8d0, #f8a4bc 45%, #e8a0c8);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow:
    0 6px 22px rgba(232, 120, 150, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn--gate:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 10px 28px rgba(232, 120, 150, 0.45);
}

.btn--gate:active {
  transform: translateY(0);
}

.btn--gate:disabled {
  opacity: 0.85;
  cursor: default;
  transform: none;
}

.gate--shake {
  animation: gate-shake 0.58s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes gate-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(-10px);
  }
  36% {
    transform: translateX(9px);
  }
  54% {
    transform: translateX(-7px);
  }
  72% {
    transform: translateX(5px);
  }
  90% {
    transform: translateX(-2px);
  }
}

body.gate-body--unlocking {
  animation: gate-body-glow 0.9s ease forwards;
}

@keyframes gate-body-glow {
  to {
    filter: brightness(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate__fh {
    animation: none;
    opacity: 0.28;
  }

  .gate--shake {
    animation: none;
  }

  .gate-envelope--open .gate__envelope-flap {
    transform: rotateX(-176deg);
    transition-duration: 0.01ms;
  }

  body.gate-body--unlocking {
    animation: none;
  }
}
