:root {
  --cream: #fdf6ec;
  --warm-pink: #e8868b;
  --dusty-rose: #d4a0a0;
  --deep-rose: #b5465a;
  --kraft: #c4a882;
  --brown-ink: #5c3d2e;
  --soft-gold: #dab06e;
  --blush: #f5ddd5;
  --tape: rgba(255, 235, 180, 0.65);
  --shadow: rgba(92, 61, 46, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--cream);
  color: var(--brown-ink);
  font-family: 'Karla', sans-serif;
  overflow-x: hidden;
  cursor: default;
}

/* ============ PAPER TEXTURE OVERLAY ============ */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 50px,
      rgba(196, 168, 130, 0.03) 50px,
      rgba(196, 168, 130, 0.03) 51px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 50px,
      rgba(196, 168, 130, 0.03) 50px,
      rgba(196, 168, 130, 0.03) 51px
    );
  pointer-events: none;
  z-index: 9999;
}

/* ============ FLOATING DOODLE HEARTS ============ */
.doodle-hearts {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.doodle-heart {
  position: absolute;
  opacity: 0;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% { transform: translateY(100vh) rotate(0deg) scale(0.5); opacity: 0; }
  10% { opacity: 0.15; }
  90% { opacity: 0.15; }
  100% { transform: translateY(-100px) rotate(360deg) scale(1); opacity: 0; }
}

/* ============ HERO SECTION ============ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 2rem;
}

.hero-envelope {
  width: 120px;
  height: 90px;
  margin-bottom: 2rem;
  animation: gentleBounce 3s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.hero-envelope:hover {
  transform: scale(1.1) rotate(-3deg);
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero h1 {
  font-family: 'Caveat', cursive;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  color: var(--deep-rose);
  line-height: 1.1;
  margin-bottom: 0.5rem;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero h1 .heart-inline {
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
  color: var(--warm-pink);
}

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

.hero .subtitle {
  font-family: 'Gaegu', cursive;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--dusty-rose);
  font-weight: 400;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero .date-badge {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--blush);
  border-radius: 50px;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--deep-rose);
  border: 2px dashed var(--dusty-rose);
  animation: fadeInUp 1s ease-out 0.9s both;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  animation: fadeInUp 1s ease-out 1.5s both, bob 2s ease-in-out infinite;
  font-family: 'Gaegu', cursive;
  font-size: 1.1rem;
  color: var(--dusty-rose);
}

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

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

/* ============ SECTION BASE ============ */
section {
  position: relative;
  z-index: 1;
  padding: 5rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--deep-rose);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--warm-pink), transparent);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* ============ LOVE LETTER ============ */
.love-letter {
  background: white;
  border-radius: 2px;
  padding: 3rem 2.5rem;
  max-width: 640px;
  margin: 0 auto 3rem;
  box-shadow:
    0 1px 3px var(--shadow),
    0 8px 24px var(--shadow);
  position: relative;
  transform: rotate(-0.5deg);
}

.love-letter::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 22px;
  background: var(--tape);
  border-radius: 2px;
  border: 1px solid rgba(218, 176, 110, 0.2);
}

.love-letter p {
  font-family: 'Gaegu', cursive;
  font-size: 1.35rem;
  line-height: 1.8;
  color: var(--brown-ink);
  margin-bottom: 1rem;
}

.love-letter .signature {
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  color: var(--deep-rose);
  text-align: right;
  margin-top: 1.5rem;
}

/* ============ REASONS I LOVE YOU ============ */
.reasons-section {
  background: linear-gradient(180deg, transparent, var(--blush) 10%, var(--blush) 90%, transparent);
  max-width: 100%;
  padding: 5rem 1.5rem;
}

