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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--fg);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

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

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

:focus-visible {
  outline: 2px solid var(--accent-fill);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background-color: var(--accent-fill);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Каркас ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  padding-block: var(--section);
}

/* ---------- Типографика ---------- */

.display {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.h2 {
  font-family: var(--display);
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  font-size: var(--fs-lead);
  color: var(--fg-70);
  text-wrap: pretty;
}

.lead--dark {
  color: var(--on-dark-65);
}

/* Надзаголовок с индексом раздела */
.kicker {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-62);
}

.kicker::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--line);
}

.kicker--dark {
  color: var(--on-dark-50);
}

.kicker--dark::after {
  background-color: var(--line-dark);
}

.kicker b {
  color: var(--accent-on-light);
  font-weight: 500;
}

/* На тёмном глубокий изумруд уходит в фон — там нужен основной. */
.kicker--dark b {
  color: var(--accent-on-dark);
}

.section-head {
  display: grid;
  gap: var(--s-5);
  max-width: 58ch;
  margin-bottom: var(--s-12);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--s-4);
  z-index: 200;
  padding: var(--s-3) var(--s-5);
  background-color: var(--accent-fill);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 600;
}

.skip-link:focus-visible {
  top: var(--s-4);
}

/* ---------- Появление при скролле ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--t-slow) var(--ease),
    transform var(--t-slow) var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}
