/* ============================================================
   bormantov.ru — V2 design layer (P0, локальный прототип)
   Подключается ПОСЛЕ styles.css и использует его токены:
   палитра, кнопки, карточки, header/footer, форма и квиз — из styles.css.
   Здесь: hero-варианты A / B / C, новые секции и motion-система.

   Принципы движения (адаптация референсов Prompt Motion):
   — одна смысловая «сигнальная точка» связывает сцены (teal-точка);
   — пружинные входы с небольшим перелётом, без «мёртвого» времени;
   — каждое движение привязано к элементу на экране, без шума;
   — H1, лид и CTA никогда не стартуют с opacity:0;
   — prefers-reduced-motion и кнопка паузы останавливают всё.
   ============================================================ */

:root {
  --v2-blue:        var(--color-primary);    /* #2563eb */
  --v2-teal:        var(--color-secondary);  /* #14b8a6 */
  --v2-sky:         var(--color-highlight);  /* #38bdf8 */
  --v2-signal:      #5eead4;
  --v2-text-dim:    #64748b;
  --v2-line:        rgba(148, 163, 184, 0.26);
  --v2-panel:       rgba(15, 23, 42, 0.62);
  --v2-grad-text:   linear-gradient(92deg, #60a5fa 0%, #38bdf8 45%, #2dd4bf 100%);

  --v2-h1:          clamp(40px, 3.8vw, 56px);
  --v2-h1-sub:      clamp(15px, 1.25vw, 18px);
  --v2-lead:        clamp(16px, 1.3vw, 19px);
  --v2-radius-fig:  28px;

  --v2-ease-out:    cubic-bezier(0.2, 0.75, 0.2, 1);
  --v2-ease-io:     cubic-bezier(0.45, 0, 0.2, 1);
  /* Пружина: перелёт ~8% и затухание; fallback — ease-out */
  --v2-spring:      var(--v2-ease-out);
}

@supports (animation-timing-function: linear(0, 1)) {
  :root {
    --v2-spring: linear(0, 0.013 0.6%, 0.05 1.2%, 0.2 2.6%, 0.445 4.4%, 0.743 6.6%,
      0.892 8%, 0.996 9.6%, 1.054 11.2%, 1.081 12.8%, 1.084 14.6%, 1.067 16.8%,
      1.035 20%, 1.006 23.6%, 0.992 27.4%, 0.99 31.8%, 0.998 40%, 1.001 50%, 1);
  }
}

/* ------------------------------------------------------------
   Общие элементы
   ------------------------------------------------------------ */
.v2-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.v2-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--v2-signal);
}

/* Сигнальная точка — общий «персонаж» всех трёх страниц */
.v2-signal {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v2-signal);
  flex-shrink: 0;
}

.v2-signal::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--v2-signal);
  opacity: 0;
  animation: v2-ripple 2.4s var(--v2-ease-out) infinite 1.2s;
}

.v2-lead {
  font-size: var(--v2-lead);
  line-height: 1.62;
  color: var(--color-text-secondary);
  max-width: 600px;
}

.v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.v2-actions .btn {
  gap: 14px;
}

.v2-hero .v2-actions .btn-lg {
  padding: 0 24px;
  font-size: 18px;
}

.v2-arrow {
  display: inline-block;
  transition: translate 0.45s var(--v2-spring);
}

.btn:hover .v2-arrow,
.btn:focus-visible .v2-arrow {
  translate: 4px 0;
}

.v2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.v2-chips li {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: var(--color-text-tertiary);
  border: 1px solid var(--v2-line);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
}

.v2-textlink {
  color: var(--color-badge-text);
  font-weight: var(--font-bold);
  border-bottom: 1px solid rgba(147, 197, 253, 0.35);
  transition: color var(--transition), border-color var(--transition);
}

.v2-textlink:hover {
  color: #ffffff;
  border-color: #ffffff;
}

.v2-textlink:focus-visible,
.v2-card-link:focus-visible,
.v2-motion-toggle:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.65);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------
   HERO shell (общий для A / B / C)
   ------------------------------------------------------------ */
.v2-hero {
  position: relative;
  z-index: 1;
  padding: 72px 0 96px;
  min-height: min(860px, calc(100svh - var(--header-height)));
  display: flex;
  align-items: center;
}

