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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Lora', Georgia, serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* === Background: deep night -> purple twilight -> dark purple ground === */
.ground-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    to bottom,
    #0a0a2e 0%,
    #1a1a4e 15%,
    #2d1b4e 30%,
    #4a2060 45%,
    #3b1854 60%,
    #2e1245 72%,
    #1f0c33 85%,
    #150826 100%
  );
}

/* Starfield layer 1 — fast blinkers */
.ground-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  bottom: 40%;
  background-image:
    radial-gradient(2.5px 2.5px at 35% 8%, #fff, transparent),
    radial-gradient(2px 2px at 50% 20%, #fff, transparent),
    radial-gradient(2px 2px at 75% 5%, #fff, transparent),
    radial-gradient(2.5px 2.5px at 90% 12%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 15% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 70% 35%, rgba(255,255,255,0.95), transparent),
    radial-gradient(3px 3px at 25% 2%, #fff, transparent),
    radial-gradient(2px 2px at 60% 32%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 42% 14%, #fff, transparent);
  animation: blink1 2s ease-in-out infinite;
}

/* Starfield layer 2 — slow blinkers (offset timing) */
.ground-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  bottom: 40%;
  background-image:
    radial-gradient(2px 2px at 10% 10%, #fff, transparent),
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2.5px 2.5px at 65% 15%, #fff, transparent),
    radial-gradient(2px 2px at 85% 25%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 45% 5%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2.5px 2.5px at 55% 28%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 30% 18%, #fff, transparent),
    radial-gradient(2.5px 2.5px at 80% 8%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 5% 35%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 95% 30%, rgba(255,255,255,0.95), transparent);
  animation: blink2 3.5s ease-in-out 1s infinite;
}

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

@keyframes blink2 {
  0%, 100% { opacity: 1; }
  40% { opacity: 0.3; }
  60% { opacity: 0.3; }
}

/* === Flower bed (accumulates flowers) === */
.flower-bed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50vh;
  z-index: 1;
  pointer-events: none;
}

/* === Petal particles container === */
.petal-container {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

/* === Scroll container === */
.scroll-container {
  position: relative;
  z-index: 2;
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.scroll-container::-webkit-scrollbar {
  width: 0;
}
.scroll-container {
  scrollbar-width: none;
}

/* === Screen sections === */
.screen {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.screen-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: clamp(1rem, 4vw, 3rem);
  max-width: 900px;
  width: 100%;
}

/* === Typography === */
h1, h2 {
  font-family: 'Great Vibes', cursive;
}

.title {
  font-size: clamp(2.5rem, 8vw, 6rem);
  line-height: 1.2;
  text-shadow: 0 0 30px rgba(255, 100, 150, 0.6), 0 2px 10px rgba(0,0,0,0.5);
  margin-bottom: 0.5em;
}

.subtitle {
  font-size: clamp(1rem, 3vw, 1.8rem);
  font-style: italic;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* === Scroll hint === */
.scroll-hint {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.7;
  animation: fadeInUp 1.5s ease-out 1s both;
}

.scroll-hint span {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  animation: bounceArrow 2s ease-in-out infinite;
}

@keyframes bounceArrow {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(8px); }
}

/* === Memory cards === */
.memory-card {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  text-align: left;
}

.memory-card.reverse {
  flex-direction: row-reverse;
  text-align: right;
}

.memory-image {
  flex-shrink: 0;
  width: clamp(150px, 35vw, 320px);
  height: clamp(150px, 35vw, 320px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(255, 100, 150, 0.2);
  border: 3px solid rgba(255,255,255,0.2);
}

.memory-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-text h2 {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  margin-bottom: 0.5em;
  text-shadow: 0 0 20px rgba(255, 100, 150, 0.4), 0 2px 8px rgba(0,0,0,0.5);
}

.memory-text p {
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  line-height: 1.7;
  opacity: 0.9;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* === Screen 5: Final message === */
.final-message {
  font-size: clamp(2.5rem, 7vw, 5rem);
  margin-top: 1.5rem;
  text-shadow: 0 0 40px rgba(255, 100, 150, 0.8), 0 2px 10px rgba(0,0,0,0.5);
}

.final-sub {
  font-size: clamp(1rem, 3vw, 1.6rem);
  font-style: italic;
  margin-top: 0.5rem;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* === Music button === */
.music-btn {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.music-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  transform: scale(1.1);
}

.music-btn svg {
  width: 22px;
  height: 22px;
}

.music-btn .music-icon-off {
  display: none;
}

.music-btn.paused .music-icon {
  display: none;
}

.music-btn.paused .music-icon-off {
  display: block;
}

.music-btn.pulse-hint {
  animation: pulseHint 1.5s ease-in-out infinite;
}

@keyframes pulseHint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 100, 150, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255, 100, 150, 0); }
}

/* === Splash screen === */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a4e, #0a0a2e);
  transition: opacity 0.8s ease-out, visibility 0.8s;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  animation: fadeInUp 1s ease-out;
}

.splash-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(3rem, 10vw, 7rem);
  text-shadow: 0 0 40px rgba(255, 100, 150, 0.6), 0 2px 10px rgba(0,0,0,0.5);
  margin-bottom: 0.3em;
}

.splash-sub {
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  font-style: italic;
  opacity: 0.8;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.splash-btn {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: #fff;
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  border: none;
  padding: 0.8em 2.2em;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 60, 100, 0.4), 0 0 40px rgba(255, 60, 100, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: pulseBtn 2s ease-in-out infinite;
}

.splash-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 30px rgba(255, 60, 100, 0.6), 0 0 60px rgba(255, 60, 100, 0.25);
}

@keyframes pulseBtn {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 60, 100, 0.4), 0 0 40px rgba(255, 60, 100, 0.15); }
  50% { box-shadow: 0 4px 30px rgba(255, 60, 100, 0.6), 0 0 60px rgba(255, 60, 100, 0.3); }
}

/* === Responsive === */
@media (max-width: 768px) {
  .memory-card,
  .memory-card.reverse {
    flex-direction: column;
    text-align: center;
  }

  .memory-image {
    width: clamp(180px, 60vw, 280px);
    height: clamp(180px, 60vw, 280px);
  }

  .screen-content {
    padding: 1.5rem;
  }

  .flower-bed {
    height: 30vh;
  }
}

@media (max-width: 480px) {
  .music-btn {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}
