/*
 * Anniversary page — "Envelope Opening into a Love Letter"
 * Mobile-first, soft romantic palette (cream, blush, gold).
 * CUSTOMIZATION: tweak --color-* and --font-* CSS variables below.
 */

/* -------------------------------------------------------------------------- */
/* Design tokens */
/* -------------------------------------------------------------------------- */
:root {
  --color-cream: #fdf8f4;
  --color-blush: #fce4ec;
  --color-rose-soft: #f8bbd9;
  --color-rose-deep: #c2185b;
  --color-rose-light: #f48fb1;
  --color-text: #4a3f45;
  --color-text-muted: #7a6e74;
  --color-gold: #b8860b;
  --color-gold-soft: #f0e6c8;
  --color-gold-bright: #ffd54f;
  --color-envelope: #f5e6dc;
  --color-envelope-edge: #e8d4c8;
  --font-display: "Great Vibes", cursive;
  --font-letter: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Open Sans", system-ui, sans-serif;
  --shadow-soft: 0 12px 40px rgba(74, 63, 69, 0.12);
  --shadow-card: 0 8px 32px rgba(201, 162, 39, 0.15);
  --shadow-elevated: 0 24px 48px rgba(194, 24, 91, 0.12);
  --radius-lg: 16px;
  --transition-smooth: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.35s ease;
  --gradient-page: linear-gradient(
    165deg,
    #fff9fb 0%,
    #fce4ec 38%,
    #fff5f0 72%,
    #fdf5e8 100%
  );
  --gradient-aurora: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(244, 143, 177, 0.35), transparent 55%);
}

/* -------------------------------------------------------------------------- */
/* Reset & base */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@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;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--gradient-page);
  background-attachment: fixed;
  opacity: 0;
  animation: bodyFadeIn 0.8s ease forwards 0.15s;
}

body.has-lightbox {
  overflow: hidden;
}

@keyframes bodyFadeIn {
  to {
    opacity: 1;
  }
}

.font-display {
  font-family: var(--font-display);
}

.page-root {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Layered romantic atmosphere */
.page-root::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    var(--gradient-aurora),
    radial-gradient(circle at 10% 25%, rgba(248, 187, 217, 0.28) 0%, transparent 42%),
    radial-gradient(circle at 92% 78%, rgba(232, 213, 163, 0.22) 0%, transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(255, 213, 230, 0.2) 0%, transparent 45%);
  z-index: 0;
}

/* Floating decorative hearts */
.ambient-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-hearts__heart {
  position: absolute;
  font-size: clamp(0.75rem, 2vw, 1.1rem);
  opacity: 0.22;
  color: var(--color-rose-deep);
  animation: heartFloat 18s ease-in-out infinite;
  text-shadow: 0 0 12px rgba(244, 143, 177, 0.5);
}

.ambient-hearts__heart:nth-child(1) {
  left: 8%;
  top: 12%;
  animation-delay: 0s;
  font-size: 1rem;
}

.ambient-hearts__heart:nth-child(2) {
  left: 78%;
  top: 8%;
  animation-delay: -3s;
}

.ambient-hearts__heart:nth-child(3) {
  left: 18%;
  top: 55%;
  animation-delay: -7s;
  opacity: 0.16;
}

.ambient-hearts__heart:nth-child(4) {
  left: 88%;
  top: 42%;
  animation-delay: -11s;
}

.ambient-hearts__heart:nth-child(5) {
  left: 45%;
  top: 22%;
  animation-delay: -5s;
  opacity: 0.18;
}

.ambient-hearts__heart:nth-child(6) {
  left: 62%;
  top: 68%;
  animation-delay: -14s;
}

@keyframes heartFloat {
  0%,
  100% {
    transform: translate(0, 0) rotate(-8deg) scale(1);
  }
  25% {
    transform: translate(12px, -20px) rotate(6deg) scale(1.05);
  }
  50% {
    transform: translate(-8px, 12px) rotate(-4deg) scale(0.95);
  }
  75% {
    transform: translate(16px, 8px) rotate(10deg) scale(1.02);
  }
}

/* Top scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  z-index: 100;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--color-rose-light), var(--color-gold-bright), var(--color-rose-deep));
  box-shadow: 0 0 12px rgba(244, 143, 177, 0.45);
  transition: transform 0.12s ease-out;
}

/* Confetti burst container — above envelope, below lightbox */
.fx-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 85;
  overflow: visible;
}

