:root {
  --bg-cream: #fff8f2;
  --paper: #fffdfb;
  --white: #ffffff;
  --pink-soft: #ffdbe6;
  --pink-mid: #f8b7c8;
  --rose: #ea6f8f;
  --red-soft: #cf4d69;
  --gold-soft: #d8b26e;
  --text-main: #402731;
  --text-soft: #6e4e58;
  --shadow-soft: 0 10px 30px rgba(121, 58, 78, 0.13);
  --shadow-lift: 0 14px 32px rgba(121, 58, 78, 0.2);
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Quicksand", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 204, 219, 0.48), transparent 44%),
    radial-gradient(circle at 85% 12%, rgba(255, 241, 216, 0.56), transparent 42%),
    linear-gradient(180deg, #fffaf6 0%, #fff4f7 58%, #fff9f2 100%);
  line-height: 1.65;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.65rem 1rem;
  background: var(--white);
  border-radius: 10px;
  color: var(--text-main);
  z-index: 120;
  box-shadow: var(--shadow-soft);
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  padding: 4.5rem 1.25rem 3rem;
}

.hero-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.66;
}

.glow-one {
  width: min(46vw, 360px);
  height: min(46vw, 360px);
  background: radial-gradient(circle, rgba(255, 196, 214, 0.74), rgba(255, 196, 214, 0));
  left: -8%;
  top: -2%;
  animation: driftGlow 12s ease-in-out infinite alternate;
}

.glow-two {
  width: min(44vw, 330px);
  height: min(44vw, 330px);
  background: radial-gradient(circle, rgba(255, 228, 174, 0.64), rgba(255, 228, 174, 0));
  right: -8%;
  bottom: 2%;
  animation: driftGlow 13.5s ease-in-out infinite alternate-reverse;
}

.hero-inner {
  position: relative;
  z-index: 4;
  max-width: 780px;
}

.hero h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  letter-spacing: 0.02em;
  color: #8f3f55;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}

.hero-subtitle {
  margin: 0.8rem auto 1.8rem;
  max-width: 520px;
  font-size: clamp(1.08rem, 2.7vw, 1.45rem);
  color: var(--text-soft);
}

.hero-button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f08eab, #cf4d69);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(207, 77, 105, 0.34);
  transition: transform 240ms ease, box-shadow 240ms ease, filter 240ms ease;
}

.hero-button:hover {
  transform: translateY(-3px);
  filter: brightness(1.04);
  box-shadow: 0 14px 28px rgba(207, 77, 105, 0.4);
}

.hero-button:focus-visible,
.lightbox-close:focus-visible,
.song-button:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
}

.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 86px;
  background: radial-gradient(120px 40px at 15% 10%, #fff9f6 98%, transparent 100%),
    radial-gradient(120px 40px at 45% 35%, #fff9f6 98%, transparent 100%),
    radial-gradient(120px 40px at 75% 8%, #fff9f6 98%, transparent 100%),
    radial-gradient(120px 40px at 95% 30%, #fff9f6 98%, transparent 100%);
}

.floating-hearts,
.sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.float-heart {
  position: absolute;
  bottom: -30px;
  width: 18px;
  height: 18px;
  background: linear-gradient(145deg, rgba(253, 148, 176, 0.95), rgba(230, 86, 123, 0.9));
  clip-path: polygon(50% 92%, 7% 48%, 20% 24%, 39% 20%, 50% 32%, 61% 20%, 80% 24%, 93% 48%);
  opacity: 0;
  border-radius: 0;
  animation: heartRise var(--duration, 10s) linear infinite;
  animation-delay: var(--delay, 0s);
}

.sparkle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 1px;
  background: linear-gradient(145deg, rgba(255, 228, 158, 1), rgba(251, 174, 102, 0.92));
  transform: rotate(45deg);
  opacity: 0;
  animation: twinkle var(--duration, 3.6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.sparkle::before,
.sparkle::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.sparkle::before {
  left: -50%;
}

.sparkle::after {
  top: -50%;
}

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

.section-heading {
  text-align: center;
  margin-bottom: 2.2rem;
}

.section-heading h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #8f3f55;
}

.section-heading p {
  margin: 0.5rem auto 0;
  color: var(--text-soft);
  max-width: 600px;
}

.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.2rem;
}

.polaroid {
  background: var(--paper);
  border-radius: 13px;
  box-shadow: var(--shadow-soft);
  padding: 0.62rem 0.62rem 0.95rem;
  transform-origin: center;
  transition: transform 280ms ease, box-shadow 280ms ease;
}

.polaroid:nth-child(3n + 1) {
  transform: rotate(-1.8deg);
}

.polaroid:nth-child(3n + 2) {
  transform: rotate(1.6deg);
}

.polaroid:nth-child(3n + 3) {
  transform: rotate(-0.7deg);
}

.polaroid:hover {
  transform: translateY(-6px) rotate(0deg);
  box-shadow: var(--shadow-lift);
}

.photo-trigger {
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  border-radius: 10px;
  cursor: default;
  pointer-events: none;
  overflow: hidden;
  background: transparent;
}

.photo-trigger img {
  aspect-ratio: 4 / 5;
  object-fit: contain;
  object-position: center;
  background: #fff3f7;
  transition: transform 450ms ease;
}

.polaroid:hover .photo-trigger img {
  transform: scale(1.04);
}

.polaroid p {
  margin: 0.75rem 0.35rem 0;
  text-align: center;
  font-family: "Satisfy", cursive;
  font-size: 1.28rem;
  color: #7e4759;
  line-height: 1.25;
}

.heart-divider {
  width: min(1100px, 92vw);
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.heart-divider svg {
  width: min(330px, 80vw);
  fill: rgba(207, 77, 105, 0.42);
}

.moments-list {
  display: grid;
  gap: 1.5rem;
}

.moment-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.2fr);
  align-items: center;
  gap: 1.3rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 249, 0.96));
  box-shadow: var(--shadow-soft);
}

