/* ==========================================================================
   🌸 ULTRA-BESPOKE 3D BIRTHDAY ODYSSEY FOR REET
   Design System & Tactile Luxury Tokens
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Caveat:wght@400;600;700&family=Sacramento&family=Dancing+Script:wght@500;700&display=swap');

:root {
  /* Canvas & Atmosphere */
  --bg-primary:         #FFF0F3; /* Soft cotton-candy pink canvas */
  --bg-secondary:       #FFE3E8; /* Slightly deeper romantic blush */
  --card-glass-bg:      rgba(255, 255, 255, 0.84); /* Frosted glass with pink tint */
  --card-glass-border:  rgba(255, 182, 193, 0.55); /* Soft rose-gold & pink hairline border */
  --card-parchment:     rgba(255, 255, 255, 0.88);
  --bg-cream-cotton:    #FFF0F3;
  --bg-golden-warmth:   #FFE3E8;
  --baby-pink:          #FFE5EC;
  --soft-cloud-pink:    #FFE5EC;
  
  /* Romantic Reds & Deep Pinks */
  --valentine-red:      #E63946; /* Vibrant classic Valentine red for primary buttons & seals */
  --cherry-rose:        #D62839; /* Deep romantic cherry accent */
  --sweetheart-pink:    #FF758F; /* Playful strawberry pink for badges and highlights */
  --soft-blush:         #FFB3C1; /* Glow shadows, progress track, subtle badges */
  --petal-pink:         #FFCCD5; /* Accent cards and tags */
  --crimson-rose:       #E63946;
  --crimson-heart:      #E63946;
  --warm-blush:         #FF758F;
  --macaron-lavender:   #FFE5EC;
  
  /* Ink & Typography */
  --romantic-charcoal:  #3D1E24; /* Deep velvet-berry ink (much softer & warmer than black) */
  --ink-charcoal:       #3D1E24;
  --sepia-ink:          #3D1E24;
  --sepia-subtext:      #7A4B54; /* Warm berry-tinted secondary text */
  --sepia-dust:         #7A4B54;
  
  /* Shimmer & Accents */
  --rose-gold-foil:     #E8A598; /* Shimmer borders & metallic accents */
  --lily-white:         #FFFFFF; /* Pure crisp white for white lily accents & highlights */
  --lily-petal-white:   #FFF8FA;
  --lily-leaf-sage:     #8DA382;
  --warm-gold:          #E8A598;
  --liquid-gold:        #E8A598;
  --gold-glow:          rgba(232, 165, 152, 0.45);
  --heart-glow:         rgba(230, 57, 70, 0.35); /* Glowing heart drop-shadow */
  
  /* Nighttime / Sanctuary */
  --twilight-plum:      #2B131D; /* Deep velvety burgundy/plum */
  --twilight-card:      #3D1B2A;
  --twilight-text:      #FFE3E8;

  /* Typography Stacks */
  --font-serif:         'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-editorial:     'Cormorant Garamond', Garamond, serif;
  --font-sans:          'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-hand:          'Caveat', 'Dancing Script', cursive;
  --font-script:        'Sacramento', cursive;

  /* Elevation & Shadows */
  --shadow-subtle:      0 4px 20px rgba(61, 30, 36, 0.05);
  --shadow-medium:      0 12px 35px rgba(230, 57, 70, 0.08), 0 4px 12px rgba(255, 117, 143, 0.12);
  --shadow-floating:    0 24px 60px rgba(230, 57, 70, 0.16), 0 8px 24px rgba(255, 117, 143, 0.18);
  --shadow-gold:        0 10px 30px rgba(232, 165, 152, 0.4);
  --shadow-crimson:     0 8px 24px rgba(230, 57, 70, 0.35);

  /* Tactile Paper Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 36px;
  --radius-full: 9999px;

  /* Transitions */
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Smooth Scrolling */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--romantic-charcoal);
  overflow-x: hidden;
  width: 100vw;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 15% 20%, #FFE5EC 0%, #FFF0F3 50%, #FFD6E0 100%);
  background-attachment: fixed;
  color: var(--romantic-charcoal);
  line-height: 1.65;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100vw;
  max-width: 100%;
  position: relative;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--petal-pink);
  color: var(--cherry-rose);
}

/* Touch & Tap action optimization */
button, a, input, select, textarea, .interactive-btn, .valentine-card, .deckle-card, .polaroid-card-container, .flip-card-container, .wax-seal, .gift-box-3d, .keychain-badge, .deck-card, .stamp-toy-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button, .wax-seal, .keychain-badge, .deck-card, .polaroid-card-inner, .flip-card-inner, .gift-cube-body, .btn-hug-hold {
  user-select: none;
  -webkit-user-select: none;
}

/* Tactile Paper Texture Overlay with Soft Shimmer Grain */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* 3D WebGL Background Canvas Container */
#three-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  pointer-events: none;
}

#three-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Main Content Container Layer */
.experience-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Slow-Pulsing Red Heart Badge */
.pulsing-heart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 1.15em;
  color: var(--valentine-red);
  animation: heartPulseGlow 2.2s ease-in-out infinite;
  vertical-align: middle;
  filter: drop-shadow(0 2px 8px rgba(230, 57, 70, 0.45));
}

@keyframes heartPulseGlow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(230, 57, 70, 0.35)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 14px rgba(230, 57, 70, 0.75)); }
}

