/* ==========================================================================
   Happy Girlfriend's Day — Design Tokens & Core Styles
   Palette:
     --bg-base: #0b1020
     --bg-sec: #1b1435
     --accent-deep: #31153d
     --pink-soft: #ffb3d9
     --pink-strong: #ff4f93
     --pink-heart: #ff7eb6
     --text-white: #ffffff
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Poppins:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

:root {
  /* Color Palette */
  --bg-base: #0b1020;
  --bg-sec: #1b1435;
  --accent-deep: #31153d;
  --pink-soft: #ffb3d9;
  --pink-strong: #ff4f93;
  --pink-heart: #ff7eb6;
  --text-white: #ffffff;

  /* Transparent Tints & Gradients */
  --bg-gradient: radial-gradient(circle at 50% 20%, #1b1435 0%, #0b1020 70%, #060914 100%);
  --glass-bg: rgba(27, 20, 53, 0.55);
  --glass-border: rgba(255, 179, 217, 0.18);
  --glass-glow: rgba(255, 79, 147, 0.12);
  --text-subtle: rgba(255, 255, 255, 0.82);
  --text-muted: rgba(255, 255, 255, 0.65);

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing & Radii */
  --radius-card: 24px;
  --radius-photo: 14px;
  --radius-button: 9999px;
  --transition-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-white);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-gradient);
  background-attachment: fixed;
  position: relative;
  line-height: 1.7;
  font-size: 1rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.25;
  pointer-events: none;
  animation: orbFloat 20s ease-in-out infinite alternate;
}

.glow-orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-deep);
  top: -10%;
  left: 15%;
}

.glow-orb-2 {
  width: 600px;
  height: 600px;
  background: var(--bg-sec);
  bottom: 10%;
  right: -10%;
  animation-delay: -7s;
}

.glow-orb-3 {
  width: 400px;
  height: 400px;
  background: rgba(255, 79, 147, 0.15);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.1); }
  100% { transform: translate(-30px, 20px) scale(0.95); }
}

/* Ambient Floating Hearts Layer */
#ambient-hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.ambient-heart {
  position: absolute;
  color: var(--pink-heart);
  opacity: 0.25;
  pointer-events: none;
  will-change: transform, opacity;
  animation: floatHeart 12s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255, 126, 182, 0.4));
}

@keyframes floatHeart {
  0% {
    transform: translateY(105vh) scale(0.6) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.35;
  }
  85% {
    opacity: 0.25;
  }
  100% {
    transform: translateY(-10vh) scale(1.1) rotate(25deg);
    opacity: 0;
  }
}

/* Page Layout Structure */
.page-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   SECTION 1: HERO / OPENING
   ========================================================================== */

.hero-section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 4rem 1rem 6rem;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 5;
  max-width: 850px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--pink-soft);
  margin-bottom: 1.25rem;
  font-weight: 500;
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  line-height: 1.15;
  color: var(--text-white);
  text-shadow: 0 0 30px rgba(255, 79, 147, 0.35);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: clamp(1.15rem, 2.8vw, 1.75rem);
  font-weight: 300;
  color: var(--text-subtle);
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}

.hero-subtitle strong {
  font-weight: 600;
  color: var(--pink-soft);
}

/* Scroll Cue */
.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.3s ease;
  z-index: 5;
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
  color: var(--pink-soft);
  outline: none;
}

.scroll-icon {
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  position: relative;
  display: flex;
  justify-content: center;
}

.scroll-dot {
  width: 4px;
  height: 8px;
  background: var(--pink-soft);
  border-radius: 4px;
  margin-top: 6px;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(12px); opacity: 0.2; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   SECTION 2: MEMORY WALL + LOVE LETTER
   ========================================================================== */

.memory-letter-section {
  position: relative;
  padding: 6rem 0 8rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.scattered-composition {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Photo Card Styles (Compact & Refined) */
.photo-card {
  position: absolute;
  z-index: 3;
  border-radius: var(--radius-photo);
  overflow: hidden;
  background: rgba(27, 20, 53, 0.75);
  padding: 6px 6px 9px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 16px var(--glass-glow);
  transition: transform 0.4s var(--transition-smooth), box-shadow 0.4s var(--transition-smooth), border-color 0.3s ease;
  cursor: pointer;
  outline: none;
}

.photo-card:hover {
  transform: translateY(-8px) rotate(0deg) scale(1.04) !important;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 79, 147, 0.28);
  border-color: rgba(255, 179, 217, 0.45);
  z-index: 10;
}

.photo-card:focus-visible {
  outline: 3px solid var(--pink-strong);
  outline-offset: 4px;
  z-index: 12;
}

.photo-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-photo) - 3px);
  overflow: hidden;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--transition-smooth);
}

.photo-card:hover img {
  transform: scale(1.05);
}

