/* ============================================================
   FAERI College Partnership — Animations
   ============================================================ */

/* ============================================================
   Starfield Background (3-layer parallax)
   ============================================================ */
.starfield {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: var(--z-bg);
}

.stars-layer-1,
.stars-layer-2,
.stars-layer-3 {
  position: absolute;
  width: 100%;
  height: 200%;
  top: 0;
  left: 0;
}

.stars-layer-1 {
  background-image:
    radial-gradient(1px 1px at  50px  80px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 180px 160px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 320px  40px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 480px 200px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 620px 120px, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 760px 260px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 900px  60px, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 100px 300px, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 400px 340px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 700px 380px, rgba(255,255,255,0.5), transparent);
  background-size: 1000px 500px;
  animation: starDrift1 60s linear infinite;
}

.stars-layer-2 {
  background-image:
    radial-gradient(1.5px 1.5px at 120px 140px, rgba(0,230,118,0.4), transparent),
    radial-gradient(1.5px 1.5px at 340px 220px, rgba(0,230,118,0.3), transparent),
    radial-gradient(1.5px 1.5px at 560px 100px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 780px 300px, rgba(0,230,118,0.35), transparent),
    radial-gradient(1.5px 1.5px at 200px 360px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 650px  50px, rgba(0,230,118,0.45), transparent),
    radial-gradient(1.5px 1.5px at 450px 280px, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at  80px 420px, rgba(0,230,118,0.3), transparent);
  background-size: 1000px 500px;
  animation: starDrift2 45s linear infinite;
}

.stars-layer-3 {
  background-image:
    radial-gradient(2px 2px at 260px  90px, rgba(255,215,0,0.3), transparent),
    radial-gradient(2px 2px at 520px 250px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 140px 320px, rgba(0,230,118,0.4), transparent),
    radial-gradient(2px 2px at 680px 170px, rgba(255,215,0,0.25), transparent),
    radial-gradient(2px 2px at 840px 350px, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 380px  30px, rgba(0,230,118,0.35), transparent);
  background-size: 1000px 500px;
  animation: starDrift3 35s linear infinite;
}

@keyframes starDrift1 {
  from { transform: translateY(0);    }
  to   { transform: translateY(-50%); }
}

@keyframes starDrift2 {
  from { transform: translateY(0);    }
  to   { transform: translateY(-50%); }
}

@keyframes starDrift3 {
  from { transform: translateY(0);    }
  to   { transform: translateY(-50%); }
}

/* ============================================================
   Glow & Float Keyframes
   ============================================================ */
@keyframes tagGlow {
  0%, 100% { text-shadow: 0 0 6px rgba(0, 230, 118,0.3);  }
  50%      { text-shadow: 0 0 16px rgba(0, 230, 118,0.55); }
}

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

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%);  }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 230, 118,0.15); }
  50%      { box-shadow: 0 0 28px rgba(0, 230, 118,0.35); }
}

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

/* ============================================================
   Scroll-Triggered Animations
   ============================================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll[data-delay="1"] { transition-delay: 0.1s; }
.animate-on-scroll[data-delay="2"] { transition-delay: 0.2s; }
.animate-on-scroll[data-delay="3"] { transition-delay: 0.3s; }
.animate-on-scroll[data-delay="4"] { transition-delay: 0.4s; }
.animate-on-scroll[data-delay="5"] { transition-delay: 0.5s; }
.animate-on-scroll[data-delay="6"] { transition-delay: 0.6s; }

/* Slide Left */
.animate-slide-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-slide-left.animated {
  opacity: 1;
  transform: translateX(0);
}

/* Slide Right */
.animate-slide-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-slide-right.animated {
  opacity: 1;
  transform: translateX(0);
}

/* Scale In */
.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-scale.animated {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   Page Hero
   ============================================================ */
.page-hero {
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-height) + 20px) 24px 40px;
  background: radial-gradient(ellipse at 50% 40%, #0f2040 0%, #0a0e1a 65%);
}

.page-hero-nebula {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.page-hero-nebula::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(0,230,118,0.06) 0%, transparent 65%),
    radial-gradient(ellipse 45% 35% at 75% 65%, rgba(124,77,255,0.045) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 20%, rgba(255,215,0,0.025) 0%, transparent 50%);
  animation: pageHeroNebula 14s ease-in-out infinite alternate;
}
@keyframes pageHeroNebula {
  0%   { transform: scale(1) translate(0,0); opacity: .5; }
  100% { transform: scale(1.06) translate(8px,-5px); opacity: .8; }
}

.page-hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.page-hero-particles span {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: pageHeroParticle 5s ease-in-out infinite;
}
@keyframes pageHeroParticle {
  0%,100% { opacity: 0; transform: translateY(0) scale(1); }
  15%     { opacity: 0.7; }
  85%     { opacity: 0.2; }
  100%    { opacity: 0; transform: translateY(-50px) scale(0.3); }
}

.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.page-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 12px;
  text-shadow: 0 0 40px rgba(0,230,118,0.2);
  opacity: 0;
  animation: pageHeroTitleIn 0.8s cubic-bezier(0.22,1,0.36,1) 0.3s forwards;
}
@keyframes pageHeroTitleIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.page-hero-divider {
  width: 0;
  height: 2px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, #00e676, #ffd700, #00e676, transparent);
  border-radius: 2px;
  animation: pageHeroDivExpand 0.8s ease 0.6s forwards;
}
@keyframes pageHeroDivExpand {
  to { width: 180px; }
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0,230,118,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,230,118,0.018) 1px, transparent 1px);
  background-size: 55px 55px;
  animation: pageHeroGridPulse 8s ease-in-out infinite alternate;
}
@keyframes pageHeroGridPulse {
  0%   { opacity: .2; }
  100% { opacity: .6; }
}

@media (max-width: 768px) {
  .page-hero { min-height: 35vh; }
  .page-hero-title { font-size: 2rem; }
  .page-hero-particles { display: none; }
}

/* ============================================================
   Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll,
  .animate-slide-left,
  .animate-slide-right,
  .animate-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .starfield,
  .page-hero-nebula,
  .page-hero-particles {
    display: none;
  }
  .page-hero::after {
    display: none;
  }
}