.v2-hero > .container {
  width: 100%;
}

.v2-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 56px;
  align-items: center;
}

.v2-hero__content .v2-lead {
  margin: 26px 0 34px;
}

.v2-hero__note {
  margin-top: 22px;
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

/* ------------------------------------------------------------
   Kinetic Typography (B) — H1 видим сразу:
   слова стартуют с opacity .3 и небольшим сдвигом, без маски.
   ------------------------------------------------------------ */
.v2-h1 {
  font-size: var(--v2-h1);
  line-height: 1.0;
  letter-spacing: -0.045em;
  font-weight: var(--font-black);
  margin-top: 22px;
  text-wrap: balance;
}

.kt-line {
  display: block;
}

@media (min-width: 641px) {
  .kt-line--keep {
    white-space: nowrap;
  }
}

.kt-w {
  display: inline-block;
  white-space: nowrap;
  animation: v2-kt-rise 0.95s var(--v2-spring) both;
  animation-delay: calc(80ms + var(--i, 0) * 70ms);
}

.kt-line--accent .kt-w {
  background: var(--v2-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.06em;
}

.kt-line--accent {
  position: relative;
  width: fit-content;
}

/* Линия-акцент дорисовывается после слов */
.kt-line--accent::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0.12em;
  bottom: -0.04em;
  height: 0.06em;
  min-height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--v2-blue), var(--v2-teal));
  transform-origin: left center;
  animation: v2-draw-x 0.9s var(--v2-ease-out) both 0.75s;
}

.v2-h1-sub {
  display: block;
  margin-top: 22px;
  font-size: var(--v2-h1-sub);
  line-height: 1.4;
  letter-spacing: 0.02em;
  font-weight: var(--font-bold);
  color: var(--color-text-tertiary);
}

/* ------------------------------------------------------------
   HERO A — System Flow
   ------------------------------------------------------------ */
.v2-flow {
  position: relative;
  aspect-ratio: 600 / 540;
  border: 1px solid var(--color-border);
  border-radius: var(--v2-radius-fig);
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, rgba(37, 99, 235, 0.16) 0%, transparent 70%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(2, 6, 23, 0.7) 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
  isolation: isolate;
}

.v2-flow::before {
  content: '';
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(148, 163, 184, 0.07);
  border-radius: 18px;
  pointer-events: none;
}

.v2-flow svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.flow-orbit {
  fill: none;
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: 1;
  stroke-dasharray: 3 9;
  transform-box: fill-box;
  transform-origin: center;
  animation: v2-spin 90s linear infinite;
}

.flow-orbit--inner {
  stroke: rgba(94, 234, 212, 0.18);
  animation-direction: reverse;
  animation-duration: 60s;
}

.flow-line {
  fill: none;
  stroke: rgba(125, 211, 252, 0.42);
  stroke-width: 1.5;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: v2-draw-line 1.1s var(--v2-ease-out) both;
  animation-delay: calc(0.35s + var(--i, 0) * 0.09s);
}

/* «Пакет данных»: нулевой штрих с круглым концом = точка на линии */
.flow-packet {
  fill: none;
  stroke: var(--v2-signal);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 0.001 200;
  stroke-dashoffset: 0;
  opacity: 0;
  animation: v2-packet 7.2s linear infinite;
  animation-delay: calc(1.6s + var(--i, 0) * 1.2s);
}

.flow-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  font-size: 13px;
  font-weight: var(--font-bold);
  color: #e2e8f0;
  white-space: nowrap;
  animation: v2-node-in 0.8s var(--v2-spring) both;
  animation-delay: calc(0.2s + var(--i, 0) * 0.08s);
}

.flow-node i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v2-teal);
  animation: v2-node-ping 7.2s linear infinite;
  animation-delay: calc(1.6s + var(--i, 0) * 1.2s);
}

