/* VOSTOK MOTORS demo. Design tokens */
:root {
  --bg: #0b0b0d;
  --bg-2: #121216;
  --bg-3: #1a1a21;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --fg: #ffffff;
  --fg-2: rgba(255, 255, 255, 0.7);
  --fg-3: rgba(255, 255, 255, 0.48);
  --accent: #e3262f;
  --accent-hover: #f0343d;
  --accent-press: #c41e26;
  --font: "Manrope", "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --container: 1240px;
  --pad: clamp(20px, 4vw, 56px);
  --header-h: 72px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t-fast: 160ms;
  --t-stage: 350ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font: 500 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--fg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 52px; padding: 0 26px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 16px; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-press); }
.btn--ghost { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.btn--ghost:hover { border-color: rgba(255, 255, 255, 0.42); background: rgba(255, 255, 255, 0.09); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }

/* Header */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out);
}
.header.is-solid {
  background: rgba(11, 11, 13, 0.94);
  border-bottom-color: var(--line);
}
.header__inner { height: 100%; padding: 0 var(--pad); display: flex; align-items: center; gap: var(--s-6); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; letter-spacing: 0.1em; white-space: nowrap; }
.brand__mark { width: 18px; height: 10px; background: var(--accent); border-radius: 2px; transform: skewX(-18deg); flex-shrink: 0; }
.nav { display: flex; gap: 28px; margin-left: auto; font-size: 15px; font-weight: 600; color: var(--fg-2); }
.nav a { transition: color var(--t-fast) var(--ease-out); }
.nav a:hover { color: var(--fg); }
.header__phone { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Hero: one 100svh screen. app.js plays pre-baked eased transitions (forward file F, reverse file R)
   between story stops; the stop still sits under both videos, .hero__fade crossfades jumps/fallbacks. */
.hero { position: relative; height: 100vh; height: 100svh; }
.hero.is-locked { touch-action: none; overscroll-behavior: none; }
.hero__stage {
  --hero-bottom: env(safe-area-inset-bottom, 0px);
  position: relative; height: 100%; overflow: hidden; background: var(--bg);
}
.hero__media { position: absolute; inset: 0; contain: strict; }
.hero__media picture { display: contents; }
.hero__still, .hero__video, .hero__fade { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__video { z-index: 1; opacity: 0; pointer-events: none; transition: opacity 300ms var(--ease-out); }
.hero__video.is-on { opacity: 1; }
.hero__video.is-front { z-index: 2; }
.hero__fade { z-index: 3; opacity: 0; pointer-events: none; transition: opacity 400ms var(--ease-out); }
.hero__fade.is-on { opacity: 1; }
.hero__fade.is-instant { transition: none; }
.hero__line { position: absolute; left: 0; right: 0; bottom: var(--hero-bottom); height: 2px; z-index: 1; pointer-events: none; }
.hero__line i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; will-change: transform; }
.hero__loader {
  position: absolute; right: var(--pad); bottom: calc(var(--hero-bottom) + 41px);
  width: 64px; height: 2px; border-radius: 1px; overflow: hidden; background: rgba(255, 255, 255, 0.18);
  transition: opacity 300ms var(--ease-out);
}
.hero__loader i { display: block; height: 100%; background: var(--fg-2); transform: scaleX(var(--load, 0)); transform-origin: left; transition: transform 200ms var(--ease-out); }
.hero__loader.is-done { opacity: 0; }
.hero__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 11, 13, 0.86) 0%, rgba(11, 11, 13, 0.6) 32%, rgba(11, 11, 13, 0.12) 60%, rgba(11, 11, 13, 0) 100%),
    linear-gradient(180deg, rgba(11, 11, 13, 0.66) 0%, rgba(11, 11, 13, 0.2) 14%, rgba(11, 11, 13, 0) 28%, rgba(11, 11, 13, 0) 72%, rgba(11, 11, 13, 0.55) 100%);
}
.hero__content {
  position: absolute; left: var(--pad); right: var(--pad); top: 50%; transform: translateY(-50%);
  max-width: 680px; display: flex; flex-direction: column; gap: var(--s-7);
}
.hero__stages { display: grid; align-items: end; }
.hero__stages.is-instant .stage { transition: none; }
.stage {
  grid-area: 1 / 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4);
  opacity: 0; transform: translateY(12px); visibility: hidden; pointer-events: none;
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out), visibility 0s linear 250ms;
}
.stage.is-active {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity 450ms var(--ease-out) 150ms, transform 450ms var(--ease-out) 150ms, visibility 0s;
}
.stage.is-leaving { transform: translateY(-10px); }
.stage__label { font-size: 13px; font-weight: 700; letter-spacing: 0.16em; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.stage__title {
  font-size: clamp(2.5rem, 5.4vw, 4.9rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em;
  text-wrap: balance; max-width: 13ch;
}
.stage__sub { font-size: clamp(1.05rem, 1.35vw, 1.3rem); line-height: 1.45; color: var(--fg-2); max-width: 46ch; text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero__progress { position: absolute; left: var(--pad); bottom: calc(var(--hero-bottom) + 40px); display: flex; gap: 6px; transition: opacity 200ms var(--ease-out); }
.hero__progress span { width: 44px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.hero__progress i { display: block; height: 100%; background: var(--fg); transform: scaleX(0); transform-origin: left; will-change: transform; }
.hero__hint {
  position: absolute; left: 50%; bottom: calc(var(--hero-bottom) + 30px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--fg-2); pointer-events: none;
  transition: opacity 240ms var(--ease-out);
}
.hero__hint svg { animation: hint-nudge 1.6s var(--ease-out) infinite; }
.hero__hint.is-hidden { opacity: 0; }
.hero__hint.is-hidden svg { animation: none; }
@keyframes hint-nudge { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(4px); opacity: 1; } }

/* Sections (part 2 follows) */
.section { padding: var(--s-10) 0; }
.section__head { display: flex; flex-direction: column; gap: var(--s-4); max-width: 640px; margin-bottom: var(--s-8); }
.section__head h2, .lead__text h2 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 800; line-height: 1.06; letter-spacing: -0.025em; }
.section__head p { font-size: 17px; line-height: 1.5; color: var(--fg-2); max-width: 56ch; }

/* Models */
.models { background: var(--bg); }
.models__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.card {
  position: relative; display: flex; align-items: flex-end; min-height: 440px; padding: var(--s-5);
  border-radius: var(--r-lg); overflow: hidden; background: var(--bg-2);
  isolation: isolate;
  transition: transform 160ms var(--ease-out);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--img) center / cover no-repeat, var(--bg-3);
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0.05) 0%, rgba(11, 11, 13, 0.25) 45%, rgba(11, 11, 13, 0.92) 100%);
  transition: opacity 240ms var(--ease-out);
}
.card:active { transform: scale(0.985); }
.card__body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.card__title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.card__text { font-size: 14px; line-height: 1.45; color: var(--fg-2); text-wrap: pretty; }
.card__link { margin-top: var(--s-3); font-size: 14px; font-weight: 700; color: var(--fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, 0.35); transition: text-decoration-color var(--t-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .card:hover::after { opacity: 0.82; }
  .card:hover .card__link { text-decoration-color: var(--accent); }
}

/* Why */
.why { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.why__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-8); align-items: start; }
.why .section__head { margin-bottom: 0; }
.why__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7) var(--s-8); }
.why__list li { display: flex; flex-direction: column; gap: var(--s-3); padding-top: var(--s-5); border-top: 1px solid var(--line-strong); }
.why__list h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.why__list p { font-size: 15px; line-height: 1.55; color: var(--fg-2); text-wrap: pretty; }

