/* ----------------------------------------------
   Romantic Blush‑Pink Theme for Shravani
   ---------------------------------------------- */
:root {
  --bg-0: #fce4ec;          /* light pink base */
  --bg-1: #f8d7da;          /* soft blush */
  --bg-2: #f4c2c8;          /* slightly deeper pink */
  --cream: #fff5f7;         /* warm white */
  --pink-light: #fce4ec;
  --pink: #f4a6b0;          /* main pink */
  --pink-dark: #e884a0;     /* darker blush */
  --rose-gold: #e6b0b0;     /* rose gold accent */
  --text-dark: #4a2e32;     /* dark brownish pink for contrast */
  --muted: rgba(74, 46, 50, 0.7);
  --shadow: 0 24px 80px rgba(180, 80, 100, 0.25);
  --shadow-soft: 0 12px 30px rgba(180, 80, 100, 0.15);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --space-1: 0.5rem;
  --space-2: 0.875rem;
  --space-3: 1.25rem;
  --space-4: 1.75rem;
  --space-5: 2.5rem;
  --space-6: 3.5rem;
  --space-7: 5rem;
  --container: 1120px;
  --hero-parallax: 0;
  --transition: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 30%, #ffe6ea, var(--bg-1) 60%, var(--bg-0) 100%);
  color: var(--text-dark);
  font-family: "Quicksand", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(255, 200, 210, 0.2), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 180, 190, 0.15), transparent 30%);
  z-index: 0;
}

body.locked,
body.modal-open {
  overflow: hidden;
}

/* --- Floating Hearts (background) --- */
.floating-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.heart-float {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  animation: floatUp 10s ease-in infinite;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0.4) rotate(0deg);
  }
  12% { opacity: 0.7; }
  88% { opacity: 0.7; }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1.1) rotate(720deg);
  }
}

/* --- Page Shell --- */
.page-shell {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms ease, transform 900ms ease;
}
body.is-open .page-shell {
  opacity: 1;
  transform: translateY(0);
}

img,
video {
  display: block;
  max-width: 100%;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: clip;
  isolation: isolate;
}
.hero__backdrop {
  position: absolute;
  inset: -8% 0 0;
  background:
    linear-gradient(180deg, rgba(255, 240, 245, 0.2), rgba(252, 228, 236, 0.7)),
    url("assets/hero.jpg") center / cover no-repeat;
  transform: translate3d(0, calc(var(--hero-parallax) * 1px), 0) scale(1.08);
  z-index: -2;
  will-change: transform;
}
.hero__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 200, 210, 0.25), transparent 50%),
    linear-gradient(180deg, transparent 30%, rgba(252, 228, 236, 0.6) 100%);
}
.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  padding: 8rem 0 6rem;
}
.eyebrow {
  margin: 0 0 var(--space-2);
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--hero {
  color: rgba(74, 46, 50, 0.8);
}
.hero__title,
.section__heading h2,
.envelope-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}
.hero__title {
  font-size: clamp(3.2rem, 10vw, 6.8rem);
  color: #4a2e32;
  text-shadow: 0 8px 30px rgba(180, 80, 100, 0.2);
}
.hero__subtitle,
.envelope-copy {
  margin: var(--space-3) 0 0;
  max-width: 36rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
  color: var(--muted);
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dark);
  text-decoration: none;
  transform: translateX(-50%);
  z-index: 1;
}
.hero__scroll-line {
  width: 1px;
  height: 2.6rem;
  background: linear-gradient(180deg, transparent, var(--pink-dark), transparent);
}
.hero__scroll-arrow {
  width: 0.8rem;
  height: 0.8rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: bounce 1.7s infinite;
}

/* --- Sections --- */
.section {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
  padding: clamp(4rem, 8vw, 7rem) 0 0;
}
.section__heading {
  margin-bottom: var(--space-5);
}
.section__heading h2 {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  color: #4a2e32;
}

