/* Reset, typography and page-level layout. Reads tokens.css only. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display);
  font-weight: 700;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--accent);
  color: var(--accent-on);
  border-radius: var(--r-sm);
}

.skip-link:focus {
  top: var(--sp-3);
}

/* Page sections */
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(var(--sp-8), 8vw, var(--sp-9));
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-head {
  display: grid;
  justify-items: start;
  gap: var(--sp-3);
  max-width: 44rem;
  margin-bottom: var(--sp-7);
}

.lead {
  font-size: var(--fs-lead);
  color: var(--text-2);
  max-width: 40rem;
}

.muted {
  color: var(--text-2);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

.h3-size {
  font-size: var(--fs-h3);
}

/* Space Grotesk and Be Vietnam Pro have no Cyrillic: use one system face for the whole page in Russian */
html:lang(ru) {
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
