:root {
  --cream: #f9f3e8;
  --warm-tan: #e8d5b7;
  --terracotta: #c17f5a;
  --rust: #a0522d;
  --sage: #8a9e7e;
  --deep-brown: #3e2a1a;
  --warm-white: #fdf8f0;
  --dusty-rose: #d4967a;
  --honey: #d4a853;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--cream);
  color: var(--deep-brown);
  font-family: "Lora", serif;
  overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.5;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f5ede0 0%, #eddcc4 40%, #e0c9a6 100%);
  position: relative;
  overflow: hidden;
  padding: 2rem;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 20% 30%,
      rgba(193, 127, 90, 0.15) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 80% 70%,
      rgba(138, 158, 126, 0.12) 0%,
      transparent 60%
    );
}

/* Decorative botanical SVG corners */
.corner-deco {
  position: absolute;
  width: 180px;
  opacity: 0.25;
}
.corner-deco.tl {
  top: 0;
  left: 0;
  transform: rotate(0deg);
}
.corner-deco.tr {
  top: 0;
  right: 0;
  transform: rotate(90deg);
}
.corner-deco.bl {
  bottom: 0;
  left: 0;
  transform: rotate(270deg);
}
.corner-deco.br {
  bottom: 0;
  right: 0;
  transform: rotate(180deg);
}

.hero-tag {
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  color: var(--terracotta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  animation: fadeDown 1s ease both;
}

.hero-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  color: var(--deep-brown);
  line-height: 1.1;
  animation: fadeDown 1s 0.2s ease both;
}

.hero-title span {
  color: var(--terracotta);
  font-style: italic;
}

.hero-divider {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--honey), transparent);
  margin: 1.5rem auto;
  animation: fadeDown 1s 0.4s ease both;
}

.hero-sub {
  font-family: "Lora", serif;
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--rust);
  opacity: 0.85;
  animation: fadeDown 1s 0.6s ease both;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  font-family: "Caveat", cursive;
  font-size: 1rem;
  color: var(--terracotta);
  opacity: 0.7;
  animation: bounce 2s infinite;
}

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

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

/* ===== SECTIONS SHARED ===== */
section {
  padding: 5rem 2rem;
  position: relative;
}

.section-label {
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  color: var(--terracotta);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--deep-brown);
  text-align: center;
  margin-bottom: 3rem;
}

/* Fade-in on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ===== LOVE LETTER ===== */
.letter-section {
  background: var(--warm-white);
  display: flex;
  justify-content: center;
  align-items: center;
}

.letter-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--sage),
    var(--honey),
    var(--terracotta)
  );
}

.letter-wrap {
  max-width: 680px;
  width: 100%;
  background: #fff9f0;
  border: 1px solid rgba(193, 127, 90, 0.2);
  border-radius: 4px;
  padding: 3.5rem 4rem;
  position: relative;
  box-shadow:
    0 8px 40px rgba(62, 42, 26, 0.08),
    4px 4px 0 var(--warm-tan);
}

/* Torn paper top edge */
.letter-wrap::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: #fff9f0;
  clip-path: polygon(
    0% 100%,
    2% 0%,
    5% 80%,
    8% 10%,
    11% 90%,
    14% 20%,
    17% 100%,
    20% 30%,
    23% 85%,
    26% 5%,
    29% 95%,
    32% 40%,
    35% 80%,
    38% 15%,
    41% 95%,
    44% 50%,
    47% 90%,
    50% 20%,
    53% 85%,
    56% 0%,
    59% 90%,
    62% 30%,
    65% 85%,
    68% 5%,
    71% 90%,
    74% 20%,
    77% 95%,
    80% 15%,
    83% 80%,
    86% 5%,
    89% 90%,
    92% 25%,
    95% 80%,
    98% 10%,
    100% 100%
  );
}

.letter-greeting {
  font-family: "Caveat", cursive;
  font-size: 2rem;
  color: var(--terracotta);
  margin-bottom: 1.5rem;
}

.letter-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--deep-brown);
  margin-bottom: 1.2rem;
}

.letter-sign {
  font-family: "Caveat", cursive;
  font-size: 1.5rem;
  color: var(--rust);
  margin-top: 2rem;
  text-align: right;
}

/* ===== PHOTO GALLERY ===== */
.gallery-section {
  background: linear-gradient(180deg, var(--cream) 0%, #ede3d0 100%);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.photo-slot {
  position: relative;
  background: #fff9f0;
  border: 1px solid rgba(193, 127, 90, 0.25);
  padding: 12px 12px 40px;
  box-shadow:
    3px 3px 12px rgba(62, 42, 26, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.05);
  transform: rotate(var(--rot, 0deg));
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.photo-slot:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 6px 6px 24px rgba(62, 42, 26, 0.18);
  z-index: 10;
}

.photo-slot:nth-child(1) {
  --rot: -2deg;
}
.photo-slot:nth-child(2) {
  --rot: 1.5deg;
}
.photo-slot:nth-child(3) {
  --rot: -1deg;
}
.photo-slot:nth-child(4) {
  --rot: 2.5deg;
}
.photo-slot:nth-child(5) {
  --rot: -1.8deg;
}
.photo-slot:nth-child(6) {
  --rot: 1deg;
}

/* tape strip */
.photo-slot::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 18px;
  background: rgba(212, 168, 83, 0.45);
  border-radius: 2px;
  backdrop-filter: blur(2px);
}

