/* ============================================================
   BASE — сброс, типографика, контейнеры, утилиты.
   Компонентные стили — в components.css. Значения берём из tokens.css.
   ============================================================ */

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

* { margin: 0; }

/* Атрибут hidden всегда побеждает display из классов */
[hidden] { display: none !important; }

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-200);
  line-height: var(--lh-normal);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-700); }

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

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

:focus-visible {
  outline: 3px solid var(--c-primary-600);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Заголовки ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--c-ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-600); line-height: 1.05; }
h2 { font-size: var(--fs-500); font-weight: var(--fw-bold); line-height: 1.14; }
h3 { font-size: var(--fs-400); font-weight: var(--fw-bold); line-height: 1.2; }
h4 { font-size: var(--fs-300); font-weight: var(--fw-bold); letter-spacing: var(--tracking-normal); line-height: 1.25; }

p { text-wrap: pretty; }

/* ---------- Контейнеры / секции ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--surface { background: var(--c-surface); }
.section--primary-tint { background: var(--c-primary-50); }
.section--dark {
  background: url("/img/azot-pattern.svg") center / cover no-repeat var(--c-dark);
  color: var(--c-on-dark);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }

/* ---------- Заголовок секции ---------- */
.section__head { max-width: 56ch; margin-bottom: var(--space-lg); }
.section__eyebrow {
  display: inline-block;
  font-size: var(--fs-100);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: var(--space-2xs);
}
.section__lead { font-size: var(--fs-300); color: var(--c-ink-2); line-height: 1.5; margin-top: var(--space-xs); }

/* ---------- Утилиты ---------- */
.muted { color: var(--c-ink-2); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.stack > * + * { margin-top: var(--space-sm); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }
.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;
}

/* Адаптивная сетка карточек (auto-fit) */
.grid-cards {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

/* ─── View Transitions (cross-document, Chrome 126+) ─── */
@keyframes vt-page-in {
  from { opacity: 0; translate: 0 8px; }
}
@keyframes vt-page-out {
  to { opacity: 0; translate: 0 -4px; }
}
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: 160ms ease both vt-page-out; }
  ::view-transition-new(root) { animation: 280ms ease both vt-page-in; }
}

/* ─── Scroll Reveal (атрибут data-reveal добавляется через JS) ─── */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
/* Stagger для grid-детей */
.product-cards > [data-reveal]:nth-child(2),
.gas-tiles > [data-reveal]:nth-child(2),
.advantages > [data-reveal]:nth-child(2),
.applications > [data-reveal]:nth-child(2),
.steps > [data-reveal]:nth-child(2) { transition-delay: 75ms; }

.product-cards > [data-reveal]:nth-child(3),
.gas-tiles > [data-reveal]:nth-child(3),
.advantages > [data-reveal]:nth-child(3),
.applications > [data-reveal]:nth-child(3),
.steps > [data-reveal]:nth-child(3) { transition-delay: 150ms; }

.product-cards > [data-reveal]:nth-child(4),
.gas-tiles > [data-reveal]:nth-child(4),
.advantages > [data-reveal]:nth-child(4),
.applications > [data-reveal]:nth-child(4) { transition-delay: 225ms; }

.product-cards > [data-reveal]:nth-child(5) { transition-delay: 300ms; }
.product-cards > [data-reveal]:nth-child(6) { transition-delay: 375ms; }