.photo-caption {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.08em;
  font-weight: 500;
  text-transform: uppercase;
}

/* Scattered Positions for 12 Compact Desktop Cards (>= 1200px) */
.scatter-1  { width: 170px; height: 235px; top: -50px; left: 1%;   transform: rotate(-5deg); }
.scatter-2  { width: 175px; height: 240px; top: -40px; right: 1%;  transform: rotate(6deg); }
.scatter-3  { width: 165px; height: 230px; top: 125px; left: -25px; transform: rotate(4deg); }
.scatter-4  { width: 170px; height: 235px; top: 135px; right: -25px; transform: rotate(-6deg); }
.scatter-5  { width: 175px; height: 240px; top: 310px; left: -45px; transform: rotate(-4deg); }
.scatter-6  { width: 165px; height: 230px; top: 320px; right: -45px; transform: rotate(5deg); }
.scatter-7  { width: 170px; height: 235px; top: 495px; left: -25px; transform: rotate(3deg); }
.scatter-8  { width: 175px; height: 240px; top: 505px; right: -25px; transform: rotate(-4deg); }
.scatter-9  { width: 165px; height: 230px; top: 680px; left: 0%;   transform: rotate(-5deg); }
.scatter-10 { width: 170px; height: 235px; top: 690px; right: 0%;  transform: rotate(6deg); }
.scatter-11 { width: 175px; height: 240px; bottom: -50px; left: 6%; transform: rotate(4deg); }
.scatter-12 { width: 170px; height: 235px; bottom: -40px; right: 6%; transform: rotate(-3deg); }

/* Love Letter Card Styling */
.love-letter-card {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 720px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: clamp(2rem, 5vw, 4rem);
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 40px rgba(255, 79, 147, 0.08);
  margin: 0 auto;
}

.letter-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 179, 217, 0.15);
  padding-bottom: 1.5rem;
}

.letter-salutation {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  color: var(--pink-soft);
  line-height: 1.2;
}

.letter-body {
  font-size: clamp(1.02rem, 1.8vw, 1.15rem);
  color: var(--text-white);
  line-height: 1.85;
  font-weight: 300;
  letter-spacing: 0.015em;
}

.letter-body p {
  margin-bottom: 1.5rem;
}

.letter-body p:last-child {
  margin-bottom: 0;
}

.letter-signature-block {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.letter-closing-phrase {
  font-size: 1rem;
  color: var(--text-subtle);
  font-style: italic;
  margin-bottom: 0.25rem;
}

.letter-signature-interactive {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--pink-soft);
  cursor: pointer;
  user-select: none;
  transition: transform 0.3s ease, color 0.3s ease;
  display: inline-block;
  position: relative;
}

.letter-signature-interactive:hover {
  transform: scale(1.05) rotate(-1deg);
  color: var(--pink-strong);
  text-shadow: 0 0 15px rgba(255, 79, 147, 0.5);
}

/* Burst Heart Styling for Signature Easter Egg */
.burst-heart {
  position: fixed;
  color: var(--pink-heart);
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 999;
  animation: burstUp 1.2s ease-out forwards;
}

@keyframes burstUp {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.6) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.4) rotate(var(--dr));
  }
}

/* ==========================================================================
   SECTION 3: SONG / CLOSING
   ========================================================================== */

.song-closing-section {
  position: relative;
  z-index: 5;
  padding: 6rem 1rem 8rem;
  text-align: center;
}

.song-closing-card {
  max-width: 680px;
  margin: 0 auto;
  background: rgba(27, 20, 53, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 179, 217, 0.12);
  border-radius: var(--radius-card);
  padding: 3.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.song-section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--pink-soft);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.song-track-name {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  color: var(--text-white);
  margin-bottom: 2rem;
  line-height: 1.2;
}

/* Refined "Play Our Song" Circular Action Button */
.play-song-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--pink-strong) 0%, #d83b7b 100%);
  color: var(--text-white);
  text-decoration: none;
  padding: 14px 32px;
  border-radius: var(--radius-button);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 25px rgba(255, 79, 147, 0.4);
  transition: transform 0.3s var(--transition-smooth), box-shadow 0.3s var(--transition-smooth), background 0.3s ease;
  min-height: 48px;
  min-width: 44px;
}

.play-song-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 15px 35px rgba(255, 79, 147, 0.6);
  background: linear-gradient(135deg, #ff6ba6 0%, var(--pink-strong) 100%);
}

.play-song-btn:focus-visible {
  outline: 3px solid var(--pink-soft);
  outline-offset: 4px;
}

.play-icon-svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Divider & Summer 2027 Message */
.closing-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pink-soft), transparent);
  margin: 3rem 0;
}

.countdown-message {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: var(--text-subtle);
  font-weight: 300;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.countdown-subtext {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--pink-soft);
  font-weight: 500;
}

