/* === 1. HERO — scroll-scrubbed сборка ===
   Высокая секция (data-hero), внутри sticky-экран 100vh.
   Прокрутка по секции протягивает кадры на <canvas>.
   Аннотации (.hero__layer / .hero__note) появляются по прогрессу:
   их opacity/transform пишет JS через --p (0..1 внутри своего окна). */

.hero--scrub {
  position: relative;
  /* длина проматывания: чем больше — тем «медленнее» и подробнее скраб */
  height: 540vh;
  background: var(--bg);
}

.hero__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.hero__canvas,
.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* постер виден, пока canvas пустой; JS прячет его после первой отрисовки */
.hero__poster { z-index: 0; }
.hero__canvas { z-index: 1; }
.hero--ready .hero__poster { opacity: 0; }

/* лёгкое затемнение для читабельности текста поверх кадра */
.hero__sticky::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 28%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 32%);
}

/* ---------- прелоадер кадров ---------- */
.hero__loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14vh;
  background: var(--bg);
  transition: opacity 0.5s ease;
}
.hero--ready .hero__loader { opacity: 0; pointer-events: none; }
.hero__loader-bar {
  width: min(220px, 50vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.hero__loader-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.2s ease;
}

/* ---------- лого-бейдж (правый низ): прячет вотермарк нейросети ---------- */
.hero__brand {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: 360px;
  height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 38px 28px;
  pointer-events: none;
  background: radial-gradient(ellipse at 82% 82%,
    rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.5) 38%, rgba(0, 0, 0, 0) 74%);
}
.hero__brand img {
  height: 30px;
  width: auto;
  /* лого — чёрная графика на прозрачном фоне; инвертируем в белый (как в шапке) */
  filter: invert(1) drop-shadow(0 1px 6px rgba(0, 0, 0, 0.6));
}
@media (max-width: 768px) {
  .hero__brand { width: 240px; height: 150px; padding: 0 22px 18px; }
  .hero__brand img { height: 24px; }
}

/* ---------- слой интерфейса ---------- */
.hero__ui {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.hero__ui a,
.hero__ui .btn { pointer-events: auto; }

/* общий layer: центрированный блок текста */
.hero__layer {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 var(--container-padding);
  will-change: opacity, transform;
}
/* мягкая тёмная подложка под текст — читаемость поверх светлых кадров */
.hero__layer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  height: 320%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 38%, rgba(0, 0, 0, 0) 72%);
  z-index: -1;
  pointer-events: none;
}
.hero__intro { top: 28vh; }
.hero__story { top: 26vh; }
.hero__outro { top: 32vh; gap: 22px; }

/* ---------- беат "процесс покупки" ---------- */
.hero__process {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 0 var(--container-padding);
}
.hero__process-title {
  font-weight: 800;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  letter-spacing: -0.02em;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
  will-change: opacity, transform;
}
.hero__steps {
  display: flex;
  gap: clamp(10px, 1.4vw, 18px);
  width: 100%;
  max-width: 1180px;
  justify-content: center;
}
.hero__step {
  flex: 1 1 0;
  max-width: 220px;
  min-width: 0;
  padding: 20px 18px;
  background: rgba(20, 18, 16, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;                /* стартово скрыты; показывает JS-спотлайт */
  will-change: opacity, transform;
}
.hero__step-num {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--accent, #f0883e);
}
.hero__step-ic {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 2px;
}
.hero__step b { font-size: 1.02rem; font-weight: 700; line-height: 1.2; }
.hero__step span:last-child { font-size: 0.86rem; line-height: 1.35; color: rgba(255, 255, 255, 0.72); }

.hero__process-bar {
  width: min(560px, 80vw);
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  overflow: hidden;
  will-change: opacity;
}
.hero__process-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent, #f0883e);
}

@media (max-width: 860px) {
  .hero__steps { flex-wrap: wrap; max-width: 460px; }
  .hero__step { flex: 1 1 40%; max-width: none; padding: 14px; }
  .hero__step-ic { width: 24px; height: 24px; }
  .hero__process { gap: 18px; }
}

.hero__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 5.6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 14px 0 0;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}
.hero__lead {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.6);
  max-width: 640px;
}
.hero__intro .kicker { color: rgba(255, 255, 255, 0.7); }
/* CTA в hero — только на мобиле (на десктопе действие даёт скролл-скраб) */
.hero__cta-m { display: none; }

/* ---------- аннотации-врезки к модулям ---------- */
.hero__note {
  position: absolute;
  max-width: 270px;
  padding: 14px 16px;
  background: rgba(20, 18, 16, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 3px;
  will-change: opacity, transform;
}
.hero__note b { font-weight: 700; font-size: 1.02rem; }
.hero__note span:last-child { color: rgba(255, 255, 255, 0.7); }
.hero__note-num {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
}
.hero__note--tl { top: 18vh; left: 6vw; }
.hero__note--tr { top: 24vh; right: 6vw; }
.hero__note--bl { bottom: 22vh; left: 8vw; }
.hero__note--br { bottom: 20vh; right: 6vw; }
/* центрировано над модулями + линия-указатель вниз к блокам
   (без transform на самой плашке — его перезаписывает JS-анимация слоя) */
.hero__note--top { top: 13vh; left: 50%; margin-left: -135px; }
.hero__note--top::after {           /* линия от плашки вниз к модулям */
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 30vh;
  margin-left: -0.5px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.05));
  pointer-events: none;
}
.hero__note--top::before {          /* точка на конце линии (у модуля) */
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 30vh);
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

/* ---------- подсказка-скролл ---------- */
.hero__hint {
  position: absolute;
  left: 50%;
  bottom: 5vh;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero__hint-mouse {
  width: 22px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  position: relative;
}
.hero__hint-mouse::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 6px;
  margin-left: -1.5px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  animation: hero-wheel 1.6s ease-in-out infinite;
}
@keyframes hero-wheel {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}

/* ---------- мобайл: статичный hero (без скраба и без загрузки кадров) ---------- */
@media (max-width: 768px) {
  .hero--scrub { height: auto; }
  .hero__sticky { position: static; height: auto; min-height: 88vh; }
  /* скраб-элементы не нужны на мобиле */
  .hero__canvas, .hero__loader, .hero__hint,
  .hero__story, .hero__process, .hero__note, .hero__outro { display: none; }
  /* постер остаётся фоном (JS на мобиле не запускается, hero--ready не ставится) */
  .hero--scrub .hero__poster { opacity: 1; }
  /* центрируем интро поверх постера */
  .hero__ui { position: absolute; inset: 0; display: grid; place-items: center; }
  .hero__layer { position: static; }
  .hero__intro { display: flex; }
  .hero__intro .hero__lead { display: none; }   /* «крутите вниз» — не для статики */
  .hero__cta-m { display: inline-flex; margin-top: 24px; }
}

/* доступность: без анимации колеса при reduce-motion */
@media (prefers-reduced-motion: reduce) {
  .hero__hint-mouse::after { animation: none; }
}
