/* ==========================================================================
   HERO — unified premium slider (index)
   ========================================================================== */

.hero {
  --hero-h: clamp(640px, 78vh, 860px);
  --hero-ui-pad-x: clamp(24px, 4.5vw, 64px);
  --hero-ui-pad-b: clamp(18px, 2.8vw, 28px);
  position: relative;
  height: var(--hero-h);
  min-height: var(--hero-h);
  max-height: var(--hero-h);
  overflow: hidden;
  background: #08080a;
}

.hero__viewport {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

/* Background slides */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 1100ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 1100ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero__bg-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.hero__bg-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__bg-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-pos-desktop, center center);
  transform: scale(1);
  will-change: transform;
}

.hero__bg-slide.is-active .hero__bg-img {
  animation: heroKenBurns 9000ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero__bg-slide--1 {
  --hero-pos-desktop: center 58%;
  --hero-pos-tablet: center 52%;
  --hero-pos-mobile: center 44%;
}

.hero__bg-slide--2 {
  --hero-pos-desktop: 58% center;
  --hero-pos-tablet: 56% center;
  --hero-pos-mobile: 52% 50%;
}

.hero__bg-slide--3 {
  --hero-pos-desktop: center 92%;
  --hero-pos-tablet: center 90%;
  --hero-pos-mobile: center 92%;
}

@keyframes heroKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* Shade overlays */
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.28) 0%, transparent 22%),
    linear-gradient(180deg, transparent 42%, rgba(9, 9, 9, 0.72) 76%, rgba(9, 9, 9, 0.94) 100%);
  transition: background 900ms ease;
}

.hero--slide-0 .hero__shade {
  background:
    linear-gradient(90deg, rgba(8, 8, 10, 0.78) 0%, rgba(8, 8, 10, 0.42) 38%, transparent 68%),
    linear-gradient(180deg, rgba(8, 8, 10, 0.18) 0%, transparent 24%),
    linear-gradient(180deg, transparent 46%, rgba(9, 9, 9, 0.76) 80%, rgba(9, 9, 9, 0.94) 100%);
}

.hero--slide-1 .hero__shade {
  background:
    linear-gradient(90deg, rgba(4, 8, 18, 0.94) 0%, rgba(4, 8, 18, 0.68) 32%, rgba(4, 8, 18, 0.22) 56%, transparent 78%),
    linear-gradient(180deg, rgba(8, 8, 10, 0.2) 0%, transparent 24%),
    linear-gradient(180deg, transparent 40%, rgba(9, 9, 9, 0.78) 80%, rgba(9, 9, 9, 0.94) 100%);
}

.hero--slide-2 .hero__shade {
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.34) 0%, transparent 28%),
    linear-gradient(180deg, transparent 38%, rgba(9, 9, 9, 0.74) 78%, rgba(9, 9, 9, 0.94) 100%);
}

/* Foreground UI */
.hero__ui {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-rows: 1fr auto auto;
  grid-template-areas:
    "copy"
    "highlights"
    "dots";
  gap: clamp(14px, 2vw, 18px);
  padding:
    calc(var(--site-header-height) + clamp(16px, 2.5vh, 28px))
    var(--hero-ui-pad-x)
    var(--hero-ui-pad-b);
  pointer-events: none;
}

.hero__panels {
  grid-area: copy;
  position: relative;
  align-self: end;
  min-height: 0;
}

.hero__panel {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: min(620px, 100%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(22px);
  pointer-events: none;
  transition:
    opacity 950ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 950ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 950ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero__panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.hero__panel .hero__title {
  margin-bottom: clamp(12px, 1.6vw, 16px);
}

.hero__panel .hero__desc {
  margin-bottom: clamp(18px, 2.2vw, 24px);
}

.hero__panel .hero__animate {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 650ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 650ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero__panel.is-active .hero__animate--1 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.08s;
}

.hero__panel.is-active .hero__animate--2 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.18s;
}

.hero__panel.is-active .hero__animate--3 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.28s;
}

.hero__panel:not(.is-active) .hero__animate {
  transition-delay: 0s;
}

/* Highlights inside hero */
.hero__highlights {
  grid-area: highlights;
  pointer-events: auto;
  align-self: end;
}

.hero .hero-highlights__list {
  width: 100%;
  margin: 0;
}

.hero .hero__highlights .hero-highlights__list {
  background: rgba(10, 10, 12, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Pagination */
.hero__dots {
  grid-area: dots;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
}

.hero__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition:
    width 450ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 450ms ease,
    box-shadow 450ms ease;
}

.hero__dot.is-active {
  width: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 16px rgba(31, 79, 255, 0.38);
}

/* Arrows — vertical center of hero */
.hero__arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(9, 9, 12, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  pointer-events: auto;
  transition:
    background-color 350ms ease,
    border-color 350ms ease;
}

.hero__arrow:hover {
  background: rgba(31, 79, 255, 0.28);
  border-color: rgba(31, 79, 255, 0.45);
}

.hero__arrow--prev { left: clamp(12px, 2vw, 24px); }
.hero__arrow--next { right: clamp(12px, 2vw, 24px); }
.hero__arrow svg { width: 18px; height: 18px; }

.hero.is-dragging .hero__bg-slide.is-active .hero__bg-img {
  animation-play-state: paused;
}

/* Desktop: single-row highlights */
@media (min-width: 1024px) {
  .hero .hero-highlights__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 0;
    max-width: 1200px;
    height: 84px;
    margin: 0 auto;
    padding: 0 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
      0 20px 56px rgba(0, 0, 0, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .hero__highlights {
    padding-bottom: clamp(2px, 0.6vw, 6px);
  }

  .hero .hero-highlights__item {
    justify-content: center;
    height: 100%;
    min-height: 0;
    background: transparent;
    border: none;
    border-radius: 999px;
    backdrop-filter: none;
  }

  .hero .hero-highlights__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .hero__bg-img {
    object-position: var(--hero-pos-tablet, var(--hero-pos-desktop, center center));
  }

  .hero__panel .hero__title {
    font-size: clamp(28px, 4.2vw, 40px);
  }
}

@media (max-width: 768px) {
  .hero {
    --hero-h: min(660px, 92svh);
  }

  .hero__bg-img {
    object-position: var(--hero-pos-mobile, center center);
  }

  .hero__ui {
    gap: clamp(8px, 2.5vw, 12px);
    padding-top: calc(var(--site-header-height) + clamp(22px, 5vw, 36px));
    padding-bottom: clamp(12px, 3vw, 18px);
  }

  .hero__panels {
    align-self: end;
    padding-top: clamp(72px, 16vw, 108px);
  }

  .hero__panel {
    max-width: 100%;
  }

  .hero__panel .hero__title {
    font-size: clamp(22px, 6.2vw, 30px);
  }

  .hero__panel .hero__desc {
    font-size: clamp(13px, 3.5vw, 15px);
    line-height: 1.55;
  }

  .hero__panel .hero__actions .hero__btn {
    min-width: 0;
    width: 100%;
    max-width: 300px;
  }

  .hero .hero-highlights__list {
    gap: 8px;
    margin-top: clamp(2px, 1vw, 6px);
  }

  .hero .hero-highlights__item {
    min-height: 50px;
    height: 52px;
    background: rgba(8, 8, 10, 0.68);
  }

  .hero__arrow {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__bg-slide,
  .hero__bg-slide.is-active .hero__bg-img,
  .hero__panel,
  .hero__dot,
  .hero__shade {
    transition: none;
    animation: none;
  }

  .hero__bg-slide.is-active .hero__bg-img {
    transform: none;
  }
}
