/* Using system fonts for better performance and security */

:root {
  /* Cinematic Universe Color Palette - Inspired by stargazing wonder */
  --bg: linear-gradient(135deg, 
    #0c0f1f 0%,     /* Deep space black */
    #1a1b3e 15%,    /* Dark cosmic blue */
    #2d1b69 30%,    /* Rich purple */
    #4a2c7d 45%,    /* Deep violet */
    #663399 60%,    /* Cosmic purple */
    #8b5fbf 75%,    /* Lighter purple */
    #b19cd9 90%,    /* Dreamy lavender */
    #d4c5e8 100%);  /* Soft cosmic pink */
  
  --bg-light: #ffffff;
  --text: #2d1b69;
  --text-light: #5a5a5a;
  --muted: #d4af37;
  --brand: #d4af37;
  --brand-secondary: #f4e4bc;
  --brand-contrast: #1a1a2e;
  --accent: #f4e4bc;
  --accent-secondary: #d4af37;
  --border: rgba(212, 175, 55, 0.2);
  --focus: #d4af37;
  
  /* Rich Golden Gradients */
  --gradient-primary: linear-gradient(135deg, #d4af37 0%, #f4e4bc 100%);
  --gradient-secondary: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
  --gradient-accent: linear-gradient(135deg, #f4e4bc 0%, #ffffff 100%);
  --gradient-magic: linear-gradient(45deg, #d4af37, #f4e4bc, #ffffff, #d4af37);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  
  /* Magical Space Colors */
  --star-1: #ffffff;
  --star-2: #ffc107;  /* Golden stars like in the image */
  --star-3: #4a90e2;  /* Blue stars */
  --star-4: #e74c3c;  /* Red dwarf stars */
  --star-5: #9b59b6;  /* Purple stars */
  
  /* Diverse Planets */
  --planet-1: #4a90e2;  /* Blue planet like Earth */
  --planet-2: #e74c3c;  /* Red planet like Mars */
  --planet-3: #f39c12;  /* Orange gas giant */
  --planet-4: #9b59b6;  /* Purple alien world */
  --planet-5: #27ae60;  /* Green habitable world */
  
  /* Rich Nebulae */
  --nebula-1: rgba(102, 51, 153, 0.4);   /* Deep purple nebula */
  --nebula-2: rgba(214, 51, 132, 0.3);   /* Pink-red nebula */
  --nebula-3: rgba(255, 193, 7, 0.3);    /* Golden nebula */

  --maxw: 1200px;
  --radius: 20px;
  --radius-small: 12px;
  --shadow: 0 10px 40px rgba(0,0,0,0.3);
  --shadow-hover: 0 15px 50px rgba(0,0,0,0.4);
  --shadow-inset: inset 0 2px 10px rgba(0,0,0,0.1);
  --line: 1.6;
  --font: system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  --font-story: system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  
  /* Animation variables */
  --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Global Styles & Reset */
* { 
  box-sizing: border-box; 
}

html, body { 
  padding: 0; 
  margin: 0; 
  overflow-x: hidden;
}

body.site {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: var(--line);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
}

/* Magical space background with stars, planets, and nebulae */
body.site::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: -3;
}

/* Twinkling stars layer - much cleaner */
body.site::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    /* Only large bright stars */
    radial-gradient(circle at 20% 15%, var(--star-1) 2px, transparent 3px),
    radial-gradient(circle at 85% 25%, var(--star-2) 1.5px, transparent 2px),
    radial-gradient(circle at 60% 10%, var(--star-1) 2px, transparent 3px),
    radial-gradient(circle at 95% 60%, var(--star-3) 1px, transparent 2px),
    radial-gradient(circle at 15% 75%, var(--star-4) 1.5px, transparent 2px),
    radial-gradient(circle at 75% 80%, var(--star-1) 2px, transparent 3px);
  background-size: 
    800px 800px, 700px 700px, 900px 900px, 600px 600px, 850px 850px, 750px 750px;
  animation: twinkle 12s ease-in-out infinite alternate;
  opacity: 0.4;
  z-index: -2;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Cool space objects with random movements */
.space-object {
  position: absolute;
  opacity: 0.6;
  font-size: 40px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

/* Cinematic Universe - Inspired by stargazing wonder */

/* Space Objects Container */
.space-objects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

/* Distant Space Vehicles - Tiny and Magical */
.space-object {
  position: absolute;
  font-size: 8px;
  opacity: 0.2;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}


.tiny-rocket {
  animation: rocket-float 30s linear infinite alternate;
  top: 25%;
  left: -20px;
}
.tiny-rocket::before { content: '🚀'; }

@keyframes rocket-float {
  0% { transform: translate(0, 0) rotate(-10deg); }
  30% { transform: translate(40vw, -10vh) rotate(5deg); }
  60% { transform: translate(60vw, 10vh) rotate(-5deg); }
  100% { transform: translate(100vw, 0) rotate(10deg); }
}


.space-probe {
  animation: probe-arc 40s linear infinite alternate;
  top: 60%;
  right: -20px;
  animation-delay: -10s;
}
.space-probe::before { content: '🛰️'; }

@keyframes probe-arc {
  0% { transform: translate(0, 0) rotate(-5deg); }
  50% { transform: translate(-40vw, -20vh) rotate(10deg); }
  100% { transform: translate(-80vw, 0) rotate(-5deg); }
}


.satellite {
  animation: vertical-bob 18s ease-in-out infinite alternate;
  top: 80%;
  left: 30%;
  animation-delay: -5s;
}
.satellite::before { content: '🛰️'; }

/* Cosmic Objects - The Main Attractions */
.cosmic-object {
  position: absolute;
  border-radius: 50%;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

/* Planet Sizes and Colors */
/* Enhanced cartoon planet with shading and craters */
.large-planet {
  width: 90px;
  height: 90px;
  animation: cartoon-planet-bob 18s ease-in-out infinite alternate, cosmic-float 200s infinite ease-in-out;
  position: relative;
  z-index: 1;
}

.large-planet.blue {
  background: radial-gradient(circle at 30% 30%, #6ec6ff 60%, #4a90e2 80%, #2c5aa0 100%);
  box-shadow: 0 8px 24px 0 #2c5aa088, 0 0 0 8px #b3e5fc44;
}

/* Add cartoon craters and shading using pseudo-elements */
.large-planet.blue::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 22px;
  width: 18px;
  height: 12px;
  background: radial-gradient(circle at 60% 40%, #b3e5fc 70%, #81d4fa 100%);
  border-radius: 50%;
  opacity: 0.7;
  box-shadow: 30px 10px 0 0 #4fc3f788, 10px 30px 0 0 #0288d155;
  z-index: 2;
}
.large-planet.blue::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 18px;
  background: radial-gradient(circle at 60% 40%, #01579b 60%, transparent 100%);
  border-radius: 50%;
  opacity: 0.4;
  z-index: 2;
}

.medium-planet {
  width: 50px;
  height: 50px;
  animation: gentle-pulse 12s ease-in-out infinite alternate;
}

.small-planet {
  width: 30px;
  height: 30px;
  animation: tiny-orbit 10s linear infinite;
}

.gas-giant {
  width: 100px;
  height: 100px;
  animation: majestic-rotation 30s linear infinite;
}

/* Planet Color Variants */
.blue { 
  background: radial-gradient(circle at 30% 30%, var(--planet-1), #2c5aa0);
  top: 15%; left: 20%;
}

.red { 
  background: radial-gradient(circle at 30% 30%, var(--planet-2), #c0392b);
  top: 70%; right: 25%;
  animation-delay: -50s;
}

.orange { 
  background: radial-gradient(circle at 30% 30%, var(--planet-3), #d68910);
  top: 40%; left: 70%;
  animation-delay: -100s;
}

.purple { 
  background: radial-gradient(circle at 30% 30%, var(--planet-4), #7d3c98);
  top: 85%; left: 15%;
  animation-delay: -75s;
}

.green { 
  background: radial-gradient(circle at 30% 30%, var(--planet-5), #1e8449);
  top: 60%; left: 50%;
  animation-delay: -125s;
}

.ringed { 
  background: radial-gradient(circle at 30% 30%, #f39c12, #e67e22);
  top: 25%; right: 15%;
  animation-delay: -150s;
  position: relative;
}

.ringed::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 140px;
  border: 2px solid rgba(255, 193, 7, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Stellar Objects - Twinkling Stars */
.stellar-object {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out;
}

.bright-star {
  background: var(--star-1);
  box-shadow: 0 0 10px var(--star-1);
  top: 30%; left: 40%;
}

.golden-star {
  background: var(--star-2);
  box-shadow: 0 0 8px var(--star-2);
  top: 75%; left: 60%;
  animation-delay: -1s;
}

.blue-star {
  background: var(--star-3);
  box-shadow: 0 0 6px var(--star-3);
  top: 50%; right: 30%;
  animation-delay: -2s;
}

.red-star {
  background: var(--star-4);
  box-shadow: 0 0 5px var(--star-4);
  top: 20%; right: 45%;
  animation-delay: -1.5s;
}

/* Dreamy Nebulae */
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  animation: nebula-drift 80s infinite ease-in-out;
  opacity: 0.3;
}

.purple-nebula {
  width: 200px;
  height: 120px;
  background: var(--nebula-1);
  top: 10%; right: 10%;
}

.pink-nebula {
  width: 150px;
  height: 90px;
  background: var(--nebula-2);
  top: 50%; left: 5%;
  animation-delay: -20s;
}

.golden-nebula {
  width: 180px;
  height: 100px;
  background: var(--nebula-3);
  bottom: 20%; right: 20%;
  animation-delay: -40s;
}

.blue-nebula {
  width: 120px;
  height: 80px;
  background: radial-gradient(circle, rgba(74, 144, 226, 0.4), transparent);
  top: 75%; left: 80%;
  animation-delay: -60s;
}

/* Special Elements */
.asteroid-belt {
  width: 200px;
  height: 10px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.1) 20%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.1) 80%, 
    transparent);
  top: 45%;
  left: -200px;
  animation: slow-traverse 600s infinite linear;
  transform: rotate(15deg);
}

.distant-galaxy {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
  border: 1px solid rgba(255, 255, 255, 0.1);
  top: 5%; left: 80%;
  animation: galaxy-spin 400s infinite linear;
}

/* Galaxies */
.galaxy {
  position: absolute;
  font-size: 60px;
  opacity: 0.3;
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));
}

.milky-way {
  top: 30%;
  left: -100px;
  animation: float-diagonal-slow 200s infinite linear;
  animation-delay: -80s;
}

.milky-way::before {
  content: '🌌';
}

.spiral-galaxy {
  top: 85%;
  right: -120px;
  animation: float-right-left 220s infinite linear;
  animation-delay: -140s;
}

.spiral-galaxy::before {
  content: '🌌';
  filter: hue-rotate(120deg);
}

/* Different movement animations for variety */
/* Cinematic Universe Animations */

/* Gentle spacecraft movements */

@keyframes galaxy-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Space objects container */
.space-objects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

/* Nebula clouds */
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: drift 40s infinite ease-in-out;
  opacity: 0.3;
}

.nebula-1 {
  width: 200px;
  height: 120px;
  background: var(--nebula-1);
  top: 20%;
  left: 10%;
  animation-duration: 50s;
}

.nebula-2 {
  width: 150px;
  height: 80px;
  background: var(--nebula-2);
  top: 70%;
  right: 15%;
  animation-duration: 45s;
  animation-delay: -20s;
}

.nebula-3 {
  width: 180px;
  height: 100px;
  background: var(--nebula-3);
  top: 40%;
  left: 60%;
  animation-duration: 55s;
  animation-delay: -30s;
}

@keyframes drift {
  0%, 100% { transform: translateX(0) translateY(0); }
  33% { transform: translateX(20px) translateY(-15px); }
  66% { transform: translateX(-15px) translateY(10px); }
}

/* Shooting stars - subtle random appearances */
.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: linear-gradient(45deg, var(--star-1), transparent);
  animation: shoot 3s ease-out infinite;
  opacity: 0;
}

.shooting-star:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; animation-duration: 4s; }
.shooting-star:nth-child(2) { top: 60%; left: 70%; animation-delay: 8s; animation-duration: 3s; }
.shooting-star:nth-child(3) { top: 40%; left: 30%; animation-delay: 15s; animation-duration: 5s; }
.shooting-star:nth-child(4) { top: 80%; left: 80%; animation-delay: 25s; animation-duration: 3.5s; }

/* Gentle pulsing distant stars */
.distant-stars {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 5% 20%, rgba(255,255,255,0.3) 1px, transparent 2px),
    radial-gradient(circle at 95% 15%, rgba(255,255,255,0.2) 1px, transparent 2px),
    radial-gradient(circle at 15% 80%, rgba(255,255,255,0.4) 1px, transparent 2px),
    radial-gradient(circle at 85% 85%, rgba(255,255,255,0.3) 1px, transparent 2px),
    radial-gradient(circle at 45% 30%, rgba(255,255,255,0.2) 1px, transparent 2px),
    radial-gradient(circle at 65% 70%, rgba(255,255,255,0.3) 1px, transparent 2px);
  background-size: 300px 300px, 250px 250px, 400px 400px, 350px 350px, 200px 200px, 300px 300px;
  animation: gentle-pulse 15s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes gentle-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* Soft asteroid field */
.asteroid {
  position: absolute;
  background: radial-gradient(circle, rgba(200,200,200,0.6), rgba(150,150,150,0.3));
  border-radius: 50%;
  animation: gentle-drift linear infinite;
  opacity: 0.6;
  box-shadow: 0 0 3px rgba(255,255,255,0.2);
}

.asteroid-1 {
  width: 8px;
  height: 8px;
  top: 25%;
  left: -20px;
  animation-duration: 80s;
}

.asteroid-2 {
  width: 12px;
  height: 12px;
  top: 70%;
  left: -30px;
  animation-duration: 100s;
  animation-delay: -20s;
}

.asteroid-3 {
  width: 6px;
  height: 6px;
  top: 45%;
  left: -15px;
  animation-duration: 60s;
  animation-delay: -40s;
}

@keyframes gentle-drift {
  0% { 
    transform: translateX(-30px) translateY(0px);
    opacity: 0;
  }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { 
    transform: translateX(calc(100vw + 30px)) translateY(-20px);
    opacity: 0;
  }
}

/* Shooting stars - rare magical moments */
.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: linear-gradient(45deg, var(--star-1), transparent);
  animation: shoot-gentle 4s ease-out infinite;
  opacity: 0;
}

.shooting-star:nth-child(odd) { 
  top: 20%; 
  left: 5%; 
  animation-delay: 0s; 
  animation-duration: 3s; 
}

.shooting-star:nth-child(even) { 
  top: 70%; 
  left: 80%; 
  animation-delay: 8s; 
  animation-duration: 4s; 
}

@keyframes shoot-gentle {
  0% { 
    opacity: 0; 
    transform: translateX(0) translateY(0) scale(1); 
    box-shadow: 0 0 0 transparent;
  }
  20% { 
    opacity: 1; 
    box-shadow: 0 0 6px var(--star-1), 0 0 12px var(--star-1);
  }
  80% { 
    opacity: 0.8; 
    transform: translateX(80px) translateY(-40px) scale(1.1); 
    box-shadow: 0 0 8px var(--star-1), 0 0 16px var(--star-1);
  }
  100% { 
    opacity: 0; 
    transform: translateX(150px) translateY(-75px) scale(0.5); 
    box-shadow: 0 0 2px transparent;
  }
}

/* Comets - slow moving with tails */
.comet {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, var(--star-2), transparent);
  animation: comet-drift linear infinite;
  opacity: 0;
}

.comet::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, var(--star-2), transparent);
  transform: translateY(-50%);
  opacity: 0.6;
}

.comet-1 {
  top: 30%;
  left: -50px;
  animation-duration: 25s;
  animation-delay: 0s;
}

.comet-2 {
  top: 65%;
  left: -50px;
  animation-duration: 30s;
  animation-delay: 12s;
}

@keyframes comet-drift {
  0% { 
    opacity: 0;
    transform: translateX(-50px) translateY(0px);
  }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% { 
    opacity: 0;
    transform: translateX(calc(100vw + 50px)) translateY(-30px);
  }
}

/* Floating clouds animation */
.clouds {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.1;
}

.cloud {
  position: absolute;
  background: white;
  border-radius: 50px;
  opacity: 0.8;
  animation: float 20s infinite linear;
}

.cloud::before {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50px;
}

.cloud::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50px;
}

