/* ==========================================================================
   Base Styles — БизнесМатика
   Сброс, основные стили, типографика, layout-утилиты.
   ========================================================================== */

/* ── Импорт модулей ───────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url('variables.css');
@import url('components.css');
@import url('responsive.css');

/* ── Сброс (Modern Reset) ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%; /* 16px */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Убираем скролл при открытом модальном окне */
body.modal-open,
body.menu-open {
  overflow: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Убираем стандартную обводку для мыши, оставляем для клавиатуры */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Типографика ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-primary);
}

.hero-title {
  font-size: var(--fs-hero);
  line-height: 1.15;
}

h1, .h1 { font-size: var(--fs-h1); }
h2, .h2 { font-size: var(--fs-h2); margin-bottom: var(--space-lg); }
h3, .h3 { font-size: var(--fs-h3); }
h4, .h4 { font-size: var(--fs-h4); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-light);
}

p:last-child {
  margin-bottom: 0;
}

.text-accent  { color: var(--color-accent); }
.text-primary { color: var(--color-primary); }
.text-muted   { color: var(--color-text-muted); }
.text-white   { color: var(--color-white); }
.text-center  { text-align: center; }
.text-small   { font-size: var(--fs-small); }
.text-xs      { font-size: var(--fs-xs); }

.fw-medium { font-weight: var(--fw-medium); }
.fw-bold   { font-weight: var(--fw-bold); }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow {
  max-width: var(--container-lg);
}

.section {
  padding-block: var(--space-section);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.section--primary h2,
.section--primary h3,
.section--primary h4 {
  color: var(--color-white);
}

.section--primary p {
  color: rgba(255, 255, 255, 0.85);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header p {
  max-width: 640px;
  margin-inline: auto;
  margin-top: var(--space-sm);
}

/* ── Flexbox / Grid утилиты ───────────────────────────────────────────────── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm     { gap: var(--space-sm); }
.gap-md     { gap: var(--space-md); }
.gap-lg     { gap: var(--space-lg); }
.gap-xl     { gap: var(--space-xl); }

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

/* ── Spacing утилиты ──────────────────────────────────────────────────────── */
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* ── Видимость ────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hidden { display: none !important; }

/* ── Анимации входа (Intersection Observer) ───────────────────────────────── */
.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-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }

/* ── Privacy Policy page ─────────────────────────────────────────────────── */
.privacy__container {
  max-width: var(--container-lg);
}

.privacy__container h1 {
  margin-bottom: var(--space-2xl);
}

.privacy__container h2 {
  font-size: var(--fs-h3);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.privacy__container p {
  margin-bottom: var(--space-sm);
  line-height: var(--lh-relaxed);
}

.privacy__container ul {
  list-style: disc;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.privacy__container li {
  margin-bottom: var(--space-xs);
  color: var(--color-text-light);
  line-height: var(--lh-relaxed);
}

.privacy__container a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── 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;
  }

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