/* Page Footer */
.site-footer {
  text-align: center;
  padding: 3rem 1rem 4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 5;
}

/* ==========================================================================
   INTERACTIVE LIGHTBOX MODAL
   ========================================================================== */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 32, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 1.5rem;
}

.lightbox-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-photo);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 179, 217, 0.15);
  border: 1px solid var(--glass-border);
}

.lightbox-img-wrapper img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}

.lightbox-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

.lightbox-btn {
  background: rgba(27, 20, 53, 0.7);
  border: 1px solid var(--glass-border);
  color: var(--text-white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.lightbox-btn:hover {
  background: var(--pink-strong);
  border-color: var(--pink-soft);
  transform: scale(1.1);
}

.lightbox-btn:focus-visible {
  outline: 3px solid var(--pink-soft);
  outline-offset: 3px;
}

.lightbox-close-btn {
  position: absolute;
  top: -55px;
  right: 0;
}

.lightbox-nav-prev {
  position: absolute;
  left: -70px;
}

.lightbox-nav-next {
  position: absolute;
  right: -70px;
}

.lightbox-counter {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-subtle);
  letter-spacing: 0.15em;
  font-weight: 500;
  background: rgba(27, 20, 53, 0.6);
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* TABLET (768px – 1199px) */
@media (max-width: 1199px) {
  .scatter-1  { width: 145px; height: 210px; left: -10px; top: -30px; }
  .scatter-2  { width: 150px; height: 215px; right: -10px; top: -20px; }
  .scatter-3  { width: 140px; height: 200px; left: -20px; top: 18%; }
  .scatter-4  { width: 145px; height: 205px; right: -20px; top: 20%; }
  .scatter-5  { width: 150px; height: 210px; left: -30px; top: 38%; }
  .scatter-6  { width: 140px; height: 200px; right: -30px; top: 40%; }
  .scatter-7  { width: 145px; height: 205px; left: -20px; top: 58%; }
  .scatter-8  { width: 150px; height: 210px; right: -20px; top: 60%; }
  .scatter-9  { width: 140px; height: 200px; left: -10px; top: 78%; }
  .scatter-10 { width: 145px; height: 205px; right: -10px; top: 80%; }
  .scatter-11 { width: 150px; height: 210px; left: 0px; bottom: -30px; }
  .scatter-12 { width: 145px; height: 205px; right: 0px; bottom: -25px; }

  .love-letter-card {
    max-width: 620px;
  }

  .lightbox-nav-prev { left: -10px; }
  .lightbox-nav-next { right: -10px; }
}

/* MOBILE (< 768px)
   Compact 2-column organic staggered collage */
@media (max-width: 767px) {
  .hero-section {
    padding: 4rem 1rem 3rem;
    min-height: 70vh;
  }

  .memory-letter-section {
    padding: 1.5rem 0 4rem;
  }

  .scattered-composition {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    align-items: start;
  }

  .love-letter-card {
    grid-column: 1 / -1;
    position: relative;
    max-width: 100%;
    margin: 1rem 0;
    padding: 2rem 1.25rem;
  }

  .photo-card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3 / 4;
    padding: 5px 5px 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  }

  /* Staggered organic offsets & gentle rotations on mobile */
  .scatter-1  { transform: translateY(0) rotate(-2deg) !important; }
  .scatter-2  { transform: translateY(12px) rotate(2deg) !important; }
  .scatter-3  { transform: translateY(0) rotate(-1.5deg) !important; }
  .scatter-4  { transform: translateY(10px) rotate(2.2deg) !important; }
  .scatter-5  { transform: translateY(0) rotate(-2deg) !important; }
  .scatter-6  { transform: translateY(12px) rotate(1.8deg) !important; }
  .scatter-7  { transform: translateY(0) rotate(-1.8deg) !important; }
  .scatter-8  { transform: translateY(10px) rotate(2deg) !important; }
  .scatter-9  { transform: translateY(0) rotate(-2.2deg) !important; }
  .scatter-10 { transform: translateY(12px) rotate(1.5deg) !important; }
  .scatter-11 { transform: translateY(0) rotate(-1.5deg) !important; }
  .scatter-12 { transform: translateY(10px) rotate(2.2deg) !important; }

  .lightbox-nav-prev { left: 10px; }
  .lightbox-nav-next { right: 10px; }
  .lightbox-close-btn { top: -45px; right: 10px; }
  .lightbox-container { max-width: 95vw; }
}

/* VERY SMALL MOBILE (< 400px) */
@media (max-width: 400px) {
  .scattered-composition {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .photo-card {
    padding: 4px 4px 6px;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .play-song-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   REDUCED MOTION ACCESSIBILITY OVERRIDES
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ambient-heart, .glow-orb {
    animation: none !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }

  .photo-card {
    transform: none !important;
  }
}