@keyframes float {
  0% { transform: translateX(-100px); }
  100% { transform: translateX(calc(100vw + 100px)); }
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Magical Space Header */
.site-header {
  border: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  overflow: hidden;
  background: rgba(16, 20, 30, 0.85);
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 15% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 70%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
    linear-gradient(135deg, rgba(212, 175, 55, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 80px;
  position: relative;
  z-index: 2;
}

.brand {
  font-weight: 300 !important;
  font-size: 2.2rem !important;
  text-decoration: none !important;
  position: relative;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex !important;
  align-items: center;
  gap: 16px;
  color: #ffffff !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 8px 16px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

.brand-icon {
  width: 30px;
  height: 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: visible;
}

/* Just stars - no other shapes */
.brand-icon {
  box-shadow: 
    26px 4px 0 -1.5px #d4af37,
    28px 8px 0 -2px #f7e98e,
    24px 10px 0 -1.5px #d4af37;
}

/* ONLY crescent moon - nothing else */
.brand-icon::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #d4af37 0%, #f7e98e 50%, #d4af37 100%);
  border-radius: 50%;
  box-shadow: 
    inset 6px 0 0 0 rgba(16, 16, 40, 0.95),
    0 0 8px rgba(212, 175, 55, 0.3);
  z-index: 2;
  transition: all 0.3s ease;
}

/* NO child silhouette - completely removed */
.brand-icon::after {
  display: none;
}

.brand-text {
  background: linear-gradient(135deg, #d4af37 0%, #f4e4bc 20%, #ffffff 40%, #f4e4bc 60%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 300;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.9em;
  position: relative;
  padding-left: 4px;
}

.brand-text::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #d4af37, #f4e4bc);
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border-radius: 1px;
}

.brand:hover {
  transform: translateY(-2px);
  padding: 8px 20px !important;
}

.brand:hover .brand-icon {
  transform: scale(1.08) translateY(-1px);
  /* Subtle star enhancement */

}

.brand:hover .brand-icon::before {
  background: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, #f7e98e 0%, #FFD700 50%, #f7e98e 100%);
  box-shadow: 
    inset 7px 0 0 0 rgba(16, 16, 40, 0.8),
    0 0 18px rgba(212, 175, 55, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.25);
  transform: scale(1.02);
}

.brand:hover .brand-icon::after {
  /* Simple hover effect - no book */
  background: 
    radial-gradient(circle 2px at 2px 2px, #0f0f1a 0%, #0f0f1a 90%, transparent 91%),
    radial-gradient(ellipse 3px 4px at 5px 5px, #0f0f1a 0%, #0f0f1a 90%, transparent 91%);
  filter: drop-shadow(0 0.5px 2px rgba(212, 175, 55, 0.2));
}

.brand:hover .brand-text::after {
  width: calc(100% - 4px);
}

/* Add a subtle glow effect for the entire brand */
.brand::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(145deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.brand:hover::before {
  opacity: 1;
}

/* Enhanced typography for modern look */
@keyframes brandGlow {
  0%, 100% { 
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.3));
  }
  50% { 
    filter: drop-shadow(0 4px 15px rgba(212, 175, 55, 0.5));
  }
}

.brand-icon::after {
  animation: brandGlow 3s ease-in-out infinite;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .brand {
    font-size: 1.8rem !important;
    gap: 12px;
  }
  
  .brand-icon {
    width: 35px;
    height: 35px;
  }
  
  .brand-icon::after {
    font-size: 18px;
  }
  
  .brand-text {
    font-size: 0.85em;
    letter-spacing: 0.5px;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-link {
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
  color: #d4af37;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  min-width: 110px;
  white-space: nowrap;
  height: 44px;
  box-sizing: border-box;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    0 4px 20px rgba(212, 175, 55, 0.15),
    inset 0 1px 0 rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.25);
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(212, 175, 55, 0.15), 
    transparent);
  transition: left 0.6s ease;
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link:hover {
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
  color: #f4e4bc;
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 
    0 8px 25px rgba(212, 175, 55, 0.25),
    inset 0 1px 0 rgba(212, 175, 55, 0.3);
  transform: translateY(-3px);
}

.nav-icon {
  font-size: 1rem;
}

.nav-text {
  font-size: 0.7rem;
  font-weight: 800;
}

/* Top right toggle buttons - matching story card button style */
.top-right-toggles {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toggle-pill {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 4px 15px rgba(212, 175, 55, 0.2),
    inset 0 1px 0 rgba(212, 175, 55, 0.3);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  height: 32px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255,255,255,0.3), 
    transparent);
  transition: left 0.8s ease;
}

.toggle-pill:hover::before {
  left: 100%;
}

.toggle-pill:hover {
  background: rgba(212, 175, 55, 0.25);
  color: #f4e4bc;
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 
    0 6px 20px rgba(212, 175, 55, 0.3),
    inset 0 1px 0 rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.toggle-pill.on {
  background: rgba(212, 175, 55, 0.35);
  color: #f4e4bc;
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 
    0 8px 25px rgba(212, 175, 55, 0.4),
    inset 0 1px 0 rgba(212, 175, 55, 0.5);
}

/* Header decoration */
.header-decoration {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    rgba(255, 107, 157, 0.8) 0%, 
    rgba(78, 205, 196, 0.8) 25%, 
    rgba(255, 217, 61, 0.8) 50%, 
    rgba(162, 155, 254, 0.8) 75%, 
    rgba(255, 107, 157, 0.8) 100%
  );
  background-size: 200% 100%;
  animation: aurora-flow 10s ease-in-out infinite;
}

.header-stars {
  position: absolute;
  top: -50px;
  left: 0;
  right: 0;
  height: 30px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  pointer-events: none;
}

.header-star {
  font-size: 1rem;
  animation: float-header-star 4s ease-in-out infinite;
  opacity: 0.7;
}

.header-star:nth-child(1) { animation-delay: 0s; }
.header-star:nth-child(2) { animation-delay: 1s; }
.header-star:nth-child(3) { animation-delay: 2s; }
.header-star:nth-child(4) { animation-delay: 3s; }

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

@keyframes float-header-star {
  0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
  50% { transform: translateY(-10px) rotate(180deg); opacity: 1; }
}

.nav-link:hover::before {
  left: 0;
}

.nav-link:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Magical Footer */
.site-footer {
  border: none;
  margin-top: 60px;
  padding: 30px 0;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  text-align: center;
  font-weight: 500;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.site-main { 
  padding: 40px 0 50px; 
  position: relative;
  z-index: 1;
}

/* Magical Buttons */
.btn {
  appearance: none;
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #d4af37 0%, #f4e4bc 50%, #d4af37 100%);
  color: #1a1a2e;
  padding: 15px 25px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-width: 120px;
  min-height: 50px;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
  transition: all 0.3s var(--bounce);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 1px 3px rgba(255,255,255,0.3);
  font-size: 1rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transition: all 0.5s ease;
  transform: translate(-50%, -50%);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(212, 175, 55, 0.4);
  border-color: rgba(212, 175, 55, 0.6);
  background: linear-gradient(135deg, #f4e4bc 0%, #ffffff 50%, #f4e4bc 100%);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

.btn[aria-disabled="true"], 
.btn:disabled { 
  opacity: 0.6; 
  cursor: not-allowed; 
  transform: none !important;
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.btn-accent {
  background: var(--gradient-accent);
  color: #2d1b69;
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
  font-weight: 800;
}

/* Form Elements */
.input, .select, .lbl {
  font: inherit;
  font-family: var(--font);
}

.select, .input {
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-small);
  padding: 12px 16px;
  min-height: 50px;
  background: rgba(212, 175, 55, 0.25);
  color: white;
  font-weight: 600;
  transition: all 0.3s var(--smooth);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.select:focus, .input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.4), 0 4px 20px rgba(212, 175, 55, 0.2);
  background: rgba(212, 175, 55, 0.35);
  outline: none;
}

.lbl { 
  margin: 0 8px 0 15px; 
  color: white; 
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  font-size: 0.95rem;
}

/* Focus Styles */
:where(a, button, input, select):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-small);
}

/* Magical Home Page */
.home {
  text-align: center;
  position: relative;
  z-index: 2;
}

.home-title { 
  margin: 20px 0 15px; 
  font-size: 3.5rem; 
  font-weight: 700;
  background: var(--gradient-magic);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow 4s ease-in-out infinite;
  text-shadow: 0 4px 20px rgba(0,0,0,0.1);
  position: relative;
}

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

.home-title::after {
  content: '🌟';
  position: absolute;
  right: -50px;
  top: 10px;
  font-size: 2rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

.home-subtitle { 
  margin: 0 0 30px; 
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.3rem;
  font-weight: 500;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Age Selection Grid */
.age-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 40px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .age-grid { 
    grid-template-columns: repeat(4, 1fr); 
    max-width: 800px;
  }
}

.age-card {
  display: block;
  text-decoration: none;
  background: var(--gradient-card);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 25px 20px;
  box-shadow: var(--shadow);
  transition: all 0.4s var(--bounce);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transform-origin: center;
}

.age-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, var(--sparkle-1), transparent, var(--sparkle-2), transparent, var(--sparkle-3), transparent);
  animation: rotate 20s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.age-card::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--gradient-card);
  border-radius: calc(var(--radius) - 2px);
  z-index: 1;
}

.age-card:hover::before {
  opacity: 0.3;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.age-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 255, 255, 0.5);
}

.age-card:active {
  transform: translateY(-4px) scale(1.02);
}

.age-label { 
  font-weight: 700; 
  font-size: 2rem; 
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
}

.age-desc { 
  color: var(--text-light);
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  z-index: 2;
}

/* Home Action Links */
.home-links { 
  margin-top: 40px; 
  display: flex; 
  gap: 20px; 
  flex-wrap: wrap; 
  justify-content: center;
}

/* Archive Page Magic */
.archive-filters {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: center;
  margin: 30px 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.25) 100%);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: 0 15px 35px rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

