/* ==========================================================================
   Hero Carousel — full-bleed image slider with glassmorphism overlays
   ========================================================================== */

.hero-carousel,
#hero-carousel {
  position: relative;
  width: 100%;
  height: var(--hero-viewport-height);
  min-height: var(--hero-viewport-height);
  max-height: var(--hero-viewport-height);
  margin-top: 0;
  background: #020617;
  overflow: hidden;
}

.hero-page .hero-carousel,
.hero-page #hero-carousel {
  margin-top: 0;
}

.hero-carousel__viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.hero-carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.hero-carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.85s;
  z-index: 1;
}

.hero-carousel__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.hero-carousel__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-carousel__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  transform-origin: center center;
}

.hero-carousel__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    #020617 0%,
    rgba(2, 6, 23, 0.92) 20%,
    rgba(2, 6, 23, 0.7) 40%,
    rgba(2, 6, 23, 0.28) 58%,
    transparent 78%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-carousel__inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 2.5rem 0 4.5rem;
  pointer-events: none;
}

.hero-carousel__inner.container {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.hero-carousel__glass {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 640px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  pointer-events: auto;
}

.hero-carousel__tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.hero-carousel__tagline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 10px #06b6d4;
  animation: carouselDotPulse 2s ease infinite;
}

@keyframes carouselDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.25); }
}

