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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

body {
  min-height: 100svh;
  overflow-x: hidden;
  overflow-anchor: none;
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--color-ink);
  background: var(--gradient-light);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: var(--lh-heading);
  font-weight: 600;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--color-secondary);
  color: var(--color-on-dark);
}

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

section[id] {
  scroll-margin-top: 6.5rem;
}

@media (max-width: 40rem) {
  .container {
    padding-inline: 24px;
  }
}

/* Планшет: та же логика, что и на мобильном, на шаг шире по 8pt-шкале —
   иначе выше 40rem паддинг резко проваливается обратно к ~8px из clamp(). */
@media (min-width: 40.0625rem) and (max-width: 64rem) {
  .container {
    padding-inline: 32px;
  }
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--color-secondary);
  color: #fff;
  border-radius: var(--radius-sm);
  transition: top var(--duration-base) var(--ease-out);
}

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

.mt-6 {
  margin-top: var(--space-6);
}
