/* Общие правила: сброс, типографика, фокус, уменьшенное движение. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--topbar-height);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

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

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* Область содержимого */
.container {
  width: 100%;
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Акцентное слово заголовка: Lora Italic, не больше одного на заголовок */
.accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--color-accent-strong);
}

/* Текст только для чтения с экрана */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Видимый фокус при управлении с клавиатуры: кольцо с отступом цвета страницы */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 5px var(--color-focus);
}

/* Уменьшенное движение: без переходов и без прокрутки с анимацией */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
