/* ═══════════════════════════════════
   RESET (based on Andy Bell)
═══════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  /* Резервируем место под вертикальный скроллбар,
     чтобы его появление не смещало layout */
  scrollbar-gutter: stable;
}

/* Базовый фон — на <html>, чтобы body/sidebar/main-area были прозрачными и
   noise слой body::before оставался виден. Хардкод #212121 / #f5f5f5 здесь —
   намеренный: --color-bg из tokens.css определён на :root + [data-theme="..."]
   на body, и <html> не может читать его через var() (theme-scope ниже html).
   Значения зеркалят --color-bg: tokens.css → :root #212121, [data-theme="light"] #f5f5f5. */
html { background: #212121; }  /* fallback = dark, mirrors tokens.css :root --color-bg */
html:has(> body[data-theme="light"]) { background: #f5f5f5; }  /* mirrors [data-theme="light"] --color-bg */
html:has(> body[data-theme="dark"])  { background: #212121; }  /* mirrors [data-theme="dark"] --color-bg */

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  /* bg переехал на <html> — body прозрачен, чтобы noise слой
     (body::before) был виден через лайаут */
  background: transparent;
  color: var(--color-text);
}

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

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

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

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration:  0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
