:root {
  --bg: #fff8f5;
  --bg-alt: #fef2f4;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.76);
  --text: #5b3550;
  --text-soft: #7b5b72;
  --accent: #ef8eb0;
  --accent-deep: #d86c96;
  --gold: #dcb46b;
  --lavender: #caa5de;
  --cream: #fff8ec;
  --shadow: 0 22px 60px rgba(157, 93, 122, 0.18);
  --shadow-soft: 0 14px 40px rgba(157, 93, 122, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 212, 226, 0.8), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(233, 208, 255, 0.7), transparent 22%),
    linear-gradient(180deg, #fffaf4 0%, #fff5f6 48%, #fdf1fb 100%);
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

.page-glow {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.page-glow-left {
  top: -10rem;
  left: -8rem;
  background: rgba(255, 185, 203, 0.9);
}

.page-glow-right {
  bottom: -10rem;
  right: -7rem;
  background: rgba(215, 196, 255, 0.8);
}

.sparkle-layer,
.confetti-zone {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-shell,
.main-experience {
  position: relative;
  z-index: 1;
}

.opening-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.opening-card {
  width: min(100%, 42rem);
  padding: 3rem 2rem;
  text-align: center;
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 246, 249, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.eyebrow {
  margin: 0 0 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-deep);
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", serif;
  line-height: 0.95;
  margin: 0;
}

h1 {
  font-size: clamp(3.2rem, 8vw, 5.7rem);
}

h2 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
}

h3 {
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.opening-copy,
.opening-note,
.section-heading p,
.hero-subcopy,
.memory-card p,
.gallery-slide figcaption,
.final-content p {
  color: var(--text-soft);
}

.opening-copy {
  max-width: 30rem;
  margin: 1.25rem auto 2rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

.opening-note {
  margin-top: 1.5rem;
  font-size: 0.92rem;
}

.gift-button {
  position: relative;
  width: 13.5rem;
  height: 13.5rem;
  margin: 0 auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 250ms ease;
}

.gift-button:hover,
.gift-button:focus-visible {
  transform: translateY(-4px) scale(1.02);
}

.gift-button:focus-visible,
.music-toggle:focus-visible,
.gallery-control:focus-visible,
.surprise-button:focus-visible,
.reason-card:focus-visible {
  outline: 2px solid rgba(216, 108, 150, 0.45);
  outline-offset: 4px;
}

.gift-lid,
.gift-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.gift-lid {
  top: 1.6rem;
  width: 10rem;
  height: 2.6rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 47%, rgba(216, 108, 150, 0.88) 47%, rgba(216, 108, 150, 0.88) 53%, rgba(255, 255, 255, 0.15) 53%),
    linear-gradient(180deg, #ffc4d7, #f49abb);
  transform-origin: center bottom;
  animation: lidFloat 2.8s ease-in-out infinite;
}

.gift-box {
  top: 4rem;
  width: 9rem;
  height: 7.2rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 46%, rgba(216, 108, 150, 0.88) 46%, rgba(216, 108, 150, 0.88) 54%, rgba(255, 255, 255, 0.12) 54%),
    linear-gradient(180deg, #ffd6e1, #f6a5c0);
}

.gift-heart {
  position: absolute;
  top: 5.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: white;
  text-shadow: 0 6px 24px rgba(255, 255, 255, 0.6);
  animation: pulse 1.8s ease-in-out infinite;
}

.gift-label {
  position: absolute;
  bottom: 0.4rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 12px 28px rgba(216, 108, 150, 0.28);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  text-decoration: none;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  color: var(--text);
}

.music-toggle,
.surprise-button,
.gallery-control {
  border: 0;
  cursor: pointer;
}

.music-toggle,
.surprise-button {
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.music-toggle.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.section {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 3rem 0 2.5rem;
}

.glass-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--surface-strong), var(--surface));
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero-message {
  min-height: 85vh;
  display: grid;
  place-items: center;
}

.hero-message-content {
  width: min(100%, 52rem);
  padding: clamp(2rem, 4vw, 4rem);
  text-align: center;
}

.typed-message {
  min-height: 5.6rem;
  margin: 1.4rem auto 1rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.85;
  max-width: 40rem;
}

.typed-message::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin-left: 0.12em;
  background: var(--accent-deep);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

.hero-ornaments {
  position: absolute;
  inset: auto 0 3rem;
  height: 8rem;
}

.floating-bloom {
  position: absolute;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0 18%, transparent 19%),
    radial-gradient(circle at 50% 15%, rgba(255, 190, 214, 0.95) 0 28%, transparent 29%),
    radial-gradient(circle at 15% 50%, rgba(255, 190, 214, 0.95) 0 28%, transparent 29%),
    radial-gradient(circle at 85% 50%, rgba(255, 190, 214, 0.95) 0 28%, transparent 29%),
    radial-gradient(circle at 50% 85%, rgba(255, 190, 214, 0.95) 0 28%, transparent 29%);
  box-shadow: 0 10px 30px rgba(239, 142, 176, 0.28);
}

.bloom-one {
  left: 10%;
  bottom: 1rem;
  animation: drift 6s ease-in-out infinite;
}

.bloom-two {
  left: 48%;
  bottom: 3rem;
  transform: scale(0.8);
  animation: drift 7s ease-in-out infinite reverse;
}

.bloom-three {
  right: 10%;
  bottom: 0.5rem;
  animation: drift 5.8s ease-in-out infinite;
}

.section-heading {
  max-width: 38rem;
  margin-bottom: 2rem;
}

.section-heading h2 {
  margin-bottom: 1rem;
}

.section-heading p {
  line-height: 1.8;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.25rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(216, 108, 150, 0.2), rgba(220, 180, 107, 0.5), rgba(202, 165, 222, 0.24));
}

.memory-card {
  position: relative;
  margin-left: 2.5rem;
  padding: 1.6rem 1.5rem 1.5rem;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 700ms ease, opacity 700ms ease;
}

.memory-card::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 1.8rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.45);
}

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