.fx-particle {
  position: absolute;
  opacity: 1;
  will-change: transform, opacity;
  animation-name: particleFly;
  animation-duration: 1.55s;
  animation-timing-function: cubic-bezier(0.18, 0.85, 0.28, 1);
  animation-fill-mode: forwards;
}

.fx-particle--round {
  border-radius: 50%;
}

.fx-particle--strip {
  border-radius: 4px;
}

@keyframes particleFly {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.45);
    opacity: 0;
  }
}

/* -------------------------------------------------------------------------- */
/* Envelope section */
/* -------------------------------------------------------------------------- */
.envelope-section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.envelope-section.is-done {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
  height: 100%;
  transform: scale(0.92);
}

.envelope-gift-note {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-style: italic;
  font-weight: 600;
  color: var(--color-rose-deep);
  letter-spacing: 0.03em;
  text-align: center;
  opacity: 0.92;
}

.envelope-hint {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  color: var(--color-text);
  margin: 0 0 0.5rem;
  text-align: center;
  animation: floatHint 4s ease-in-out infinite;
  text-shadow: 0 2px 24px rgba(194, 24, 91, 0.12);
}

.envelope-from {
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  text-align: center;
  letter-spacing: 0.04em;
}

.envelope-hint__heart {
  display: inline-block;
  animation: heartPulse 1.8s ease-in-out infinite;
}

@keyframes heartPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(233, 30, 140, 0.35));
  }
  50% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 10px rgba(233, 30, 140, 0.55));
  }
}

@keyframes floatHint {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.envelope-tap-hint {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  animation: tapFade 2.8s ease-in-out infinite;
}

@keyframes tapFade {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* Envelope button — closed state (perspective enables 3D flap rotation) */
.envelope {
  position: relative;
  width: min(88vw, 320px);
  height: 200px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  perspective: 640px;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 16px 28px rgba(74, 63, 69, 0.12));
}

.envelope:hover:not(.is-open) {
  transform: translateY(-6px) scale(1.02);
}

.envelope:active:not(.is-open) {
  transform: translateY(-2px) scale(0.99);
}

.envelope:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 8px;
  border-radius: 8px;
}

