/* ==========================================================================
   GRUZ74 — base.css
   Токены, сброс, типографика, сетка, утилиты.
   Порядок подключения: base.css → components.css → pages.css
   ========================================================================== */

:root {
  /* Палитра: графит, антрацит, чёрный, белый, насыщенный оранжевый */
  --bg: #0a0a0c;
  --bg-soft: #0f0f13;
  --surface: #141419;
  --surface-2: #1a1a21;
  --surface-3: #22222b;
  --line: #2b2b35;
  --line-soft: rgba(255, 255, 255, 0.08);

  --text: #f3f3f6;
  --text-dim: #b6b6c2;
  --text-muted: #8b8b99;

  --accent: #ff6a13;
  --accent-strong: #ff7d33;
  --accent-soft: rgba(255, 106, 19, 0.12);
  --accent-line: rgba(255, 106, 19, 0.38);
  --accent-ink: #16100c;

  --ok: #3ecf8e;
  --err: #ff5c5c;

  /* Геометрия */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --container: 1200px;
  --gutter: clamp(18px, 4.2vw, 40px);
  --section-y: clamp(56px, 8vw, 116px);

  /* Типографика */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --fs-h1: clamp(2rem, 5.4vw, 4.15rem);
  --fs-h2: clamp(1.55rem, 3.4vw, 2.6rem);
  --fs-h3: clamp(1.12rem, 1.6vw, 1.35rem);
  --fs-lead: clamp(1.02rem, 1.35vw, 1.2rem);

  --shadow-lg: 0 30px 80px -32px rgba(0, 0, 0, 0.85);
  --shadow-md: 0 16px 40px -24px rgba(0, 0, 0, 0.8);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  color-scheme: dark;
}

/* ---------- Сброс ---------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Фоновые свечения: тонкие, без «кислотности» */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 78% -8%, rgba(255, 106, 19, 0.11), transparent 62%),
    radial-gradient(50rem 36rem at 6% 4%, rgba(120, 130, 160, 0.09), transparent 65%),
    linear-gradient(180deg, #0b0b0e 0%, #08080a 55%, #0a0a0c 100%);
}

body.is-locked {
  overflow: hidden;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- Типографика --------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 62ch;
  text-wrap: pretty;
}

p {
  text-wrap: pretty;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- Сетка и секции ------------------------------------------------ */

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

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--tight {
  padding-block: clamp(36px, 5vw, 64px);
}

.section--surface {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 55%);
  border-block: 1px solid var(--line-soft);
}

.section-head {
  display: grid;
  gap: 18px;
  max-width: 46rem;
  margin-bottom: clamp(28px, 4vw, 52px);
}

.section-head--wide {
  max-width: 60rem;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
}

.grid {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
}

.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));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

/* ---------- Утилиты ------------------------------------------------------- */

.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;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.accent {
  color: var(--accent);
}

.muted {
  color: var(--text-muted);
}

.nowrap {
  white-space: nowrap;
}

.hairline {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--line), transparent);
  margin: 0;
}

/* Появление по скроллу: прогрессивное улучшение */
.reveal {
  opacity: 1;
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Адаптив сеток ------------------------------------------------- */

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

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  :root {
    --section-y: 52px;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }

  h1 {
    letter-spacing: -0.022em;
  }
}
