/**
 * MASONIC LODGE — Animations
 * ==========================
 * Celestial movements and sacred transitions
 */

/* ============================================
   REALISTIC STAR ANIMATIONS
   Pure pulsation from center, no movement
   ============================================ */

/* Halo breathing effect - centered pulsation */
@keyframes halo-pulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.08);
  }
}

/* Diffraction spikes pulsation */
@keyframes spikes-shimmer {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Inner glow pulse - centered */
@keyframes inner-glow-pulse {
  0%, 100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

/* Core intensity pulse - centered */
@keyframes core-pulse {
  0%, 100% {
    opacity: 0.9;
    transform: scale(1);
    filter: blur(0px);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    filter: blur(0.5px);
  }
}

/* Companion Star Pulsation - no movement */
@keyframes scintillate {
  0%, 100% {
    opacity: 0.5;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05);
  }
}

/* ============================================
   BACKGROUND ANIMATIONS
   ============================================ */

/* Star Field Drift */
@keyframes starfield-drift {
  from {
    background-position:
      0 0, 50px 100px, 150px 50px, 25px 150px, 200px 80px,
      100px 200px, 180px 150px, 130px 220px, 220px 180px,
      50px 250px, 280px 60px, 300px 140px, 350px 200px,
      80px 280px, 260px 260px;
  }
  to {
    background-position:
      650px 500px, 700px 600px, 800px 550px, 675px 650px, 850px 580px,
      750px 700px, 830px 650px, 780px 720px, 870px 680px,
      700px 750px, 930px 560px, 950px 640px, 1000px 700px,
      730px 780px, 910px 760px;
  }
}

/* Gradient Shift (subtle) */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 50% 0%;
  }
  50% {
    background-position: 50% 100%;
  }
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */

@keyframes scroll-hint {
  0% {
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
  }
  50% {
    opacity: 0.5;
    transform: scaleY(0.3);
    transform-origin: top;
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
  }
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   HERO ENTRANCE SEQUENCE
   ============================================ */

.hero-content {
  animation: fadeIn var(--duration-slower) var(--ease-out);
}

.northern-star-container {
  animation: scaleIn 1s var(--ease-spring) 0.2s both;
}

.companion-stars {
  animation: fadeInUp 0.8s var(--ease-out) 0.5s both;
}

.hero-title {
  animation: fadeInUp 0.8s var(--ease-out) 0.7s both;
}

.hero-subtitle {
  animation: fadeInUp 0.8s var(--ease-out) 0.9s both;
}

.motto-banner {
  animation: fadeInUp 0.8s var(--ease-out) 1.1s both;
}

.scroll-indicator {
  animation: fadeIn 1s var(--ease-out) 1.5s both;
}

.celestial-bodies {
  animation: fadeIn 1.5s var(--ease-out) 1s both;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

/* Glow on Hover */
.glow-hover {
  transition: filter var(--duration-normal) var(--ease-out);
}

.glow-hover:hover {
  filter: drop-shadow(0 0 15px rgba(246, 186, 0, 0.5));
}

/* Lift on Hover */
.lift-hover {
  transition: transform var(--duration-normal) var(--ease-out);
}

.lift-hover:hover {
  transform: translateY(-4px);
}

/* Scale on Hover */
.scale-hover {
  transition: transform var(--duration-normal) var(--ease-spring);
}

.scale-hover:hover {
  transform: scale(1.05);
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */

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

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

.float {
  animation: float 4s ease-in-out infinite;
}

.float-slow {
  animation: float-slow 6s ease-in-out infinite;
}

/* ============================================
   SHIMMER EFFECT
   ============================================ */

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

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(246, 186, 0, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

/* ============================================
   PULSE RING
   ============================================ */

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -10px;
  border: 2px solid var(--color-gold);
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
}

/* ============================================
   ROTATE ANIMATIONS
   ============================================ */

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

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

.rotate-slow {
  animation: rotate-slow 60s linear infinite;
}

.rotate-reverse {
  animation: rotate-reverse 60s linear infinite;
}

/* ============================================
   BORDER ANIMATIONS
   ============================================ */

@keyframes border-glow {
  0%, 100% {
    border-color: rgba(246, 186, 0, 0.2);
    box-shadow: 0 0 0 rgba(246, 186, 0, 0);
  }
  50% {
    border-color: rgba(246, 186, 0, 0.5);
    box-shadow: 0 0 20px rgba(246, 186, 0, 0.2);
  }
}

.border-glow {
  animation: border-glow 3s ease-in-out infinite;
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

@keyframes text-glow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(246, 186, 0, 0.3);
  }
  50% {
    text-shadow: 0 0 20px rgba(246, 186, 0, 0.6);
  }
}

.text-glow {
  animation: text-glow 3s ease-in-out infinite;
}

/* Letter spacing animation */
@keyframes letter-expand {
  0%, 100% {
    letter-spacing: var(--tracking-wider);
  }
  50% {
    letter-spacing: var(--tracking-widest);
  }
}

/* ============================================
   MOBILE MENU ANIMATIONS
   ============================================ */

.mobile-menu-overlay.active .mobile-nav-link {
  animation: slideInLeft 0.5s var(--ease-out) both;
}

.mobile-menu-overlay.active .mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-overlay.active .mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-overlay.active .mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-overlay.active .mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-overlay.active .mobile-nav-link:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-overlay.active .mobile-nav-link:nth-child(6) { animation-delay: 0.35s; }

.mobile-menu-overlay.active .mobile-menu-motto {
  animation: fadeInUp 0.5s var(--ease-out) 0.5s both;
}

/* ============================================
   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;
  }

  .hero-starfield {
    animation: none;
  }

  .northern-star,
  .star-glow,
  .companion-star {
    animation: none;
  }

  .scroll-indicator {
    display: none;
  }
}
