/* Основные анимации */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Специальные анимации */
@keyframes blink-glow {
  0%, 100% {
    filter: drop-shadow(0 0 10px var(--color-accent));
  }
  50% {
    filter: drop-shadow(0 0 1px var(--color-accent));
  }
}

@keyframes assemble {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* Классы для анимаций */
.fade-in {
  animation: fadeIn var(--transition-smooth) forwards;
  will-change: transform, opacity;
}

/* body.fade-in must NOT use transform or will-change:transform —
   either one makes body a containing block for position:fixed children,
   which breaks the mobile-menu drawer and any other fixed elements when
   the page is scrolled (fixed elements follow the page instead of staying
   in the viewport). Use opacity-only fade for the body. */
body.fade-in {
  animation: bodyFadeIn var(--transition-smooth) forwards;
  will-change: opacity;
}

@keyframes bodyFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.slide-in {
  animation: slideIn var(--transition-smooth) forwards;
  will-change: transform, opacity;
}

.scale-in {
  animation: scaleIn var(--transition-smooth) forwards;
  will-change: transform, opacity;
}

.assemble {
  animation: assemble 1.2s ease-out, blink-glow 4s infinite ease-in-out;
  will-change: transform, opacity, filter;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: transform, opacity;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Анимации для футера */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.social-icon {
  animation: float 3s ease-in-out infinite;
  will-change: transform;
}

.social-icon:nth-child(2) {
  animation-delay: 0.3s;
}

.social-icon:nth-child(3) {
  animation-delay: 0.6s;
}

.social-icon:nth-child(4) {
  animation-delay: 0.9s;
}

/* Анимация для lang-switcher dropdown */
@keyframes fadeInScale {
  0%   { opacity: 0; transform: translateY(-6px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Pulsing dot for availability badges */
@keyframes badgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(1.25); }
}

/* Поддержка prefers-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;
  }
}