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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Типографика ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 650;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: var(--font-size-xl); }
h2 { font-size: var(--font-size-lg); }
h3 { font-size: 1.05rem; }

p { margin-bottom: var(--space-3); }

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

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

small, .text-small { font-size: var(--font-size-sm); }

/* ===== Списки ===== */
ul, ol { padding-left: var(--space-5); }

/* ===== Изображения ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Таблицы (базовый сброс) ===== */
table {
  border-collapse: collapse;
  width: 100%;
}

/* ===== Фокус: доступность ===== */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Кнопки (базовое) ===== */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ===== Поля (базовое) ===== */
input,
textarea,
select {
  font-family: inherit;
  font-size: var(--font-size-md);
}

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

/* ===== Skip-link ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--color-brand);
  color: var(--color-brand-contrast);
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
  color: var(--color-brand-contrast);
  text-decoration: none;
}