@media (max-width: 640px) {
  .archive-filters { grid-template-columns: 1fr; }
}

.age-switch { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap; 
  margin-bottom: 15px; 
  justify-content: center;
}

.chip {
  display: inline-block;
  padding: 10px 18px;
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: 25px;
  text-decoration: none;
  color: #1a1a2e;
  background: rgba(244, 228, 188, 0.9);
  font-weight: 500;
  transition: all 0.3s var(--bounce);
  backdrop-filter: blur(5px);
}

.chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
  border-color: rgba(212, 175, 55, 0.6);
}

.chip-active { 
  background: var(--gradient-primary); 
  color: white; 
  border-color: transparent;
  transform: scale(1.05);
}

.archive-list { 
  list-style: none; 
  padding: 0; 
  margin: 20px 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.25) 100%);
  border-radius: var(--radius);
  box-shadow: 0 15px 35px rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(20px);
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.archive-list li { 
  padding: 15px 25px; 
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  transition: all 0.3s ease;
}

.archive-list li:last-child {
  border-bottom: none;
}

.archive-list li:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: translateX(5px);
}

.archive-list a { 
  text-decoration: none; 
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.archive-list a:hover {
  text-decoration: underline;
}

.pager { 
  display: flex; 
  gap: 15px; 
  align-items: center; 
  margin-top: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.pager-info { 
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

/* Gallery Page Magic */
.gallery {
  padding: 20px 0;
}

.gallery-header {
  text-align: center;
  margin-bottom: 40px;
}

.gallery-title {
  font-size: 2.2rem;
  font-weight: 600;
  color: white;
  margin: 0 0 8px 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gallery-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-weight: 400;
}

.gallery-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.age-chip {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.2);
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.age-chip::before {
  display: none;
}

.age-chip:hover::before {
  display: none;
}

.age-chip:hover {
  transform: none;
  background: rgba(212, 175, 55, 0.2);
  color: white;
  border-color: rgba(212, 175, 55, 0.5);
}

.age-chip-active {
  background: rgba(212, 175, 55, 0.9);
  color: #1a1a2e;
  border-color: rgba(212, 175, 55, 0.8);
  font-weight: 600;
}

.gallery-stats {
  text-align: center;
  margin-bottom: 20px;
}

.gallery-stats p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 400;
  margin: 0;
}

.story-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
  padding: 0;
}

@media (max-width: 640px) {
  .story-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
}

.gallery-card {
  display: block;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.gallery-card::before {
  display: none;
}

.gallery-card:hover::before {
  display: none;
}

.gallery-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
}

.gallery-card-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.gallery-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.gallery-card:hover .gallery-thumbnail {
  transform: scale(1.02);
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
}

.placeholder-emoji {
  font-size: 2rem;
  opacity: 0.5;
}

.gallery-card-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 4px 8px;
  opacity: 1;
  backdrop-filter: blur(10px);
}

