/* ─────────────────────────────────────────────────────────────
   TOKENS
───────────────────────────────────────────────────────────── */
:root {
  --rose-deep:    #1a0008;
  --rose-mid:     #3d0018;
  --rose-light:   #7a1235;
  --blush:        #f4a0b0;
  --blush-light:  #fcd9e0;
  --gold:         #d4af37;
  --gold-light:   #f0d060;
  --cream:        #fdf3e7;
  --white:        #ffffff;
  --shadow:       rgba(0,0,0,0.45);

  --ff-display:  'Dancing Script', cursive;
  --ff-serif:    'Cormorant Garamond', Georgia, serif;
  --ff-body:     'Lato', sans-serif;
}

/* ─────────────────────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--rose-deep);
  color: var(--blush-light);
  font-family: var(--ff-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────
   SHARED SECTION CHROME
───────────────────────────────────────────────────────────── */
section {
  position: relative;
  padding: 6rem 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  text-align: center;
}

.section-header h2 {
  font-family: var(--ff-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.section-ornament {
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0.7;
}

.section-hint {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--blush);
  opacity: 0.7;
  margin-top: -2rem;
  margin-bottom: 2.5rem;
}

/* ─────────────────────────────────────────────────────────────
   HERO
───────────────────────────────────────────────────────────── */
#hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(122,18,53,0.55) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(61,0,24,0.7) 0%, transparent 55%),
    linear-gradient(160deg, #2a0012 0%, var(--rose-deep) 60%, #0d0005 100%);
  overflow: hidden;
  text-align: center;
}

/* Petals */
#petals-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -60px;
  border-radius: 150% 0 150% 0;
  opacity: 0;
  animation: petalFall linear infinite;
  will-change: transform, opacity;
}

@keyframes petalFall {
  0%   { transform: translateY(0) rotate(0deg) scale(1);   opacity: 0; }
  5%   { opacity: 0.75; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(110vh) rotate(540deg) scale(0.6); opacity: 0; }
}

/* Hero text */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--blush);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.8;
}

.hero-name {
  font-family: var(--ff-serif);
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--white);
  line-height: 1.1;
  text-shadow: 0 2px 24px rgba(212,175,55,0.3);
}

.hero-nick {
  font-family: var(--ff-display);
  font-size: clamp(1.6rem, 5vw, 3rem);
  color: var(--gold);
  opacity: 0.9;
  margin-top: -0.2rem;
}

/* Heart button */
#heart-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin: 1.2rem 0 0;
  padding: 0;
  width: clamp(70px, 14vw, 110px);
  filter: drop-shadow(0 0 16px rgba(212,175,55,0.45));
  animation: heartPulse 1.6s ease-in-out infinite;
  transition: transform 0.15s;
}

#heart-btn:hover { transform: scale(1.12); }
#heart-btn:active { transform: scale(0.95); }

#heart-btn svg path {
  fill: var(--blush);
  stroke: var(--gold);
  stroke-width: 2;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

.heart-hint {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--blush);
  opacity: 0.55;
  margin-top: -0.2rem;
}

/* Anniversary badge */
.anniversary-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.5rem;
  padding: 0.6rem 1.8rem;
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: 999px;
  background: rgba(212,175,55,0.06);
  backdrop-filter: blur(4px);
  gap: 0.1rem;
}

.badge-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
}

.badge-date {
  font-family: var(--ff-serif);
  font-size: 1.05rem;
  color: var(--gold-light);
  letter-spacing: 0.06em;
}

/* Scroll arrow */
.scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 50%;
  color: var(--gold);
  text-decoration: none;
  animation: arrowBounce 2s ease-in-out infinite;
  transition: background 0.2s;
  z-index: 2;
}

.scroll-arrow:hover { background: rgba(212,175,55,0.15); }

