/* ═══════════════════════════════════════════════════════════
   base.css — Reset, типографика, базовые стили
   ═══════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  min-height: 100vh;
  overflow: hidden;
}

/* ── Типографика ── */
h1, .h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h2, .h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

h3, .h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

h4, .h4 {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

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

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

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

/* ── Списки ── */
ul, ol {
  list-style: none;
}

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

/* ── Кнопки и инпуты — наследуют шрифт ── */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

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

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

/* ── Скроллбар (webkit) ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-disabled);
}

/* ── Утилиты ── */
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success-text); }
.text-danger { color: var(--danger-text); }

.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.caption {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-tertiary);
}

/* ── Анимации ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn var(--transition-fast) ease-out;
}

/* ── Скрытие (доступно для скринридеров) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