/* --- Moods --- */
.moods {
  display: grid;
  gap: var(--space-4);
}
.moods__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.mood-button {
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(180, 80, 100, 0.2);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  color: var(--text-dark);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}
.mood-button:hover,
.mood-button:focus-visible {
  transform: scale(1.04);
  background: rgba(255, 200, 210, 0.6);
  box-shadow: 0 12px 30px rgba(180, 80, 100, 0.2);
}
.mood-button.is-active {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: #fff;
  border-color: var(--pink-dark);
  box-shadow: 0 8px 24px rgba(232, 132, 160, 0.4);
}

.moods__frame {
  position: relative;
  min-height: 24rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow);
  border: 1px solid rgba(180, 80, 100, 0.15);
}
.moods__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(252, 228, 236, 0.2) 100%);
  pointer-events: none;
}
.moods__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 700ms ease, transform 900ms ease;
}
.moods__image.is-visible {
  opacity: 1;
}

.moods__caption {
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(180, 80, 100, 0.12);
}
.moods__caption-label {
  margin: 0 0 0.35rem;
  color: var(--pink-dark);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.moods__caption p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  display: grid;
  gap: 1.5rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--rose-gold), transparent);
}
.timeline__item {
  position: relative;
  display: grid;
  gap: 1rem;
  padding-left: 2.5rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.timeline__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.timeline__item::before {
  content: "♥";
  position: absolute;
  left: 0.4rem;
  top: 1rem;
  font-size: 1.2rem;
  color: var(--pink-dark);
  background: var(--cream);
  border-radius: 50%;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 0.3rem rgba(232, 132, 160, 0.15);
}
.timeline__media {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(180, 80, 100, 0.1);
}
.timeline__media img {
  width: 100%;
  height: 18rem;
  object-fit: cover;
}
.timeline__content {
  padding: 1.2rem 1.5rem 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(180, 80, 100, 0.1);
  box-shadow: var(--shadow-soft);
}
.timeline__date {
  color: var(--pink-dark);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
}
.timeline__content h3 {
  font-family: "Great Vibes", cursive;
  font-size: 1.8rem;
  margin-bottom: 0.55rem;
  color: #4a2e32;
}
.timeline__content p:last-child {
  color: var(--muted);
  line-height: 1.7;
}
.timeline__content [contenteditable="true"] {
  outline: none;
  border-radius: 0.5rem;
}
.timeline__content [contenteditable="true"]:focus-visible,
.letter-paper__body:focus-visible {
  box-shadow: 0 0 0 2px rgba(232, 132, 160, 0.4);
}

/* --- Gallery --- */
/* --- Gallery - CSS Masonry (Auto-balances columns) --- */
.gallery {
  column-count: 2;
  column-gap: 0.9rem;
  width: 100%;
  display: block; /* Override any grid */
}

.gallery__item {
  display: inline-block;
  width: 100%;
  margin-bottom: 0.9rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(180, 80, 100, 0.12);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  padding: 0;
  transition: transform 500ms ease, box-shadow 500ms ease, filter 500ms ease;
  break-inside: avoid; /* Prevents images from splitting across columns */
}

.gallery__item img {
  width: 100%;
  height: auto; /* Let the image determine its natural height */
  display: block;
  filter: saturate(1.05) contrast(1.02);
  transition: transform 500ms ease, filter 500ms ease;
}

.gallery__item:hover img,
.gallery__item:focus-visible img {
  transform: scale(1.06);
  filter: saturate(1.1) brightness(1.05);
}

.gallery__item:hover,
.gallery__item:focus-visible {
  box-shadow: 0 16px 40px rgba(180, 80, 100, 0.2);
  transform: perspective(1100px) rotateX(2deg) rotateY(-3deg) scale(1.02);
}



.span-2 { grid-row: span 22; }
.span-3 { grid-row: span 28; }
.span-4 { grid-row: span 34; }

/* --- Finale & Video --- */
.section--finale {
  padding-bottom: 3rem;
}
.video-card {
  display: grid;
  gap: 1.2rem;
  justify-items: center;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(180, 80, 100, 0.12);
  box-shadow: var(--shadow);
}
.video-card__video {
  width: 100%;
  max-width: 56rem;
  border-radius: calc(var(--radius-xl) - 6px);
  background: #000;
  box-shadow: var(--shadow-soft);
}

.footer {
  padding: 1.5rem 0 0.25rem;
  text-align: center;
  color: var(--muted);
}

/* --- Buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.button--rose {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  box-shadow: 0 8px 24px rgba(232, 132, 160, 0.35);
}
.button--rose:hover,
.button--rose:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 12px 32px rgba(232, 132, 160, 0.5);
}
.button--wide {
  min-width: min(100%, 18rem);
}

/* --- Envelope Overlay --- */
.envelope-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at center, rgba(232, 132, 160, 0.15), transparent 45%),
    linear-gradient(180deg, rgba(252, 228, 236, 0.98), rgba(248, 215, 218, 0.98));
  z-index: 50;
  transition: opacity 900ms ease, visibility 900ms ease;
}
.envelope-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.envelope-card {
  position: relative;
  width: min(100%, 34rem);
  padding: 3rem 1.5rem 2.5rem;
  border-radius: 28px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(180, 80, 100, 0.15);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.envelope-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 54%;
  background: linear-gradient(135deg, rgba(255, 200, 210, 0.2), rgba(232, 132, 160, 0.15));
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
}
.envelope-card > * {
  position: relative;
  z-index: 1;
}
.envelope-seal {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fcd5d5, var(--pink-dark) 55%, #b36b7a 100%);
  box-shadow: 0 0 36px rgba(232, 132, 160, 0.3);
}
.envelope-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  color: #4a2e32;
}
.envelope-copy {
  margin-top: 1rem;
}