.flow-core {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 25%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: radial-gradient(circle at 50% 40%, #12305a 0%, #0b1730 70%);
  box-shadow: 0 0 0 14px rgba(37, 99, 235, 0.06), 0 0 0 40px rgba(37, 99, 235, 0.035);
  animation: v2-core-in 0.9s var(--v2-spring) both 0.1s;
}

.flow-core__inner {
  animation: v2-core-beat 1.2s linear infinite 3.4s;
}

.flow-core strong {
  display: block;
  font-size: clamp(13px, 1.25vw, 17px);
  font-weight: var(--font-black);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.flow-core span {
  display: block;
  margin-top: 6px;
  font-size: clamp(9px, 0.75vw, 11px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--v2-signal);
}

.flow-core::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--v2-signal);
  opacity: 0;
  animation: v2-ripple 1.2s var(--v2-ease-out) infinite 3.4s;
}

.v2-fig-caption {
  position: absolute;
  left: 26px;
  bottom: 20px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

/* Кнопка паузы (WCAG 2.2.2): показывается только с JS */
.v2-motion-toggle {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--v2-line);
  background: rgba(5, 8, 22, 0.72);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: var(--font-bold);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.v2-motion-toggle[hidden] {
  display: none;
}

.v2-motion-toggle:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
}

.v2-motion-toggle__knob {
  position: relative;
  width: 24px;
  height: 14px;
  border-radius: 99px;
  background: var(--v2-teal);
  transition: background var(--transition);
}

.v2-motion-toggle__knob::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  transition: left 0.4s var(--v2-spring);
}

.v2-motion-toggle[aria-pressed="true"] .v2-motion-toggle__knob {
  background: #475569;
}

.v2-motion-toggle[aria-pressed="true"] .v2-motion-toggle__knob::after {
  left: 2px;
}

/* ------------------------------------------------------------
   HERO C — Product Showcase
   ------------------------------------------------------------ */
.v2-showcase {
  position: relative;
  height: 540px;
  perspective: 1400px;
}

.shot-card {
  position: absolute;
  width: 78%;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(2, 6, 23, 0.94) 100%);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
  animation: v2-deal 1s var(--v2-spring) both;
  animation-delay: calc(0.25s + var(--i, 0) * 0.16s);
  transition: translate 0.7s var(--v2-spring), rotate 0.7s var(--v2-spring), border-color var(--transition);
}

.shot-card:nth-child(1) { left: 0;   top: 0;    rotate: -2deg; z-index: 1; }
.shot-card:nth-child(2) { left: 11%; top: 124px; rotate: 1deg; z-index: 2; }
.shot-card:nth-child(3) { left: 22%; top: 248px; rotate: -0.5deg; z-index: 3; }

@media (hover: hover) and (pointer: fine) {
  .v2-showcase:hover .shot-card:nth-child(1) { translate: -18px -14px; rotate: -5deg; }
  .v2-showcase:hover .shot-card:nth-child(2) { translate: 0 -4px; rotate: 0deg; }
  .v2-showcase:hover .shot-card:nth-child(3) { translate: 18px 12px; rotate: 1.5deg; }
  .shot-card:hover { border-color: var(--color-border-hover); }
}

.shot-card__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.shot-card__bar > span:not(.v2-status) {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
}

.shot-card__bar .v2-status {
  flex-shrink: 0;
  margin-left: auto;
  padding: 3px 9px;
  font-size: 11px;
}

.shot-card__bar em {
  margin-left: 10px;
  font-style: normal;
  font-size: 11px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.04em;
}

.shot-card__body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.shot-card__mono {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 20px;
  font-weight: var(--font-black);
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(20, 184, 166, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.shot-card__body strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.shot-card__body small {
  display: block;
  margin-top: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.shot-card__status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  padding-top: 14px;
  border-top: 1px dashed var(--v2-line);
}

/* Контейнер под будущий реальный скриншот */
.v2-shot {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 0;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.32);
  background:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px) 0 0 / 22px 22px,
    rgba(2, 6, 23, 0.5);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color var(--transition);
}

.v2-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v2-shot figcaption {
  max-width: 80%;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-tertiary);
}

.v2-shot figcaption b {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--v2-signal);
}

/* ------------------------------------------------------------
   HERO B — Kinetic Typography (агентства)
   Все строки видимы всегда; «акцент» последовательно переходит
   по строкам — читаемость не теряется ни в один момент.
   ------------------------------------------------------------ */
.v2-typestack {
  position: relative;
  padding: 34px 36px;
  border-radius: var(--v2-radius-fig);
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(2, 6, 23, 0.6) 100%);
  overflow: hidden;
}

