/**
 * Эффекты без «тряски» при скролле: лёгкая «ТВ-рыбь» на hover и навигации.
 */

/* ---------- Карточки и плитки: наведение (без сильного сдвига) ---------- */
body.page-glitch .portfolio .portfolio-wrap {
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.2s ease;
}

body.page-glitch .portfolio .portfolio-wrap:hover {
  animation: gx-crt-hover 0.55s steps(3, end);
  box-shadow:
    inset 0 0 0 1px rgba(255, 61, 193, 0.35),
    0 0 0 1px rgba(46, 203, 255, 0.25);
}

@keyframes gx-crt-hover {
  0%,
  100% {
    filter: brightness(1) contrast(1);
  }
  33% {
    filter: brightness(1.04) contrast(1.02);
  }
  66% {
    filter: brightness(0.98) contrast(1.03);
  }
}

body.page-glitch .services .icon-box:hover {
  animation: gx-crt-hover 0.45s steps(3, end);
}

body.page-glitch .facts .count-box:hover {
  animation: gx-crt-hover 0.45s steps(3, end);
}

body.page-glitch .contact .php-email-form button[type="submit"]:hover {
  animation: gx-crt-hover 0.4s steps(3, end);
}

body.page-glitch #footer .social-links a:hover {
  animation: gx-crt-hover 0.45s steps(3, end);
}

/* Навигация: лёгкий «шум» строки */
body.page-glitch .nav-menu a:hover span {
  animation: gx-link-flicker 0.45s steps(2, end);
}

@keyframes gx-link-flicker {
  0%,
  100% {
    letter-spacing: inherit;
    filter: none;
  }
  40% {
    letter-spacing: 0.08em;
    filter: contrast(1.08);
  }
  70% {
    letter-spacing: 0.02em;
    filter: brightness(1.05);
  }
}

/* ---------- Доступность ---------- */
@media (prefers-reduced-motion: reduce) {
  body.page-glitch .portfolio .portfolio-wrap:hover,
  body.page-glitch .services .icon-box:hover,
  body.page-glitch .facts .count-box:hover,
  body.page-glitch .contact .php-email-form button[type="submit"]:hover,
  body.page-glitch #footer .social-links a:hover,
  body.page-glitch .nav-menu a:hover span {
    animation: none !important;
  }
}
