/* ========== Theme ========== */
:root {
  --blush: #f4a7b9;
  --blush-deep: #e8879a;
  --lavender: #c9b8e0;
  --sky: #a8d4e6;
  --cream: #fff8f4;
  --cream-soft: #fceee6;
  --rose-ink: #5c3a42;
  --rose-muted: #8a6570;
  --scrim: rgba(255, 248, 244, 0.72);
  --white: #ffffff;
  --shadow-soft: 0 12px 40px rgba(92, 58, 66, 0.12);

  --font-display: "Quicksand", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;

  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  font-family: var(--font-body);
  color: var(--rose-ink);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button,
a {
  font-family: inherit;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose-muted);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--rose-ink);
}

.section-subtitle {
  color: var(--rose-muted);
  font-size: 1rem;
  max-width: 28ch;
  margin-inline: auto;
}

/* ========== Shared page shell ========== */
.page {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  scroll-snap-align: start;
}

.bubble-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.bubble-canvas.interactive {
  pointer-events: auto;
  cursor: pointer;
}

/* ========== PAGE 1 — Hero ========== */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(244, 167, 185, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(168, 212, 230, 0.4), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(201, 184, 224, 0.25), transparent 60%),
    var(--cream);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 28rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 14vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--rose-ink);
  margin: 0.4rem 0 1rem;
}

.hero-tagline {
  color: var(--rose-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.cta-button {
  display: inline-block;
  padding: 0.9rem 1.75rem;
  background: var(--blush-deep);
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.25s ease;
}

.cta-button:hover {
  background: #d97588;
  transform: translateY(-2px);
}

.cta-button:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

/* Confetti overlay (Page 1 CTA) */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: 28px;
  height: 42px;
  border: 2px solid var(--blush);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
  text-decoration: none;
}

.scroll-hint span {
  width: 4px;
  height: 8px;
  background: var(--blush-deep);
  border-radius: 2px;
  animation: scroll-nudge 1.8s ease-in-out infinite;
}

@keyframes scroll-nudge {
  0%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(8px);
  }
}

/* ========== PAGE 2 — Memory Lane ========== */
.memory {
  min-height: 100svh;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
  background: var(--cream);
}

.memory:nth-child(even) {
  background: var(--cream-soft);
}

.memory-media {
  width: min(100%, 22rem);
  margin: 0 auto 1.25rem;
}

.memory-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: min(62vh, 34rem);
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.memory-text {
  max-width: 26rem;
  margin: 0 auto;
  text-align: center;
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.memory.is-visible .memory-text {
  opacity: 1;
  transform: translateY(0);
}

.memory-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blush-deep);
  margin-bottom: 0.35rem;
}

.memory-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.memory-message {
  color: var(--rose-muted);
  font-size: 1.05rem;
}

/* ========== PAGE 3 — Reasons ========== */
.reasons {
  background:
    radial-gradient(ellipse 70% 50% at 10% 30%, rgba(168, 212, 230, 0.3), transparent),
    radial-gradient(ellipse 60% 40% at 90% 70%, rgba(244, 167, 185, 0.3), transparent),
    var(--cream-soft);
  padding: 3rem 1.25rem;
  gap: 2.5rem;
}

.section-intro {
  text-align: center;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reason-bubbles {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  width: min(100%, 22rem);
  justify-items: center;
}

.reason-bubble {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.85), transparent 42%),
    radial-gradient(circle at 70% 70%, rgba(244, 167, 185, 0.55), rgba(201, 184, 224, 0.45));
  color: var(--rose-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(92, 58, 66, 0.1);
  transition: transform 0.3s var(--ease);
  animation: float-gentle 5s ease-in-out infinite;
}

.reason-bubble:nth-child(1) {
  animation-delay: 0s;
}
.reason-bubble:nth-child(2) {
  animation-delay: -0.8s;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.85), transparent 42%),
    radial-gradient(circle at 70% 70%, rgba(168, 212, 230, 0.55), rgba(201, 184, 224, 0.4));
}
.reason-bubble:nth-child(3) {
  animation-delay: -1.6s;
  grid-column: 1 / -1;
}
.reason-bubble:nth-child(4) {
  animation-delay: -2.4s;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.85), transparent 42%),
    radial-gradient(circle at 70% 70%, rgba(201, 184, 224, 0.55), rgba(244, 167, 185, 0.4));
}
.reason-bubble:nth-child(5) {
  animation-delay: -3.2s;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.85), transparent 42%),
    radial-gradient(circle at 70% 70%, rgba(244, 167, 185, 0.45), rgba(168, 212, 230, 0.5));
}