/* Drifting Touch/Click Heart Particle */
.screen-heart-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.4rem;
  color: var(--crimson-heart);
  transform: translate(-50%, -50%);
  animation: heartFloatUp 1.2s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  filter: drop-shadow(0 0 8px rgba(252, 234, 232, 0.9));
}

@keyframes heartFloatUp {
  0% { transform: translate(-50%, -50%) scale(0.4) rotate(0deg); opacity: 1; }
  50% { transform: translate(calc(-50% + var(--randX, 0px)), calc(-50% - 60px)) scale(1.2) rotate(var(--randRot, 10deg)); opacity: 0.9; }
  100% { transform: translate(calc(-50% + var(--randX, 0px)), calc(-50% - 120px)) scale(0.6) rotate(calc(var(--randRot, 10deg) * 2)); opacity: 0; }
}

/* Typography Utilities */
h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-charcoal);
}

.font-editorial {
  font-family: var(--font-editorial);
  letter-spacing: -0.01em;
}

.font-hand {
  font-family: var(--font-hand);
}

.font-script {
  font-family: var(--font-script);
}

/* Luxury Editorial Section Header */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #FFE5EC;
  border: 1px solid #FFCCD5;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cherry-rose);
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(255, 117, 143, 0.15);
}

.section-tag::before {
  content: "🌸";
  font-size: 0.85rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--romantic-charcoal);
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--sepia-subtext);
  max-width: 620px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.6;
}

/* Glassmorphism & Rose-Gold Tactile Card Utility */
.deckle-card {
  background: var(--card-glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--card-glass-border);
  box-shadow: 0 12px 35px rgba(230, 57, 70, 0.08), 0 4px 12px rgba(255, 117, 143, 0.12);
  border-radius: 24px;
  position: relative;
  transition: transform 0.4s var(--spring-bounce), box-shadow 0.4s ease;
  overflow: hidden;
}

.deckle-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(232, 165, 152, 0.6), transparent 40%, rgba(255, 182, 193, 0.5));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Gold / Rose Gold Foil Specular Sheen Effect */
.gold-foil-text {
  background: linear-gradient(135deg, #D62839 0%, #FF758F 40%, #FFE3E8 60%, #E63946 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  text-shadow: 0 0 20px rgba(255, 117, 143, 0.3);
}

/* Buttons with Squishy Spring Physics & Romantic Valentine Gradient */
.btn-primary, .btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #E63946 0%, #FF758F 100%);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.35);
  transition: transform 0.25s var(--spring-bounce), box-shadow 0.25s ease, background 0.25s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
  text-decoration: none;
}

.btn-primary:hover, .btn-gold:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 10px 30px rgba(230, 57, 70, 0.5), 0 0 20px rgba(255, 117, 143, 0.4);
  background: linear-gradient(135deg, #D62839 0%, #FF758F 100%);
}

.btn-primary:active, .btn-gold:active {
  transform: translateY(1px) scale(0.97);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--cherry-rose);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--soft-blush);
  border-radius: var(--radius-full);
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-subtle);
  transition: all 0.25s var(--spring-bounce);
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--valentine-red);
  color: var(--valentine-red);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 117, 143, 0.25);
}

/* Audio Control Floating Bar with Romantic Rhythmic Pulse & Mobile Safe Area */
.ambient-sound-bar {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--card-glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(230, 57, 70, 0.12), 0 4px 12px rgba(255, 117, 143, 0.18);
  transition: transform 0.3s var(--spring-bounce), box-shadow 0.3s ease;
  animation: ambientBarPulse 3.5s ease-in-out infinite;
}

@media (max-width: 640px) {
  .ambient-sound-bar {
    padding: 6px 12px;
    gap: 8px;
    bottom: max(14px, env(safe-area-inset-bottom, 14px));
    right: max(12px, env(safe-area-inset-right, 12px));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .sound-label {
    display: none;
  }
}

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

.ambient-sound-bar:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-floating);
}

.sound-toggle-btn {
  background: linear-gradient(135deg, #E63946, #FF758F);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.4);
  transition: transform 0.25s var(--spring-bounce);
  touch-action: manipulation;
}

.sound-toggle-btn:hover {
  transform: scale(1.1);
}

.sound-toggle-btn:active {
  transform: scale(0.95);
}

.sound-info {
  display: flex;
  flex-direction: column;
}

.sound-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cherry-rose);
}

.sound-status {
  font-size: 0.8rem;
  color: var(--sepia-subtext);
  font-family: var(--font-hand);
}

.sound-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.sound-bar-item {
  width: 3px;
  background: var(--valentine-red);
  border-radius: 2px;
  height: 4px;
  transition: height 0.2s ease;
}

.sound-playing .sound-bar-item:nth-child(1) { animation: soundWave 0.8s ease-in-out infinite alternate; }
.sound-playing .sound-bar-item:nth-child(2) { animation: soundWave 0.6s ease-in-out infinite alternate 0.2s; }
.sound-playing .sound-bar-item:nth-child(3) { animation: soundWave 0.9s ease-in-out infinite alternate 0.4s; }

@keyframes soundWave {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* Animations */
@keyframes floatGentle {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1.5deg); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(230, 57, 70, 0.25); }
  50% { box-shadow: 0 0 35px rgba(230, 57, 70, 0.55), 0 0 15px rgba(255, 117, 143, 0.35); }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.12); }
  28% { transform: scale(1.02); }
  42% { transform: scale(1.16); }
  70% { transform: scale(1); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--soft-blush);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--valentine-red);
}