.scroll-arrow svg {
  width: 18px;
  height: 18px;
  stroke: var(--gold);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* Burst hearts */
.burst-heart {
  position: fixed;
  pointer-events: none;
  font-size: 1.4rem;
  z-index: 999;
  animation: burstFly 1.1s ease-out forwards;
  will-change: transform, opacity;
}

@keyframes burstFly {
  0%   { transform: translate(0,0) scale(0.5); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(1.2); opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────
   LOVE LETTER
───────────────────────────────────────────────────────────── */
#letter {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(61,0,24,0.6) 0%, transparent 65%),
    var(--rose-deep);
}

.letter-card {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  background: linear-gradient(145deg, #fdf3e7 0%, #f5e6d3 100%);
  border-radius: 4px;
  padding: 3rem 3.5rem 4rem;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(212,175,55,0.3),
    inset 0 0 40px rgba(212,175,55,0.07);
  color: #3a1a08;
}

.letter-card::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 2px;
  pointer-events: none;
}

.letter-inner { position: relative; z-index: 1; }

.letter-salutation {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  color: var(--rose-light);
  margin-bottom: 1.2rem;
}

.letter-body {
  font-family: var(--ff-serif);
  font-size: 1.1rem;
  line-height: 1.9;
  color: #3a1a08;
  min-height: 3em;
}

.letter-body p { margin-bottom: 1em; }

.letter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--rose-light);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.9s step-end infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.letter-closing {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  color: var(--rose-light);
  margin-top: 1.8rem;
  line-height: 1.6;
}

.letter-wax-seal {
  position: absolute;
  bottom: -22px;
  right: 48px;
  width: 54px;
  height: 54px;
  background: radial-gradient(circle at 40% 35%, #c0392b, #7a1235);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gold-light);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  border: 2px solid rgba(212,175,55,0.5);
}

/* ─────────────────────────────────────────────────────────────
   REASONS / FLIP CARDS
───────────────────────────────────────────────────────────── */
#reasons {
  background:
    radial-gradient(ellipse at 0% 50%, rgba(122,18,53,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 50%, rgba(61,0,24,0.5) 0%, transparent 50%),
    var(--rose-deep);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.flip-card {
  perspective: 1000px;
  height: 280px;
  cursor: pointer;
  outline: none;
}

.flip-card:focus-visible .flip-card-inner {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4,0.2,0.2,1);
  border-radius: 12px;
}

.flip-card.flipped .flip-card-inner,
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.flip-card-front {
  background: linear-gradient(145deg, rgba(61,0,24,0.9), rgba(26,0,8,0.95));
  border: 1px solid rgba(212,175,55,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  gap: 0.8rem;
}

.flip-card-front::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212,175,55,0.12);
  border-radius: 8px;
  pointer-events: none;
}

.card-icon { font-size: 2.5rem; }

.flip-card-front h3 {
  font-family: var(--ff-serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.flip-card-back {
  background: linear-gradient(145deg, #7a1235, #3d0018);
  border: 1px solid rgba(212,175,55,0.4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: rotateY(180deg);
}

.flip-card-back p {
  font-family: var(--ff-serif);
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--blush-light);
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────
   PHOTO GALLERY
───────────────────────────────────────────────────────────── */
#gallery {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(61,0,24,0.5) 0%, transparent 55%),
    var(--rose-deep);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.gallery-item--large { grid-column: span 2; grid-row: span 2; }
.gallery-item--wide  { grid-column: span 2; }

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item--large { aspect-ratio: unset; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 0 0 2px var(--gold), 0 16px 40px rgba(0,0,0,0.5);
}


/* ─────────────────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────────────────── */
#footer {
  background: #0d0005;
  text-align: center;
  padding: 5rem 2rem 4rem;
  border-top: 1px solid rgba(212,175,55,0.15);
}

.footer-heart {
  font-size: 2.4rem;
  color: var(--blush);
  animation: heartPulse 2s ease-in-out infinite;
  display: block;
  margin-bottom: 1.5rem;
}

.footer-quote {
  font-family: var(--ff-serif);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-style: italic;
  color: var(--blush-light);
  max-width: 520px;
  margin: 0 auto 0.5rem;
  line-height: 1.6;
}

.footer-attribution {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  opacity: 0.6;
  margin-bottom: 2rem;
}

.footer-date {
  font-family: var(--ff-serif);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.footer-sig {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  color: var(--blush);
  opacity: 0.75;
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  section { padding: 4rem 1.2rem; }

  .letter-card { padding: 2.2rem 1.6rem 3rem; }

  .cards-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .flip-card { height: 240px; }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-item--large {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 4/3;
  }
  .gallery-item--wide { grid-column: span 2; }
}

@media (max-width: 420px) {
  .cards-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item--large,
  .gallery-item--wide { grid-column: span 1; }
}
