/* ─── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Desktop-only root scale: 80% makes 100% zoom match 80% browser zoom */
@media (min-width: 701px) {
  html { font-size: 80%; }
}

body {
  background-color: #F0E6E0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.04'/%3E%3C/svg%3E");
  color: var(--ink);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; }

/* ─── CUSTOM PROPERTIES ────────────────────────────────────── */
:root {
  --bg-cream:  #F0E6E0;
  --bg-warm:   #FAF6F3;
  --blush:     #EAC3BF;
  --rose:      #B77D77;
  --mauve:     #9F544A;
  --truffle:   #5A3735;
  --ink:       #2A1F1D;

  --font-display: 'Cormorant Garamond', serif;
  --font-script:  'Pinyon Script', cursive;
  --font-body:    'Jost', sans-serif;
}

/* ─── GRAIN OVERLAY ────────────────────────────────────────── */
.grain-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
}
.grain-overlay--dark {
  opacity: 1.5; /* slightly more grain on dark section */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.06'/%3E%3C/svg%3E");
}

/* ─── NAVIGATION ───────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(240, 230, 224, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom-color: var(--blush);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 75rem;
  margin: 0 auto;
  padding: 1.25rem 2.5rem;
}
.nav-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--truffle);
  letter-spacing: 0.05em;
}
.nav-links {
  display: flex;
  gap: 2.25rem;
}
.nav-link {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--truffle);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav-link.active,
.nav-link:hover {
  border-bottom-color: var(--mauve);
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--truffle);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-menu ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.mobile-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2.5rem;
  color: var(--truffle);
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}
.mobile-link:hover { color: var(--mauve); }
.mobile-menu__close {
  position: absolute;
  top: 24px;
  right: 36px;
  font-size: 2rem;
  color: var(--truffle);
  line-height: 1;
}

/* ─── POLAROID BASE ────────────────────────────────────────── */
.polaroid {
  background: var(--bg-warm);
  padding: 0.75rem 0.75rem 3rem;
  box-shadow: 0 1px 2px rgba(90,55,53,0.08), 0 0.5rem 1.5rem rgba(90,55,53,0.12);
  position: relative;
  transform: rotate(var(--rot, 0deg));
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 400ms cubic-bezier(0.4, 0, 0.2, 1);
}
.polaroid__photo {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--blush);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.polaroid__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.polaroid__placeholder {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(183, 125, 119, 0.6);
}
.polaroid__caption {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  text-align: center;
  font-family: var(--font-script);
  font-size: 1rem;
  color: var(--mauve);
  line-height: 1;
}
.polaroid__paperclip {
  position: absolute;
  top: -1.125rem;
  right: 1.25rem;
  width: 1rem;
  height: 2.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .polaroid:hover {
    transform: translateY(-0.5rem) scale(1.02) rotate(0deg);
    box-shadow: 0 0.25rem 0.5rem rgba(90,55,53,0.10), 0 1rem 2.5rem rgba(90,55,53,0.16);
  }
}

/* washi tape generic */
.washi-tape {
  position: absolute;
  width: 3.75rem;
  height: 1rem;
  background: var(--blush);
  opacity: 0.6;
}
.tape {
  position: absolute;
  background: var(--blush);
  opacity: 0.55;
  border-radius: 1px;
}

/* ─── HERO (cinematic poster) ─────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6.25rem 1.5rem 3.75rem;
  background: #1a0e0c;
}

/* Full bleed photo layer */
.hero__bg {
  position: absolute;
  inset: 0;
  background-color: #1a0e0c;
  background-image: url('photos/hero-dinner.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* Heavy radial vignette */
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 55% 55% at center,
    rgba(26, 14, 12, 0.15) 0%,
    rgba(26, 14, 12, 0.55) 50%,
    rgba(26, 14, 12, 0.92) 100%
  );
}

/* Warm film tone overlay */
.hero__tone {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(90, 55, 53, 0.15) 0%,
    rgba(60, 30, 28, 0.1) 50%,
    rgba(40, 20, 18, 0.25) 100%
  );
  mix-blend-mode: multiply;
}

/* Stronger grain on hero */
.grain-overlay--hero {
  z-index: 3;
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.09'/%3E%3C/svg%3E");
}

