/* ==========================================================================
   УмКид — Animations
   ========================================================================== */

/* --- Keyframes ------------------------------------------------------------ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

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

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

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

@keyframes spin-slow-rev {
  to { transform: rotate(-360deg); }
}

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

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

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

@keyframes bounce-in {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes streak {
  0%   { transform: translateX(-100%) scaleX(0); opacity: 0; }
  50%  { transform: translateX(0) scaleX(1); opacity: 1; }
  100% { transform: translateX(100%) scaleX(0); opacity: 0; }
}

@keyframes number-count {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Entrance Animation Classes ------------------------------------------ */
.fade-up {
  animation: fade-up 0.6s var(--ease-out-soft) backwards;
}

.scale-in {
  animation: scale-in 0.7s var(--ease-out-soft) backwards;
}

.slide-in-right {
  animation: slide-in-right 0.7s var(--ease-out-soft) backwards;
}

.slide-in-left {
  animation: slide-in-left 0.7s var(--ease-out-soft) backwards;
}

/* --- Stagger Delays ------------------------------------------------------- */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.15s; }
.stagger > *:nth-child(3) { animation-delay: 0.25s; }
.stagger > *:nth-child(4) { animation-delay: 0.35s; }
.stagger > *:nth-child(5) { animation-delay: 0.45s; }
.stagger > *:nth-child(6) { animation-delay: 0.55s; }
.stagger > *:nth-child(7) { animation-delay: 0.65s; }
.stagger > *:nth-child(8) { animation-delay: 0.75s; }

/* --- Ambient Loops -------------------------------------------------------- */
.float        { animation: float      6s var(--ease-sine) infinite; }
.float-alt    { animation: float-alt  7s var(--ease-sine) infinite; }
.float-sm     { animation: float-sm   4s var(--ease-sine) infinite; }
.spin-slow    { animation: spin-slow  30s linear infinite; }
.spin-slow-rev { animation: spin-slow-rev 20s linear infinite; }

/* --- Scroll-triggered Reveals --------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s var(--ease-out-soft),
    transform 0.7s var(--ease-out-soft);
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.7s var(--ease-out-soft),
    transform 0.7s var(--ease-out-soft);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition:
    opacity 0.7s var(--ease-out-soft),
    transform 0.7s var(--ease-out-soft);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition:
    opacity 0.7s var(--ease-out-soft),
    transform 0.7s var(--ease-out-soft);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delays for groups */
.reveal-group > *:nth-child(1) { transition-delay: 0s; }
.reveal-group > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-group > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-group > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-group > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-group > *:nth-child(6) { transition-delay: 0.5s; }

/* --- Hover Micro-interactions --------------------------------------------- */
.hover-lift {
  transition:
    transform 0.3s var(--ease-out-soft),
    box-shadow 0.3s var(--ease-out-soft);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-scale {
  transition: transform 0.3s var(--ease-out-soft);
}
.hover-scale:hover {
  transform: scale(1.03);
}

/* --- Gradient Animated Background ---------------------------------------- */
.gradient-animated {
  background-size: 300% 300%;
  animation: gradient-shift 8s ease infinite;
}

/* --- Link Underline Sweep ------------------------------------------------- */
.link-sweep {
  position: relative;
  text-decoration: none;
}
.link-sweep::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.86, 0, 0.07, 1);
}
.link-sweep:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-scale, .reveal-left, .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .float, .float-alt, .float-sm, .spin-slow, .spin-slow-rev {
    animation: none !important;
  }
}