.v2-typestack__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.ts-line {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 4px 0;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.08;
  font-weight: var(--font-black);
  letter-spacing: -0.045em;
  color: #475569;
  animation:
    v2-kt-rise 0.9s var(--v2-spring) both,
    v2-ts-accent 9.6s var(--v2-ease-io) infinite;
  animation-delay:
    calc(0.15s + var(--i, 0) * 0.07s),
    calc(1.4s + var(--i, 0) * 1.6s);
}

.ts-line small {
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: var(--font-bold);
  color: var(--color-text-tertiary);
  min-width: 22px;
}

.ts-line::after {
  content: '';
  position: absolute;
  left: 38px;
  bottom: 2px;
  width: 64px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--v2-blue), var(--v2-teal));
  transform-origin: left center;
  transform: scaleX(0);
  animation: v2-ts-bar 9.6s var(--v2-ease-io) infinite;
  animation-delay: calc(1.4s + var(--i, 0) * 1.6s);
}

/* ------------------------------------------------------------
   Секции V2
   ------------------------------------------------------------ */
.v2-grid-3,
.v2-grid-2 {
  display: grid;
  gap: 20px;
}

.v2-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v2-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.v2-comp {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v2-comp > .num-badge,
.v2-format > .v2-label,
.v2-project__head .v2-status {
  align-self: flex-start;
  justify-self: start;
}

.v2-comp h3 {
  font-size: 22px;
}

.v2-comp p {
  font-size: var(--text-base);
}

.v2-comp__links {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: var(--text-sm);
}

.v2-comp--wide {
  grid-column: span 2;
}

.v2-label {
  font-size: 11px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

/* Карточка проекта */
.v2-project {
  display: grid;
  gap: 18px;
  align-content: start;
}

.v2-project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.v2-project h3 {
  font-size: 26px;
  letter-spacing: -0.03em;
}

.v2-project dl {
  display: grid;
  gap: 12px;
}

.v2-project dt {
  font-size: 11px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: 3px;
}

.v2-project dd {
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.v2-project__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-subtle);
  font-size: var(--text-sm);
}

.v2-card-link {
  color: var(--color-badge-text);
  font-weight: var(--font-bold);
}

.v2-pending {
  color: var(--color-text-tertiary);
  font-weight: var(--font-bold);
}

.v2-project .v2-shot {
  transition: border-color var(--transition), scale 0.6s var(--v2-spring);
}

@media (hover: hover) and (pointer: fine) {
  .v2-project:hover .v2-shot {
    border-color: rgba(56, 189, 248, 0.5);
    scale: 1.015;
  }
}

.v2-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: var(--font-bold);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--v2-line);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.v2-status::before {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
}