.envelope__shadow {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  height: 24px;
  background: radial-gradient(ellipse, rgba(74, 63, 69, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  transition: opacity var(--transition-fast);
}

.envelope__back {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
    linear-gradient(180deg, var(--color-envelope) 0%, var(--color-envelope-edge) 100%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Paper peeking from envelope */
.envelope__paper {
  position: absolute;
  bottom: 28%;
  left: 12%;
  right: 12%;
  height: 55%;
  background: linear-gradient(180deg, #fffef9 0%, #faf6f0 100%);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(0);
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.envelope__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, #edd9ce 0%, var(--color-envelope-edge) 100%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  z-index: 2;
  clip-path: polygon(0 0, 50% 42%, 100% 0, 100% 100%, 0 100%);
}

/* Triangular flap */
.envelope__flap {
  position: absolute;
  top: 12%;
  left: 0;
  right: 0;
  height: 48%;
  background: linear-gradient(180deg, #f0ddd2 0%, var(--color-envelope) 100%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.85s cubic-bezier(0.45, 0, 0.2, 1);
  z-index: 3;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.envelope__seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -20%);
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 30% 28%, #ffc0cb, #e91e63 55%, #ad1457);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  z-index: 4;
  box-shadow:
    0 4px 16px rgba(194, 24, 91, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.45);
  transition: opacity 0.4s ease, transform 0.4s ease;
  animation: sealShimmer 3s ease-in-out infinite;
}

@keyframes sealShimmer {
  0%,
  100% {
    box-shadow:
      0 4px 16px rgba(194, 24, 91, 0.4),
      inset 0 2px 4px rgba(255, 255, 255, 0.45);
  }
  50% {
    box-shadow:
      0 6px 22px rgba(233, 30, 140, 0.55),
      inset 0 2px 4px rgba(255, 255, 255, 0.55);
  }
}

/* Open state */
.envelope.is-open .envelope__flap {
  transform: rotateX(-180deg);
}

.envelope.is-open .envelope__paper {
  transform: translateY(-28px);
}

.envelope.is-open .envelope__seal {
  opacity: 0;
  transform: translate(-50%, -60%) scale(0.5);
}

.envelope.is-open .envelope__shadow {
  opacity: 0.5;
}

/* -------------------------------------------------------------------------- */
/* Main content */
/* -------------------------------------------------------------------------- */
.main-content {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  animation: contentRise 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Gift ribbon — “to / from” like a wrapped present */
.gift-banner {
  margin: 0 auto 2.25rem;
  max-width: 520px;
  text-align: center;
}

.gift-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, #fff8fb 50%, rgba(255, 248, 240, 0.98) 100%);
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 12px;
  box-shadow:
    0 8px 28px rgba(194, 24, 91, 0.08),
    0 0 0 3px rgba(255, 255, 255, 0.65) inset,
    0 -2px 0 rgba(201, 162, 39, 0.15) inset;
  position: relative;
}

.gift-banner__inner::before,
.gift-banner__inner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 22px;
  background: linear-gradient(180deg, var(--color-rose-light), var(--color-rose-deep));
  opacity: 0.35;
  transform: translateY(-50%);
  border-radius: 2px;
}

.gift-banner__inner::before {
  left: 8px;
}

.gift-banner__inner::after {
  right: 8px;
}

.gift-banner__tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.gift-banner__name {
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  color: var(--color-rose-deep);
  line-height: 1;
}

.gift-banner__divider {
  width: 1px;
  height: 1.5rem;
  background: linear-gradient(180deg, transparent, rgba(201, 162, 39, 0.6), transparent);
}

.gift-banner__from {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.gift-banner__sub {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--color-text-muted);
}

@media (max-width: 520px) {
  .gift-banner__divider {
    display: none;
  }

  .gift-banner__inner {
    flex-direction: column;
    gap: 0.35rem;
  }
}

/* Floating music pill */
.music-dock {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem 0.5rem 0.5rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: var(--shadow-soft);
  animation: dockIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes dockIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.music-dock__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--color-gold-soft), var(--color-gold-bright));
  color: #4a3510;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(184, 134, 11, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.music-dock__btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(184, 134, 11, 0.45);
}

.music-dock__btn:focus-visible {
  outline: 3px solid var(--color-rose-deep);
  outline-offset: 2px;
}

.music-dock__icon {
  line-height: 1;
}

.music-dock__icon--play {
  display: none;
}

/* Paused state: show play, hide pause */
.music-dock__btn[aria-pressed="false"] .music-dock__icon--pause {
  display: none;
}

.music-dock__btn[aria-pressed="false"] .music-dock__icon--play {
  display: block;
  font-size: 0.85rem;
  margin-left: 2px;
}

.music-dock__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  max-width: 5.5rem;
  line-height: 1.2;
}

@media (max-width: 480px) {
  .music-dock {
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.65rem 0.4rem 0.4rem;
  }

  .music-dock__label {
    display: none;
  }
}

.main-content.is-hidden {
  display: none !important;
}

@keyframes contentRise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 1.5rem;
}

.section__kicker {
  text-align: center;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin: 0 auto 0.65rem;
  max-width: 28rem;
  line-height: 1.5;
}

.section__title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 400;
  color: var(--color-rose-deep);
  text-align: center;
  margin: 0 0 1.75rem;
  text-shadow: 0 2px 20px rgba(233, 30, 140, 0.15);
  animation: titleFade 1s ease forwards;
  opacity: 0;
}

@keyframes titleFade {
  to {
    opacity: 1;
  }
}

