/* ═══════════════════════════════════════════════════════════════════════
   AVatar 1С-Битрикс — скетч главной, вариант A «Панорамный разворот»
   ДНК: standards/theme-bank/19-panoramnyy-razvorot.md (cold, full-bleed-photo)
   Линза: high-end-visual-design (crafted-колонка premium-levers §6)
   Палитра — из мира продукта (bitrix.avboo.us), см. манифест.md
   ═══════════════════════════════════════════════════════════════════════ */

/* ---------- Шрифты: self-host, кириллица + латиница раздельно ---------- */
@font-face {
  font-family: "Oswald";
  src: url("fonts/oswald-var-latin.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Oswald";
  src: url("fonts/oswald-var-cyrillic.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2116, U+2122, U+2212;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-cyrillic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plexmono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2122, U+2212;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plexmono-cyrillic-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- Токены (провенанс — см. манифест.md, раздел «Палитра») ---------- */
:root {
  /* палитра: 60/30/10, мир продукта bitrix.avboo.us */
  --bg:           #F2F4F8;  /* светлый разворот: поверхности панели #f1f4f8 */
  --bg-dark:      #12151C;  /* тёмный разворот: холодное почти-чёрное */
  --surface:      #E7EBF2;  /* карточки/поля на светлом */
  --surface-dark: #1B202A;  /* карточки на тёмном */
  --ink:          #191D26;  /* текст на светлом (от тёмного текста продукта) */
  --ink-inv:      #E9EDF5;  /* текст на тёмном */
  --mute:         #545E70;  /* вторичный текст на светлом, 5.94:1 */
  --mute-inv:     #A7B0C0;  /* вторичный текст на тёмном, 8.36:1 */
  --accent:       #326D86;  /* сталь-тил: переработка фирменного синего AVatar (см. манифест) */
  --accent-soft:  #80B1C6;  /* светлый шаг того же тона: текст на тёмном, 7.85:1 */
  --hairline:     #D5DBE5;  /* разделители на светлом */
  --hairline-dark:#2A313D;  /* разделители на тёмном */
  --line-strong:  #5F6B7E;  /* рамки полей ввода, 4.9:1 (не-текст 3:1) */
  --plate:        #F7F9FC;  /* подписная полоса hero */

  /* типографика: шкала ×1.333 от 16px */
  --fs-s:   0.75rem;   /* 12px — служебные mono-подписи */
  --fs-b:   1rem;      /* 16px — body */
  --fs-lead:1.3125rem; /* 21px — подводки */
  --fs-h3:  1.75rem;   /* 28px */
  --fs-h2:  2.375rem;  /* 38px */
  --fs-h1:  clamp(2.375rem, 4.7vw, 4.1875rem); /* 38 → 67 */

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", monospace;

  --curve: cubic-bezier(0.22, 0.61, 0.2, 1);
  --pad: clamp(20px, 4vw, 48px);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-b);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-s);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.spread--dark :focus-visible { outline-color: var(--accent-soft); }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--bg-dark);
  color: var(--ink-inv);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-64px);
}
.skip-link:focus-visible { transform: none; }

.wrap {
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Заголовочные уровни */
.h1, .h2 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.07;
  letter-spacing: 0.015em;
  text-wrap: balance;
}
.h1 { font-size: var(--fs-h1); max-width: 15em; }
.h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); }

.kicker {
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.kicker--inv { color: var(--accent-soft); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink);
  max-width: 36em;
}
.lead--inv { color: var(--ink-inv); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 32px;
  font: 600 var(--fs-b) var(--font-body);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms var(--curve), background-color 160ms var(--curve),
    border-color 160ms var(--curve), color 160ms var(--curve);
}
.btn--primary { background: var(--accent); color: #F5F7FB; }
.btn--primary:hover { transform: translateY(-2px); background: #3B7C99; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.spread--dark .btn--ghost { color: var(--ink-inv); border-color: var(--hairline-dark); }
.spread--dark .btn--ghost:hover { border-color: var(--ink-inv); }
.btn--sm { min-height: 40px; padding: 8px 24px; }
.btn--wide { width: 100%; }

/* ---------- Шапка ---------- */
.head {
  position: sticky;
  top: 0;
  z-index: 40;
  /* непрозрачный фон вместо blur: backdrop-filter делает .head containing
     block для fixed-потомков, и мобильный ящик .nav--open строится от шапки
     (хит-зона 88px вместо вьюпорта) */
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
}
.head__in {
  max-width: 1440px;
  margin-inline: auto;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 24px;
  border: 1px solid var(--hairline);
}
.brand__name { font-weight: 700; font-size: var(--fs-b); letter-spacing: 0.01em; white-space: nowrap; }

.nav { margin-left: auto; }
.nav__list {
  display: none;
  align-items: center;
  gap: 8px;
}
.nav__link {
  display: inline-block;
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
}
.nav__link:hover { background: var(--surface); }
.nav__link[aria-current="page"] { color: var(--accent); font-weight: 600; }

.head__actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav + .head__actions { margin-left: 0; }

/* Бургер: скрытая навигация заменяется выдвижным ящиком */
.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
}
.burger__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform 200ms var(--curve), opacity 200ms var(--curve);
}
.burger[aria-expanded="true"] .burger__bar:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__bar:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Ящик мобильного меню (состояния открыт/закрыт — реальные) */
.nav--open {
  display: block;
  position: fixed;
  inset: 73px 0 0 0;
  z-index: 30;
  background: var(--bg-dark);
  padding: 40px var(--pad) 48px;
  overflow-y: auto;
}
.nav--open .nav__list { display: block; }
.nav--open .nav__link {
  display: block;
  padding: 16px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-lead);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-inv);
  border-bottom: 1px solid var(--hairline-dark);
  border-radius: 0;
}
.nav--open .nav__link[aria-current="page"] { color: var(--accent-soft); }