.v2-status--live::before  { background: var(--color-accent-green); }
.v2-status--pilot::before { background: var(--v2-sky); }
.v2-status--closed::before { background: #94a3b8; }
.v2-status--product::before { background: #5eead4; }

.v2-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v2-stack li {
  font-size: 12px;
  font-weight: var(--font-bold);
  color: #bae6fd;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.26);
  border-radius: 8px;
  padding: 3px 9px;
}

/* Форматы сотрудничества */
.v2-format {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.v2-format ul {
  display: grid;
  gap: 8px;
}

.v2-format li {
  position: relative;
  padding-left: 18px;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.v2-format li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v2-teal);
}

.v2-format .btn {
  margin-top: auto;
  align-self: flex-start;
}

.v2-format--accent {
  border-color: rgba(56, 189, 248, 0.38);
}

/* Процесс в 4 шага */
.v2-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.v2-steps .card h3,
.v2-card-title {
  font-size: 20px;
  margin: 14px 0 8px;
}

/* Финальный CTA-блок */
.v2-cta {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto;
  gap: 28px;
  align-items: center;
}

.v2-cta h2 {
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.03em;
}

.v2-cta p {
  margin-top: 10px;
}

.v2-honest {
  margin-top: 26px;
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  max-width: 820px;
}

/* ------------------------------------------------------------
   Keyframes
   ------------------------------------------------------------ */
@keyframes v2-kt-rise {
  from { opacity: 0.3; transform: translateY(0.3em); }
  to   { opacity: 1;   transform: none; }
}

@keyframes v2-draw-x {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes v2-draw-line {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

@keyframes v2-node-in {
  from { opacity: 0; scale: 0.82; }
  to   { opacity: 1; scale: 1; }
}

@keyframes v2-core-in {
  from { opacity: 0; scale: 0.6; }
  to   { opacity: 1; scale: 1; }
}

/* Пакет: 0–25% цикла летит от узла к ядру, затем ждёт своей очереди */
@keyframes v2-packet {
  0%   { stroke-dashoffset: 0;    opacity: 0; animation-timing-function: var(--v2-ease-io); }
  3%   { opacity: 1; }
  23%  { opacity: 1; }
  25%  { stroke-dashoffset: -100; opacity: 0; }
  100% { stroke-dashoffset: -100; opacity: 0; }
}

/* Точка узла вспыхивает в момент отправки пакета */
@keyframes v2-node-ping {
  0%   { background: var(--v2-signal); box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5); }
  6%   { box-shadow: 0 0 0 6px rgba(94, 234, 212, 0); }
  12%  { background: var(--v2-teal); }
  100% { background: var(--v2-teal); box-shadow: none; }
}

/* Ядро «принимает» пакет: короткий пружинный толчок, синхронно с прилётом */
@keyframes v2-core-beat {
  0%   { transform: scale(1); }
  10%  { transform: scale(1.07); }
  22%  { transform: scale(0.98); }
  34%  { transform: scale(1); }
  100% { transform: scale(1); }
}

@keyframes v2-ripple {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.35); }
}

@keyframes v2-spin {
  to { transform: rotate(360deg); }
}

@keyframes v2-deal {
  from { opacity: 0; transform: translateY(56px) rotateX(10deg); }
  to   { opacity: 1; transform: none; }
}

/* Акцент на строке: 1,6 с из 9,6 с цикла (6 строк) */
@keyframes v2-ts-accent {
  0%    { color: #475569; translate: 0 0; }
  3%    { color: #ffffff; translate: 0.18em 0; }
  14%   { color: #ffffff; translate: 0.18em 0; }
  18%   { color: #475569; translate: 0 0; }
  100%  { color: #475569; translate: 0 0; }
}

@keyframes v2-ts-bar {
  0%   { transform: scaleX(0); }
  4%   { transform: scaleX(1); }
  14%  { transform: scaleX(1); transform-origin: right center; }
  18%  { transform: scaleX(0); transform-origin: right center; }
  100% { transform: scaleX(0); }
}

/* ------------------------------------------------------------
   Пауза: кнопка (JS) и сцена вне экрана (JS)
   ------------------------------------------------------------ */
.v2-motion-paused [data-motion-scope],
.v2-motion-paused [data-motion-scope] *,
.v2-motion-paused [data-motion-scope] *::before,
.v2-motion-paused [data-motion-scope] *::after,
[data-motion-scope].is-offscreen,
[data-motion-scope].is-offscreen *,
[data-motion-scope].is-offscreen *::before,
[data-motion-scope].is-offscreen *::after {
  animation-play-state: paused !important;
}

/* ------------------------------------------------------------
   Адаптивность
   ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .v2-hero__grid {
    gap: 40px;
  }

  .flow-node {
    font-size: 12px;
    padding: 9px 12px;
  }
}

@media (max-width: 960px) {
  .v2-hero {
    min-height: 0;
    padding: 48px 0 72px;
  }

  .v2-hero__grid,
  .v2-cta {
    grid-template-columns: 1fr;
  }

  .v2-grid-3,
  .v2-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v2-comp--wide {
    grid-column: auto;
  }

  .v2-showcase {
    height: 470px;
  }
}

@media (max-width: 640px) {
  .v2-hero {
    padding: 36px 0 56px;
  }

  .v2-h1 {
    font-size: clamp(34px, 9.2vw, 46px);
    margin-top: 16px;
  }

  .v2-eyebrow {
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .v2-hero__content .v2-lead {
    margin: 20px 0 26px;
  }

  .v2-actions {
    flex-direction: column;
  }

  .v2-actions .btn,
  .v2-hero .v2-actions .btn-lg {
    width: 100%;
    justify-content: space-between;
    white-space: normal;
    text-align: left;
    font-size: 17px;
  }

  .v2-grid-3,
  .v2-grid-2,
  .v2-steps {
    grid-template-columns: 1fr;
  }

  .v2-flow {
    border-radius: 20px;
  }

  /* На узком экране — 4 ключевых узла вместо 6 */
  .flow-node.is-extra,
  .flow-line.is-extra,
  .flow-packet.is-extra {
    display: none;
  }

  .flow-node {
    font-size: 11px;
    padding: 7px 9px;
    gap: 6px;
    border-radius: 9px;
  }

  .flow-core {
    width: 34%;
  }

  .v2-fig-caption {
    left: 16px;
    bottom: 12px;
    font-size: 9px;
  }

  .v2-motion-toggle {
    right: 10px;
    top: 10px;
    height: 28px;
    font-size: 11px;
  }

  .v2-showcase {
    height: 400px;
  }

  .shot-card {
    width: 88%;
  }

  .shot-card:nth-child(2) { left: 6%;  top: 104px; }
  .shot-card:nth-child(3) { left: 12%; top: 208px; }

  .shot-card__bar em {
    display: none;
  }

  .shot-card__body {
    padding: 16px;
    gap: 14px;
  }

  .shot-card__mono {
    width: 50px;
    height: 50px;
    font-size: 17px;
  }

  .shot-card__body strong {
    font-size: 19px;
  }

  .v2-typestack {
    padding: 22px 20px;
  }

  .ts-line {
    font-size: clamp(26px, 8.2vw, 36px);
    gap: 12px;
  }

  .ts-line::after {
    left: 34px;
    width: 48px;
  }

  .v2-project h3 {
    font-size: 23px;
  }
}

/* ------------------------------------------------------------
   prefers-reduced-motion: статичная, полностью читаемая композиция
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .kt-w,
  .kt-line--accent::after,
  .flow-line,
  .flow-node,
  .flow-node i,
  .flow-core,
  .flow-core__inner,
  .flow-core::after,
  .flow-orbit,
  .shot-card,
  .ts-line,
  .ts-line::after,
  .v2-signal::after {
    animation: none !important;
  }

  .flow-packet {
    display: none;
  }

  .kt-line--accent::after {
    transform: none;
  }

  .ts-line:first-of-type {
    color: #ffffff;
  }

  .ts-line:first-of-type::after {
    transform: scaleX(1);
  }

  .v2-arrow,
  .shot-card,
  .v2-shot,
  .v2-motion-toggle__knob::after {
    transition: none !important;
  }
}

/* ============================================================
   PREMIUM PASS · дизайн + движение (локальная версия на согласование)
   Все правила — поверх styles.css и V2; HTML-структура и логика не затронуты.
   Принцип: свечение — сигнал (hover/активное), движение — только transform/opacity.
   ============================================================ */
:root {
  --pm-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* 1. Hero: вход в диагностику — тихая ссылка под кнопками */
.hv2__diag {
  margin-top: 20px;
  font-size: 16px;
}

.hv2__diag .v2-textlink {
  color: #cbd5e1;
  border-bottom-color: rgba(203, 213, 225, 0.4);
}

/* 2. Карточки проектов: превью реальных экранов (утверждённые изображения кейсов) */
.v2-projects {
  gap: 24px;
}

.v2-project__shot {
  display: block;
  margin: -24px -24px 4px;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  background: #0b1224;
  border-bottom: 1px solid var(--color-border-subtle);
}

.v2-project__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.5s var(--pm-out);
}

@media (hover: hover) and (pointer: fine) {
  .v2-project:hover .v2-project__shot img {
    transform: scale(1.03);
  }
}

@media (max-width: 700px) {
  .v2-projects {
    grid-template-columns: 1fr;
  }
}

/* 3. Свечение карточек: приглушено в покое, полное — при наведении */
.card::before {
  opacity: 0.35;
  transition: opacity 0.3s var(--pm-out);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover::before {
    opacity: 1;
  }
}

/* 4. Появление секций: короче и точнее (16px, 0.5 с, сильный ease-out) */
.has-scroll-reveal .reveal {
  transform: translateY(16px);
  transition: opacity 0.5s var(--pm-out), transform 0.5s var(--pm-out);
}

.has-scroll-reveal .reveal .card {
  transition: opacity 0.4s var(--pm-out);
}

/* 5. Обратная связь кнопок: нажатие, без ложных hover на касании */
.btn:active {
  transform: scale(0.98);
  transition-duration: 0.12s;
}

@media (hover: none) {
  .btn-primary:hover,
  .btn-secondary:hover,
  .card:hover {
    transform: none;
  }
}

/* 6. Квиз: бесконечные декоративные анимации идут только пока блок на экране.
   Пульс статуса — только opacity (без анимации box-shadow). */
#quiz:not(.is-live) .quiz__border,
#quiz:not(.is-live) .quiz__glow,
#quiz:not(.is-live) .quiz__status-dot {
  animation-play-state: paused;
}

@keyframes pm-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.quiz__status-dot {
  animation-name: pm-pulse;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* 7. Плавающая CTA не перекрывает карточки, форму, квиз, CTA-панели, подвал и открытое меню.
   Скрытие: быстрое затухание и лёгкий сдвиг вниз; visibility переключается после затухания.
   Возврат: стандартный переход из styles.css (opacity и transform), без скачков вёрстки (кнопка fixed). */
body.v2-float-off .floating-cta {
  opacity: 0 !important;
  transform: translateY(8px) !important;
  pointer-events: none !important;
  visibility: hidden;
  transition: opacity 0.18s var(--pm-out), transform 0.18s var(--pm-out), visibility 0s linear 0.18s;
}

/* 8. Читаемость мелких подписей */
.v2-label,
.v2-project dt,
.hv2__toggle {
  font-size: 12px;
}

@media (max-width: 699px) {
  .hv2__eyebrow {
    font-size: 12px;
  }
}

/* 9. Цели нажатия на телефоне и планшете (визуальный размер не меняется) */
@media (pointer: coarse) {
  .v2-textlink,
  .v2-card-link,
  .hv2__toggle,
  .header-logo {
    position: relative;
  }

  .v2-textlink::after,
  .v2-card-link::after,
  .hv2__toggle::after,
  .header-logo::after {
    content: '';
    position: absolute;
    inset: -12px -6px;
  }

  .hv2__toggle::after {
    inset: -8px -6px;
  }

  .nav-mobile-contacts .btn-header-call,
  .nav-mobile-contacts .btn-header-tg {
    height: 44px;
  }

  .footer-nav-list a,
  .footer-contact-item,
  .footer-privacy {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* 2b. Мягкий переход превью в тело карточки (светлые экраны не режут тёмную тему) */
.v2-project__shot {
  position: relative;
}

.v2-project__shot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(11, 18, 36, 0.9) 100%);
  pointer-events: none;
}

/* 7b. Мобильная CTA-панель (до 767 px). Та же ссылка #floating-cta, не вторая кнопка.
   Место под панель зарезервировано всегда (padding страницы и scroll-padding для якорей и фокуса),
   поэтому при показе и скрытии вёрстка не прыгает, а конец страницы и подвал не закрыты.
   Safe-area: отступ снизу env(safe-area-inset-bottom). Панель закреплена у нижнего края
   видимой области, поэтому следует за динамической адресной панелью браузера. */
@media (max-width: 767px) {
  :root {
    --pm-bar-h: 64px;
    --pm-bar-space: calc(var(--pm-bar-h) + env(safe-area-inset-bottom, 0px));
  }

  html {
    scroll-padding-bottom: calc(var(--pm-bar-space) + 12px);
  }

  body {
    padding-bottom: var(--pm-bar-space);
  }

  .floating-cta {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(5, 8, 22, 0.97);
    border-top: 1px solid var(--color-border-subtle);
    transform: translateY(100%);
  }

  .floating-cta.is-visible {
    transform: translateY(0);
  }

  .floating-cta__btn {
    width: 100%;
    justify-content: center;
    height: 48px;
    box-shadow: none;
    border-radius: var(--radius-btn);
  }

  .floating-cta__btn:hover {
    box-shadow: none;
    transform: none;
  }

  body.v2-float-off .floating-cta {
    transform: translateY(100%) !important;
  }
}