.gallery-card:hover .gallery-card-overlay {
  opacity: 1;
}

.story-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.age-badge, .page-badge {
  background: rgba(212, 175, 55, 0.9);
  color: #1a1a2e;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(5px);
}

.gallery-card-content {
  padding: 12px;
}

.gallery-story-title {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  margin: 0 0 6px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.gallery-story-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.story-date, .story-type {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

.gallery-pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pagination-btn {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(212, 175, 55, 0.9);
  color: #1a1a2e;
  text-decoration: none;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(212, 175, 55, 0.5);
}

.pagination-btn:hover {
  background: rgba(212, 175, 55, 1);
  transform: translateY(-1px);
}

.pagination-btn-disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
}

.pagination-btn-disabled:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.1);
}

.pagination-info {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-size: 0.9rem;
}

.gallery-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.7);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.gallery-empty h2 {
  font-size: 1.5rem;
  color: white;
  margin: 0 0 10px 0;
  font-weight: 600;
}

.gallery-empty p {
  font-size: 1rem;
  margin: 0 0 20px 0;
}

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

/* Story Page Magic */
.story-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
  text-align: center;
}

.story-title { 
  margin: 0; 
  font-size: 2.5rem; 
  font-weight: 700;
  background: linear-gradient(135deg, #d4af37 0%, #f4e4bc 20%, #ffffff 40%, #f4e4bc 60%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
  position: relative;
}

.story-title::before {
  content: '🌟';
  position: absolute;
  left: -60px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  animation: starGlow 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.6));
}

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

