/* ===== DESIGN SYSTEM — Premium Overhaul ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=Inter:wght@300;400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  --primary: #E8A0B4;
  --primary-light: #FDE8EF;
  --primary-dark: #C46B88;
  --secondary: #6B1D3A;
  --secondary-light: #8B3A5A;
  --accent: #C9A96E;
  --accent-light: #E2D1A8;
  --bg-cream: #FDF6F0;
  --bg-warm: #FAF0E8;
  --bg-dark: #0F0F1A;
  --bg-dark-lighter: #1A1A2E;
  --text-dark: #2A1F1F;
  --text-light: #FAF0E8;
  --text-muted: #8A7A7A;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(244, 160, 181, 0.2);
  --shadow-sm: 0 2px 8px rgba(107, 29, 58, 0.06);
  --shadow: 0 4px 24px rgba(107, 29, 58, 0.08);
  --shadow-lg: 0 12px 48px rgba(107, 29, 58, 0.12);
  --shadow-glow: 0 0 40px rgba(232, 160, 180, 0.2);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text-dark);
  background: var(--bg-cream);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 2.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(253, 246, 240, 0.7);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid var(--glass-border);
}

.nav.dark-nav {
  background: rgba(15, 15, 26, 0.8);
  border-bottom: 1px solid rgba(232, 160, 180, 0.08);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
}

.nav.dark-nav .nav-logo { color: var(--primary); }

.nav-links {
  display: flex;
  gap: 0.15rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 99px;
  transition: var(--transition);
  opacity: 0.55;
}

.nav-links a:hover, .nav-links a.active {
  opacity: 1;
  background: var(--primary-light);
  color: var(--secondary);
}

.nav.dark-nav .nav-links a { color: var(--text-light); opacity: 0.45; }
.nav.dark-nav .nav-links a:hover, .nav.dark-nav .nav-links a.active {
  opacity: 1;
  background: rgba(232, 160, 180, 0.12);
  color: var(--primary);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--secondary);
  transition: var(--transition);
  border-radius: 2px;
}

.nav.dark-nav .hamburger span { background: var(--primary); }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav { padding: 0 1.25rem; }
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 75%; max-width: 300px;
    height: 100vh;
    background: var(--bg-cream);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 0.5rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
  }
  .nav.dark-nav .nav-links { background: var(--bg-dark); }
  .nav-links.open { right: 0; }
  .nav-links a { font-size: 1rem; padding: 0.75rem 1rem; opacity: 0.8; }
  .mobile-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s; z-index: 999;
  }
  .mobile-overlay.open { opacity: 1; pointer-events: all; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2.2rem;
  border: none;
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(107, 29, 58, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(107, 29, 58, 0.4);
}

.btn-light {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}

.btn-light:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }

/* ===== LAYOUT ===== */
.section { padding: 5rem 2rem; }
.container { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--secondary);
}

.section-subtitle {
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto 3rem;
}

@media (max-width: 768px) {
  .section { padding: 3.5rem 1.25rem; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 160, 180, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(232, 160, 180, 0); }
}

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

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes floatUp {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.12; }
  90% { opacity: 0.12; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Scroll-triggered animations — elements start visible, animate subtly when observed */
.reveal {
  opacity: 1; /* NEVER start invisible */
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.animate {
  animation: fadeInUp 0.7s ease both;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--secondary);
  color: rgba(250,240,232,0.6);
  font-size: 0.85rem;
}

.footer-heart {
  display: inline-block;
  cursor: pointer;
  transition: var(--transition);
  animation: heartPulse 2s infinite;
}

.footer-heart:hover { transform: scale(1.4); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(250,240,232,0.4);
  text-decoration: none;
  font-size: 0.8rem;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--primary); }

/* ===== MUSIC PLAYER ===== */
.music-btn {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--secondary);
  color: white;
  border: none;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.music-btn:hover { transform: scale(1.1); }
.music-btn.playing { animation: musicPulse 1.5s infinite; }

/* Heart burst particles */
.heart-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.1rem;
  animation: heartFloat 2s ease-out forwards;
}

@keyframes heartFloat {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.2) rotate(var(--rot)); }
}

/* Confetti canvas */
.confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Loader */
.loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.loader.hidden { opacity: 0; pointer-events: none; }
.loader-heart { font-size: 2.5rem; animation: heartPulse 1s infinite; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }


/* ============================================
   PAGE 1: HERO / HOME
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-warm) 50%, var(--primary-light) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(232, 160, 180, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(201, 169, 110, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(107, 29, 58, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-hearts {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  opacity: 0.1;
  animation: floatUp linear infinite;
}

.hero-title {
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  line-height: 1.05;
}

.hero-subtitle {
  font-family: 'Cormorant Garamond', 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  font-weight: 400;
}

.hero-cta { position: relative; z-index: 1; }

/* Stats */
.stats-ribbon {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  padding: 3rem 2rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: -3rem 2rem 0;
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.stat { text-align: center; }

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 0.35rem;
  font-weight: 500;
}

@media (max-width: 600px) {
  .stats-ribbon { gap: 1.5rem; padding: 2rem 1.5rem; margin: -2rem 1rem 0; }
  .stat-number { font-size: 1.6rem; }
}

/* Love Letter */
.love-letter {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: 4rem 0 2rem;
}

.love-letter p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.9;
  color: var(--text-dark);
  opacity: 0.8;
}

/* Home Cards */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.home-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-dark);
  border: 1px solid rgba(232, 160, 180, 0.08);
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  opacity: 0;
  transition: var(--transition);
}

.home-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.home-card:hover::before { opacity: 1; }

.home-card-icon { font-size: 2.2rem; margin-bottom: 0.75rem; }

.home-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--secondary);
}

.home-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}


/* ============================================
   PAGE 2: TIMELINE
   ============================================ */

.timeline-wrapper {
  position: relative;
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-light), var(--primary), var(--secondary), var(--primary), var(--primary-light));
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 1.25rem;
  /* VISIBLE by default, animated via JS */
  opacity: 1;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.tl-hidden {
  opacity: 0;
  transform: translateX(-30px);
}

.timeline-item:nth-child(even).tl-hidden {
  transform: translateX(30px);
}

.timeline-item:nth-child(odd) {
  margin-left: 0;
  padding-right: 3rem;
  text-align: right;
}

.timeline-item:nth-child(even) {
  margin-left: 50%;
  padding-left: 3rem;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  top: 2rem;
  width: 14px; height: 14px;
  background: var(--primary);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(232, 160, 180, 0.25), var(--shadow-sm);
  z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-dot { right: -7px; }
.timeline-item:nth-child(even) .timeline-dot { left: -7px; }

.timeline-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 160, 180, 0.06);
  transition: var(--transition);
}

.timeline-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.timeline-date {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.3rem;
}

.timeline-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--secondary);
  margin-bottom: 0.6rem;
}

.timeline-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-dark);
  opacity: 0.75;
  border-left: 2px solid var(--primary-light);
  padding-left: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.timeline-quote .tq-sender {
  display: block;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 0.2rem;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .timeline-line { left: 16px; }
  .timeline-item,
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding: 0.75rem 0.75rem 0.75rem 2.75rem;
    text-align: left;
  }
  .timeline-dot,
  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 9px; right: auto;
  }
  .timeline-item.tl-hidden,
  .timeline-item:nth-child(even).tl-hidden {
    transform: translateX(20px);
  }
}


/* ============================================
   PAGE 3: QUIZ
   ============================================ */

.quiz-container { max-width: 660px; margin: 0 auto; }

.quiz-progress {
  width: 100%;
  height: 5px;
  background: var(--primary-light);
  border-radius: 3px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.quiz-counter {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.quiz-question-card {
  background: white;
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 160, 180, 0.06);
  animation: fadeInUp 0.4s ease;
}

.quiz-question {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--secondary);
  margin-bottom: 1.75rem;
  text-align: center;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-option {
  padding: 0.9rem 1.25rem;
  border: 2px solid rgba(232, 160, 180, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  text-align: left;
  background: white;
  font-family: 'Inter', sans-serif;
}

.quiz-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
}

.quiz-option.correct {
  border-color: #4CAF50;
  background: #E8F5E9;
  transform: none;
}

.quiz-option.wrong {
  border-color: #E57373;
  background: #FFEBEE;
  animation: shake 0.4s ease;
}

.quiz-option.disabled { pointer-events: none; opacity: 0.5; }

.quiz-next { display: none; margin: 1.5rem auto 0; }

.quiz-results {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.5s ease;
}

.quiz-score {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--secondary);
}

.quiz-result-msg {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin: 0.75rem 0 1.5rem;
}

