/* ============================================
   COSMIC HERO — shared night-sky hero background
   Purpose: Reusable across any page's hero section. Add class
   "cosmic-hero" alongside the page's own hero class (e.g.
   class="people-hero cosmic-hero"), and include this file LAST
   in that page's pageCSS array so it wins the cascade over the
   page's own hero background rule.

   Every page keeps the exact same navy/purple gradient and star
   animation — the only thing that should vary page to page is
   the floating icon (.hero-float-icon, any emoji) and optional
   extra decorative elements layered in by that page's own CSS.
   ============================================ */

.cosmic-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #1B1440 0%, #2E1F63 55%, #402A7D 100%);
  color: var(--text-on-primary);
}

.cosmic-hero .container {
  position: relative;
  z-index: 2;
}

.cosmic-hero .hero-title,
.cosmic-hero .hero-subtitle,
.cosmic-hero .people-hero-eyebrow {
  color: var(--text-on-primary);
}

.cosmic-hero .hero-subtitle {
  color: rgba(255, 255, 255, 0.95);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.cosmic-hero .people-hero-eyebrow {
  color: rgba(255, 255, 255, 0.85);
}

.hero-starfield {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-star {
  position: absolute;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.6);
  animation: heroStarTwinkle 3.2s ease-in-out infinite;
}

@keyframes heroStarTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hero-shooting-star {
  position: absolute;
  top: 18%;
  left: -10%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.9);
  animation: heroShootingStar 6s ease-in infinite;
  animation-delay: 2s;
}

.hero-shooting-star::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  width: 90px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8));
  transform: translateY(-50%);
}

@keyframes heroShootingStar {
  0% { transform: translate(0, 0); opacity: 0; }
  5% { opacity: 1; }
  25% { transform: translate(340px, 170px); opacity: 0; }
  100% { transform: translate(340px, 170px); opacity: 0; }
}

/* The one per-page variable: whatever emoji/icon fits that page
   (💗 support, 🙋 volunteer, ✉️ contact, 📚 resources, ...) */
.hero-float-icon {
  display: inline-block;
  font-size: 26px;
  margin-bottom: 14px;
  animation: heroIconFloat 3s ease-in-out infinite;
}

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

/* ============================================
   HERO SCENES — small code-drawn animated motifs, one per
   page "story" (never a photo/raster image). Same warm cosmic
   palette everywhere; the scene is what makes each hero distinct.
   Rendered by partials/hero-scene.ejs via the heroVariant local.
   ============================================ */

/* --- moon scene (Team: a companion sitting on the moon, clouds drifting by) --- */
.hero-moon {
  position: absolute;
  right: 9%;
  bottom: -26px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F5EEFF 0%, #DCC9F3 42%, #B79EDB 75%, #9B7FC7 100%);
  box-shadow: 0 0 55px 12px rgba(216, 196, 240, 0.35), inset -18px -10px 26px rgba(110, 82, 150, 0.35);
  animation: heroMoonGlow 4.5s ease-in-out infinite;
}

@keyframes heroMoonGlow {
  0%, 100% { box-shadow: 0 0 55px 12px rgba(216, 196, 240, 0.3), inset -18px -10px 26px rgba(110, 82, 150, 0.35); }
  50%      { box-shadow: 0 0 75px 18px rgba(216, 196, 240, 0.5), inset -18px -10px 26px rgba(110, 82, 150, 0.35); }
}

.hero-companion-moon {
  position: absolute;
  top: -30px;
  left: 50%;
  font-size: 38px;
  transform: translateX(-50%) rotate(-3deg);
  transform-origin: bottom center;
  animation: heroCompanionRock 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(20, 10, 40, 0.35));
}

@keyframes heroCompanionRock {
  0%, 100% { transform: translateX(-50%) rotate(-3deg) translateY(0); }
  50%      { transform: translateX(-50%) rotate(3deg) translateY(-3px); }
}

.hero-cloud {
  position: absolute;
  width: 90px;
  height: 26px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50px;
  filter: blur(0.5px);
}

.hero-cloud::before, .hero-cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.hero-cloud::before { width: 40px; height: 40px; top: -18px; left: 10px; }
.hero-cloud::after   { width: 30px; height: 30px; top: -12px; left: 45px; }

.hero-cloud-a { bottom: 32px; left: -15%; animation: heroCloudDrift 42s linear infinite; }
.hero-cloud-b { bottom: 74px; left: -25%; opacity: 0.6; transform: scale(0.7); animation: heroCloudDrift 58s linear infinite; animation-delay: -20s; }

