/**
 * Стили главного слайдера (hero) на главной: блок под шапкой, монтируется в #home-hero-mount.
 * Разметка: slider.html. Логика: slider.js.
 */
#home-hero-mount {
  background: var(--surface-page);
}

.hero-proto {
  /*
   * Ручная настройка hero (десктоп):
   * --hero-section-min / --hero-section-max — высота всей секции;
   * --hero-slider-ui-space — место снизу под точки / цифры / полосу прогресса;
   * --hero-copy-inner-max — ширина «синей» зоны (текст + кнопка) внутри левой половины;
   * --hero-text-nudge-in — лёгкий сдвиг текста вправо (к центру);
   * --hero-block-padding-y — верх/низ только у .hero-proto__text-zone (фото без отступов у секции).
   */
  --hero-section-min: min(100dvh, 920px);
  --hero-section-max: min(100dvh, 920px);
  --hero-slider-ui-space: 2.75rem;
  --hero-copy-inner-max: 36rem;
  --hero-corner-radius: clamp(1.25rem, 3.8vw, 2.5rem);
  /* Вертикальные отступы только у колонки текста; у секции сверху/снизу 0 — фото на всю высоту без «полос». */
  --hero-block-padding-y: clamp(1.5rem, 4.5vw, 3.5rem);
  /* Лёгкий сдвиг текстового блока вправо (к центру страницы) */
  --hero-text-nudge-in: clamp(0.35rem, 1.2vw, 0.85rem);

  --reveal-ease: cubic-bezier(0.16, 1, 0.32, 1);
  position: relative;
  font-family: var(--font-site);
  font-style: normal;
  font-synthesis: none;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--hero-section-min);
  max-height: var(--hero-section-max);
  background: var(--surface-muted);
  color: var(--text-primary);
  display: grid;
  /* Максимальнее расширяем правую область под фото */
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  align-items: stretch;
  gap: 0;
  padding:
    0
    clamp(1rem, 6vw, 5rem)
    0
    clamp(1rem, 6vw, 5rem);
  border-bottom-left-radius: var(--hero-corner-radius);
  border-bottom-right-radius: var(--hero-corner-radius);
  overflow: hidden;
  isolation: isolate;
}

.hero-proto::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--surface-elevated);
  border-bottom-left-radius: var(--hero-corner-radius);
  border-bottom-right-radius: var(--hero-corner-radius);
  z-index: 0;
}

.hero-proto > * {
  position: relative;
  z-index: 1;
}

/* Зелёная зона: вся левая колонка под контент текста */
.hero-proto__text-zone {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--hero-block-padding-y);
  padding-inline-start: var(--hero-text-nudge-in);
  padding-inline-end: clamp(0.75rem, 2vw, 1.5rem);
  padding-bottom: calc(var(--hero-block-padding-y) + var(--hero-slider-ui-space));
  box-sizing: border-box;
}

/* Синяя зона: ограничение ширины под текст и CTA */
.hero-proto__copy {
  min-width: 0;
  max-width: var(--hero-copy-inner-max);
  width: 100%;
  text-align: left;
}

.hero-proto__reveal-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.02em;
}

.hero-proto__reveal-line-inner {
  display: block;
  transform: translate3d(0, 108%, 0);
  opacity: 0;
  transition:
    transform 0.92s var(--reveal-ease),
    opacity 0.72s ease;
}

.hero-proto__reveal-line--show .hero-proto__reveal-line-inner {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.hero-proto__copy--exiting .hero-proto__reveal-line--show .hero-proto__reveal-line-inner {
  transform: translate3d(0, -108%, 0);
  opacity: 0;
  transition:
    transform 1s var(--reveal-ease),
    opacity 0.85s ease;
}

.hero-proto__copy--instant .hero-proto__reveal-line-inner {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .hero-proto__reveal-line-inner {
    transform: none;
    opacity: 1;
    transition: none;
  }

  .hero-proto__copy--exiting .hero-proto__reveal-line--show .hero-proto__reveal-line-inner {
    transform: none;
    opacity: 1;
  }

  .hero-proto__visual-inner {
    transform: none !important;
    transition: none !important;
  }
}

.hero-proto__word {
  white-space: nowrap;
}

.hero-proto__interword {
  display: inline;
  white-space: pre;
}

.hero-proto__eyebrow {
  margin: 0 0 clamp(0.85rem, 2.2vw, 1.25rem);
  font-size: clamp(0.62rem, 0.95vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  word-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.45;
}

.hero-proto__eyebrow-word {
  cursor: pointer;
  display: inline-block;
  color: inherit;
  box-sizing: border-box;
  vertical-align: baseline;
}

.hero-proto__eyebrow-plain {
  display: inline;
}

.hero-proto__eyebrow-char {
  display: inline;
  color: inherit;
  transition:
    opacity 0.22s ease,
    filter 0.28s ease;
}

.hero-proto__title {
  margin: 0 0 clamp(1rem, 2.5vw, 1.45rem);
  font-size: clamp(2.15rem, 5.2vw, 3.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--text-primary);
}

.hero-proto__title-line {
  display: block;
}

.hero-proto__lead {
  margin: 0 0 clamp(1rem, 2.4vw, 1.55rem);
  font-size: clamp(0.92rem, 1.45vw, 1.12rem);
  font-weight: 400;
  line-height: 1.32;
  color: var(--text-secondary);
  max-width: 30rem;
}

.hero-proto__title-line[hidden],
.hero-proto__lead-line--3[hidden],
.hero-proto__lead-br3[hidden] {
  display: none !important;
}

.hero-proto__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem 0.75rem 1.4rem;
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: var(--radius-pill);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.2s ease, background 0.2s ease;
}

.hero-proto__cta--visible {
  opacity: 1;
  pointer-events: auto;
}

.hero-proto__cta--visible:hover {
  background: var(--site-accent);
  opacity: 1;
}

.hero-proto__cta:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 3px;
}

