* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto Condensed", Arial, sans-serif;
}

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  margin-top: 0; /* extend under fixed header */
  background-color: #0c275d;
  background-image: url("../img/hero.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero__container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding-top: var(--section-header-height);
}

.hero__content {
  height: calc(100% - 56px);
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.hero__left {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 100vw;
  left: clamp(200px, 12vw, 360px);
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical centering */
  align-items: flex-start; /* keep left alignment */
  pointer-events: none;
}

/* Align left block vertically to match hero image height and center the active line */
@media (min-width: 861px) {
  .hero__left {
    top: 50%;
    bottom: auto;
    transform: translateY(-40%);
    height: clamp(740px, 37vw, 960px); /* same as image */
  }
}

.roller {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(68px, 5.1vw, 116px);
  height: clamp(740px, 37vw, 960px); /* match hero image height */
  max-height: none;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateZ(0); /* promote for stable subpixel rendering */
}

.roller_item {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: clamp(72px, 4vw, 120px); /* keep font-size stable to avoid reflow */
  font-weight: 600;
  color: #fff;
  line-height: 1;
  transition: opacity 0.3s ease, transform 0.3s ease; /* no font-size transition */
  opacity: 0;
  pointer-events: none;
  position: static;
  transform-origin: left center;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.roller__title {
  user-select: none;
  text-decoration: underline 5.5% solid rgb(81, 73, 195);
  text-underline-offset: 7%;
  text-decoration-skip-ink: none;
}

.roller_item.center {
  transform: scale(1);
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

.roller_item.side {
  transform: scale(0.6);
  opacity: 0.2;
  z-index: 1;
  pointer-events: auto;
}

.roller_item.side:hover {
  cursor: pointer;
  transform: scale(0.6);
  opacity: 0.4 !important;
}

/* subtle entrance for the active text */
@keyframes heroCenterIn {
  from {
    opacity: 1;
    transform: none;
    filter: none;
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
.roller_item.center {
  animation: none;
}

@keyframes heroScrollBounce {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
    opacity: 0.9;
  }
  50% {
    transform: translateY(4px) rotate(45deg);
    opacity: 0.5;
  }
}

.hero__right {
  position: relative;
  z-index: 1;
  flex: 0 0 clamp(1160px, 58vw, 1680px);
  width: clamp(1160px, 58vw, 1680px);
  height: 100%;
  align-self: flex-end;
  margin-bottom: 0;
  padding-bottom: 0;
  border-radius: 100px 0px 0px 0px;
  overflow: hidden;
  touch-action: pan-y; /* разрешаем вертикальный скролл, блокируем горизонтальный */
}

.slider {
  display: flex;
  flex-direction: column;
  /* Reserve space for custom scrollbar below the image to prevent layout jump */
  --slider-scrollbar-h: 8px;
  height: 100%;
}

.slider__controls {
  position: absolute; /* stick to hero; disappears when section scrolls */
  left: 50vw; /* center relative to viewport width */
  transform: translateX(-50%);
  bottom: 16px;
  display: none; /* desktop: hidden */
  align-items: center;
  gap: 10px;
  z-index: 3;
  pointer-events: none; /* enable only children */
}
/* center the controls relative to hero container, not viewport */
.slider__controls.-fixed {
  position: absolute;
}
.slider__controls.-hidden {
  opacity: 0;
  pointer-events: none;
}
.slider__arrow {
  position: static;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(13, 48, 121, 0.35);
  backdrop-filter: blur(4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  display: none; /* hidden by default (desktop) */
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.slider__arrow {
  opacity: 0;
  pointer-events: none;
}
.slider__arrow:hover {
  background: rgba(13, 48, 121, 0.5);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.slider__arrow:active {
  transform: translateY(0) scale(0.98);
}
.slider__arrow.-prev {
  left: auto;
}
.slider__arrow.-next {
  left: auto;
}
.slider__arrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: rotate(45deg);
}
.slider__arrow.-prev::before {
  transform: rotate(-135deg);
}
.slider__arrow.-next::before {
  transform: rotate(45deg);
}

.slider__dots {
  position: static;
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.slider__dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.slider__dot.-active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.slider__dot.-active::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: inherit;
  opacity: 1;
  animation: sliderDotPulse 1.6s ease infinite;
}
@keyframes sliderDotPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.35;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

.slider__item {
  position: relative;
  display: inline-block;
  height: calc(100% - var(--slider-scrollbar-h, 8px));
}

/* slide enter effects (card-like) */
/* apply slide animation only on mobile */
@media (max-width: 860px) {
  /* mobile slide-in disabled */
  .enter-right,
  .enter-left {
    animation: none !important;
  }
}
@media (min-width: 861px) {
  .enter-right,
  .enter-left {
    animation: none !important;
  }
}
/* softer, low-contrast entrance (less shift, light fade, slight scale + brightness ease) */
@keyframes slideInRight {
  0% {
    transform: translate3d(8%, 0, 0) rotate(0.8deg);
    opacity: 0.55;
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0);
    opacity: 1;
  }
}
@keyframes slideInLeft {
  0% {
    transform: translate3d(-8%, 0, 0) rotate(-0.8deg);
    opacity: 0.55;
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0);
    opacity: 1;
  }
}

.hero__right img {
  width: clamp(1160px, 58vw, 1680px);
  height: 100%;
  object-fit: cover;
  display: block;
  margin-bottom: 0;
  padding-bottom: 0;
  user-select: none;
}

/* overlay image for safe crossfade without layout shifts */
.slider__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 360ms ease;
  pointer-events: none;
}
.slider__overlay.-show {
  opacity: 1;
}

.custom-scroll {
  display: block;
  height: var(--slider-scrollbar-h, 8px);
  background-color: #1d4aa6;
  position: relative;
  cursor: pointer;
  pointer-events: auto;
  z-index: 99999;
}

.custom-scroll__track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #fff;
  z-index: 1;
  pointer-events: none;
}

.custom-scroll__btn {
  background-color: #fff;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: auto;
  z-index: 1000001;
  cursor: pointer;
  pointer-events: auto;
}

.hero__bottom {
  height: 56px;
}

.mini-banner {
  display: flex;
  background-color: rgb(243, 62, 119);
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 72px;
  user-select: none;
  overflow: hidden;
}

/* анти‑wrap для баннера */
.mini-banner {
  flex-wrap: nowrap !important; /* не переносить элементы */
  overflow: hidden; /* лишнее скрывать */
  column-gap: 24px;
}
.mini-banner > * {
  flex: 0 0 auto !important;
}
.mini-banner .txt {
  white-space: nowrap;
}

.circle {
  width: 8px;
  height: 8px;
  background-color: rgb(255, 255, 255);
  border-radius: 100%;
}

.hero .txt {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 40px;
  color: rgb(255, 255, 255);
  letter-spacing: 0.5em;
  text-align: center;
  text-transform: uppercase;
}

/* ====== Responsive templates ====== */

/* ≥ 1440px (large desktop) */
@media (min-width: 1440px) {
  /* Пример: немного увеличим промежутки */
  .roller {
    gap: 68px;
  }
}

/* ≥ 1600px (very large desktop) */
@media (min-width: 1600px) {
  .roller {
    gap: clamp(72px, 3.95vw, 150px);
  }
  .roller_item {
    height: clamp(140px, 8vw, 220px);
  }
  .roller_item.center {
    font-size: clamp(112px, 5.6vw, 167px);
  }
  .roller_item.side {
    font-size: clamp(64px, 3.2vw, 120px);
    transform: scale(0.65);
  }
  .roller_item.side:hover {
    transform: scale(0.72);
  }
}

/* ≥ 2000px: enlarge hero image for ultra-wide displays */
@media (min-width: 2000px) {
  .hero__right {
    flex-basis: clamp(1450px, 64vw, 1960px);
    width: clamp(1450px, 64vw, 1960px);
  }
  .hero__right img {
    width: clamp(1450px, 64vw, 1960px);
  }
}

@media (max-width: 1680px) {
  /* ≤ 1440px (desktop) */
  .hero__left {
    left: 80px;
  }
  .hero__content {
    height: calc(100% - 56px);
  }
  .hero .txt {
    font-size: 28px;
  }
}

/* ≤ 1280px (desktop) */
@media (max-width: 1280px) {
  .hero__left {
    left: 40px;
  }
  .hero__right {
    flex-basis: 880px;
    width: 880px;
  }
  .hero__right img {
    width: 880px;
  }
  .roller_item.center {
    font-size: 70px;
  }
  .roller_item {
    height: 90px;
  }
  .roller_item.side {
    font-size: 40px;
  }
}

/* shrink hero image ~20% on 1025–1280px viewports */
@media (min-width: 1025px) and (max-width: 1280px) {
  .hero__right {
    flex-basis: 720px;
    width: 720px;
    height: 100%;
  }
  .hero__right img {
    width: 720px;
    height: 100%;
  }
}

/* ≤ 1024px (tablet landscape) */
@media (max-width: 1024px) {
  .hero__right {
    flex-basis: 720px;
    width: 720px;
    height: 100%;
  }
  .roller {
    gap: 64px;
  }
  .roller_item {
    height: 100px;
  }
  .roller_item.center {
    font-size: 53px;
  }
  .roller_item.side {
    font-size: 35px;
  }
}

/* further shrink for >1000px (1001–1024) to keep proportions consistent */
@media (min-width: 1001px) and (max-width: 1024px) {
  .hero__right {
    flex-basis: 680px;
    width: 680px;
    height: 100%;
  }
  .hero__right img {
    width: 680px;
    height: 100%;
  }
  /* +20% total vs base (second +10%) */
  .roller_item.center { font-size: 58px; }
  .roller_item.side { font-size: 39px; }
}

/* ≤ 1000px (tablet/small desktop): make hero image smaller than default mobile layout */
@media (min-width: 861px) and (max-width: 1000px) {
  .hero__right {
    flex-basis: 680px;
    width: 680px;
  }
  .hero__right img {
    width: 680px;
    height: 100%;
    object-position: center center;
  }
  .roller {
    gap: 24px; /* уменьшенный зазор между элементами около 1000px */
  }
  /* +20% total vs base (second +10%) */
  .roller_item.center { font-size: 58px; }
  .roller_item.side { font-size: 39px; }
}

/* ≤ 860px (tablet/mid mobile) */
@media (max-width: 860px) {
  .hero {
    --banner-h: 56px;
    background-position: left center; /* якорь слева, чтобы круг всегда был виден */
  }
  /* no scrollbar on mobile; remove reserved space under image */
  .slider { --slider-scrollbar-h: 0px; height: auto; }
  .slider__item { height: auto; }
  .hero__content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* убираем большое распределение пространства */
    align-items: center;
    gap: 40px; /* фиксированный отступ между заголовком и картинкой */
    height: auto;
    min-height: calc(100% - var(--banner-h));
  }

  .hero__bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--banner-h);
    z-index: 5;
  }

  .hero__left {
    position: static;
    width: 100%;
    left: 0;
    top: 0;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto; /* не растягиваем блок, чтобы не появлялось лишнего пространства */
    margin: 0; /* без дополнительных внешних отступов */
    transform: none; /* убрать сдвиг на мобилках, чтобы не наезжать на картинку */
    height: auto;
  }

  .hero__right {
    flex-basis: 100%;
    width: 100%;
    height: auto; /* avoid height jumping; image drives height */
    margin-top: 0; /* отступ контролируем через gap */
    align-self: stretch;
    overflow: hidden;
    margin-left: 40px; 
  }

  .hero__right img {
    width: 100%;
    height: 580px; /* fixed stable height on mobile to prevent jumping */
    object-fit: cover; /* restore original look */
    object-position: center center; /* центрировать изображение */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    image-rendering: auto;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  }

  .custom-scroll {
    display: none;
  }
  .slider__controls {
    display: flex;
    bottom: calc(var(--banner-h) + 10px);
    justify-content: center;
    gap: 8px;
    left: 50vw;
    transform: translateX(-50%);
    width: auto;
    padding: 0;
  }
  .slider__arrow {
    width: 40px;
    height: 40px;
    display: grid;
    position: static;
  }

  /* Card deck slide motion */
  .slider__item {
    position: relative;
    overflow: visible;
  }
  .overlay-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  }
  /* remove slide-in keyframes */
  @keyframes slideInRight {
    from {
      opacity: 1;
    }
    to {
      opacity: 1;
    }
  }
  @keyframes slideInLeft {
    from {
      opacity: 1;
    }
    to {
      opacity: 1;
    }
  }
  /* keep arrows next to dots in one row */
  .slider__controls {
    gap: 12px;
  }

  .roller {
    display: grid;
    place-items: center;
    gap: 0;
    width: 100%;
    height: auto;
    max-height: none;
    transform: none !important;
  }

  .roller_item {
    display: none;
    height: 240px;
  }
  .roller_item.center {
    display: flex;
    width: max-content;
    margin: 0 auto;
    font-size: 48px;
  }
  .roller_item.side {
    display: none;
    font-size: 24px;
  }

  .roller__title {
    text-align: center;
  }

  .hero__right {
    flex-basis: 100%;
    width: 100%;
    height: auto; /* keep auto here as well */
    margin-top: auto; /* прижимаем вниз */
    align-self: stretch;
  }
  .hero__right img {
    width: 100%;
    height: 580px;
    object-fit: cover;
    object-position: left center; /* якорь слева, обрезаем справа */
  }
  /* show arrows only on mobile (keep inline with dots) */
  .slider__arrow {
    display: grid;
  }
  .mini-banner {
    flex-wrap: nowrap; /* не переносим элементы */
    overflow: hidden; /* лишнее скрываем */
    justify-content: center; /* выравнивание по центру */
    column-gap: 24px;
  }
  .mini-banner > * {
    flex: 0 0 auto;
  } /* не сжимать элементы */
  .mini-banner .txt {
    white-space: nowrap;
  }
}
@media (max-width: 560px) {
  .roller__title {
    max-width: 465px;
  }
}

/* ≤ 450px (mobile small) */
@media (max-width: 500px) {
  .hero {
    background-position: left top; /* на самых узких держим ещё выше */
  }
  .hero__content {
    justify-content: flex-start;
    gap: 40px; /* тот же максимальный зазор */
    min-height: calc(100% - var(--banner-h));
  }
  .hero__bottom {
    height: var(--banner-h);
  }
  .hero__left {
    flex: 0 0 auto;
  }
  .roller__title {
    font-size: 56px;
    max-width: 400px;
    height: fit-content;
    text-align: center;
  }
  .hero__right {
    margin-top: auto;
    align-self: stretch;
    margin-left: 20px;
  }
  .hero__right img {
    height: 540px;
  }
  .hero .txt {
    font-size: 28px;
  }
  .mini-banner {
    flex-wrap: nowrap;
    overflow: hidden;
    column-gap: 16px;
  }
  .mini-banner > * {
    flex: 0 0 auto;
  }
  .mini-banner .txt {
    white-space: nowrap;
  }
}

/* ====== End responsive templates ====== */
