/* ============================================================================
   base.css — сброс + базовая типографика. Применяет токены к каркасу страницы.
   Подключать ПОСЛЕ tokens.css.
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;   /* не масштабировать текст при повороте (iOS) */
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Изображения/медиа — отзывчивые по умолчанию */
img, picture, svg, video { display: block; max-width: 100%; }

/* Кнопки/поля наследуют шрифт (иначе браузер ставит свой) */
button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Заголовки */
h1, h2, h3 { line-height: var(--leading-tight); font-weight: var(--weight-bold); }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

small { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Видимый фокус для клавиатуры/доступности (но не «мышиный» ободок) */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Уважение к «уменьшить анимацию» */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