.hero-carousel__title {
  margin: 0 0 1.15rem;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: clamp(1.875rem, 4.5vw, 3.125rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-carousel__highlight {
  background: linear-gradient(135deg, #67e8f9 0%, #06b6d4 50%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(6, 182, 212, 0.45));
}

.hero-carousel__desc {
  margin: 0 0 1.75rem;
  font-size: clamp(0.9375rem, 1.8vw, 1.0625rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  max-width: 540px;
}

.hero-carousel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-carousel__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: 14px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}

.hero-carousel__btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 50%, #0e7490 100%);
  border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.hero-carousel__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(6, 182, 212, 0.5), 0 12px 32px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.hero-carousel__btn--outline {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-carousel__btn--outline:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
  color: #fff;
}

/* Slide content — staggered entrance animations */
.hero-carousel__slide .hero-carousel__glass,
.hero-carousel__slide .hero-carousel__tagline,
.hero-carousel__slide .hero-carousel__title,
.hero-carousel__slide .hero-carousel__desc,
.hero-carousel__slide .hero-carousel__actions,
.hero-carousel__slide .hero-carousel__btn {
  opacity: 0;
}

.hero-carousel__slide.is-active .hero-carousel__media {
  animation: carouselImageIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-carousel__slide.is-active .hero-carousel__image {
  animation: carouselImageIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-carousel__slide.is-active .hero-carousel__glass {
  animation: carouselGlassIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-carousel__slide.is-active .hero-carousel__tagline {
  animation: carouselItemIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

.hero-carousel__slide.is-active .hero-carousel__title {
  animation: carouselItemIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

.hero-carousel__slide.is-active .hero-carousel__desc {
  animation: carouselItemIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}

.hero-carousel__slide.is-active .hero-carousel__actions {
  animation: carouselItemIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

.hero-carousel__slide.is-active .hero-carousel__btn:nth-child(1) {
  animation: carouselBtnPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s forwards;
}

.hero-carousel__slide.is-active .hero-carousel__btn:nth-child(2) {
  animation: carouselBtnPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 1s forwards;
}

@keyframes carouselImageIn {
  from { transform: scale(1.02); opacity: 0.85; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes carouselGlassIn {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes carouselItemIn {
  from { opacity: 0; transform: translateX(-32px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes carouselBtnPop {
  from { opacity: 0; transform: translateY(16px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Navigation arrows */
.hero-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #22d3ee;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.hero-carousel__arrow svg {
  width: 22px;
  height: 22px;
}

.hero-carousel__arrow:hover {
  transform: translateY(-50%) scale(1.06);
  background: rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.45);
}

.hero-carousel__arrow--prev { left: 1.25rem; }
.hero-carousel__arrow--next { right: 1.25rem; }

/* Dot indicators */
.hero-carousel__dots {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  border-radius: 100px;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(6, 182, 212, 0.15);
}

.hero-carousel__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.hero-carousel__dot.is-active {
  background: #22d3ee;
  transform: scale(1.25);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.8), 0 0 28px rgba(6, 182, 212, 0.4);
}

.hero-carousel__dot:hover:not(.is-active) {
  background: rgba(34, 211, 238, 0.55);
}

/* Tablet */
@media (max-width: 1024px) {
  .hero-carousel__gradient {
    background: linear-gradient(
      to right,
      #020617 0%,
      rgba(2, 6, 23, 0.9) 22%,
      rgba(2, 6, 23, 0.62) 42%,
      rgba(2, 6, 23, 0.22) 62%,
      transparent 82%
    );
  }

  .hero-carousel__arrow {
    width: 42px;
    height: 42px;
  }
}

/* Mobile — viewport-height hero below header, subject biased right */
@media (max-width: 768px) {
  .hero-carousel,
  #hero-carousel,
  .hero-carousel__viewport,
  .hero-carousel__track {
    height: var(--hero-viewport-height);
    min-height: var(--hero-viewport-height);
    max-height: var(--hero-viewport-height);
    margin-top: 0;
  }

  .hero-carousel__slide {
    position: absolute;
    inset: 0;
    display: block;
  }

  .hero-carousel__media {
    position: absolute;
    inset: 0;
    padding: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-carousel__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
    object-position: 85% center;
    transform-origin: center center;
  }

  /* Bottom scrim for text + left fade so copy stays crisp */
  .hero-carousel__gradient {
    display: block;
    background:
      linear-gradient(
        to top,
        rgba(2, 6, 23, 0.96) 0%,
        rgba(2, 6, 23, 0.82) 24%,
        rgba(2, 6, 23, 0.45) 48%,
        rgba(2, 6, 23, 0.12) 68%,
        transparent 88%
      ),
      linear-gradient(
        to right,
        rgba(2, 6, 23, 0.88) 0%,
        rgba(2, 6, 23, 0.55) 34%,
        transparent 62%
      );
  }

  .hero-carousel__inner {
    position: absolute;
    inset: 0;
    justify-content: flex-end;
    align-items: stretch;
    min-height: 100%;
    height: 100%;
    padding: 0 1.25rem calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .hero-page .hero-carousel__inner {
    padding-top: 0;
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .hero-carousel__inner.container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .hero-carousel__glass {
    max-width: 100%;
    width: 100%;
    max-height: none;
  }

  .hero-carousel__tagline {
    font-size: 0.625rem;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.65rem;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.35);
  }

  .hero-carousel__tagline-dot {
    background: #22d3ee;
    box-shadow: 0 0 10px #06b6d4;
  }

  .hero-carousel__title {
    font-size: clamp(1.375rem, 6vw, 1.75rem);
    line-height: 1.2;
    color: #fff;
    margin-bottom: 0.65rem;
    max-width: 92%;
  }

  .hero-carousel__highlight {
    background: linear-gradient(135deg, #67e8f9 0%, #06b6d4 50%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px rgba(6, 182, 212, 0.4));
  }

  .hero-carousel__desc {
    margin-bottom: 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    max-width: 92%;
    color: rgba(255, 255, 255, 0.88);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-carousel__actions {
    flex-direction: column;
    width: 100%;
    max-width: 92%;
    gap: 0.6rem;
  }

  .hero-carousel__btn {
    width: 100%;
    min-height: 44px;
    font-size: 0.875rem;
    white-space: normal;
    text-align: center;
    border-radius: 12px;
  }

  .hero-carousel__btn--primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.45), 0 6px 20px rgba(0, 0, 0, 0.25);
  }

  .hero-carousel__btn--outline {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
  }

  .hero-carousel__arrow {
    width: 34px;
    height: 34px;
    top: 42%;
    bottom: auto;
    transform: translateY(-50%);
    background: rgba(2, 6, 23, 0.55);
    border-color: rgba(6, 182, 212, 0.4);
    color: #22d3ee;
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
  }

  .hero-carousel__arrow--next {
    left: 0.65rem;
    right: auto;
    top: calc(42% + 2.75rem);
  }

  .hero-carousel__arrow:hover {
    transform: translateY(-50%) scale(1.06);
  }

  .hero-carousel__arrow--prev { left: 0.65rem; }

  .hero-carousel__dots {
    position: absolute;
    bottom: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    background: rgba(2, 6, 23, 0.55);
    border-color: rgba(6, 182, 212, 0.2);
  }

  .hero-carousel__dot {
    background: rgba(255, 255, 255, 0.3);
  }

  .hero-carousel__dot.is-active {
    background: #22d3ee;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.75);
  }
}

@media (max-width: 480px) {
  .hero-carousel__inner {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  .hero-carousel__image {
    object-position: 85% center;
  }

  .hero-carousel__title {
    font-size: 1.3125rem;
  }

  .hero-carousel__desc {
    max-width: 95%;
    -webkit-line-clamp: 2;
  }

  .hero-carousel__arrow {
    top: 40%;
    width: 32px;
    height: 32px;
  }

  .hero-carousel__arrow--next {
    left: 0.65rem;
    right: auto;
    top: calc(40% + 2.5rem);
  }

  .hero-carousel__dots {
    bottom: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel__slide,
  .hero-carousel__slide.is-active .hero-carousel__glass,
  .hero-carousel__slide.is-active .hero-carousel__tagline,
  .hero-carousel__slide.is-active .hero-carousel__title,
  .hero-carousel__slide.is-active .hero-carousel__desc,
  .hero-carousel__slide.is-active .hero-carousel__actions,
  .hero-carousel__slide.is-active .hero-carousel__btn,
  .hero-carousel__slide.is-active .hero-carousel__image,
  .hero-carousel__tagline-dot {
    animation: none !important;
    transition-duration: 0.01ms !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