.reasons-section .section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.reason-card {
  background: white;
  padding: 1.8rem 1.5rem;
  border-radius: 3px;
  box-shadow: 0 2px 12px var(--shadow);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.reason-card.visible {
  animation: cardAppear 0.6s ease-out forwards;
}

@keyframes cardAppear {
  to { opacity: 1; transform: translateY(0) rotate(var(--rotate)); }
}

.reason-card:nth-child(1) { --rotate: -1.2deg; }
.reason-card:nth-child(2) { --rotate: 0.8deg; }
.reason-card:nth-child(3) { --rotate: -0.5deg; }
.reason-card:nth-child(4) { --rotate: 1.5deg; }
.reason-card:nth-child(5) { --rotate: -0.8deg; }

.reason-card:hover {
  transform: translateY(-4px) rotate(0deg) !important;
  box-shadow: 0 6px 24px rgba(181, 70, 90, 0.12);
}

.reason-card::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 20px;
  width: 50px;
  height: 18px;
  background: var(--tape);
  border-radius: 2px;
  border: 1px solid rgba(218, 176, 110, 0.2);
  transform: rotate(3deg);
}

.reason-number {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: 2.5rem;
  color: var(--blush);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.reason-text {
  font-family: 'Gaegu', cursive;
  font-size: 1.3rem;
  color: var(--brown-ink);
  line-height: 1.5;
}

/* ============ PHOTO GALLERY ============ */
.gallery-section {
  padding: 5rem 0;
}

.gallery-section .section-title {
  padding: 0 1.5rem;
}

.gallery-scroll {
  display: flex;
  overflow-x: auto;
  gap: 1.5rem;
  padding: 2rem 2rem 3rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-scroll::-webkit-scrollbar {
  display: none;
}

.polaroid {
  flex: 0 0 auto;
  width: 280px;
  background: white;
  padding: 12px 12px 50px;
  box-shadow:
    0 2px 8px var(--shadow),
    0 12px 32px var(--shadow);
  scroll-snap-align: center;
  transition: transform 0.4s ease;
  position: relative;
}

.polaroid:hover {
  transform: scale(1.03) rotate(0deg) !important;
}

.polaroid:nth-child(odd) { transform: rotate(-2deg); }
.polaroid:nth-child(even) { transform: rotate(1.5deg); }
.polaroid:nth-child(3n) { transform: rotate(-1deg); }

.polaroid img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.02);
}

.polaroid .caption {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--brown-ink);
  text-align: center;
  position: absolute;
  bottom: 14px;
  left: 12px;
  right: 12px;
}

.gallery-hint {
  text-align: center;
  font-family: 'Gaegu', cursive;
  color: var(--dusty-rose);
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* ============ SONG SECTION ============ */
.song-section {
  text-align: center;
  padding: 4rem 1.5rem 5rem;
}

.record-player {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #2c2c2c 0deg, #3a3a3a 30deg,
    #2c2c2c 60deg, #3a3a3a 90deg,
    #2c2c2c 120deg, #3a3a3a 150deg,
    #2c2c2c 180deg, #3a3a3a 210deg,
    #2c2c2c 240deg, #3a3a3a 270deg,
    #2c2c2c 300deg, #3a3a3a 330deg,
    #2c2c2c 360deg
  );
  margin: 0 auto 1rem;
  position: relative;
  animation: spin 4s linear infinite;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.record-player::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--deep-rose);
  border: 3px solid var(--warm-pink);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.song-title {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--deep-rose);
  margin-bottom: 0.3rem;
}

.song-artist {
  font-family: 'Karla', sans-serif;
  font-size: 0.95rem;
  color: var(--dusty-rose);
  margin-bottom: 2rem;
}

.youtube-embed {
  max-width: 460px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.youtube-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

/* ============ ENTRANCE ENVELOPE (full-page) ============ */
.youtube-embed {
  position: relative;
}

.youtube-embed #song-video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.youtube-embed #song-video-player iframe {
  border-radius: 12px;
}

.video-envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  cursor: pointer;
  transition: opacity 0.5s ease, pointer-events 0s;
}

.video-envelope-overlay.opening {
  pointer-events: none;
}

.video-envelope-overlay.opening .envelope-flap {
  transform: rotateX(-180deg);
  transition: transform 0.6s ease;
}