@keyframes heroCloudDrift {
  from { transform: translateX(0); }
  to   { transform: translateX(135vw); }
}

/* --- sparkle scene (Sponsors: a pulsing badge with orbiting sparkles) --- */
.hero-sparkle-scene {
  position: absolute;
  right: 10%;
  top: 8%;
  width: 120px;
  height: 120px;
}

.hero-companion-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 52px;
  transform: translate(-50%, -50%);
  animation: heroBadgePulse 3.2s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255, 214, 130, 0.55));
}

@keyframes heroBadgePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.1); }
}

.hero-orbit-sparkle {
  position: absolute;
  font-size: 16px;
  animation: heroOrbitTwinkle 2.6s ease-in-out infinite;
}

.hero-orbit-sparkle-1 { top: 8%;  left: 4%;  animation-delay: 0s; }
.hero-orbit-sparkle-2 { top: 68%; left: 84%; font-size: 13px; animation-delay: 0.9s; }
.hero-orbit-sparkle-3 { top: 12%; left: 86%; font-size: 12px; animation-delay: 1.7s; }

@keyframes heroOrbitTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.15); }
}

/* --- steam scene (Support: a mug with rising wisps of steam) --- */
.hero-steam-scene {
  position: absolute;
  right: 11%;
  bottom: 6%;
  width: 100px;
  height: 130px;
}

.hero-companion-mug {
  position: absolute;
  bottom: 0;
  left: 50%;
  font-size: 46px;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 8px rgba(20, 10, 40, 0.35));
}

.hero-steam {
  position: absolute;
  bottom: 46px;
  width: 6px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(2px);
  animation: heroSteamRise 3s ease-in infinite;
}

.hero-steam-1 { left: 38%; animation-delay: 0s; }
.hero-steam-2 { left: 50%; height: 18px; animation-delay: 1s; }
.hero-steam-3 { left: 62%; animation-delay: 2s; }

@keyframes heroSteamRise {
  0%   { transform: translate(0, 0) scaleX(1); opacity: 0; }
  15%  { opacity: 0.7; }
  50%  { transform: translate(6px, -22px) scaleX(1.3); opacity: 0.5; }
  100% { transform: translate(-4px, -46px) scaleX(1.6); opacity: 0; }
}

/* --- comet scene (About: a comet streaking across, echoing the site's own logo) --- */
.hero-comet-scene {
  position: absolute;
  top: 14%;
  right: 4%;
  width: 220px;
  height: 130px;
}

.hero-comet {
  position: absolute;
  left: 0;
  top: 68%;
  font-size: 30px;
  animation: heroCometFly 6s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 214, 130, 0.7));
}

.hero-comet::after {
  content: '';
  position: absolute;
  top: 55%;
  right: 100%;
  width: 110px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 130, 0.6), rgba(255, 255, 255, 0.9));
  transform: translateY(-50%);
}

@keyframes heroCometFly {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(180px, -95px); opacity: 1; }
  62%  { opacity: 0; }
  100% { transform: translate(180px, -95px); opacity: 0; }
}

/* --- hands scene (Volunteer: open hands releasing small hearts) --- */
.hero-hands-scene {
  position: absolute;
  right: 9%;
  bottom: 6%;
  width: 100px;
  height: 130px;
}

.hero-hands-icon {
  position: absolute;
  bottom: 0;
  left: 50%;
  font-size: 42px;
  transform: translateX(-50%);
  animation: heroHandsGlow 3.4s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(20, 10, 40, 0.3));
}

@keyframes heroHandsGlow {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%      { transform: translateX(-50%) scale(1.08); }
}

.hero-heart-rise {
  position: absolute;
  bottom: 40px;
  font-size: 15px;
  animation: heroHeartRise 3.2s ease-out infinite;
}

.hero-heart-rise-1 { left: 28%; animation-delay: 0s; }
.hero-heart-rise-2 { left: 50%; font-size: 12px; animation-delay: 1.1s; }
.hero-heart-rise-3 { left: 68%; font-size: 13px; animation-delay: 2.1s; }

@keyframes heroHeartRise {
  0%   { transform: translate(0, 0) scale(0.7); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(6px, -68px) scale(1.1); opacity: 0; }
}

/* --- paper plane scene (Contact: a note flying over, trailing a dotted path) --- */
.hero-plane-scene {
  position: absolute;
  top: 20%;
  right: 6%;
  width: 200px;
  height: 110px;
}

