/* ===== Reset & Base ===== */

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

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

body {
  font-family: 'Lora', Georgia, serif;
  color: #4a3728;
  background: #fdf6f0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ===== Scroll-snap sections ===== */

.hero,
.photo-section,
.closing {
  scroll-snap-align: start;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ===== Hero Section ===== */

.hero {
  background: linear-gradient(
    160deg,
    #fdf6f0 0%,
    #fce4ec 30%,
    #f8bbd0 60%,
    #e8b4cb 100%
  );
  text-align: center;
  padding: 2rem 1.5rem;
}

.hero-content {
  max-width: 600px;
}

.hero-prelude {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #b07a8f;
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeSlideUp 1s 0.3s ease forwards;
}

.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 8vw, 4.5rem);
  line-height: 1.15;
  color: #5c2d44;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeSlideUp 1s 0.6s ease forwards;
}

.hero-title em {
  font-style: italic;
  color: #8e3a5e;
}

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: #7a5068;
  font-style: italic;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeSlideUp 1s 0.9s ease forwards;
}

/* ===== Scroll Indicator ===== */

.scroll-indicator {
  opacity: 0;
  animation: fadeSlideUp 1s 1.2s ease forwards;
  color: #b07a8f;
}

.scroll-indicator svg {
  animation: bounceDown 2s ease-in-out infinite;
}

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

/* ===== Photo Sections ===== */

.photo-section {
  padding: 2.5rem 1.25rem;
  gap: 1.5rem;
  background: #fdf6f0;
}

.photo-section:nth-child(even) {
  background: #fef9f5;
}

.photo-wrapper {
  width: 100%;
  max-width: 500px;
  flex-shrink: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow:
    0 8px 30px rgba(90, 40, 60, 0.1),
    0 2px 8px rgba(90, 40, 60, 0.06);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.photo-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.photo-wrapper img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: linear-gradient(135deg, #fce4ec, #f3e5f5);
}

.message {
  max-width: 500px;
  text-align: center;
  padding: 0 0.5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s 0.2s ease, transform 0.8s 0.2s ease;
}

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

.message p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.15rem, 4vw, 1.6rem);
  line-height: 1.55;
  color: #5c2d44;
  font-weight: 400;
  font-style: italic;
}

/* ===== Closing Section ===== */

.closing {
  background: linear-gradient(
    160deg,
    #fdf6f0 0%,
    #fce4ec 40%,
    #f8bbd0 70%,
    #e8b4cb 100%
  );
  text-align: center;
  padding: 2rem 1.5rem;
}

.closing-content {
  max-width: 550px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.closing-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.closing-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 6vw, 2.8rem);
  line-height: 1.35;
  color: #5c2d44;
  font-weight: 600;
  margin-bottom: 2rem;
}

.closing-sign {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: #7a5068;
  line-height: 1.6;
}

.closing-sign em {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
}

.heart {
  font-size: 2.5rem;
  color: #d4627a;
  margin-top: 2rem;
  animation: heartbeat 1.8s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
  60% { transform: scale(1); }
}

/* ===== Fade / Slide animation keyframes ===== */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Desktop enhancements ===== */

@media (min-width: 768px) {
  .photo-section {
    flex-direction: row;
    padding: 3rem 3rem;
    gap: 3rem;
  }

  .photo-section:nth-child(odd) {
    flex-direction: row;
  }

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

  .photo-wrapper {
    max-width: 480px;
    flex: 0 0 auto;
    width: 48%;
  }

  .photo-wrapper img {
    aspect-ratio: 3 / 4;
  }

  .message {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    padding: 2rem;
  }

  .message p {
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  }
}

@media (min-width: 1200px) {
  .photo-section {
    padding: 3rem 6rem;
  }
}

/* ===== Reduced motion ===== */

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

  .hero-prelude,
  .hero-title,
  .hero-subtitle,
  .scroll-indicator {
    animation: none;
    opacity: 1;
  }

  .photo-wrapper,
  .message,
  .closing-content {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-indicator svg {
    animation: none;
  }

  .heart {
    animation: none;
  }
}
