:root {
  --beige: #f5ede6;
  --rose: #d8a7b1;
  --cream: #fff8f2;
  --burgundy: #7a2e3a;
  --gold: #c6a75e;
  --text: #5b3a40;
  --text-soft: rgba(91, 58, 64, 0.76);
  --line: rgba(122, 46, 58, 0.18);
  --card-shadow: 0 22px 48px rgba(122, 46, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--beige);
  overflow-x: clip;
}

.sunset-parallax {
  position: fixed;
  inset: 0;
  z-index: -2;
  will-change: transform;
  background:
    radial-gradient(950px 500px at 20% 6%, rgba(255, 248, 242, 0.92), transparent 60%),
    radial-gradient(1000px 580px at 84% 14%, rgba(198, 167, 94, 0.24), transparent 58%),
    radial-gradient(900px 540px at 50% 112%, rgba(216, 167, 177, 0.72), transparent 56%),
    linear-gradient(160deg, #f7ece3 0%, #f2d5c4 44%, #e7bdaf 68%, #dbaf9a 100%);
  filter: blur(0.4px) saturate(1.05);
}

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

.heart-particles span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50% 50% 35% 35%;
  transform: rotate(45deg);
  background: radial-gradient(circle at 30% 30%, rgba(255, 248, 242, 0.92), rgba(198, 167, 94, 0.5));
  opacity: 0.25;
  filter: blur(0.2px);
  animation: floatHeart linear infinite;
}

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 26px;
}

.hero-inner {
  width: min(920px, 100%);
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 248, 242, 0.72), rgba(255, 248, 242, 0.45));
  border: 1px solid rgba(198, 167, 94, 0.28);
  border-radius: 28px;
  padding: 28px 20px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(5px);
}

.overline {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(122, 46, 58, 0.84);
}

h1,
h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  color: var(--burgundy);
  text-wrap: balance;
}

h1 {
  margin-top: 12px;
  font-size: clamp(2.2rem, 10.5vw, 5rem);
  line-height: 1.07;
}

.hero-subtext {
  margin: 16px auto 0;
  color: var(--text-soft);
  max-width: 34ch;
  font-size: clamp(1rem, 3.8vw, 1.2rem);
}

.cta {
  display: inline-flex;
  margin-top: 28px;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  color: var(--cream);
  background: linear-gradient(130deg, #8a3544, #7a2e3a 58%, #6a2531);
  border: 1px solid rgba(198, 167, 94, 0.6);
  box-shadow:
    0 0 0 0 rgba(198, 167, 94, 0.42),
    0 12px 28px rgba(122, 46, 58, 0.35);
  transition: transform 0.25s ease, box-shadow 0.28s ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 8px rgba(198, 167, 94, 0.15),
    0 14px 32px rgba(122, 46, 58, 0.42);
}

.music-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  border: 1px solid rgba(198, 167, 94, 0.52);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  color: var(--cream);
  background: linear-gradient(130deg, rgba(122, 46, 58, 0.94), rgba(91, 30, 42, 0.92));
  box-shadow:
    0 12px 28px rgba(122, 46, 58, 0.26),
    0 0 0 1px rgba(255, 248, 242, 0.08) inset;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.music-toggle:hover,
.music-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 14px 32px rgba(122, 46, 58, 0.3),
    0 0 0 4px rgba(198, 167, 94, 0.18);
}

.music-toggle[data-state="playing"] {
  background: linear-gradient(130deg, rgba(91, 30, 42, 0.96), rgba(122, 46, 58, 0.94));
}

main {
  padding-bottom: 82px;
}

.section {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 70px 0 0;
}

.section-head {
  margin-bottom: 24px;
}

h2 {
  margin-top: 10px;
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 1.14;
}

.letter-grid {
  display: grid;
  gap: 14px;
}

.letter-card {
  background: linear-gradient(160deg, rgba(255, 248, 242, 0.96), rgba(245, 237, 230, 0.84));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.quote {
  margin: 0;
  color: var(--burgundy);
  font-family: "Caveat", cursive;
  font-size: clamp(1.5rem, 7vw, 2rem);
  line-height: 1.28;
}

.letter-meta {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.timeline-wrap {
  position: relative;
  padding: 16px 0 8px;
}

.story-slides {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 290px);
  gap: 16px;
  overflow-x: auto;
  padding: 18px 2px 8px;
  scrollbar-width: thin;
}

.story-card {
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(198, 167, 94, 0.24);
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(245, 237, 230, 0.88));
  box-shadow: var(--card-shadow);
}

.story-photo {
  aspect-ratio: 4 / 5;
  display: block;
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(122, 46, 58, 0.14);
  background: rgba(255, 248, 242, 0.78);
  object-fit: cover;
  object-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 242, 0.35);
}

.story-step {
  margin: 14px 0 0;
  color: rgba(122, 46, 58, 0.72);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.story-caption {
  margin: 8px 0 0;
  color: var(--burgundy);
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  line-height: 1.55;
  text-wrap: balance;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 2px 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  height: 1px;
  background: linear-gradient(to right, rgba(198, 167, 94, 0.24), rgba(122, 46, 58, 0.38), rgba(198, 167, 94, 0.24));
}

.milestone {
  position: relative;
  padding: 34px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(198, 167, 94, 0.25);
  background: rgba(255, 248, 242, 0.75);
  min-height: 170px;
}

.dot {
  position: absolute;
  top: 17px;
  left: 14px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffeec7, #c6a75e);
  box-shadow: 0 0 0 5px rgba(198, 167, 94, 0.2);
}

.date {
  margin: 0;
  color: var(--burgundy);
  font-weight: 600;
  font-size: 1rem;
}

.detail {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.7;
}

.response-card {
  background: linear-gradient(160deg, rgba(255, 248, 242, 0.96), rgba(245, 237, 230, 0.84));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.response-intro {
  margin: 0 0 14px;
  color: var(--text-soft);
  line-height: 1.72;
}

.response-form {
  display: grid;
  gap: 8px;
}

.response-form label {
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(122, 46, 58, 0.92);
}

.response-form input,
.response-form textarea {
  width: 100%;
  border: 1px solid rgba(122, 46, 58, 0.24);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 248, 242, 0.92);
}

.response-form textarea {
  resize: vertical;
}

.response-form input:focus,
.response-form textarea:focus {
  outline: none;
  border-color: rgba(122, 46, 58, 0.45);
  box-shadow: 0 0 0 3px rgba(198, 167, 94, 0.18);
}

.submit-btn {
  margin-top: 8px;
  justify-content: center;
  width: fit-content;
}

.submit-btn:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.reply-status {
  margin: 2px 0 0;
  min-height: 22px;
  color: rgba(122, 46, 58, 0.9);
  font-size: 0.93rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

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

@keyframes floatHeart {
  from {
    transform: translateY(110vh) rotate(45deg);
    opacity: 0;
  }
  10% {
    opacity: 0.2;
  }
  to {
    transform: translateY(-14vh) translateX(-24px) rotate(45deg);
    opacity: 0;
  }
}

@media (min-width: 760px) {
  .hero {
    padding: 34px;
  }

  .hero-inner {
    padding: 52px 44px;
  }

  .letter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timeline {
    overflow: visible;
  }

  .timeline-wrap {
    padding-top: 20px;
  }

  .story-slides {
    grid-auto-columns: minmax(270px, 320px);
  }
}

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

  .reveal,
  .reveal.visible,
  .heart-particles span,
  .cta,
  .music-toggle,
  .sunset-parallax {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