.moment-card:nth-child(even) {
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr);
}

.moment-card:nth-child(even) img {
  order: 2;
}

.moment-card img {
  width: 100%;
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: center;
  background: #fff3f7;
}

.moment-text h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #8f3f55;
}

.song-button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f08eab, #cf4d69);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 1rem;
  margin: 0 0 0.7rem;
  box-shadow: 0 8px 18px rgba(207, 77, 105, 0.28);
  cursor: pointer;
  transition: transform 220ms ease, filter 220ms ease;
}

.song-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.song-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.moment-text p {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
}

.letter-card {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 241, 0.93));
  border: 1px solid rgba(216, 178, 110, 0.45);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: clamp(1.2rem, 4vw, 2.3rem);
}

.letter-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(216, 178, 110, 0.52);
  border-radius: 12px;
  pointer-events: none;
}

.letter-card p {
  margin: 0;
  position: relative;
  z-index: 1;
  font-size: clamp(1rem, 2.6vw, 1.1rem);
}

.letter-card p + p {
  margin-top: 0.95rem;
}

.signature {
  margin-top: 1.35rem;
  display: inline-grid;
  gap: 0.2rem;
  position: relative;
  z-index: 1;
}

.signature strong {
  font-family: "Satisfy", cursive;
  font-weight: 400;
  font-size: 1.8rem;
  color: #994d65;
}

.signature-heart {
  font-size: 1.2rem;
  color: var(--red-soft);
  display: inline-block;
  animation: heartbeat 1.8s ease-in-out infinite;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2.2rem;
  color: #7a5661;
  font-size: 0.95rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
  z-index: 200;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 20, 28, 0.72);
  backdrop-filter: blur(2px);
}

.lightbox-content {
  position: relative;
  margin: 0;
  width: min(90vw, 900px);
  max-height: 88vh;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(27, 11, 17, 0.35);
  padding: 0.9rem;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 280ms ease, opacity 280ms ease;
}

.lightbox.is-open .lightbox-content {
  transform: scale(1);
  opacity: 1;
}

.lightbox-content img {
  width: 100%;
  max-height: calc(88vh - 88px);
  object-fit: contain;
  border-radius: 12px;
}

#lightbox-caption {
  margin: 0.65rem 0.35rem 0.25rem;
  text-align: center;
  color: var(--text-soft);
}

.lightbox-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2.15rem;
  height: 2.15rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #8f3f55;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

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

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

@keyframes heartRise {
  0% {
    transform: translateY(0) rotate(45deg) scale(0.92);
    opacity: 0;
  }
  12% {
    opacity: 0.86;
  }
  100% {
    transform: translateY(-118vh) rotate(45deg) scale(1.28);
    opacity: 0;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.38;
    transform: rotate(45deg) scale(0.9);
  }
  50% {
    opacity: 0.95;
    transform: rotate(45deg) scale(1.2);
  }
}

@keyframes driftGlow {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-16px);
  }
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.18);
  }
  45% {
    transform: scale(1.02);
  }
}

@media (max-width: 900px) {
  .moment-card,
  .moment-card:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .moment-card:nth-child(even) img {
    order: 0;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 90vh;
    padding-top: 4rem;
  }

  .hero-wave {
    height: 56px;
  }

  .section {
    padding: 3.1rem 0;
  }

  .polaroid-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .polaroid p {
    font-size: 1.1rem;
  }

  .lightbox-content {
    width: 92vw;
    padding: 0.65rem;
  }
}

@media (max-width: 420px) {
  .polaroid-grid {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .floating-hearts,
  .sparkles {
    display: none;
  }
}
