/* ============================================================
   BASE — сброс, типографика, глобальные примитивы
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: var(--lh-snug); }
p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.35em; }
li { margin-bottom: var(--sp-2); }
li:last-child { margin-bottom: 0; }

a { color: var(--acid); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

b, strong { font-weight: 700; color: var(--fg); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--sp-6) 0;
}

code, kbd, samp, pre { font-family: var(--font-mono); }

:not(pre) > code {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  padding: 0.12em 0.4em;
  font-size: 0.88em;
  color: var(--acid);
  white-space: nowrap;
}

kbd {
  background: var(--bg-3);
  border: 1px solid var(--line-3);
  border-bottom-width: 2px;
  padding: 0.1em 0.42em;
  font-size: 0.8em;
  color: var(--fg-2);
}

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

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

::selection { background: var(--acid); color: #000; }

/* --- Скроллбары --- */
* { scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg-1); }
*::-webkit-scrollbar-thumb { background: var(--line-2); border: 2px solid var(--bg-1); }
*::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

/* --- Зернистость фона: тонкий слой «плёнки» поверх чёрного --- */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Утилиты --- */
.mono { font-family: var(--font-mono); }
.dim  { color: var(--fg-3); }
.nowrap { white-space: nowrap; }
.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;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: block;
  margin-bottom: var(--sp-3);
}

/* Заголовок секции с полосой-разделителем во всю ширину */
.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  margin: var(--sp-8) 0 var(--sp-5);
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px);
}
.section-head h2 {
  font-size: var(--fs-h2);
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.section-head__count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-3);
}