.hero-plane {
  position: absolute;
  left: 0;
  top: 58%;
  font-size: 32px;
  animation: heroPlaneFly 5s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(20, 10, 40, 0.3));
}

@keyframes heroPlaneFly {
  0%   { transform: translate(0, 10px) rotate(-8deg); }
  50%  { transform: translate(140px, -38px) rotate(-2deg); }
  100% { transform: translate(0, 10px) rotate(-8deg); }
}

.hero-plane-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  animation: heroPlaneDotFade 5s ease-in-out infinite;
}

.hero-plane-dot-1 { left: 18px; top: 78%; animation-delay: 0.3s; }
.hero-plane-dot-2 { left: 52px; top: 68%; animation-delay: 0.6s; }
.hero-plane-dot-3 { left: 86px; top: 54%; animation-delay: 0.9s; }

@keyframes heroPlaneDotFade {
  0%, 100% { opacity: 0; }
  15%, 40% { opacity: 0.8; }
  60%      { opacity: 0; }
}

/* --- lightbulb scene (FAQ: an idea pulsing, questions orbiting) --- */
.hero-lightbulb-scene {
  position: absolute;
  right: 10%;
  top: 8%;
  width: 120px;
  height: 120px;
}

.hero-lightbulb-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 50px;
  transform: translate(-50%, -50%);
  animation: heroBulbPulse 2.8s ease-in-out infinite;
}

@keyframes heroBulbPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    filter: drop-shadow(0 0 12px rgba(255, 224, 130, 0.45)); }
  50%      { transform: translate(-50%, -50%) scale(1.08); filter: drop-shadow(0 0 22px rgba(255, 224, 130, 0.75)); }
}

.hero-q-bubble {
  position: absolute;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  animation: heroOrbitTwinkle 2.6s ease-in-out infinite;
}

.hero-q-bubble-1 { top: 6%;  left: 4%;  font-size: 16px; animation-delay: 0s; }
.hero-q-bubble-2 { top: 70%; left: 82%; font-size: 12px; animation-delay: 0.9s; }
.hero-q-bubble-3 { top: 12%; left: 84%; font-size: 13px; animation-delay: 1.7s; }

/* --- compass scene (Resources: gently searching, guiding families to help) --- */
.hero-compass-scene {
  position: absolute;
  right: 8%;
  top: 10%;
  width: 84px;
  height: 84px;
}

.hero-compass-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  animation: heroCompassSearch 4.5s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(160, 210, 255, 0.5));
}

@keyframes heroCompassSearch {
  0%, 100% { transform: rotate(-12deg); }
  25%      { transform: rotate(10deg); }
  50%      { transform: rotate(-6deg); }
  75%      { transform: rotate(14deg); }
}

/* --- balloons scene (Events: camps, fundraisers, little celebrations) --- */
.hero-balloons-scene {
  position: absolute;
  right: 9%;
  top: 12%;
  width: 90px;
  height: 100px;
}

.hero-balloon {
  position: absolute;
  font-size: 30px;
  animation: heroBalloonBob 3.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(20, 10, 40, 0.25));
}

.hero-balloon::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.4);
  transform: translateX(-50%);
}

.hero-balloon-1 { left: 0;   top: 6px;  animation-delay: 0s; }
.hero-balloon-2 { left: 34px; top: 22px; font-size: 23px; animation-delay: 1.2s; }

@keyframes heroBalloonBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-9px) rotate(4deg); }
}

/* --- book scene (Stories: guides & articles from families, sparks rising off the page) --- */
.hero-book-scene {
  position: absolute;
  right: 4%;
  top: 2%;
  width: 80px;
  height: 90px;
}

.hero-book-icon {
  position: absolute;
  bottom: 0;
  left: 50%;
  font-size: 38px;
  transform: translateX(-50%);
  animation: heroBookSway 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(20, 10, 40, 0.3));
}

@keyframes heroBookSway {
  0%, 100% { transform: translateX(-50%) rotate(-2deg); }
  50%      { transform: translateX(-50%) rotate(2deg); }
}

.hero-book-spark {
  position: absolute;
  bottom: 36px;
  animation: heroHeartRise 3s ease-out infinite;
}

.hero-book-spark-1 { left: 28%; font-size: 13px; animation-delay: 0s; }
.hero-book-spark-2 { left: 55%; font-size: 10px; animation-delay: 1s; }
.hero-book-spark-3 { left: 70%; font-size: 11px; animation-delay: 2s; }