/* --- Confetti --- */
.confetti-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 60;
}
.confetti-piece {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 0.6rem;
  height: 1.1rem;
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: confetti-burst 1800ms ease-out forwards;
}
.confetti-piece:nth-child(3n) { background: var(--pink); }
.confetti-piece:nth-child(3n+1) { background: var(--cream); }
.confetti-piece:nth-child(3n+2) { background: var(--pink-dark); }

/* --- Reveal Animations --- */
.reveal,
.timeline-reveal,
.gallery__item {
  opacity: 0;
  transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.is-visible,
.gallery__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.timeline-reveal:nth-child(odd) {
  transform: translateX(-34px) translateY(24px);
}
.timeline-reveal:nth-child(even) {
  transform: translateX(34px) translateY(24px);
}
.timeline-reveal.is-visible {
  transform: translateX(0) translateY(0);
}

/* --- Modals (Lightbox & Letter) --- */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms ease, visibility 300ms ease;
  z-index: 70;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 20, 25, 0.7);
  backdrop-filter: blur(8px);
}
.lightbox__panel,
.letter-paper {
  position: relative;
  z-index: 1;
  width: min(100%, 62rem);
  max-height: min(88vh, 52rem);
  overflow: auto;
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.lightbox__panel {
  width: min(100%, 72rem);
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(180, 80, 100, 0.15);
}
.lightbox__panel img {
  width: 100%;
  height: auto;
  border-radius: 20px;
}
.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: transform var(--transition), background var(--transition);
}
.modal__close:hover {
  transform: scale(1.1);
  background: #fff;
}
.modal__close--paper {
  background: rgba(255, 240, 240, 0.9);
  color: #4a2e32;
}
.letter-paper {
  width: min(100%, 46rem);
  padding: 4.2rem 1.5rem 1.5rem;
  color: #4a2e32;
  background:
    linear-gradient(180deg, rgba(255, 245, 247, 0.96), rgba(255, 235, 238, 0.98));
  border: 1px solid rgba(180, 80, 100, 0.12);
  transform: rotate(-0.6deg);
}
.letter-paper__label {
  margin: 0 0 1.1rem;
  color: var(--pink-dark);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.letter-paper__body {
  min-height: 20rem;
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  line-height: 1.8;
  outline: none;
  white-space: normal;
}

/* --- Music Player --- */
.music-player {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
}
.music-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(180, 80, 100, 0.15);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}
.music-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(180, 80, 100, 0.2);
}
.music-toggle.is-playing .music-icon {
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
.music-icon {
  font-size: 1.3rem;
  color: var(--pink-dark);
}

/* --- Keyframes --- */
@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(6px) rotate(45deg); }
}
@keyframes confetti-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(0.5);
  }
  15% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1);
  }
}