.quiz-result-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-warm) 100%);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 360px;
  margin: 0 auto;
  border: 1px solid var(--primary);
}


/* ============================================
   PAGE 4: UNIVERSE
   ============================================ */

.universe-page {
  background: var(--bg-dark);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.universe-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.universe-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: 80px;
}

.universe-header {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

.universe-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin-bottom: 0.5rem;
}

.universe-instruction {
  font-size: 0.9rem;
  color: rgba(250,240,232,0.4);
  margin-top: 0.5rem;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
}

.universe-counter {
  position: fixed;
  bottom: 2rem; left: 2rem;
  color: rgba(250,240,232,0.4);
  font-size: 0.8rem;
  z-index: 10;
  font-weight: 500;
}

.star {
  position: absolute;
  cursor: pointer;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.4) 40%, transparent 70%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 5;
}

.star:hover {
  transform: scale(1.6) !important;
  filter: brightness(1.3);
}

.star.discovered {
  background: radial-gradient(circle, rgba(232,160,180,0.9) 0%, rgba(232,160,180,0.3) 40%, transparent 70%);
}

.star-card {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(232, 160, 180, 0.15);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  width: 88%;
  z-index: 100;
  animation: fadeInUp 0.35s ease;
  text-align: center;
  color: var(--text-light);
}

.star-card-close {
  position: absolute;
  top: 0.75rem; right: 1rem;
  background: none;
  border: none;
  color: rgba(250,240,232,0.3);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.star-card-close:hover { color: var(--primary); }

.star-card .sender {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.star-card .quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-light);
}

.star-card .star-date {
  font-size: 0.7rem;
  color: rgba(250,240,232,0.3);
  margin-top: 1rem;
}

.star-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(4px);
}


/* ============================================
   PAGE 5: MEMORY CARDS
   ============================================ */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }

.memory-card {
  aspect-ratio: 3/4;
  perspective: 1000px;
  cursor: pointer;
}

.memory-card-inner {
  position: relative;
  width: 100%; height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
  position: absolute;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.card-front {
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.15);
}

.card-front-icon { font-size: 1.8rem; }

.card-front-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
}

.card-back {
  background: white;
  transform: rotateY(180deg);
  flex-direction: column;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--primary-light);
}

.card-back-type {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.card-back-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-dark);
}

.card-back-sender {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.5rem;
  font-weight: 500;
}

.cards-counter {
  text-align: center;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cards-complete {
  text-align: center;
  padding: 2rem;
  animation: fadeInUp 0.5s ease;
  display: none;
}

.cards-complete h2 { font-size: 1.8rem; color: var(--secondary); margin-bottom: 0.5rem; }
.cards-complete p { font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--text-muted); font-size: 1.05rem; }


/* ============================================
   PAGE 6: STORYBOOK
   ============================================ */

.storybook-container {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.story-page {
  display: none;
  animation: fadeIn 0.5s ease;
  background: white;
  border-radius: var(--radius);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  min-height: 420px;
  position: relative;
  border: 1px solid rgba(232, 160, 180, 0.06);
}

.story-page.active { display: block; }

.story-chapter {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--primary-dark);
  margin-bottom: 0.4rem;
}

.story-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--secondary);
  margin-bottom: 1.25rem;
}

.story-text {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-dark);
  margin-bottom: 1.25rem;
  opacity: 0.85;
}

.story-quote-block {
  border-left: 3px solid var(--primary);
  padding: 0.85rem 1.25rem;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
}

.story-quote-block .sq-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--secondary);
  line-height: 1.5;
}

.story-quote-block .sq-sender {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 0.3rem;
  letter-spacing: 0.3px;
}

.story-decoration {
  text-align: center;
  font-size: 1.2rem;
  margin-top: 1rem;
  opacity: 0.25;
  letter-spacing: 8px;
}

.story-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

.story-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  background: none;
  border: 1.5px solid var(--primary);
  border-radius: 99px;
  color: var(--secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.story-nav-btn:hover { background: var(--primary-light); }
.story-nav-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.story-page-indicator { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.story-final-page { text-align: center; padding: 1.5rem 0; }

.story-final-page h2 {
  font-size: 2.2rem;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.story-final-page p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--text-dark);
  max-width: 480px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .story-page { padding: 2rem 1.5rem; }
  .story-title { font-size: 1.35rem; }
}
