/*
 * Сброс, типографика и фокус маркетингового сайта.
 * Подключается ПОСЛЕ tokens.css.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Якорь не должен уезжать под липкую шапку. */
  scroll-padding-top: calc(var(--header-h) + var(--s5));
}

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(34px, 5.2vw, 56px); }
h2 { font-size: clamp(27px, 3.6vw, 40px); }
h3 { font-size: clamp(19px, 2vw, 22px); line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-size: 17px; line-height: 1.35; letter-spacing: 0; }

p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }

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

img, svg, video, iframe { max-width: 100%; }
img, video { height: auto; display: block; }

a {
  color: var(--brand-deep);
  text-decoration-color: var(--brand-line);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

button { font: inherit; color: inherit; }

/* Видимый фокус — на всём сайте, одинаковый. Убирать его нельзя: сайт
   обязан проходиться с клавиатуры (ТЗ, раздел 16.2). */
:focus-visible {
  outline: 3px solid var(--brand-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Служебное ---------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: 200;
  padding: var(--s3) var(--s5);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--s4); }

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

.section { padding-block: clamp(56px, 8vw, 96px); }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
/* Шапка внутренней страницы. Своя секция нужна, чтобы её нижний отступ не
   складывался с верхним отступом следующей: две подряд идущие секции давали
   между заголовком и первым блоком провал под 200 пикселей. */
.section--head { padding-block: clamp(24px, 3vw, 40px) 0; }
.section--head .head { margin-bottom: 0; }
.section--surface { background: var(--surface); }
.section--soft { background: var(--brand-soft); }
.section--night { background: var(--night); color: var(--on-night-2); }
.section--night h2, .section--night h3 { color: var(--on-night); }

.section + .section--surface,
.section--surface + .section { border-top: 1px solid transparent; }

/* --- Заголовок секции ---------------------------------------------------- */

.head { max-width: 720px; margin-bottom: var(--s7); }
.head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  margin-bottom: var(--s3);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  /* Оранжевый как текст — только --brand-deep (4.6:1). */
  color: var(--brand-deep);
}
.section--night .eyebrow { color: var(--brand); }

.head__lead {
  margin-top: var(--s4);
  font-size: 18px;
  color: var(--ink-2);
}
.section--night .head__lead { color: var(--on-night-2); }

/* --- Сетки --------------------------------------------------------------- */

.grid { display: grid; gap: var(--s5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* --- Мелочи -------------------------------------------------------------- */

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }

.note {
  font-size: 14px;
  color: var(--ink-3);
}

/* Маркер незакрытого факта: в разработке виден жёлтым, в проде его быть не
   должно — `npm run check:content` роняет сборку, пока маркеры остались. */
.todo-slot {
  background: #FFF3B0;
  outline: 2px dashed #C79A00;
  padding: 0 4px;
  border-radius: 3px;
  color: #6B5200;
}