@keyframes starGlow {
  0%, 100% { 
    transform: translateY(-50%) scale(1);
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.6));
  }
  50% { 
    transform: translateY(-50%) scale(1.1);
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.9));
  }
}

.controls { 
  display: flex; 
  gap: 15px; 
  flex-wrap: wrap; 
  align-items: center; 
  justify-content: center;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.25) 100%);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: 0 15px 35px rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.4);
  position: relative;
  overflow: hidden;
}

.controls::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    transparent, 
    rgba(212, 175, 55, 0.3), 
    transparent, 
    rgba(244, 228, 188, 0.3), 
    transparent);
  background-size: 200% 200%;
  animation: goldenFlow 4s ease-in-out infinite;
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0.6;
}

.tts-controls { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  flex-wrap: wrap;
  justify-content: center;
}

.accessibility-controls { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap;
}

.story-content {
  margin-top: 30px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.22) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius);
  padding: 35px;
  box-shadow: 0 20px 50px rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(25px);
  position: relative;
  overflow: hidden;
}

.story-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d4af37 0%, #f4e4bc 25%, #ffffff 50%, #f4e4bc 75%, #d4af37 100%);
  background-size: 400% 400%;
  animation: goldenFlow 4s ease-in-out infinite;
}

.story-section { 
  margin: 20px 0; 
  position: relative;
}

