/* База: сброс, типографика, обёртка страницы. Компоненты — в своих файлах. */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-lg); font-family: var(--font-text); font-weight: 600; letter-spacing: 0; }

p { margin: 0; }
p + p { margin-top: .8em; }
p, dd, summary { text-wrap: pretty; }   /* Детали (21.09): браузер не оставляет одно слово на последней строке */
a, button { -webkit-tap-highlight-color: transparent; }

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

img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

::selection { background: var(--sage); color: var(--ink); }

:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; border-radius: var(--r-md); }

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.skip { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill); background: var(--moss); color: var(--moss-ink); font-weight: 600; font-size: var(--text-sm); }
.skip:focus-visible { top: 16px; outline-color: var(--ink); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Маркер-таблетка на слове в заголовке */
.hl {
  display: inline-block;
  padding: 0 .35em;
  margin: 0 -.1em;
  border-radius: var(--r-pill);
  background: var(--sage);
  font-weight: 400;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  animation: hl var(--dur-slow) var(--ease-out) .3s both;
}
@keyframes hl { from { background-color: transparent; } to { background-color: var(--sage); } }

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