/* Gradient shimmer on section headings */
.section__title--shine {
  background: linear-gradient(
    110deg,
    var(--color-rose-deep) 0%,
    #e91e63 25%,
    var(--color-gold-bright) 50%,
    #e91e63 75%,
    var(--color-rose-deep) 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleFade 1s ease forwards, shineShift 10s ease-in-out infinite 0.5s;
}

@keyframes shineShift {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

/* -------------------------------------------------------------------------- */
/* Love letter card */
/* -------------------------------------------------------------------------- */
.letter-card {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(244, 143, 177, 0.07) 27px,
      rgba(244, 143, 177, 0.07) 28px
    ),
    linear-gradient(155deg, #fffeff 0%, #faf5ee 48%, #fff5f8 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-elevated);
  border: 1px solid rgba(201, 162, 39, 0.32);
  padding: clamp(1.35rem, 4vw, 2.5rem);
  padding-top: clamp(2.25rem, 5vw, 2.75rem);
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
}

/* Hanging tag — reads like a present label */
.letter-card__gift-tag {
  position: absolute;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 0.38rem 1.1rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #4a3510;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
  border-radius: 4px;
  box-shadow:
    0 3px 10px rgba(184, 134, 11, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.letter-card__gift-tag::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #ff8f00;
  opacity: 0.9;
}

/* Card header: label + name */
.letter-card__header {
  text-align: center;
  margin-bottom: 1.35rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(194, 24, 91, 0.12);
  position: relative;
  z-index: 2;
}

.letter-card__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.letter-card__from {
  display: block;
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 600;
  color: var(--color-text);
  opacity: 0.88;
  margin-bottom: 0.5rem;
}

.letter-card__name {
  display: block;
  font-size: clamp(2rem, 6vw, 2.85rem);
  line-height: 1.1;
  color: var(--color-rose-deep);
  text-shadow: 0 2px 18px rgba(194, 24, 91, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .letter-card:hover {
    transform: translateY(-4px) rotate(-0.3deg);
    box-shadow:
      0 16px 40px rgba(194, 24, 91, 0.1),
      0 4px 20px rgba(201, 162, 39, 0.12);
  }
}

.letter-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-gold-bright), var(--color-gold-soft), transparent);
  opacity: 0.9;
}

/* Decorative wax seal — clears gift tag + header */
.letter-card__wax {
  position: absolute;
  top: 8.85rem;
  right: 1rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f8bbd9, #c2185b 70%, #880e4f);
  opacity: 0.88;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    0 6px 16px rgba(194, 24, 91, 0.25);
  z-index: 1;
  pointer-events: none;
}

.letter-card__wax::after {
  content: "✿";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: rgba(255, 248, 250, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.letter-card__inner {
  position: relative;
  min-height: 13rem;
  z-index: 2;
  border-left: 3px solid rgba(201, 162, 39, 0.35);
  padding: 0 0.25rem 0 1.15rem;
}

.letter-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-letter);
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: #513740;
  font-weight: 500;
  text-wrap: pretty;
}

.letter-text::first-line {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 400;
  line-height: 1.2;
  color: #b01258;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 16px rgba(194, 24, 91, 0.15);
}

.letter-cursor {
  display: inline-block;
  font-weight: 600;
  color: var(--color-rose-deep);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

.letter-cursor.is-done {
  opacity: 0;
}

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

/* -------------------------------------------------------------------------- */
/* Photo grid */
/* -------------------------------------------------------------------------- */
.memories-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

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

@media (min-width: 900px) {
  .memories-grid {
    display: block;
    column-count: 3;
    column-gap: 1.5rem;
  }

  .memory-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 2.95rem;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
  }
}

.memory-item {
  margin: 0 0 1.9rem;
  opacity: 0;
  transform: translateY(24px) perspective(800px) rotateX(4deg);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.memory-item.is-visible {
  opacity: 1;
  transform: translateY(0) perspective(800px) rotateX(0deg);
}

.memory-item__frame {
  position: relative;
  border-radius: 14px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.65), rgba(244, 143, 177, 0.5), rgba(201, 162, 39, 0.45));
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.memory-item.is-visible .memory-item__frame:hover,
.memory-item.is-visible .memory-item__frame:focus-within {
  box-shadow: 0 16px 40px rgba(194, 24, 91, 0.15), 0 8px 24px rgba(184, 134, 11, 0.12);
}

.memory-item__open {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 11px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--color-blush);
  -webkit-tap-highlight-color: transparent;
}

.memory-item__open:focus-visible {
  outline: 3px solid var(--color-rose-deep);
  outline-offset: 3px;
}

.memory-item__img-wrap {
  display: block;
  border-radius: 11px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

/* Vary photo heights for an elegant staggered feel */
.memory-item:nth-child(1) .memory-item__img-wrap {
  aspect-ratio: 5 / 4;
}

.memory-item:nth-child(2) .memory-item__img-wrap {
  aspect-ratio: 3 / 4;
}

.memory-item:nth-child(3) .memory-item__img-wrap {
  aspect-ratio: 4 / 3;
}

.memory-item:nth-child(4) .memory-item__img-wrap {
  aspect-ratio: 16 / 10;
}

.memory-item:nth-child(5) .memory-item__img-wrap {
  aspect-ratio: 21 / 9;
}

.memory-item:nth-child(6) .memory-item__img-wrap {
  aspect-ratio: 3 / 4;
}

.memory-item:nth-child(7) .memory-item__img-wrap {
  aspect-ratio: 4 / 5;
}

.memory-item:nth-child(8) .memory-item__img-wrap {
  aspect-ratio: 16 / 10;
}

.memory-item__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
  will-change: transform;
  transform: translateY(var(--parallax-y, 0px)) scale(1.02);
}