/* Top metadata line */
.hero__meta {
  position: relative;
  z-index: 10;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(245, 235, 230, 0.85);
  text-align: center;
}

/* Centered cinematic title block */
.hero__title {
  position: relative;
  z-index: 10;
  text-align: center;
  width: 100%;
  max-width: 68.75rem;
  margin: 0 auto;
}

/* HAPPY — bold serif caps */
.hero-happy {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 11vw, 9rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 235, 230, 0.92);
  line-height: 1;
  display: block;
  position: relative;
  z-index: 1;
}

/* Birthday — ornate script crossing through HAPPY */
.hero-birthday {
  font-family: var(--font-script);
  font-size: clamp(6rem, 18vw, 15rem);
  color: rgba(255, 248, 245, 0.96);
  line-height: 0.9;
  margin-top: clamp(-7rem, -10vw, -9rem);
  display: block;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 1.25rem rgba(0, 0, 0, 0.4);
  width: 110%;
  margin-left: -5%;
}

/* Bottom subject line */
.hero__subject {
  position: relative;
  z-index: 10;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(245, 235, 230, 0.9);
  text-align: center;
  line-height: 2;
  margin-top: -1rem;
}

/* Director credit */
.hero__credit {
  position: relative;
  z-index: 10;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(245, 235, 230, 0.7);
  text-align: center;
  line-height: 2.2;
}
.hero__credit span {
  font-family: var(--font-script);
  font-size: 1.3rem;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(245, 235, 230, 0.95);
  display: block;
}

/* Nav text/icons for dark hero */
.site-nav:not(.scrolled) .nav-wordmark,
.site-nav:not(.scrolled) .nav-link {
  color: rgba(245, 235, 230, 0.9);
}
.site-nav:not(.scrolled) .nav-hamburger span {
  background: rgba(245, 235, 230, 0.9);
}
.site-nav:not(.scrolled) .nav-link.active,
.site-nav:not(.scrolled) .nav-link:hover {
  border-bottom-color: rgba(245, 235, 230, 0.9);
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}
.scroll-cue__line {
  width: 1px;
  height: 2.5rem;
  background: rgba(245, 235, 230, 0.5);
}
.scroll-cue__label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(245, 235, 230, 0.7);
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-cue__line {
    animation: scrollBounce 2s ease-in-out infinite;
  }
  @keyframes scrollBounce {
    0%, 100% { transform: scaleY(1) translateY(0); }
    50%       { transform: scaleY(0.8) translateY(0.25rem); }
  }
}

/* ─── HERO ENTRANCE ANIMATIONS ─────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .hero__meta {
    opacity: 0;
    animation: heroFadeUp 0.8s ease-out 0.3s forwards;
  }
  .hero-happy {
    opacity: 0;
    transform: translateY(1rem) scale(0.95);
    animation: heroHappyIn 1s ease-out 0.6s forwards;
  }
  .hero-birthday {
    opacity: 0;
    transform: translateY(1.875rem);
    animation: heroBirthdayIn 1.5s ease-out 1.4s forwards;
  }
  .hero__subject {
    opacity: 0;
    animation: heroFadeUp 0.8s ease-out 2.6s forwards;
  }
  .hero__credit {
    opacity: 0;
    animation: heroFadeUp 0.8s ease-out 2.9s forwards;
  }

  @keyframes heroHappyIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes heroBirthdayIn {
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(0.625rem); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ─── SECTION TITLES ────────────────────────────────────────── */
.section-title {
  font-family: var(--font-script);
  font-size: clamp(3.5rem, 6vw, 6rem);
  font-weight: 400;
  color: var(--mauve);
  line-height: 1;
}
.section-title--right  { text-align: right; }
.section-title--center { text-align: center; color: var(--blush); }
.section-title--light  { color: var(--blush); }
.section-title__heart {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--mauve);
  margin-left: 0.5rem;
  vertical-align: middle;
}
.section-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--truffle);
  margin-top: 0.75rem;
}