/* --- satellite scene (Dashboard: your own mission control, drifting gently) --- */
.hero-satellite-scene {
  position: absolute;
  right: 9%;
  top: 16%;
  width: 100px;
  height: 90px;
}

.hero-satellite-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 40px;
  transform: translate(-50%, -50%);
  animation: heroSatelliteDrift 6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(160, 210, 255, 0.5));
}

@keyframes heroSatelliteDrift {
  0%, 100% { transform: translate(-50%, -50%) rotate(-6deg) translateY(0); }
  50%      { transform: translate(-50%, -50%) rotate(6deg) translateY(-8px); }
}

/* --- seedling scene (Submit a Resource: growing the directory together) --- */
.hero-seedling-scene {
  position: absolute;
  right: 9%;
  bottom: 8%;
  width: 80px;
  height: 90px;
}

.hero-seedling-icon {
  position: absolute;
  bottom: 0;
  left: 50%;
  font-size: 38px;
  transform: translateX(-50%);
  animation: heroSeedlingSway 3.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(20, 10, 40, 0.3));
}

@keyframes heroSeedlingSway {
  0%, 100% { transform: translateX(-50%) rotate(-3deg); }
  50%      { transform: translateX(-50%) rotate(3deg); }
}

.hero-seedling-spark {
  position: absolute;
  bottom: 34px;
  animation: heroHeartRise 3s ease-out infinite;
}

.hero-seedling-spark-1 { left: 30%; font-size: 12px; animation-delay: 0s; }
.hero-seedling-spark-2 { left: 62%; font-size: 10px; animation-delay: 1.3s; }

/* --- quill scene (Submit a Story: writing, with a little sparkle trail) --- */
.hero-quill-scene {
  position: absolute;
  right: 9%;
  top: 14%;
  width: 90px;
  height: 100px;
}

.hero-quill-icon {
  position: absolute;
  top: 0;
  left: 50%;
  font-size: 38px;
  transform: translateX(-50%) rotate(-15deg);
  animation: heroQuillWrite 3.4s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(20, 10, 40, 0.3));
}

@keyframes heroQuillWrite {
  0%, 100% { transform: translateX(-50%) rotate(-15deg) translateY(0); }
  50%      { transform: translateX(-50%) rotate(-8deg) translateY(-4px); }
}

.hero-quill-spark {
  position: absolute;
  animation: heroOrbitTwinkle 2.6s ease-in-out infinite;
}

.hero-quill-spark-1 { bottom: 22px; left: 18%; font-size: 13px; animation-delay: 0s; }
.hero-quill-spark-2 { bottom: 8px;  left: 62%; font-size: 10px; animation-delay: 1.2s; }

/* --- gear scene (Account: settings, quietly turning) --- */
.hero-gear-scene {
  position: absolute;
  right: 9%;
  top: 16%;
  width: 70px;
  height: 70px;
}

.hero-gear-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  animation: heroGearSpin 8s linear infinite;
  filter: drop-shadow(0 0 10px rgba(160, 210, 255, 0.4));
}

@keyframes heroGearSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Below desktop width, hero subtitles can wrap unpredictably (length varies
   by page and language) and there isn't reliably clear space for a corner
   companion scene without risking text overlap. Rather than chase every
   text-length/breakpoint combination, the companion art (and its sparkles/
   trails/wisps) only appears at desktop widths; the starfield + shooting
   star underneath still renders at every size. */
@media (max-width: 1023px) {
  .hero-moon, .hero-sparkle-scene, .hero-steam-scene,
  .hero-comet-scene, .hero-hands-scene, .hero-plane-scene,
  .hero-lightbulb-scene, .hero-compass-scene, .hero-balloons-scene, .hero-book-scene,
  .hero-satellite-scene, .hero-seedling-scene, .hero-quill-scene, .hero-gear-scene {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-star, .hero-shooting-star, .hero-float-icon,
  .hero-moon, .hero-companion-moon, .hero-cloud-a, .hero-cloud-b,
  .hero-companion-badge, .hero-orbit-sparkle, .hero-steam,
  .hero-comet, .hero-hands-icon, .hero-heart-rise,
  .hero-plane, .hero-plane-dot, .hero-lightbulb-icon, .hero-q-bubble,
  .hero-compass-icon, .hero-balloon, .hero-book-icon, .hero-book-spark,
  .hero-satellite-icon, .hero-seedling-icon, .hero-seedling-spark,
  .hero-quill-icon, .hero-quill-spark, .hero-gear-icon {
    animation: none !important;
  }
}
