/**
 * motion.css — стили для js/motion-init.js (anime.js + Motion).
 * Подключается последним, после modern.css.
 *
 * Классы на <html> ставит includes/head.php:
 *   .js-motion      — анимации включены (пользователь не просил «меньше движения»)
 *   .js-motion-pre  — временно: прячет цели до старта скрипта, чтобы не было мигания.
 *                     Скрипт снимает его сам, а если не загрузился — снимает таймер из head.php.
 *
 * ВАЖНО: список селекторов в .js-motion-pre должен совпадать с HERO/GRIDS/BLOCKS в js/motion-init.js.
 */

/* Эти блоки теперь анимирует скрипт — старый CSS-вход (m-rise в modern.css,
   fadeIn у .hero.fade-in) отключаем, иначе будет двойная анимация. */
html.js-motion[data-theme] body main :is(.hero, .section, .contacts-strip) {
  animation: none;
}

/* Предварительное скрытие целей (до старта скрипта) */
html.js-motion-pre :is(
  :is(.hero, .catalog-hero) > :not(.hero-actions),
  :is(.hero, .catalog-hero) .hero-actions > .btn,
  :is(.instructions-grid, .download-list, .seo-cluster-grid, .related-products, .firmware-list, .feature-grid, .catalog-grid) > *,
  .section-header, .step, .note, .warning, .success-box, .catalog-promo, .contacts-strip, .nav-footer,
  .product-section, .product-facts, .product-toc
) {
  opacity: 0;
}

/* Индикатор прокрутки страницы (его создаёт и двигает Motion) */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--m-accent, #3a7ab8), var(--m-accent-strong, #5aa0d8));
  z-index: 9999;
  pointer-events: none;
}

@media print {
  .scroll-progress { display: none !important; }
}