/* ─── MEMORIES ──────────────────────────────────────────────── */
.memories {
  position: relative;
  background:
    radial-gradient(ellipse 70% 60% at 15% 20%, rgba(234,195,191,0.35) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 80%, rgba(159,84,74,0.12) 0%, transparent 60%),
    #EDE0DC;
  padding: 7.5rem 0 10rem;
  overflow: hidden;
}
.memories__header {
  padding: 0 clamp(2rem, 6vw, 6.25rem);
  margin-bottom: 5rem;
  position: relative;
  z-index: 2;
}

/* ─── BOOK STAGE ───────────────────────────────────────────── */
.book-stage {
  position: relative;
  width: 100%;
  max-width: 68.75rem;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
  perspective: 150rem;
  perspective-origin: 50% 50%;
}

/* ─── BOOK ─────────────────────────────────────────────────── */
.book {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  transform-style: preserve-3d;
  transition: transform 800ms cubic-bezier(0.65, 0, 0.35, 1);
}

.book[data-state="open"] {
  transform: rotateX(2deg);
}

/* ─── COVER ────────────────────────────────────────────────── */
.book__cover {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--mauve) 0%, var(--truffle) 100%);
  border-radius: 0.25rem 0.75rem 0.75rem 0.25rem;
  box-shadow:
    0 0.25rem 0.75rem rgba(90, 55, 53, 0.2),
    0 1.5rem 3rem rgba(90, 55, 53, 0.3),
    inset 0 0 3.75rem rgba(0, 0, 0, 0.15);
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  cursor: pointer;
  z-index: 50;
  transition: transform 1400ms cubic-bezier(0.7, 0, 0.3, 1);
}

.book__cover--front {
  background-image:
    linear-gradient(135deg, rgba(234, 195, 191, 0.08) 0%, transparent 50%),
    linear-gradient(135deg, var(--mauve) 0%, var(--truffle) 100%);
}

.book__cover--back {
  z-index: 1;
  cursor: default;
  background: linear-gradient(135deg, var(--truffle) 0%, var(--mauve) 100%);
}

.book[data-state="open"] .book__cover--front {
  transform: rotateY(-180deg);
  pointer-events: none;
}

.book__cover-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  text-align: center;
  border: 1px solid rgba(234, 195, 191, 0.2);
  margin: 1.125rem;
  border-radius: 0.125rem;
}

.book__cover-meta {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(234, 195, 191, 0.7);
  margin-bottom: 1.5rem;
}

.book__cover-title {
  font-family: var(--font-script);
  font-size: clamp(3.5rem, 8vw, 6rem);
  color: rgba(245, 235, 230, 0.95);
  line-height: 1;
  margin-bottom: 1.75rem;
}

.book__cover-flourish {
  width: 5rem;
  margin-bottom: 5rem;
}

.book__cover-hint {
  position: absolute;
  bottom: 3rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(234, 195, 191, 0.85);
  display: flex;
  align-items: center;
  gap: 0.875rem;
  transition: transform 300ms ease, color 300ms ease;
}

.book__cover-hint-arrow {
  display: inline-block;
  animation: hint-bounce 1.8s ease-in-out infinite;
}

@keyframes hint-bounce {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(0.375rem); }
}

.book__cover--front:hover .book__cover-hint {
  color: rgba(245, 235, 230, 1);
  transform: translateX(0.25rem);
}

.book__cover-inner--back {
  border-color: rgba(234, 195, 191, 0.15);
}

.book__cover-back-text {
  font-family: var(--font-script);
  font-size: clamp(2rem, 4vw, 3rem);
  color: rgba(234, 195, 191, 0.85);
  line-height: 1.3;
  text-align: center;
}

/* ─── BASE PAGES ───────────────────────────────────────────── */
.book__page {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background-color: var(--bg-warm);
  background-image:
    radial-gradient(ellipse at top left, rgba(234,195,191,0.08) 0%, transparent 40%),
    linear-gradient(180deg, transparent 0%, rgba(183,125,119,0.04) 100%);
  overflow: hidden;
}

.book__page--base-left {
  left: 0;
  z-index: 1;
  border-radius: 0.25rem 0 0 0.25rem;
  box-shadow:
    inset -0.5rem 0 1.25rem rgba(90, 55, 53, 0.08),
    inset 0 0 1.875rem rgba(90, 55, 53, 0.04);
}