/* --- Cake Section --- */
#cakeSection {
  padding-top: 1rem;
}
.cake-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(180, 80, 100, 0.12);
  box-shadow: var(--shadow-soft);
}
.cake-illustration svg {
  filter: drop-shadow(0 8px 20px rgba(180, 80, 100, 0.2));
}
.flame {
  animation: flicker 0.8s ease-in-out infinite alternate;
}
.flame:nth-child(2) { animation-delay: 0.3s; }
.flame:nth-child(3) { animation-delay: 0.6s; }
@keyframes flicker {
  0% { transform: scale(1) translateY(0); opacity: 0.8; }
  100% { transform: scale(1.1) translateY(-4px); opacity: 1; }
}
#wishMessage {
  animation: fadeGlow 1.2s ease forwards;
}
@keyframes fadeGlow {
  0% { opacity: 0; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.05); box-shadow: 0 0 40px rgba(232, 132, 160, 0.3); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- Open When Cards --- */
.openwhen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.2rem;
}
.openwhen-card {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(180, 80, 100, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  color: var(--text-dark);
}
.openwhen-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(180, 80, 100, 0.15);
  border-color: var(--pink);
}
.openwhen-seal {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}
.openwhen-card h3 {
  font-family: "Quicksand", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

/* --- Scratch Card --- */
.scratch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.scratch-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 2px solid rgba(180, 80, 100, 0.15);
}
.scratch-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#scratchCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.scratch-text-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(180deg, transparent, rgba(74, 46, 50, 0.7));
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.scratch-text-overlay p {
  font-family: "Great Vibes", cursive;
  font-size: 1.4rem;
  margin: 0;
}
.scratch-wrapper.revealed .scratch-text-overlay {
  opacity: 1;
}
/* --- Love Meter (Envelope Gatekeeper) --- */
.love-meter {
  margin: 1.8rem auto 1.2rem;
  width: 100%;
  max-width: 320px;
  padding: 1rem 1.2rem 0.8rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(180, 80, 100, 0.15);
  box-shadow: var(--shadow-soft);
}

.love-question {
  margin: 0 0 0.8rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.02em;
}

.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.love-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pink-dark);
  min-width: 1.8rem;
  text-align: center;
}
.love-label--max {
  font-size: 1.2rem;
}

/* Custom Pink Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f8d7da, var(--pink-dark));
  outline: none;
  transition: background 0.2s;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--pink));
  border: 2px solid var(--pink-dark);
  box-shadow: 0 4px 12px rgba(232, 132, 160, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 20px rgba(232, 132, 160, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--pink));
  border: 2px solid var(--pink-dark);
  cursor: pointer;
}

.love-display {
  margin-top: 0.5rem;
  font-family: "Great Vibes", cursive;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--pink-dark);
  transition: all 0.3s ease;
}
.love-display .love-percent {
  font-size: 1rem;
  font-family: "Quicksand", sans-serif;
  color: var(--muted);
}

.love-message {
  min-height: 1.8rem;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.3s, transform 0.2s;
}
.love-message.is-max {
  color: #e884a0;
  transform: scale(1.05);
  animation: heartbeat 1.2s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.12); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
  70% { transform: scale(1); }
}

/* Disabled button style */
#openGiftBtn:disabled {
  opacity: 0.4;
  filter: grayscale(0.6);
  cursor: not-allowed;
  transform: scale(0.95);
  box-shadow: none;
}
#openGiftBtn:disabled:hover {
  transform: scale(0.95);
  box-shadow: none;
}
#openGiftBtn:enabled {
  animation: glowPulse 1.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(232, 132, 160, 0.35); }
  50% { box-shadow: 0 8px 48px rgba(232, 132, 160, 0.7); }
}

