/* =============================================
   Базовые стили — типографика, body, контейнер, утилиты
   ============================================= */

/* --- Базовый body --- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
}

/* Блокировка прокрутки при открытом мобильном меню */
body.is-locked {
  overflow: hidden;
}

/* --- Контейнер --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --- Типографика заголовков --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }

p {
  margin: 0;
  color: var(--color-text);
}

/* --- Ссылки --- */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-accent);
}

/* --- Доступность: focus-visible для всех интерактивных элементов --- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Утилиты --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Анимация появления при скролле (управляется JS через .is-visible) --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Каскадная задержка появления для соседних элементов */
.animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.24s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.32s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.40s; }
.animate-on-scroll:nth-child(7) { transition-delay: 0.48s; }

/* --- Уважение к настройке prefers-reduced-motion ---
   Отключаем все наши декоративные анимации */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__title,
  .hero__lead,
  .hero__cta,
  .hero__eyebrow,
  .hero__benefits,
  .hero__trust {
    animation: none;
  }

  .hero__scroll-arrow {
    animation: none;
  }

  /* Chevron в раскрывающихся карточках — без поворота-анимации */
  .approach-card__chevron,
  .faq-card__chevron {
    transition: none;
  }

  /* Sticky CTA — без transition */
  .sticky-cta {
    transition: none;
  }

  /* Квиз — без анимации появления шага */
  .quiz__step--active {
    animation: none;
  }
}