.book__page--base-right {
  left: 50%;
  z-index: 1;
  border-radius: 0 0.25rem 0.25rem 0;
  box-shadow:
    inset 0.5rem 0 1.25rem rgba(90, 55, 53, 0.08),
    inset 0 0 1.875rem rgba(90, 55, 53, 0.04);
}

/* ─── LEAVES (double-sided turning pages) ──────────────────── */
.leaf {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1200ms cubic-bezier(0.65, 0, 0.35, 1);
}

.leaf.flipped {
  transform: rotateY(-180deg);
}

/* Unflipped: leaf-1 on top on right side. Flipped: leaf-2 on top on left side. */
.leaf[data-leaf="1"] { z-index: 30; }
.leaf[data-leaf="2"] { z-index: 20; }
.leaf[data-leaf="1"].flipped { z-index: 10; }
.leaf[data-leaf="2"].flipped { z-index: 25; }

.leaf__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background-color: var(--bg-warm);
  background-image:
    radial-gradient(ellipse at top left, rgba(234,195,191,0.08) 0%, transparent 40%),
    linear-gradient(180deg, transparent 0%, rgba(183,125,119,0.04) 100%);
}

.leaf__face--front {
  transform: rotateY(0deg);
  border-radius: 0 0.25rem 0.25rem 0;
  box-shadow:
    inset 0.5rem 0 1.25rem rgba(90, 55, 53, 0.08),
    inset 0 0 1.875rem rgba(90, 55, 53, 0.04);
}

/* Pre-rotated 180deg; net rotation = 0 when leaf flips -180deg → faces viewer */
.leaf__face--back {
  transform: rotateY(180deg);
  border-radius: 0.25rem 0 0 0.25rem;
  box-shadow:
    inset -0.5rem 0 1.25rem rgba(90, 55, 53, 0.08),
    inset 0 0 1.875rem rgba(90, 55, 53, 0.04);
}

/* Flip shadow — peaks at mid-flip for a page-catching-light effect */
.leaf__shadow {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 0, 0, 0.06) 45%,
    transparent 70%
  );
}

.leaf--flipping .leaf__shadow {
  animation: leafShadow 1200ms cubic-bezier(0.65, 0, 0.35, 1) both;
}

@keyframes leafShadow {
  0%   { opacity: 0; }
  40%  { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}

.book__page-inner {
  position: absolute;
  inset: 0;
  padding: 6%;
  overflow: hidden;
}

.book__page-num {
  position: absolute;
  bottom: 1.125rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--rose);
  opacity: 0.6;
}
.book__page--base-left .book__page-num,
.leaf__face--back .book__page-num  { right: 1.125rem; }
.book__page--base-right .book__page-num,
.leaf__face--front .book__page-num { left: 1.125rem; }

.book-polaroid {
  position: absolute;
  padding: 0.5rem 0.5rem 2rem;
}
.book-polaroid .polaroid__caption {
  bottom: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  font-size: 0.85rem;
}

.book__date {
  position: absolute;
  font-family: var(--font-script);
  font-size: 1.2rem;
  color: var(--rose);
  opacity: 0.75;
  pointer-events: none;
  z-index: 6;
}

.book__tape {
  position: absolute;
  background: var(--blush);
  opacity: 0.6;
  border-radius: 1px;
  z-index: 6;
}

.book__paperclip {
  position: absolute;
  width: 0.875rem;
  height: 2.25rem;
  z-index: 6;
  opacity: 0.85;
}

.book__end-note {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mauve);
  white-space: nowrap;
}
.book__end-note span {
  font-family: var(--font-script);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--rose);
}

/* ─── BOOK CONTROLS ────────────────────────────────────────── */
.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}
.book-stage[data-controls="visible"] .book-controls {
  opacity: 1;
  pointer-events: all;
}

.book-arrow {
  width: 3.25rem;
  height: 3.25rem;
  background: var(--bg-warm);
  border: 1px solid var(--blush);
  border-radius: 50%;
  color: var(--mauve);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0.125rem 0.5rem rgba(90, 55, 53, 0.08), 0 0.5rem 1.5rem rgba(90, 55, 53, 0.1);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
              background 300ms ease;
}
.book-arrow svg { width: 1.25rem; height: 1.25rem; }
.book-arrow:hover:not(:disabled) {
  background: var(--blush);
  color: var(--truffle);
  transform: scale(1.06);
}
.book-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.book-counter {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rose);
}