/* --- Cursor Heart Trail --- */
.cursor-heart {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.2rem;
  color: var(--pink-dark);
  animation: cursorFade 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes cursorFade {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  100% { transform: translate(-50%, -100%) scale(0.3); opacity: 0; }
}

/* Better mobile slider support */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f8d7da, var(--pink-dark));
  outline: none;
  cursor: pointer;
}

/* Make the thumb bigger for fat fingers */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;  /* Increased from 22px */
  height: 28px; /* Increased from 22px */
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--pink));
  border: 2px solid var(--pink-dark);
  box-shadow: 0 4px 12px rgba(232, 132, 160, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--pink-dark);
  background: radial-gradient(circle at 35% 30%, #fff, var(--pink));
  cursor: pointer;
}

/* Better touch feedback for mobile */
.button:active,
.mood-button:active,
.openwhen-card:active {
  transform: scale(0.95) !important;
  transition: transform 0.1s ease !important;
}
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior-y: none; /* Stops rubber-band bounce revealing white space */
}

.page-shell {
  overflow: hidden;
}

* {
  -webkit-tap-highlight-color: transparent;
}

.button, .mood-button, .openwhen-card, .music-toggle, .envelope-card {
  user-select: none;
  -webkit-user-select: none;
}

.music-player {
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  right: calc(1.5rem + env(safe-area-inset-right));
}
.gallery__item img,
.timeline__media img {
  aspect-ratio: 4 / 5;
}

.hero {
  min-height: 100vh; /* Fallback */
  min-height: 100svh; /* Modern standard */
}

.lightbox__panel,
.letter-paper {
  -webkit-overflow-scrolling: touch;
}

/* Ensure tap targets are large enough */
@media (max-width: 480px) {
  .button,
  .mood-button,
  .openwhen-card,
  .gallery__item,
  .music-toggle {
    min-height: 48px;
    min-width: 48px;
  }
}
/* Better mobile modal */
@media (max-width: 480px) {
  .letter-paper {
    padding: 3rem 1rem 1rem;
    max-height: 90vh;
    overflow-y: auto;
    transform: rotate(0deg);
  }
  
  .letter-paper__body {
    font-size: 1rem;
    min-height: 10rem;
  }
  
  .modal {
    padding: 0.5rem;
  }
}

/* --- Responsive --- */
@media (min-width: 720px) {
  .moods {
    gap: 1.2rem;
  }
  .moods__frame {
    min-height: 34rem;
  }
  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }
  .timeline__item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    padding-left: 0;
  }
  .timeline__item::before {
    left: 50%;
    transform: translateX(-50%);
  }
  .timeline__item--left .timeline__media {
    grid-column: 1;
  }
  .timeline__item--left .timeline__content {
    grid-column: 2;
  }
  .timeline__item--right .timeline__media {
    grid-column: 2;
  }
  .timeline__item--right .timeline__content {
    grid-column: 1;
    grid-row: 1;
  }
  .timeline__content {
    margin-inline: auto;
    width: min(100%, 31rem);
  }
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .mood-button,
  .gallery__item,
  .button {
    min-height: 48px;
    min-width: 48px;
  }
}
/* Desktop: 4 columns */
@media (min-width: 720px) {
  .gallery {
    column-count: 4;
  }
}


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .page-shell,
  .reveal,
  .timeline__item,
  .gallery__item,
  .moods__image,
  .envelope-overlay {
    transform: none !important;
  }
  .hero__backdrop {
    transform: none !important;
  }
}