.memory-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, transparent 35%, rgba(74, 63, 69, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.memory-item__overlay-text {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(194, 24, 91, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transform: translateY(8px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover / keyboard: overlay + zoom */
@media (hover: hover) and (pointer: fine) {
  .memory-item__open:hover .memory-item__img-wrap img {
    transform: translateY(var(--parallax-y, 0px)) scale(1.08);
    filter: saturate(1.08) brightness(1.03);
  }

  .memory-item__open:hover .memory-item__overlay {
    opacity: 1;
  }

  .memory-item__open:hover .memory-item__overlay-text {
    transform: translateY(0);
  }
}

.memory-item__open:focus-visible .memory-item__overlay {
  opacity: 1;
}

.memory-item__open:focus-visible .memory-item__overlay-text {
  transform: translateY(0);
}

/* Touch: show subtle hint without blocking image */
@media (hover: none) {
  .memory-item__overlay {
    opacity: 0.35;
    background: linear-gradient(180deg, transparent 60%, rgba(74, 63, 69, 0.35) 100%);
  }

  .memory-item__overlay-text {
    transform: translateY(0);
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
  }
}

.photo-caption {
  margin-top: 0.65rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}

/* -------------------------------------------------------------------------- */
/* Finale & hidden message */
/* -------------------------------------------------------------------------- */
.finale-section {
  text-align: center;
  padding: 2rem 0;
}

.finale-line {
  font-size: clamp(2.5rem, 8vw, 4rem);
  margin: 0 0 2rem;
  color: var(--color-rose-deep);
  line-height: 1.2;
}

.finale-line--glow {
  text-shadow:
    0 0 40px rgba(244, 143, 177, 0.45),
    0 4px 20px rgba(194, 24, 91, 0.15);
  animation: finalePulse 4s ease-in-out infinite;
}

@keyframes finalePulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

.btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn--gold {
  background: linear-gradient(135deg, var(--color-gold-soft) 0%, var(--color-gold) 100%);
  color: #3d3518;
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.35);
}

.btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(201, 162, 39, 0.4);
}

.btn--gold:focus-visible {
  outline: 3px solid var(--color-rose-deep);
  outline-offset: 3px;
}

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

.btn--gold:disabled {
  opacity: 0.85;
  cursor: default;
  transform: none;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.25);
}

/* Ripple on click (class toggled via JS) */
.btn--ripple {
  position: relative;
  overflow: hidden;
}

.btn--ripple .btn__ripple {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: scale(0);
  animation: rippleExpand 0.65s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleExpand {
  to {
    transform: scale(28);
    opacity: 0;
  }
}

/* -------------------------------------------------------------------------- */
/* Photo lightbox */
/* -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Ensure hidden lightbox never blocks initial interactions */
.lightbox[hidden] {
  display: none !important;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 35, 40, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lbBackdrop 0.35s ease forwards;
}

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

.lightbox__content {
  position: relative;
  max-width: min(92vw, 900px);
  max-height: 90vh;
  z-index: 1;
  animation: lbPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(78vh, 640px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  background: #1a1215;
}

.lightbox__caption {
  margin: 1rem 0 0;
  text-align: center;
  color: #fdf8f4;
  font-size: 1.05rem;
  font-style: italic;
}

.lightbox__close {
  position: absolute;
  top: -12px;
  right: -8px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-rose-deep);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.lightbox__close:hover {
  transform: scale(1.08);
  background: #fff;
}

.lightbox__close:focus-visible {
  outline: 3px solid var(--color-gold-bright);
  outline-offset: 2px;
}

.hidden-message {
  margin-top: 2rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
}

.hidden-message.is-revealed {
  max-height: 720px;
  opacity: 1;
}

.hidden-message__card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 248, 252, 0.92) 100%);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.65rem 1.4rem 1.5rem;
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  animation: promisePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
}

.hidden-message__card::before {
  content: "“";
  position: absolute;
  top: 0.5rem;
  left: 0.85rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  line-height: 1;
  color: rgba(194, 24, 91, 0.15);
  pointer-events: none;
}

.hidden-message__kicker {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-rose-deep);
  opacity: 0.9;
}

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

.hidden-message__body {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.82;
  color: var(--color-text);
  padding-left: 0.25rem;
}

.hidden-message__signoff {
  margin: 1.15rem 0 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-align: right;
  color: var(--color-rose-deep);
  opacity: 0.95;
}

.site-footer {
  text-align: center;
  padding: 2rem 0 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.site-footer p {
  margin: 0;
}

.site-footer__heart {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  opacity: 0.75;
  filter: drop-shadow(0 2px 6px rgba(194, 24, 91, 0.25));
}