/* ═══ S1. Hero: текстовая колонка + живой кадр в оконной рамке ═══ */
.hero {
  background: var(--bg);
  padding-block: clamp(24px, 6vh, 80px) clamp(48px, 9vh, 112px);
}

.hero__grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.hero__text .kicker { margin-bottom: 12px; }
.hero__text .h1 {
  font-size: clamp(2.375rem, 3.6vw, 3.125rem); /* 38 → 50 */
  margin-bottom: 16px;
}
.nb { white-space: normal; }
.hero__text { min-width: 0; }
.hero__text .lead { margin-bottom: 16px; }
.solutions {
  color: var(--mute);
  text-transform: none;
  margin-bottom: 24px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Оконная рамка: полный кадр интерфейса, без обрезки */
.shot {
  min-width: 0;
  max-width: 460px;
  margin-inline: auto;
  width: 100%;
}
.shot__window {
  view-transition-name: hero-shot;
  background: var(--plate);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(18, 21, 28, 0.06),
    0 24px 48px -16px rgba(18, 21, 28, 0.18);
}
.shot__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}
.shot__dot {
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background: var(--hairline);
}
.shot__url {
  margin-left: 12px;
  color: var(--mute);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2px 12px;
}
.shot__img {
  width: 100%;
  height: auto;
  animation: shot-settle 640ms var(--curve) both;
  animation-timeline: view();
  animation-range: entry 0% cover 45%;
}
.shot__credit {
  color: var(--mute);
  margin-top: 16px;
  text-align: right;
}

/* ═══ Общие развороты ═══ */
.spread { padding-block: clamp(64px, 10vh, 128px); }
.spread--dark {
  background: var(--bg-dark);
  color: var(--ink-inv);
}

/* ═══ S3. Как проходит одна задача ═══ */
.loop__head {
  display: grid;
  gap: 48px;
  align-items: start;
}
.loop__text .h2 { margin-bottom: 24px; }
.loop__text .lead { margin-bottom: 24px; }
.loop__trust {
  color: var(--mute-inv);
  max-width: 34em;
  padding-top: 24px;
  border-top: 1px solid var(--hairline-dark);
}

.phone { justify-self: center; }
.phone__body {
  width: min(64vw, 232px);
  border: 1px solid var(--hairline-dark);
  background: #0C0F14;
  border-radius: 32px;
  padding: 8px;
  position: relative;
}
.phone__body::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 16px;
  border-radius: 6px;
  background: #0C0F14;
  z-index: 1;
}
.phone__screen { border-radius: 24px; width: 100%; }
.phone figcaption {
  color: var(--mute-inv);
  margin-top: 16px;
  text-align: center;
}

/* Лента ступеней: нативный scroll-snap + видимые контролы */
.rail-zone { margin-top: 48px; }
.rail {
  margin-inline: calc(50% - 50vw);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--pad);
  scrollbar-width: thin;
  scrollbar-color: var(--hairline-dark) transparent;
}
.rail::-webkit-scrollbar { height: 4px; }
.rail::-webkit-scrollbar-thumb { background: var(--hairline-dark); }

.rail__track {
  display: flex;
  padding-inline: var(--pad);
}
.step {
  flex: 0 0 min(76vw, 296px);
  scroll-snap-align: start;
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 176px;
}
.step + .step { border-left: 1px solid var(--hairline-dark); }
.step__num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: 1;
  color: var(--accent-soft);
  font-variant-numeric: tabular-nums;
}
.step__name { font-size: var(--fs-b); font-weight: 600; color: var(--ink-inv); }
.step__line { color: var(--mute-inv); font-size: var(--fs-b); }