/* ── MOBILE: single-page view (max-width: 900px) ──────────── */
@media (max-width: 900px) {

  /* Stage: remove perspective */
  .book-stage {
    perspective: none;
    padding: 0 16px;
  }

  /* Book: fixed-size portrait card — cover & all pages share this shape.
     aspect-ratio keeps the container a consistent rectangle regardless of
     which page is showing, so navigation never changes the layout. */
  .book {
    aspect-ratio: 3 / 4;
    max-width: 380px;
    margin: 0 auto;
    transform-style: flat;
    transition: none;
  }

  /* No 3D tilt when open */
  .book[data-state="open"] { transform: none; }

  /* Cover-front: fade out on open instead of 3D flip */
  .book__cover--front {
    transition: opacity 600ms ease;
    transform: none !important;
  }
  .book[data-state="open"] .book__cover--front {
    opacity: 0;
    pointer-events: none;
  }

  /* Cover-back: not needed on mobile */
  .book__cover--back { display: none; }

  /* Base pages: fill the book card exactly (same shape as cover), hidden until JS */
  .book__page--base-left,
  .book__page--base-right {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: none;
    z-index: 5;
    box-shadow:
      0 4px 16px rgba(90, 55, 53, 0.12),
      0 12px 32px rgba(90, 55, 53, 0.10);
  }

  /* Leaves: fill the book card, all 3D logic disabled */
  .leaf {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-style: flat;
    transform: none !important;
    transition: none;
    display: none;
    z-index: 5;
  }

  /* Override per-leaf z-index stacking rules from desktop */
  .leaf[data-leaf="1"],
  .leaf[data-leaf="2"],
  .leaf[data-leaf="1"].flipped,
  .leaf[data-leaf="2"].flipped {
    z-index: 5;
  }

  /* Leaf faces: fill the book card, backface ALWAYS visible (no 3D flip on mobile).
     !important beats the more-specific .leaf__face--back { backface-visibility: hidden } rule. */
  .leaf__face {
    position: absolute;
    inset: 0;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    transform: none !important;
    transition: none;
    border-radius: 8px;
    display: none;
    z-index: 5;
    overflow: hidden;
    box-shadow:
      0 4px 16px rgba(90, 55, 53, 0.12),
      0 12px 32px rgba(90, 55, 53, 0.10);
  }

  /* Only the active page is shown — JS toggles these classes */
  .book__page--base-left.mobile-page-active,
  .book__page--base-right.mobile-page-active { display: block; }
  .leaf.mobile-leaf-active                   { display: block; }
  .leaf__face.mobile-page-active             { display: block; }

  /* No flip shadow on mobile */
  .leaf__shadow { display: none; }

  /* Page inner: fills its card, content in vertical flex, scrollable if too tall */
  .book__page-inner {
    position: absolute;
    inset: 0;
    padding: 20px 16px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  /* Polaroids: in flow, centered, sized to page width */
  .book-polaroid {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 75% !important;
    max-width: 260px;
    transform: none !important;
    z-index: auto !important;
    flex-shrink: 0;
  }

  /* Handwritten dates: in flow, centered (beat inline style with !important) */
  .book__date {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: rotate(-2deg) !important;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
  }

  /* Tape: decorative, hide on mobile */
  .book__tape { display: none; }

  /* Paperclip: in flow (beat inline style with !important) */
  .book__paperclip {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 0 auto;
    display: block;
    flex-shrink: 0;
  }

  /* Page numbers: in flow, centered */
  .book__page-num {
    position: relative;
    bottom: auto; left: auto; right: auto;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
  }

  /* End note: in flow, centered */
  .book__end-note {
    position: relative;
    bottom: auto; left: auto;
    transform: none;
    text-align: center;
    white-space: normal;
    margin-top: 0;
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .book__cover-title { font-size: 3rem; }
  .book__cover-hint  { font-size: 0.55rem; }
  .book-arrow        { width: 2.75rem; height: 2.75rem; }
}

/* ─── SCROLL FADE-UP ANIMATION ──────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .anim-fade-up {
    opacity: 0;
    transform: translateY(1.5rem) rotate(var(--rot, 0deg));
    transition: opacity 800ms ease var(--delay, 0ms),
                transform 800ms ease var(--delay, 0ms);
  }
  .anim-fade-up.in-view {
    opacity: 1;
    transform: translateY(0) rotate(var(--rot, 0deg));
  }
  /* section titles */
  .section-title {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 800ms ease, transform 800ms ease;
  }
  .section-title.in-view {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── MESSAGES ──────────────────────────────────────────────── */
.messages {
  position: relative;
  background:
    radial-gradient(ellipse 55% 45% at 95% 95%, rgba(234,195,191,0.4) 0%, transparent 65%),
    #F2E8E4;
  padding: 7.5rem 0 10rem;
  overflow: hidden;
}
.messages__header {
  padding: 0 clamp(2rem, 6vw, 6.25rem);
  margin-bottom: 5rem;
  position: relative;
  z-index: 2;
}
.messages__board {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: center;
  padding: 0 clamp(2rem, 6vw, 6.25rem);
  position: relative;
  z-index: 2;
}

.message-card {
  position: relative;
  background: var(--bg-warm);
  padding: 2rem;
  max-width: 23.75rem;
  width: 100%;
  border: 1px solid var(--blush);
  box-shadow: 0 0.125rem 0.5rem rgba(90,55,53,0.06), 0 0.75rem 2rem rgba(90,55,53,0.08);
  transform: rotate(var(--rot, 0deg));
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 400ms cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-reduced-motion: no-preference) {
  .message-card:hover {
    transform: translateY(-0.375rem) scale(1.01) rotate(0deg);
    box-shadow: 0 0.25rem 0.75rem rgba(90,55,53,0.08), 0 1.25rem 3rem rgba(90,55,53,0.12);
  }
}

.message-card__pin {
  position: absolute;
  top: -0.625rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0.125rem 0.25rem rgba(90,55,53,0.2);
}
.message-card__tape {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 3.5rem;
  height: 1rem;
  background: var(--blush);
  opacity: 0.65;
  border-radius: 1px;
}
.message-card__body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--truffle);
  max-width: 38ch;
}
.message-card__name {
  margin-top: 1.25rem;
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--mauve);
  line-height: 1;
}