.story-text { 
  margin: 0; 
  font-size: 1.2rem; 
  font-family: var(--font-story);
  line-height: 1.8;
  color: #ffffff;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.sentence {
  transition: all 0.3s ease;
  border-radius: 8px;
  padding: 2px 4px;
  margin: 0 1px;
}

.sentence.reading {
  background: linear-gradient(135deg, #d4af37, #f4e4bc);
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.6);
  transform: scale(1.02);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

/* Controls Enhancement */
.controls-sticky {
  position: sticky;
  top: 90px;
  z-index: 50;
  margin-bottom: 20px;
}

.tts-controls .select, 
.tts-controls .btn { 
  min-width: auto;
  font-size: 0.9rem;
}

.accessibility-controls .btn {
  background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
  color: white;
  border-color: rgba(212, 175, 55, 0.4);
}

.accessibility-controls .btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #f4e4bc 0%, #ffffff 100%);
  color: #1a1a2e;
  transform: scale(0.95);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

/* Page Titles */
.page-title { 
  margin-top: 0; 
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 30px;
}

/* High Contrast Accessibility Mode */
.theme-high-contrast {
  --bg: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  --bg-light: #0b0b0b;
  --text: #ffffff;
  --text-light: #d1d5db;
  --muted: #d1d5db;
  --brand: #00ffff;
  --brand-contrast: #000000;
  --border: rgba(51, 65, 85, 0.5);
  --focus: #22d3ee;
  --gradient-card: linear-gradient(135deg, #0b0b0b 0%, #1a1a1a 100%);
}

.theme-high-contrast .site-header,
.theme-high-contrast .site-footer {
  background: rgba(11, 11, 11, 0.9);
  border-color: var(--border);
}

.theme-high-contrast .story-content,
.theme-high-contrast .age-card,
.theme-high-contrast .chip,
.theme-high-contrast .archive-list,
.theme-high-contrast .controls {
  background: var(--gradient-card);
  border-color: var(--border);
}

.theme-high-contrast .nav-link:hover { 
  background: #111827; 
}

.theme-high-contrast .sentence.reading {
  background: #1e293b;
  color: #22d3ee;
  box-shadow: 0 0 0 2px #22d3ee;
}

.theme-high-contrast .brand::after {
  filter: hue-rotate(180deg);
}

/* Large Text Accessibility Mode */
.text-large .story-text { 
  font-size: 1.5rem; 
  line-height: 2; 
}

.text-large { 
  font-size: 118%; 
}

.text-large .home-title {
  font-size: 4rem;
}

.text-large .age-label {
  font-size: 2.5rem;
}

/* Links */
a { 
  color: var(--brand); 
  transition: all 0.3s ease;
}

a:hover { 
  text-decoration: underline;
  transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .home-title { 
    font-size: 2.5rem; 
  }
  
  .home-title::after {
    right: -30px;
    font-size: 1.5rem;
  }
  
  .story-title {
    font-size: 2rem;
  }
  
  .story-title::before {
    left: -40px;
    font-size: 1.5rem;
  }
  
  .age-grid {
    gap: 15px;
  }
  
  .age-card {
    padding: 20px 15px;
  }
  
  .controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .tts-controls {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .home-title {
    font-size: 2rem;
  }
  
  .site-nav {
    gap: 10px;
  }
  
  .nav-link {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .age-card { 
    transition: none; 
  }
  
  .btn {
    transition: none;
  }
  
  body.site::after {
    animation: none;
  }
}

/* Print Styles */
@media print {
  body.site::before,
  body.site::after {
    display: none;
  }
  
  .site-header,
  .site-footer,
  .controls {
    display: none;
  }
  
  .story-content {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Loading Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.age-card {
  animation: fadeInUp 0.6s ease-out forwards;
}

.age-card:nth-child(1) { animation-delay: 0.1s; }
.age-card:nth-child(2) { animation-delay: 0.2s; }
.age-card:nth-child(3) { animation-delay: 0.3s; }
.age-card:nth-child(4) { animation-delay: 0.4s; }

/* Hide elements initially for animation */
.age-card {
  opacity: 0;
  transform: translateY(30px);
}

/* Error Pages */
.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-title {
  font-size: 3rem;
  margin-bottom: 20px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