.memory-year {
  display: inline-block;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 700;
}

.memory-card p {
  margin-bottom: 0;
  line-height: 1.8;
}

.gallery-shell {
  position: relative;
  padding: 1rem;
  overflow: hidden;
}

.gallery-track {
  position: relative;
  min-height: 24rem;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(7%) scale(0.98);
  transition: opacity 500ms ease, transform 500ms ease;
  display: grid;
  gap: 1rem;
}

.gallery-slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.gallery-slide img {
  width: 100%;
  height: min(60vw, 28rem);
  object-fit: cover;
  border-radius: 22px;
}

.gallery-slide figcaption {
  text-align: center;
  line-height: 1.7;
  padding: 0 1rem 0.5rem;
}

.gallery-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  z-index: 2;
}

.gallery-prev {
  left: 1rem;
}

.gallery-next {
  right: 1rem;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1rem;
}

.gallery-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 0;
  background: rgba(216, 108, 150, 0.25);
  cursor: pointer;
}

.gallery-dot.active {
  background: linear-gradient(135deg, var(--accent), var(--gold));
  transform: scale(1.1);
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.reason-card {
  min-height: 13rem;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(255, 245, 249, 0.6));
  transition: transform 250ms ease, box-shadow 250ms ease, background 250ms ease;
}

.reason-card:hover,
.reason-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(216, 108, 150, 0.18);
}

.reason-card.is-open {
  background: linear-gradient(135deg, rgba(255, 238, 245, 0.95), rgba(255, 249, 236, 0.82));
}

.reason-icon {
  display: block;
  font-size: 2rem;
  color: var(--accent-deep);
  margin-bottom: 1rem;
}

.reason-front,
.reason-back {
  display: block;
  line-height: 1.7;
}

.reason-back {
  display: none;
  color: var(--text);
  font-weight: 600;
}

.reason-card.is-open .reason-front {
  display: none;
}

.reason-card.is-open .reason-back {
  display: block;
}

.final-section {
  position: relative;
  padding-bottom: 5rem;
}

.verse-card {
  text-align: center;
  padding: clamp(2rem, 4vw, 3.25rem);
}

.verse-text {
  margin: 1rem auto 0.75rem;
  max-width: 36rem;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  color: var(--text);
}

.verse-reference {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.final-content {
  text-align: center;
  padding: clamp(2rem, 4vw, 3.5rem);
}

.final-content > p {
  max-width: 38rem;
  margin: 1rem auto;
  line-height: 1.8;
}

.surprise-button {
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--lavender));
  color: white;
}

.final-message {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
}

.final-message p {
  margin: 0.5rem auto;
}

.sparkle,
.confetti-piece {
  position: absolute;
  border-radius: 999px;
  opacity: 0;
}

.sparkle {
  width: 0.45rem;
  height: 0.45rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
  animation: twinkle 4.5s linear infinite;
}

.confetti-piece {
  width: 0.7rem;
  height: 1rem;
  animation: fall 2200ms ease-in forwards;
}

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

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

.opening-screen.is-opening .gift-lid {
  animation: openLid 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.opening-screen.is-opening .gift-heart {
  animation: riseHeart 1s ease forwards;
}

@keyframes lidFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-6px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }

  50% {
    transform: translateX(-50%) scale(1.08);
  }
}

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

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-18px) rotate(8deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.2);
  }
}

@keyframes openLid {
  0% {
    transform: translateX(-50%) rotate(0deg) translateY(0);
  }

  100% {
    transform: translateX(-58%) rotate(-24deg) translateY(-38px);
  }
}

@keyframes riseHeart {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-90px) scale(1.9);
  }
}

@keyframes fall {
  0% {
    opacity: 1;
    transform: translateY(-10px) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: translateY(280px) rotate(280deg);
  }
}

@media (max-width: 900px) {
  .reasons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .opening-card,
  .hero-message-content,
  .final-content {
    padding: 2rem 1.25rem;
  }

  .topbar {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .section {
    width: min(calc(100% - 1rem), var(--max-width));
    padding: 2rem 0;
  }

  .gallery-track {
    min-height: 20rem;
  }

  .gallery-slide img {
    height: 16rem;
  }

  .gallery-control {
    top: auto;
    bottom: 1rem;
    transform: none;
  }

  .gallery-prev {
    left: 50%;
    margin-left: -3.6rem;
  }

  .gallery-next {
    right: 50%;
    margin-right: -3.6rem;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.4rem;
  }

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

  .timeline::before {
    left: 0.55rem;
  }

  .memory-card {
    margin-left: 1.7rem;
    padding: 1.3rem 1rem;
  }

  .memory-card::before {
    left: -1.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
