/* =============================================
   BIRTHDAY WEBSITE — style.css
   Dreamy Blue-Purple · Late-Night Love Letter
   ============================================= */

/* --- CSS VARIABLES --- */
:root {
  --night:       #0d0b1e;
  --deep:        #13103a;
  --mid:         #1c1852;
  --lavender:    #CDB4FF;
  --periwinkle:  #B8C0FF;
  --sky:         #BDE0FE;
  --blue-soft:   #A2D2FF;
  --violet:      #9381FF;
  --lilac:       #E0BBE4;
  --white-soft:  rgba(255,255,255,0.92);
  --white-dim:   rgba(255,255,255,0.55);
  --white-ghost: rgba(255,255,255,0.2);

  --glow-blue:   rgba(163, 210, 255, 0.18);
  --glow-purple: rgba(147, 129, 255, 0.22);

  --text-main:   #e8e0ff;
  --text-mid:    #b8b0d8;
  --text-dim:    rgba(200,195,230,0.6);

  --radius:      28px;
  --font-body:   'Nunito', sans-serif;
  --font-serif:  'Playfair Display', serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--night);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Stars canvas sits behind everything */
#stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

main, #intro-overlay {
  position: relative;
  z-index: 1;
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

.hidden { display: none !important; }

.hidden-msg {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.9s ease, max-height 0.9s ease;
  pointer-events: none;
}
.hidden-msg.revealed {
  opacity: 1;
  max-height: 600px;
  pointer-events: auto;
}

/* =============================================
   INTRO OVERLAY
   ============================================= */

#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(ellipse at center,
    #1e1660 0%,
    #0d0b2e 55%,
    #070614 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 1s ease, visibility 1s ease;
}

#intro-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.intro-content {
  text-align: center;
  animation: gentleBob 3s ease-in-out infinite;
}

.intro-gif {
  width: clamp(140px, 35vw, 200px);
  height: auto;
  border-radius: 50%;
  border: 2px solid rgba(205, 180, 255, 0.3);
  box-shadow:
    0 0 40px rgba(147, 129, 255, 0.35),
    0 0 80px rgba(163, 210, 255, 0.15);
  margin-bottom: 1.6rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.intro-text {
  font-weight: 300;
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  color: var(--text-mid);
  letter-spacing: 0.18em;
  text-transform: lowercase;
  margin-bottom: 0.6rem;
}

.intro-heart {
  font-size: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
  display: inline-block;
  filter: drop-shadow(0 0 8px rgba(163,210,255,0.6));
}

/* =============================================
   HERO SECTION
   ============================================= */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(147,129,255,0.15) 0%,
    rgba(163,210,255,0.08) 45%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-img-wrap {
  margin-bottom: 2.8rem;
}

.hero-gif {
  width: clamp(160px, 40vw, 220px);
  height: auto;
  border-radius: 50%;
  border: 2px solid rgba(205,180,255,0.25);
  box-shadow:
    0 0 50px rgba(147,129,255,0.3),
    0 0 100px rgba(163,210,255,0.12),
    0 8px 32px rgba(0,0,0,0.4);
  animation: floatGif 5s ease-in-out infinite;
}

.hero-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1.25;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #e8e0ff 0%, var(--lavender) 50%, var(--sky) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(205,180,255,0.4));
}

.hero-subtitle {
  font-weight: 300;
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  color: var(--text-mid);
  line-height: 2;
  letter-spacing: 0.07em;
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  font-size: 1.1rem;
  color: var(--text-dim);
  animation: scrollBob 2.5s ease-in-out infinite;
}

/* =============================================
   MEMORY SECTIONS
   ============================================= */

.memory {
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}


/* Alternating subtle accent color on left edge */
.memory::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom,
    transparent,
    var(--violet),
    transparent
  );
  opacity: 0.4;
}

.memory--right::after {
  left: auto;
  right: 0;
}

.memory-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

/* On wide screens: alternate side layout */
@media (min-width: 640px) {
  .memory-inner {
    flex-direction: row;
    text-align: left;
  }
  .memory-inner--reverse {
    flex-direction: row-reverse;
    text-align: right;
  }
}

.memory-gif {
  width: clamp(120px, 28vw, 170px);
  height: auto;
  border-radius: 50%;
  border: 2px solid rgba(205,180,255,0.2);
  box-shadow:
    0 0 30px rgba(147,129,255,0.25),
    0 4px 20px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.memory-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 3vw, 1.5rem);
  color: var(--text-main);
  line-height: 1.6;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.memory-text.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   INTERACTIVE SECTIONS
   ============================================= */

.interact-section {
  padding: 5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
  text-align: center;
  background: linear-gradient(180deg,
    rgba(28, 24, 82, 0.9) 0%,
    rgba(13, 11, 30, 0.95) 100%
  );
  position: relative;
}