/* Lead form */
.lead__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s-9); align-items: start; }
.lead__text { display: flex; flex-direction: column; gap: var(--s-4); }
.lead__panel { min-width: 0; }
.lead__text p { font-size: 17px; line-height: 1.5; color: var(--fg-2); max-width: 44ch; }
.lead__phone { margin-top: var(--s-5); font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lead__hours { font-size: 14px; color: var(--fg-3); }
.form { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-6); border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field__label { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--fg-3); }
.field__input {
  width: 100%; height: 52px; padding: 0 var(--s-4); border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--fg);
  appearance: none; -webkit-appearance: none; outline: none;
  transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
.field__input::placeholder { color: var(--fg-3); }
.field__input:hover { border-color: rgba(255, 255, 255, 0.32); }
.field__input:focus { border-color: var(--fg); }
.field__input[aria-invalid="true"] { border-color: var(--accent); }
.field__select { position: relative; display: block; }
.field__select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--fg-2); border-bottom: 2px solid var(--fg-2); transform: translateY(-70%) rotate(45deg);
}
.field__select select { padding-right: 44px; cursor: pointer; }
.field__select option { background: var(--bg-2); color: var(--fg); }
.form__error { font-size: 14px; color: var(--accent); }
.form__note { font-size: 13px; line-height: 1.45; color: var(--fg-3); }
.form--success { align-items: flex-start; gap: var(--s-3); }
.form__check { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--s-2); border-radius: 50%; background: var(--accent); }
.form--success h3 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; outline: none; }
.form--success p { color: var(--fg-2); line-height: 1.5; }
.form--success .btn { margin-top: var(--s-3); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: var(--s-7) 0; background: var(--bg); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5) var(--s-7); }
.footer__nav { display: flex; gap: var(--s-5); font-size: 14px; font-weight: 600; color: var(--fg-2); }
.footer__nav a:hover { color: var(--fg); }
.footer__phone { margin-left: auto; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.footer__copy { flex-basis: 100%; font-size: 13px; color: var(--fg-3); }

/* Tablet */
@media (max-width: 1100px) {
  .models__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { min-height: 360px; }
  .why__inner { grid-template-columns: 1fr; gap: var(--s-7); }
  .lead__inner { grid-template-columns: 1fr; gap: var(--s-7); }
}

/* Mobile: header collapses, hero text moves to the bottom over a gradient */
@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .nav, .header__phone { display: none; }
  .header__inner { gap: var(--s-4); }
  .brand { font-size: 14px; }
  .header .btn--sm { margin-left: auto; }
  .hero__shade {
    background:
      linear-gradient(180deg, rgba(11, 11, 13, 0.55) 0%, rgba(11, 11, 13, 0) 22%, rgba(11, 11, 13, 0) 38%, rgba(11, 11, 13, 0.82) 66%, rgba(11, 11, 13, 0.96) 100%);
  }
  .hero__content { top: auto; bottom: calc(var(--hero-bottom) + 68px); left: 20px; right: 20px; transform: none; max-width: none; gap: var(--s-6); }
  .stage { gap: var(--s-3); }
  .stage__title { font-size: clamp(2.1rem, 9.6vw, 2.9rem); max-width: none; }
  .stage__sub { font-size: 16px; max-width: none; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
  .hero__progress { left: 20px; bottom: calc(var(--hero-bottom) + 24px); }
  .hero__loader { right: auto; left: 216px; bottom: calc(var(--hero-bottom) + 24.5px); }
  .hero__progress span { width: 32px; }
  .hero__hint { left: auto; right: 20px; bottom: calc(var(--hero-bottom) + 16px); transform: none; }
  .section { padding: var(--s-8) 0; }
  .section__head { margin-bottom: var(--s-6); }
  .models__grid { grid-template-columns: 1fr; }
  .card { min-height: 260px; }
  .why__list { grid-template-columns: 1fr; gap: var(--s-5); }
  .form { padding: var(--s-5); }
  .footer__phone { margin-left: 0; }
}

/* Very narrow phones: shorter header CTA label */
@media (max-width: 374px) {
  .header .btn--sm { padding: 0 14px; font-size: 0; }
  .header .btn--sm::after { content: "Заявка"; font-size: 14px; }
  .brand__name { font-size: 13px; letter-spacing: 0.06em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage, .stage.is-active { transition-duration: 200ms; transition-delay: 0s; transform: none; }
  .btn, .card, .card::after { transition: none; }
  .hero__hint svg { animation: none; }
}