.rail__controls {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0 0;
}
.rail__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  border: 1px solid var(--hairline-dark);
  background: transparent;
  color: var(--ink-inv);
  cursor: pointer;
  transition: background-color 160ms var(--curve), opacity 160ms var(--curve);
}
.rail__arrow:hover { background: var(--surface-dark); }
.rail__arrow[disabled] { opacity: 0.35; cursor: default; }
.rail__pos { color: var(--mute-inv); }

/* ═══ S5 (каркас). Форма заявки ═══ */
.form__grid {
  display: grid;
  gap: 48px;
}
.form__main .h2 { margin-bottom: 32px; }

.leadform { display: grid; gap: 24px; }
.leadform__row { display: grid; gap: 24px; }

.field { display: grid; gap: 8px; }
.field label { font-size: var(--fs-s); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.field input, .field textarea {
  font: 400 var(--fs-b) var(--font-body);
  color: var(--ink);
  background: var(--plate);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 12px 16px;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 112px; }
.field input::placeholder, .field textarea::placeholder { color: var(--mute); opacity: 0.7; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.consent {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 16px;
  align-items: start;
  max-width: 40em;
}
.consent input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: var(--accent);
}
.consent label { font-size: var(--fs-b); line-height: 1.5; color: var(--mute); }
.consent a { color: var(--accent); }

.form__aside { display: grid; gap: 24px; align-content: start; }
.form__trial {
  font-size: var(--fs-lead);
  font-weight: 600;
  max-width: 20em;
}
.disclaimer {
  color: var(--ink);
  background: var(--surface);
  padding: 24px;
  border-radius: 6px;
  max-width: 26em;
}

/* ═══ M1. Вход-модалка ═══ */
.modal { border: none; padding: 0; background: transparent; }
.modal::backdrop { background: rgba(18, 21, 28, 0.72); }
.modal__box {
  background: var(--bg);
  color: var(--ink);
  border-radius: 6px;
  padding: 40px 32px;
  width: min(92vw, 400px);
  position: relative;
  display: grid;
  gap: 24px;
}
.modal__box form { display: grid; gap: 24px; }
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--mute);
  cursor: pointer;
}
.modal__close:hover { color: var(--ink); background: var(--surface); }
.modal__title {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--fs-h3);
  line-height: 1.1;
}
.modal__hint { color: var(--mute); }

/* ---------- Моушн: единая система reveal (1 момент) + settle панорамы (1) ---------- */
.reveal {
  animation: rise 320ms var(--curve) both;
  animation-timeline: view();
  animation-range: entry 0% cover 26%;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@keyframes shot-settle {
  from { transform: scale(1.03); }
  to   { transform: scale(1); }
}

/* Межстраничные переходы (View Transitions) — контракт сборщика многостраничника */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out 180ms var(--curve) both; }
  ::view-transition-new(root) { animation: vt-in 260ms var(--curve) both; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in  { from { opacity: 0; } }

/* ---------- Доступность: выключенное движение ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .shot__img { animation: none; }
  .btn, .burger__bar, .rail__arrow { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Планшет ≥720 ---------- */
@media (min-width: 720px) {
  .nb { white-space: nowrap; }
  .leadform__row { grid-template-columns: 1fr 1fr; }
  .phone__body { width: 232px; }
}

/* Ящик: пункт «Войти» (виден только когда кнопки в шапке нет) */
.nav__item-login { display: none; }

/* ---------- <560: «Войти» уходит из шапки в ящик меню ---------- */
@media (max-width: 559px) {
  .head__actions .btn { display: none; }
  .nav__item-login { display: block; }
}

.nav__login {
  display: block;
  width: 100%;
  padding: 16px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline-dark);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-lead);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-soft);
  text-align: left;
  cursor: pointer;
}

/* ---------- Десктоп ≥1024: навигация раскрывается, бургер уходит ---------- */
@media (min-width: 1024px) {
  .burger { display: none; }
  .nav__list { display: flex; }
  .nav { margin-left: auto; }
  .head__actions { margin-left: 0; }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 64px;
  }
  .shot { max-width: none; margin-inline: 0; }

  .loop__head {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 64px;
  }
  .phone { justify-self: end; }
  .phone__body { width: 264px; }

  .step { min-height: 192px; }

  .form__grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 64px;
  }
}

/* Узкая десктоп-полоса 1024–1150: ужатые гэпы и паддинги шапки,
   иначе «Войти» уходит за правый край (scrollWidth > innerWidth) */
@media (min-width: 1024px) and (max-width: 1150px) {
  .head__in { gap: 16px; }
  .nav__list { gap: 0; }
  .nav__link { padding: 8px 8px; }
  .head__actions .btn--sm { padding: 8px 16px; }
}

/* Широкий экран ≥1360: кадр уходит за правый край (разворот) */
@media (min-width: 1360px) {
  .hero__grid { align-items: center; }
  .shot {
    margin-right: calc(-1 * (var(--pad) + 32px));
  }
  .shot__window { border-radius: 10px 0 0 10px; }
}
