/* Траверса - база: палитра, сброс, типографика, общие элементы.
   Цвета только из _colors/variables.css (colorfor). */

:root {
  --color-background: #0c1018;
  --color-surface: #171b24;
  --color-surface-elevated: #232730;
  --color-surface-inverse: #e6ebf6;
  --color-text: #e6e9ef;
  --color-text-muted: #abaeb4;
  --color-text-inverse: #1d222b;
  --color-primary: #3d3bf3;
  --color-primary-hover: #3526e3;
  --color-primary-pressed: #3013d8;
  --color-primary-foreground: #d7deec;
  --color-border: #35383e;
  --color-border-strong: #636975;
  --color-focus-ring: #7dabff;
  --color-disabled: #27292d;
  --color-disabled-foreground: #6f7278;
  --color-success: #3aa85b;
  --color-error: #dc665b;

  /* производные от палитры: те же цвета с прозрачностью */
  --text-rgb: 230, 233, 239;
  --bg-rgb: 12, 16, 24;
  --surface-rgb: 23, 27, 36;
  --primary-rgb: 61, 59, 243;

  --glass: rgba(var(--surface-rgb), .55);
  --glass-line: rgba(var(--text-rgb), .12);
  --glass-top: inset 0 1px 0 rgba(var(--text-rgb), .08);
  --shadow-hang: 0 24px 48px -24px rgba(0, 0, 0, .7), 0 2px 0 rgba(0, 0, 0, .35);
  --light-top: radial-gradient(ellipse 70% 45% at 50% 0%, rgba(var(--text-rgb), .07), transparent 70%);
  --metal: linear-gradient(180deg, #e6e9ef 0%, #abaeb4 55%, #636975 100%);

  --r: 12px;          /* кнопки, поля, переключатели */
  --r-card: 18px;     /* карточки, фото, таблицы, бланки */
  --r-panel: 22px;    /* стеклянные панели и плашки */
  --r-island: 20px;   /* шапка после скролла */
  --r-sm: 5px;        /* галочки, мелкие метки */
  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.22, 1, .36, 1);

  --ff-body: "PT Sans Caption", system-ui, sans-serif;
  --ff-display: "Oswald", "Arial Narrow", sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, monospace;

  color-scheme: dark;
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--color-primary); color: var(--color-primary-foreground); }
:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 3px; border-radius: var(--r); }

[hidden] { display: none !important; }

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

/* зерно поверх всего */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* сетка и ритм */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sec { position: relative; padding-block: clamp(56px, 6.5vw, 96px); background-image: var(--light-top); overflow-x: clip; }
.sec--tight { padding-block: clamp(56px, 6vw, 88px); }

/* типографика */
.f-display { font-family: var(--ff-display); font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; line-height: .82; }
.f-mono { font-family: var(--ff-mono); }
.metal { background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h2 { font-size: clamp(32px, 4.2vw, 56px); line-height: 1.04; font-weight: 700; letter-spacing: -.02em; max-width: 18ch; }
.h3 { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.lead { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; color: var(--color-text-muted); max-width: 52ch; }
.muted { color: var(--color-text-muted); }
.label { font-family: var(--ff-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.num { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }

/* кнопки */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border: 1px solid transparent; border-radius: var(--r);
  font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; overflow: hidden; transition: background-color .25s var(--ease), border-color .25s var(--ease), transform .15s;
}
.btn--main { background: var(--color-primary); color: var(--color-primary-foreground); }
.btn--main::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-110%);
  background: linear-gradient(100deg, transparent 20%, rgba(var(--text-rgb), .22) 50%, transparent 80%);
}
.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
@media (hover: hover) and (pointer: fine) {
  .btn--main:hover { background: var(--color-primary-hover); }
  .btn--main:hover::after { transform: translateX(110%); transition: transform .8s var(--ease); }
  .btn--ghost:hover { border-color: var(--color-text-muted); background: var(--glass); }
}
.btn:active { transform: translateY(1px); }
.btn--main:active { background: var(--color-primary-pressed); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--color-disabled); color: var(--color-disabled-foreground); cursor: not-allowed; border-color: transparent; }

.link { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 2px; transition: background-image .2s; }
@media (hover: hover) { .link:hover { background-image: linear-gradient(var(--color-primary), var(--color-primary)); } }

/* стекло */
.glass {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-panel);
  box-shadow: var(--glass-top), var(--shadow-hang);
  -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%);
}

/* шапка секции: заголовок + лид рядом, не стопкой по центру */
.sec-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
@media (max-width: 860px) { .sec-head { grid-template-columns: 1fr; } }

/* формы */
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; color: var(--color-text-muted); }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r);
  background: rgba(var(--bg-rgb), .6); border: 1px solid var(--color-border-strong); color: var(--color-text);
  transition: border-color .2s;
}
textarea.input { min-height: 120px; resize: vertical; }
.input:hover { border-color: var(--color-text-muted); }
.input:focus { outline: none; border-color: var(--color-focus-ring); box-shadow: 0 0 0 3px rgba(125, 171, 255, .25); }
.field.is-error .input { border-color: var(--color-error); border-width: 2px; }
.field-err { display: none; font-size: 14px; color: var(--color-error); }
.field.is-error .field-err { display: flex; gap: 6px; }
.field-err::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 700; flex: 0 0 auto; }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: 15px; color: var(--color-text-muted); cursor: pointer; }
.check input { appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border: 1.5px solid var(--color-border-strong); border-radius: var(--r-sm); background: rgba(var(--bg-rgb), .6); cursor: pointer; display: grid; place-items: center; }
.check input:checked { background: var(--color-primary); border-color: var(--color-primary); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--color-primary-foreground); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check.is-error input { border-color: var(--color-error); border-width: 2px; }
.check a { color: var(--color-text); }

/* языки: показ блоков под язык (длинные абзацы) */
html[data-lang="en"] [data-lang-block="ru"], html:not([data-lang="en"]) [data-lang-block="en"] { display: none !important; }

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

/* английский: прячем страницу до подмены текста (доли секунды) */
html.i18n-wait body { opacity: 0; }