.video-envelope-overlay.opening .envelope-text,
.video-envelope-overlay.opening .envelope-body {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-envelope-overlay.opened {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.envelope-wrapper {
  position: relative;
  width: 240px;
  height: 168px;
  animation: envelopeFloat 2.5s ease-in-out infinite;
  perspective: 400px;
}

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

.envelope-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: white;
  border: 2.5px solid var(--deep-rose);
  border-radius: 2px 2px 4px 4px;
  box-shadow: 0 4px 20px var(--shadow);
  transition: opacity 0.3s ease;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: -2px;
  right: -2px;
  height: 84px;
  background: linear-gradient(180deg, #fafafa 0%, white 100%);
  border: 2.5px solid var(--deep-rose);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  transform-origin: top center;
  transition: transform 0.6s ease;
  box-shadow: 0 -2px 8px var(--shadow);
  backface-visibility: visible;
}

.envelope-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Caveat', cursive;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--deep-rose);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.video-envelope-overlay:hover .envelope-wrapper {
  animation: none;
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* ============ OUR STORY TIMELINE ============ */
.story-section {
  padding: 5rem 1.5rem;
}

.timeline {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--warm-pink), var(--dusty-rose), var(--soft-gold));
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateX(-10px);
}

.timeline-item.visible {
  animation: slideIn 0.5s ease-out forwards;
}

@keyframes slideIn {
  to { opacity: 1; transform: translateX(0); }
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--warm-pink);
  border: 3px solid var(--cream);
  box-shadow: 0 0 0 2px var(--dusty-rose);
}

.timeline-date {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--warm-pink);
  font-weight: 700;
}

.timeline-text {
  font-family: 'Gaegu', cursive;
  font-size: 1.2rem;
  color: var(--brown-ink);
  line-height: 1.5;
}

/* ============ DOGS SECTION ============ */
.dogs-note {
  text-align: center;
  padding: 2rem 1.5rem 4rem;
  font-family: 'Gaegu', cursive;
  font-size: 1.3rem;
  color: var(--brown-ink);
}

.dogs-note .paw {
  display: inline-block;
  font-size: 1.5rem;
  animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

/* ============ FOOTER ============ */
.footer {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  background: linear-gradient(to bottom, transparent, var(--blush));
}

.footer .big-heart {
  font-size: 4rem;
  animation: heartbeat 1.5s ease-in-out infinite;
  display: inline-block;
  margin-bottom: 1rem;
}

.footer p {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: var(--deep-rose);
  margin-bottom: 0.5rem;
}

.footer .small {
  font-family: 'Karla', sans-serif;
  font-size: 0.8rem;
  color: var(--dusty-rose);
  margin-top: 2rem;
}

.footer .kissed-first {
  font-family: 'Gaegu', cursive;
  font-size: 1rem;
  color: var(--dusty-rose);
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* ============ GALLERY LOADING STATE ============ */
.gallery-loading {
  text-align: center;
  padding: 3rem;
  font-family: 'Gaegu', cursive;
  font-size: 1.2rem;
  color: var(--dusty-rose);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 600px) {
  .love-letter {
    padding: 2rem 1.5rem;
    transform: rotate(0deg);
  }

  .reasons-grid {
    grid-template-columns: 1fr;
  }

  .polaroid {
    width: 240px;
  }

  .polaroid img {
    height: 280px;
  }

  section {
    padding: 3rem 1rem;
  }
}

/* ============ CUSTOM CURSOR HEART ON CLICK ============ */
.click-heart {
  position: fixed;
  pointer-events: none;
  font-size: 1.5rem;
  z-index: 10000;
  animation: clickPop 0.8s ease-out forwards;
}

@keyframes clickPop {
  0% { transform: scale(0) translateY(0); opacity: 1; }
  50% { transform: scale(1.2) translateY(-20px); opacity: 0.8; }
  100% { transform: scale(0.8) translateY(-60px); opacity: 0; }
}