.hero-proto__cta-arrow {
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.9;
}

.hero-proto__visual {
  /*
   * Красная зона (десктоп): правая половина — фото на всю ячейку, без «карточки».
   * --hero-visual-img-pos-y — вертикаль кадра при object-fit: cover (center | bottom | 45% …).
   */
  --hero-visual-img-pos-y: center;
  --hero-visual-img-pos-x: 60%;

  position: relative;
  height: 100%;
  /* Не даём колонке схлопнуться (внутри absolute — иначе 0 по содержимому) */
  min-height: min(42vh, 22rem);
  padding: 0;
  box-sizing: border-box;
  border-radius: 0;
  background: var(--surface-elevated);
  overflow: hidden;
  justify-self: stretch;
  align-self: stretch;
  margin-left: clamp(-3rem, -4vw, -1.4rem);
}

.hero-proto__visual-inner {
  position: absolute;
  inset: 0;
  transform: translate3d(105%, 0, 0);
  transition: transform 0.92s var(--reveal-ease);
  will-change: transform;
}

.hero-proto__visual-inner--in {
  transform: translate3d(0, 0, 0);
}

.hero-proto__visual-inner--exit {
  transform: translate3d(108%, 0, 0);
  transition: transform 1s var(--reveal-ease);
}

.hero-proto__visual-inner--instant {
  transition: none !important;
}

.hero-proto__img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: var(--hero-visual-img-pos-x) var(--hero-visual-img-pos-y);
  display: block;
}

.hero-proto__visual-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.97) 18%,
    rgba(255, 255, 255, 0.55) 42%,
    rgba(255, 255, 255, 0) 58%
  );
}

.hero-proto__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--text-primary);
  opacity: 0.44;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
  pointer-events: auto;
}

.hero-proto__arrow:hover {
  opacity: 0.88;
}

.hero-proto__arrow:focus-visible {
  opacity: 1;
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.hero-proto__arrow:active {
  transform: translateY(-50%) scale(0.94);
}

.hero-proto__arrow--prev {
  left: calc(clamp(0.4rem, 1.1vw, 0.9rem) - 62%);
}

.hero-proto__arrow--next {
  /* Выносим правую стрелку за внутреннюю границу колонок */
  right: calc(-1 * clamp(1.75rem, 3.8vw, 3rem));
}

.hero-proto__arrow-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.hero-proto__slider-ui {
  position: absolute;
  /* Центрируем UI относительно всего hero при колонках 0.78fr / 1.22fr */
  left: -63.9344%;
  width: 163.9344%;
  bottom: clamp(0.65rem, 1.8vw, 1rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.65rem, 2vw, 1rem);
  z-index: 3;
  pointer-events: auto;
}

.hero-proto__slider-num {
  font-size: clamp(0.75rem, 1.15vw, 0.9rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 1.1em;
  text-align: center;
  pointer-events: none;
  flex-shrink: 0;
}

.hero-proto__slider-num--current {
  font-weight: 600;
  color: var(--text-primary);
}

.hero-proto__slider-num--other {
  font-weight: 500;
  color: var(--text-muted);
}

.hero-proto__slider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  pointer-events: auto;
}

.hero-proto__slider-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  box-sizing: content-box;
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.hero-proto__slider-dot:hover,
.hero-proto__slider-dot:focus-visible {
  border-color: var(--site-accent);
  outline: none;
}

.hero-proto__slider-dot:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text-primary);
}

.hero-proto__slider-dot--active {
  background: var(--site-accent);
  border-color: var(--site-accent);
  transform: scale(1.2);
}

.hero-proto__slider-track {
  width: min(6rem, 22vw);
  max-width: 6rem;
  height: 3px;
  background: rgba(17, 17, 17, 0.22);
  border-radius: 1px;
  overflow: hidden;
  pointer-events: none;
}