.photo-img-area {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #f0e6d3 0%, #e8d5b7 100%);
  border-radius: 2px;
  overflow: hidden;
}

.photo-img-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-caption {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  text-align: center;
  font-family: "Caveat", cursive;
  font-size: 1rem;
  color: var(--rust);
}

/* ===== REASONS ===== */
.reasons-section {
  background: #f7efe2;
}

.reasons-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, transparent, rgba(232, 213, 183, 0.4));
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.reason-card {
  background: var(--warm-white);
  border-radius: 6px;
  padding: 2rem 1.8rem;
  border: 1px solid rgba(193, 127, 90, 0.2);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.reason-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(62, 42, 26, 0.1);
}

.reason-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--terracotta), var(--honey));
}

.reason-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.reason-card h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--deep-brown);
  margin-bottom: 0.6rem;
}

.reason-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #6b4c36;
}

/* ===== INTERACTIVE REVEAL ===== */
.reveal-section {
  background: linear-gradient(135deg, #3e2a1a 0%, #5c3d25 100%);
  text-align: center;
  padding: 5rem 2rem;
}

.reveal-section .section-label {
  color: var(--honey);
}
.reveal-section .section-title {
  color: var(--warm-white);
}

.envelope-container {
  display: flex;
  justify-content: center;
  margin: 2rem auto;
  padding-top: 14rem;
}

.envelope {
  width: 300px;
  cursor: pointer;
  position: relative;
}

.envelope-body {
  width: 300px;
  height: 200px;
  background: var(--warm-tan);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.envelope:hover .envelope-body {
  transform: scale(1.03);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-top: 100px solid #c9b48a;
  transform-origin: top center;
  transition: transform 0.6s ease;
  z-index: 2;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
}

.envelope-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-bottom: 110px solid #b8a070;
}

.envelope-left {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 150px solid #c0a97a;
  border-top: 100px solid transparent;
  border-bottom: 100px solid transparent;
}

.envelope-right {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-right: 150px solid #b8a070;
  border-top: 100px solid transparent;
  border-bottom: 100px solid transparent;
}

.envelope-letter {
  position: absolute;
  width: 250px;
  background: #fff9f0;
  border-radius: 3px;
  padding: 1.5rem;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  transition:
    transform 0.6s 0.2s ease,
    opacity 0.4s ease;
  opacity: 0;
  text-align: left;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.envelope.open .envelope-letter {
  transform: translateX(-50%) translateY(-220px);
  opacity: 1;
}

.envelope-letter p {
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  color: var(--deep-brown);
  line-height: 1.6;
}

.envelope-hint {
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  color: var(--honey);
  opacity: 0.8;
  margin-top: 1.5rem;
}

/* ===== FINAL SECTION ===== */
.final-section {
  background: var(--warm-white);
  text-align: center;
  padding: 6rem 2rem;
}

.final-section .big-number {
  font-family: "Playfair Display", serif;
  font-size: clamp(6rem, 20vw, 14rem);
  font-weight: 700;
  color: rgba(193, 127, 90, 0.12);
  line-height: 1;
  user-select: none;
  margin-bottom: -2rem;
}

.final-section h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-style: italic;
  color: var(--deep-brown);
  position: relative;
  z-index: 1;
}

.final-section p {
  max-width: 540px;
  margin: 1.5rem auto 2rem;
  font-size: 1.05rem;
  line-height: 1.85;
  color: #6b4c36;
}

.signature {
  font-family: "Caveat", cursive;
  font-size: 2rem;
  color: var(--terracotta);
}

/* ===== FOOTER ===== */
footer {
  background: var(--deep-brown);
  color: rgba(249, 243, 232, 0.6);
  text-align: center;
  padding: 2rem;
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

footer span {
  color: var(--honey);
}

/* ===== FLOATING PETALS ===== */
.petals-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -30px;
  font-size: 1.2rem;
  animation: fall linear infinite;
  opacity: 0.7;
}

/* TODO: remove after the main section */
@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg) translateX(0);
    opacity: 0.8;
  }
  50% {
    transform: translateY(50vh) rotate(180deg) translateX(20px);
  }
  100% {
    transform: translateY(105vh) rotate(360deg) translateX(-15px);
    opacity: 0;
  }
}

/* ===== SPARKLES on click ===== */
.sparkle-burst {
  position: fixed;
  pointer-events: none;
  font-size: 1.4rem;
  z-index: 9999;
  animation: sparkleUp 0.9s ease forwards;
}

@keyframes sparkleUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(0.3);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .letter-wrap {
    padding: 2.5rem 1.8rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .reasons-grid {
    grid-template-columns: 1fr;
  }
}
