:root {
  --bg-top: #fff8ef;
  --bg-bottom: #ffe4dc;
  --peach: #ff9a76;
  --rose: #e85d75;
  --cherry: #c93b58;
  --text: #542035;
  --panel: rgba(255, 255, 255, 0.68);
  --shadow: 0 18px 40px rgba(201, 59, 88, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

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

body {
  font-family: "Quicksand", sans-serif;
  color: var(--text);
  background: linear-gradient(170deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

.sky-glow {
  position: fixed;
  inset: -20vmax;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 154, 118, 0.35), transparent 42%),
    radial-gradient(circle at 80% 15%, rgba(232, 93, 117, 0.28), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255, 210, 184, 0.5), transparent 45%);
  filter: blur(3px);
  z-index: -2;
  animation: pulseGlow 12s ease-in-out infinite alternate;
}

.heart-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.heart {
  position: absolute;
  bottom: -40px;
  font-size: 18px;
  opacity: 0.72;
  animation: floatUp linear forwards;
  filter: drop-shadow(0 4px 10px rgba(201, 59, 88, 0.15));
}

.page {
  width: 100%;
}

.reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.98);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.panel {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 8vh, 5rem) 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.panel-shell {
  width: min(980px, 92vw);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  padding: clamp(1.3rem, 3vw, 2.2rem);
}

.hero,
.memories,
.question {
  text-align: center;
}

.eyebrow {
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--cherry);
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.7rem);
  line-height: 1.06;
  margin: 0.4rem 0 1rem;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
}

h3 {
  font-size: 1.25rem;
}

.subtext {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  margin: 0.2rem auto 0;
  max-width: 55ch;
}

.cta {
  display: inline-block;
  margin-top: 1.35rem;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, var(--rose), var(--peach));
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 14px 25px rgba(201, 59, 88, 0.28);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 30px rgba(201, 59, 88, 0.35);
}

.cta-soft {
  background: #fff;
  color: var(--cherry);
  box-shadow: 0 12px 22px rgba(201, 59, 88, 0.14);
}

.photo-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.photo-card {
  margin: 0;
  perspective: 1200px;
}

.photo-flip {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 16px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(0.2, 0.75, 0.4, 1);
}

.photo-card.is-flipped .photo-flip {
  transform: rotateY(180deg);
}

.photo-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  backface-visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 16px rgba(84, 32, 53, 0.08);
}

.photo-front {
  background: rgba(255, 255, 255, 0.85);
}

.photo-back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, rgba(255, 231, 224, 0.98), rgba(255, 245, 240, 0.96));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem;
  text-align: center;
}

.photo-image,
.photo-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.photo-image {
  display: block;
  object-fit: cover;
  background: #f7f1f1;
}

.photo-empty {
  display: grid;
  place-items: center;
  border: 2px dashed rgba(84, 32, 53, 0.2);
  color: rgba(84, 32, 53, 0.6);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.72);
}

.photo-card.has-photo .photo-empty {
  display: none;
}

.photo-card:not(.has-photo) .photo-image {
  display: none;
}

.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.55rem 0.7rem;
  min-height: 2.2em;
  display: flex;
  align-items: flex-end;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 700;
  background: linear-gradient(to top, rgba(26, 8, 15, 0.78), rgba(26, 8, 15, 0));
}

.photo-back-title {
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  color: var(--cherry);
}

.photo-back-text {
  font-size: 0.98rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text);
}

.photo-back-hint {
  font-size: 0.78rem;
  opacity: 0.74;
}

.photo-flip:focus-visible {
  outline: 3px solid rgba(201, 59, 88, 0.45);
  outline-offset: 3px;
}

.photo-flip:disabled {
  cursor: not-allowed;
  opacity: 0.82;
}

.question {
  position: relative;
}

.big-heart {
  margin: 0;
  font-size: 2.8rem;
  animation: beat 1s ease-in-out infinite;
}

.button-row {
  margin-top: 1.15rem;
  min-height: 54px;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn.yes {
  background: linear-gradient(130deg, var(--rose), var(--cherry));
  color: #fff;
  box-shadow: 0 10px 20px rgba(201, 59, 88, 0.3);
}

.btn.no {
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(84, 32, 53, 0.15);
}

.answer {
  min-height: 1.4em;
  margin-top: 0.8rem;
  font-weight: 700;
  color: var(--cherry);
}

.angry-cat-pop {
  position: fixed;
  width: clamp(130px, 20vw, 230px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 0;
  box-shadow: none;
  pointer-events: none;
  z-index: 12;
  animation: angryPop 1200ms ease forwards;
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 13;
  opacity: 0;
  transform: translate(0, 0) rotate(0deg);
  animation: confettiBurst 1200ms cubic-bezier(0.18, 0.82, 0.28, 1) forwards;
}

@keyframes pulseGlow {
  0% {
    transform: scale(1) translateY(0);
  }
  100% {
    transform: scale(1.04) translateY(1.8%);
  }
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.72;
  }
  100% {
    transform: translateY(-115vh) rotate(22deg);
    opacity: 0;
  }
}

@keyframes beat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes angryPop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.75) rotate(-6deg);
  }
  20% {
    opacity: 1;
    transform: translateY(-4px) scale(1.03) rotate(0deg);
  }
  72% {
    opacity: 1;
    transform: translateY(-8px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.88) rotate(5deg);
  }
}

@keyframes confettiBurst {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg) scale(0.9);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--spin)) scale(0.8);
  }
}

@media (max-width: 820px) {
  .panel {
    min-height: auto;
    padding: 2.2rem 0;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }
}

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

  html {
    scroll-snap-type: none;
  }
}