.reason-bubble:hover {
  transform: scale(1.06);
}

.reason-bubble:focus-visible {
  outline: 2px solid var(--blush-deep);
  outline-offset: 4px;
}

.reason-bubble.is-popping {
  animation: pop-out 0.35s var(--ease) forwards;
  pointer-events: none;
}

@keyframes float-gentle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pop-out {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  60% {
    transform: scale(1.25);
    opacity: 0.6;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(92, 58, 66, 0.45);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  background: var(--cream);
  border-radius: 22px;
  padding: 1.25rem 1.25rem 1.75rem;
  box-shadow: var(--shadow-soft);
  animation: modal-in 0.4s var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: var(--rose-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--rose-ink);
  background: var(--cream-soft);
}

.modal-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.modal-message {
  text-align: center;
  color: var(--rose-muted);
  font-size: 1rem;
}

body.modal-open {
  overflow: hidden;
}

/* ========== PAGE 4 — Love Letter ========== */
.letter {
  padding: 2rem 1.25rem;
}

.letter-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px) saturate(1.05);
  transform: scale(1.08);
  z-index: 0;
}

.letter-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  z-index: 1;
}

.letter-content {
  position: relative;
  z-index: 2;
  max-width: 28rem;
  text-align: center;
  padding: 1.5rem;
}

.letter-content p {
  margin-bottom: 1rem;
  font-size: 1.08rem;
  color: var(--rose-ink);
}

.letter-greeting {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}

.letter-signoff {
  font-style: italic;
  margin-top: 1.5rem;
  color: var(--rose-muted);
}

/* ========== PAGE 5 — End Note ========== */
.end-note {
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(244, 167, 185, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(168, 212, 230, 0.3), transparent),
    var(--cream);
}

.end-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
  pointer-events: none;
}

.end-note-text {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  font-weight: 600;
  line-height: 1.7;
  color: var(--rose-ink);
  margin-bottom: 1.5rem;
}

.end-hint {
  font-size: 0.85rem;
  color: var(--rose-muted);
  letter-spacing: 0.04em;
}

/* ========== Desktop tweaks ========== */
@media (min-width: 768px) {
  .memory {
    flex-direction: row;
    align-items: center;
    gap: 3rem;
    padding: 3rem 4rem;
    max-width: 56rem;
    margin-inline: auto;
  }

  .memory:nth-child(even) {
    flex-direction: row-reverse;
  }

  .memory-media,
  .memory-text {
    flex: 1;
    margin: 0;
    text-align: left;
  }

  .memory-media {
    flex: 0 1 22rem;
    max-width: 22rem;
  }

  .memory-photo {
    max-height: min(72vh, 38rem);
  }

  .memory:nth-child(even) .memory-text {
    text-align: right;
  }

  .reason-bubbles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 32rem);
    gap: 1.5rem;
  }

  .reason-bubble:nth-child(3) {
    grid-column: auto;
  }

  .reason-bubble {
    width: 8.5rem;
    height: 8.5rem;
  }

  .letter-content {
    padding: 2.5rem 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reason-bubble,
  .scroll-hint span,
  .memory-text,
  .modal-card {
    animation: none !important;
    transition: none !important;
  }

  .memory-text {
    opacity: 1;
    transform: none;
  }
}

/* ========== Private gate ========== */
body.gated {
  overflow: hidden;
}

.site-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(244, 167, 185, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(168, 212, 230, 0.4), transparent 50%),
    var(--cream);
}

.site-gate[hidden] {
  display: none;
}

.gate-card {
  width: min(100%, 22rem);
  text-align: center;
  padding: 2rem 1.5rem;
}

.gate-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin: 0.4rem 0 0.75rem;
}

.gate-hint {
  color: var(--rose-muted);
  margin-bottom: 1.25rem;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}

.gate-form input {
  border: 1.5px solid rgba(232, 135, 154, 0.45);
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  font: inherit;
  text-align: center;
  background: var(--white);
  color: var(--rose-ink);
}

.gate-form input:focus {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

.gate-error {
  margin-top: 0.85rem;
  color: var(--blush-deep);
  font-size: 0.9rem;
}

#site[hidden] {
  display: none;
}

/* ========== Audio controls ========== */
.audio-controls {
  position: fixed;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.audio-btn {
  border: 1px solid rgba(232, 135, 154, 0.4);
  background: rgba(255, 248, 244, 0.92);
  color: var(--rose-ink);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.audio-btn[aria-pressed="false"] {
  opacity: 0.7;
}

.audio-btn[hidden] {
  display: none;
}
