/* ============================================================
   bormantov.ru — Hero V2 «Engineered Motion» (локальный прототип)
   Подключается после styles.css и v2.css.
   Текст и CTA — первый слой, движение — второй (canvas за текстом).
   ============================================================ */

@font-face {
  font-family: 'Inter V2';
  src: url('/assets/fonts/inter/inter-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  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: 'Inter V2';
  src: url('/assets/fonts/inter/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body.v2-type {
  --font-family: 'Inter V2', Arial, sans-serif;
  font-family: var(--font-family);
}

.hv2 {
  --hv2-signal: #2dd4bf;
  --hv2-ink: #f8fafc;
  --hv2-muted: #aab8c8;
  position: relative;
  isolation: isolate;
  z-index: 1;
  min-height: calc(100svh - var(--header-height));
  display: flex;
  align-items: center;
  padding: 64px 0 80px;
  overflow: hidden;
}

.hv2__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hv2__still {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  pointer-events: none;
}

.hv2 > .container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hv2__content {
  max-width: 680px;
}

@media (min-width: 900px) and (max-width: 1199px) {
  .hv2__content {
    max-width: 54vw;
  }
}

/* Планшет-портрет: лента с движением над текстом */
@media (min-width: 700px) and (max-width: 899px) {
  .hv2 {
    min-height: 0;
    align-items: flex-start;
    padding: 340px 0 64px;
  }

  .hv2__content {
    max-width: 640px;
  }

}

.hv2__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #94a3b8;
}

.hv2__eyebrow i {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--hv2-signal);
}

.hv2__title {
  margin-top: 26px;
  font-size: clamp(42px, 4.1vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.042em;
  font-weight: 700;
  color: var(--hv2-ink);
  text-wrap: balance;
}

.hv2__title .hv2-line {
  display: block;
}

.hv2__title .hv2-accent {
  color: #5eead4;
}

/* Кинетика заголовка: виден с первого кадра (opacity от 0,55), слова «встают» пружиной */
.hv2-w {
  display: inline-block;
  white-space: nowrap;
  animation: hv2-rise 0.9s var(--v2-spring, cubic-bezier(0.2, 0.75, 0.2, 1)) both;
  animation-delay: calc(60ms + var(--i, 0) * 55ms);
}

.hv2__lead {
  margin-top: 26px;
  max-width: 560px;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.62;
  color: var(--hv2-muted);
}

.hv2__actions {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hv2__actions .btn {
  height: 56px;
  padding: 0 26px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  gap: 14px;
}

.hv2__actions .btn-secondary {
  background: rgba(5, 8, 22, 0.55);
}

.hv2__toggle {
  position: absolute;
  right: var(--hv2-toggle-x, 20px);
  top: var(--hv2-toggle-y, auto);
  bottom: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(5, 8, 22, 0.7);
  color: #94a3b8;
  font: 600 11px/1 var(--font-family);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.hv2__toggle[hidden] {
  display: none;
}

.hv2__toggle:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
}

.hv2__toggle:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.65);
  outline-offset: 3px;
}

.hv2__toggle i {
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.hv2__toggle[aria-pressed="true"] i {
  border: 0;
  width: 0;
  height: 0;
  border-left: 7px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

@keyframes hv2-rise {
  from { opacity: 0.55; transform: translateY(0.22em); }
  to   { opacity: 1;    transform: none; }
}

/* ------------------------------------------------------------
   Мобильный: композиция-лента над текстом, H1 и CTA на первом экране
   ------------------------------------------------------------ */
@media (max-width: 699px) {
  .hv2 {
    min-height: 0;
    align-items: flex-start;
    padding: 248px 0 48px;
  }

  .hv2__still {
    object-position: center top;
  }

  .hv2__eyebrow {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .hv2__title {
    margin-top: 16px;
    font-size: clamp(32px, 8.9vw, 40px);
    letter-spacing: -0.038em;
  }

  .hv2__title .hv2-line {
    display: inline;
  }

  .hv2__lead {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.55;
  }

  .hv2__actions {
    margin-top: 24px;
    flex-direction: column;
    gap: 10px;
  }

  .hv2__actions .btn {
    width: 100%;
    height: 54px;
    justify-content: space-between;
  }

  .hv2__toggle {
    top: 12px;
    right: 12px;
    bottom: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hv2-w {
    animation: none;
  }
}

@media (min-width: 700px) and (max-width: 899px) {
  .hv2__toggle {
    top: 20px;
    right: 20px;
  }
}

/* Вариант B: пространственное наложение — текст лежит поверх монолита и поля,
   поэтому верхний отступ меньше, чем у ленточной раскладки A */
@media (max-width: 699px) {
  .hv2[data-scene="field"] {
    /* Без верхней зоны под анимацию: текст сразу под шапкой, поле — фон всего первого экрана */
    min-height: calc(100svh - var(--header-height));
    padding-top: 40px;
    padding-bottom: 40px;
  }
}

@media (min-width: 700px) and (max-width: 899px) {
  .hv2[data-scene="field"] {
    /* Планшет: текст в верхней части экрана (без пустоты перед H1), поле — фон всего hero */
    min-height: calc(100svh - var(--header-height));
    align-items: flex-start;
    padding-top: 96px;
    padding-bottom: 64px;
  }
}

/* Пока кнопки hero на экране, плавающая CTA на телефонах и планшетах скрыта:
   она дублирует «Обсудить проект» и закрывала бы контент. После прокрутки — возвращается. */
@media (max-width: 899px) {
  body.hv2-cta-in-view .floating-cta {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
  }
}