.hero-proto__slider-fill {
  height: 100%;
  width: 100%;
  background: var(--site-accent);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

@media (max-width: 900px) {
  .hero-proto {
    --hero-section-min: auto;
    --hero-section-max: none;
    --hero-block-padding-y: clamp(1.5rem, 4vw, 2.5rem);

    grid-template-columns: 1fr;
    max-height: var(--hero-section-max);
    min-height: var(--hero-section-min);
    padding-bottom: 0;
  }

  .hero-proto__text-zone {
    order: 1;
    width: 100%;
    padding-inline-end: 0;
    padding-inline-start: 0;
    padding-bottom: 0;
    justify-content: flex-start;
  }

  .hero-proto__slider-ui {
    left: 0;
    width: auto;
    right: 0;
    padding-inline: clamp(0.85rem, 4vw, 1.25rem);
    gap: clamp(0.5rem, 2.5vw, 0.85rem);
  }

  .hero-proto__slider-track {
    width: min(5rem, 28vw);
    max-width: 5rem;
  }

  .hero-proto__arrow {
    width: 2.65rem;
    height: 2.65rem;
    opacity: 0.48;
  }

  .hero-proto__arrow-icon {
    width: 0.95rem;
    height: 0.95rem;
  }

  .hero-proto__arrow--prev {
    left: 0.15rem;
  }

  .hero-proto__arrow--next {
    right: 0.15rem;
  }

  .hero-proto__copy {
    max-width: none;
  }

  .hero-proto__word {
    white-space: normal;
  }

  .hero-proto__eyebrow-word {
    white-space: nowrap;
  }

  .hero-proto__visual {
    --hero-visual-min: min(35vh, 20rem);
    --hero-visual-max: 40vh;

    order: 2;
    height: auto;
    min-height: var(--hero-visual-min);
    max-height: var(--hero-visual-max);
    width: 100%;
    align-self: stretch;
  }

  .hero-proto__visual-fade {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.92) 0%,
      rgba(255, 255, 255, 0.45) 38%,
      rgba(255, 255, 255, 0) 72%
    );
  }

}

/* Телефон ~390–414px (и уже до 480px) */
@media (max-width: 480px) {
  .hero-proto {
    display: flex;
    flex-direction: column;
    min-height: auto;
    max-height: none;
    padding:
      0
      clamp(0.75rem, 4vw, 1rem)
      clamp(1rem, 4vw, 1.35rem);
  }

  /* 1. Фото сверху */
  .hero-proto__visual {
    order: 0;
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: min(52vh, 22rem);
    max-height: min(58vh, 24rem);
    margin-left: 0;
    align-self: stretch;
  }

  .hero-proto__visual-inner,
  .hero-proto__img {
    border-radius: var(--radius-md);
  }

  .hero-proto__visual-fade {
    display: none;
  }

  /* 3–4. Полоса по центру снизу фото, номер слева */
  .hero-proto__slider-ui {
    left: 0;
    right: 0;
    width: 100%;
    bottom: 0.65rem;
    display: grid;
    grid-template-columns: minmax(2.25rem, auto) 1fr minmax(2.25rem, auto);
    align-items: center;
    gap: 0;
    padding: 0 0.65rem;
    pointer-events: none;
  }

  /* 2. Точки — скрыть на телефоне */
  .hero-proto__slider-dots {
    display: none !important;
  }

  .hero-proto__slider-num--current {
    grid-column: 1;
    justify-self: start;
    text-align: left;
    font-size: 0.8rem;
    min-width: 0;
  }

  .hero-proto__slider-num--other {
    display: none !important;
  }

  .hero-proto__slider-track {
    grid-column: 2;
    justify-self: center;
    width: min(7.5rem, 46vw);
    max-width: 7.5rem;
    margin: 0 auto;
  }

  /* 5. Текст и CTA под фото — один блок hero */
  .hero-proto__text-zone {
    order: 1;
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding:
      clamp(1.1rem, 4vw, 1.5rem)
      0
      0;
    justify-content: flex-start;
  }

  .hero-proto__copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: none;
    width: 100%;
  }

  .hero-proto__title {
    font-size: clamp(1.65rem, 8.5vw, 2.15rem);
    margin-bottom: 0.75rem;
  }

  .hero-proto__lead {
    font-size: 0.9rem;
    margin-bottom: 0;
    max-width: none;
  }

  .hero-proto__eyebrow {
    margin-bottom: 0.65rem;
  }

  /* 6. CTA под текстом, по центру, внутри hero */
  .hero-proto__cta {
    position: relative;
    z-index: 2;
    align-self: center;
    margin-top: clamp(1.15rem, 4.5vw, 1.5rem);
    margin-bottom: 0;
    transform: none;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
  }

  .hero-proto__cta--visible:hover {
    transform: none;
  }

  .hero-proto__cta:active {
    transform: scale(0.98);
  }

  .hero-proto__cta:focus-visible {
    transform: none;
  }

  .hero-proto__arrow--prev {
    left: 0.35rem;
  }

  .hero-proto__arrow--next {
    right: 0.35rem;
  }
}