/* Floating xoxo */
.messages__xoxo {
  position: absolute;
  bottom: 3rem;
  right: clamp(2rem, 6vw, 6.25rem);
  font-family: var(--font-script);
  font-size: 4rem;
  color: var(--rose);
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
  transform: rotate(-6deg);
}

/* ─── FOR YOU (DARK / VIDEO) ────────────────────────────────── */
.forvideo {
  position: relative;
  background: var(--truffle);
  padding: 7.5rem 0 5rem;
  overflow: hidden;
}
.forvideo__header {
  padding: 0 clamp(2rem, 6vw, 6.25rem);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
  text-align: center;
}
.forvideo__subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(245, 239, 235, 0.7);
  text-align: center;
  margin-top: 1rem;
  letter-spacing: 0.02em;
}

.video-container {
  max-width: 55rem;
  width: 90%;
  aspect-ratio: 16/9;
  margin: 3.75rem auto;
  border-radius: 0.25rem;
  border: 1px solid rgba(234, 195, 191, 0.3);
  overflow: hidden;
  position: relative;
  z-index: 2;
}
.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.video-placeholder {
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--blush) 15%, var(--truffle));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.video-play {
  width: 5rem;
  height: 5rem;
  opacity: 0.7;
}
.video-placeholder__label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(234, 195, 191, 0.7);
  text-align: center;
}

.forvideo__closing {
  text-align: center;
  font-family: var(--font-script);
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--blush);
  position: relative;
  z-index: 2;
  margin-top: 0.5rem;
}
.forvideo__footer {
  text-align: center;
  margin-top: 5rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(234, 195, 191, 0.12);
  position: relative;
  z-index: 2;
}
.forvideo__footer p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(234, 195, 191, 0.5);
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-inner { padding: 16px 24px; }

  .messages__board { gap: 32px; padding: 0 20px; }
  .message-card { max-width: 100%; }

  .forvideo__header { padding: 0 24px; }
}