.interact-section--sad {
  background: linear-gradient(180deg,
    rgba(13, 11, 30, 1) 0%,
    rgba(13, 11, 30, 1) 100%
  );
}

.interact-label {
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: lowercase;
}

/* Shared button base */
.soft-btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--night);
  background: linear-gradient(135deg, var(--sky) 0%, var(--lavender) 100%);
  border: none;
  border-radius: 50px;
  padding: 0.9rem 2.6rem;
  cursor: pointer;
  box-shadow:
    0 4px 24px rgba(147,129,255,0.35),
    0 0 0 1px rgba(205,180,255,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.soft-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    0 8px 36px rgba(147,129,255,0.5),
    0 0 0 1px rgba(205,180,255,0.3),
    0 0 60px rgba(163,210,255,0.15);
}

.soft-btn:active {
  transform: translateY(0) scale(0.97);
}

.soft-btn--purple {
  background: linear-gradient(135deg, var(--lavender) 0%, var(--lilac) 100%);
}

/* Sad message card */
.sad-message {
  max-width: 360px;
  background: linear-gradient(145deg,
    rgba(30, 24, 80, 0.95),
    rgba(20, 16, 60, 0.98)
  );
  border: 1px solid rgba(205,180,255,0.15);
  border-radius: var(--radius);
  padding: 2.4rem 2.2rem;
  box-shadow:
    0 8px 40px rgba(147,129,255,0.2),
    inset 0 1px 0 rgba(255,255,255,0.05);
  text-align: center;
}

.sad-gif {
  width: 100px;
  height: auto;
  border-radius: 50%;
  border: 1px solid rgba(205,180,255,0.2);
  margin-bottom: 1.4rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.sad-message p {
  font-size: 0.92rem;
  color: var(--text-mid);
  line-height: 1.9;
  margin-bottom: 0.5rem;
}

.sad-closing {
  font-weight: 600 !important;
  color: var(--lavender) !important;
  filter: drop-shadow(0 0 8px rgba(205,180,255,0.4));
}

/* =============================================
   FINAL SECTION
   ============================================= */

.final-section {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at center,
    rgba(30,22,96,0.7) 0%,
    rgba(13,11,30,1) 70%
  );
  gap: 1.8rem;
}

.final-glow {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(205,180,255,0.12) 0%,
    rgba(163,210,255,0.06) 50%,
    transparent 70%
  );
  pointer-events: none;
}

.final-gif {
  width: clamp(160px, 38vw, 210px);
  height: auto;
  border-radius: 50%;
  border: 2px solid rgba(205,180,255,0.25);
  box-shadow:
    0 0 60px rgba(147,129,255,0.35),
    0 0 120px rgba(163,210,255,0.12),
    0 8px 40px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}

.final-message {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2rem, 6.5vw, 3.2rem);
  background: linear-gradient(135deg, #e8e0ff, var(--lavender), var(--sky));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(205,180,255,0.4));
  position: relative;
  z-index: 1;
}

.final-sub {
  font-weight: 300;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.final-hearts {
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  animation: pulse 2.5s ease-in-out infinite;
  display: inline-block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 10px rgba(163,210,255,0.5));
}

/* =============================================
   FLOATING HEARTS
   ============================================= */

#hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  animation: floatHeartUp 2.8s ease-out forwards;
  will-change: transform, opacity;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(163,210,255,0.7));
}

/* =============================================
   ANIMATIONS
   ============================================= */

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

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

@keyframes floatGif {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-14px) scale(1.01); }
}

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

@keyframes scrollBob {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50%       { opacity: 0.7; transform: translateY(10px); }
}

@keyframes floatHeartUp {
  0%   { transform: translateY(0) scale(0.4) rotate(-5deg); opacity: 0; }
  12%  { opacity: 1; transform: translateY(-30px) scale(1) rotate(5deg); }
  80%  { opacity: 0.8; }
  100% { transform: translateY(-260px) scale(0.7) rotate(15deg); opacity: 0; }
}

/* Float variants */
.float-gentle { animation: floatGif 5s ease-in-out infinite; }
.float-slow   { animation: gentleBob 5s ease-in-out infinite; }
.float-medium { animation: gentleBob 3.8s ease-in-out infinite; }

/* Main content fade-in */
#main-content.visible {
  display: block !important;
  animation: fadeInUp 1s ease forwards;
}

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

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1.2rem 5rem; }
  .memory { padding: 3.5rem 1.4rem; }
  .interact-section { padding: 4rem 1.4rem; }
  .final-section { padding: 4.5rem 1.4rem; }
  .sad-message { padding: 1.8rem 1.6rem; }

  .memory-inner,
  .memory-inner--reverse {
    flex-direction: column !important;
    text-align: center !important;
  }
}
