/* ==========================================================================
   SMARTGen — STEM Header Slider Design System
   Matches Clean Organic Wave Layout & Style from Reference
   ========================================================================== */

@font-face {
  font-family: 'Priestacy';
  src: url('/fonts/Priestacy.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --slider-teal: #0097a7;
  --slider-teal-hover: #00838f;
  --slider-teal-light: rgba(0, 151, 167, 0.12);
  --slider-teal-glow: rgba(0, 151, 167, 0.35);
  --slider-navy: #0f172a;
  --slider-charcoal: #1e293b;
  --slider-slate: #475569;
  --slider-slate-light: #64748b;
  --slider-bg: #FFFFFF;
}

/* Slider Section Container */
.stem-slider-section {
  position: relative;
  width: 100%;
  background: var(--slider-bg);
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
}

.stem-slider-viewport {
  position: relative;
  width: 100%;
  min-height: 560px;
  overflow: hidden;
}

/* Slide Item */
.stem-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s step-end;
  display: flex;
  align-items: stretch;
}

.stem-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  position: relative;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

/* Media Background on Right Side */
.stem-slide-media-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 58%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.stem-slide-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  transform: scale(1.02);
  transition: transform 7s ease-out;
}

.stem-slide.active .stem-slide-photo {
  transform: scale(1.0);
}

/* Organic Wave Divider Mask */
.stem-slide-wave-divider {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.stem-slide-wave-divider path {
  fill: var(--slider-bg);
}

/* Floating Stylized Lettering Overlay */
.stem-floating-script {
  position: absolute;
  top: 14%;
  left: calc(52% - 150px);
  z-index: 5;
  transform: rotate(-8deg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.4));
  animation: float-subtle 7s ease-in-out infinite alternate;
}

@keyframes float-subtle {
  0% {
    transform: rotate(-8deg) translateY(0px);
  }

  100% {
    transform: rotate(-7deg) translateY(-5px);
  }
}

.stem-floating-script span {
  font-family: 'Priestacy', 'Brush Script MT', cursive, sans-serif;
  font-size: 38px;
  font-weight: 500;
  color: #0b253a;
  -webkit-text-stroke: 1.2px #0b253a;
  letter-spacing: 0.02em;
  line-height: 1.22;
  white-space: nowrap;
}

.stem-floating-script span:nth-child(1) {
  margin-left: 0;
}

.stem-floating-script span:nth-child(2) {
  margin-left: 10px;
}

.stem-floating-script span:nth-child(3) {
  margin-left: 18px;
}

.stem-floating-script span:nth-child(4) {
  margin-left: 28px;
}

/* Slide Content on Left Side */
.stem-slide-content-layer {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 32px 42px 32px;
  display: flex;
  align-items: center;
}

.stem-slide-content {
  max-width: 600px;
}

/* Eyebrow */
.stem-slide-eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--slider-teal);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}

/* Title */
.stem-slide-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 52px;
  font-weight: 850;
  line-height: 1.12;
  color: var(--slider-navy);
  letter-spacing: -0.035em;
  margin: 0 0 16px 0;
}

.stem-slide-teal {
  color: var(--slider-teal);
}

/* Subtitle */
.stem-slide-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: var(--slider-slate);
  margin: 0 0 26px 0;
  max-width: 500px;
}

/* CTA Buttons */
.stem-slide-cta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.btn-slider-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF !important;
  background: var(--slider-teal);
  border: none;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 4px 14px var(--slider-teal-glow);
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-slider-primary:hover {
  background: var(--slider-teal-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 151, 167, 0.45);
}

.btn-slider-primary svg {
  transition: transform 0.2s ease;
}

.btn-slider-primary:hover svg {
  transform: translateX(3px);
}

.btn-slider-video {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--slider-navy) !important;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-slider-video:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.09);
}

.btn-slider-play-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slider-teal);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-slider-play-icon svg {
  margin-left: 1.5px;
}

/* Feature Badges / Trust Row - Single Row Layout */
.stem-slider-features {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid #EDF2F7;
  flex-wrap: nowrap;
}

.stem-feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slider-charcoal);
  white-space: nowrap;
}

.stem-feature-icon {
  width: 16px;
  height: 16px;
  color: #1e293b;
  flex-shrink: 0;
}

/* Slider Controls: Dots */
.stem-slider-controls {
  position: absolute;
  bottom: 18px;
  left: 0;
  width: 100%;
  z-index: 5;
  pointer-events: none;
}

.stem-slider-controls-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.stem-slider-dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background: #CBD5E1;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.stem-slider-dot:hover {
  background: #94A3B8;
}

.stem-slider-dot.active {
  width: 32px;
  background: var(--slider-teal);
  box-shadow: 0 0 10px var(--slider-teal-glow);
}

/* Prev / Next Arrows */
.stem-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slider-charcoal);
  cursor: pointer;
  z-index: 6;
  transition: all 0.2s ease;
}

.stem-slider-arrow:hover {
  background: var(--slider-teal);
  color: #FFFFFF;
  border-color: var(--slider-teal);
  box-shadow: 0 6px 18px var(--slider-teal-glow);
  transform: translateY(-50%) scale(1.08);
}

.stem-slider-arrow.prev {
  left: 20px;
}

.stem-slider-arrow.next {
  right: 20px;
}

/* Video Modal */
.stem-video-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.stem-video-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.stem-video-modal-box {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: #0f172a;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stem-video-modal-backdrop.open .stem-video-modal-box {
  transform: scale(1);
}

.stem-video-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease;
}

.stem-video-modal-close:hover {
  background: rgba(239, 68, 68, 0.85);
}

.stem-video-player-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  position: relative;
}

.stem-video-player-container iframe,
.stem-video-player-container video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1200px) {
  .stem-slide-title {
    font-size: 44px;
  }

  .stem-floating-script span {
    font-size: 28px;
    font-weight: bolder;
  }

  .stem-slider-features {
    gap: 14px;
  }
}

@media (max-width: 992px) {
  .stem-slider-viewport {
    min-height: auto;
  }

  /* CRITICAL: Inactive slides must not occupy flow space on mobile */
  .stem-slide {
    display: none !important;
    position: relative;
    flex-direction: column-reverse;
    height: auto;
    width: 100%;
    opacity: 0;
    visibility: hidden;
  }

  .stem-slide.active {
    display: flex !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .stem-slide-media-layer {
    position: relative;
    width: 100%;
    height: clamp(240px, 45vw, 360px);
  }

  .stem-slide-wave-divider {
    display: none;
  }

  .stem-slide-content-layer {
    padding: clamp(24px, 4vw, 36px) clamp(16px, 3.5vw, 24px) 36px;
  }

  .stem-slide-content {
    max-width: 100%;
  }

  .stem-slide-title {
    font-size: clamp(28px, 5.5vw, 38px);
    line-height: 1.15;
  }

  .stem-floating-script {
    display: none;
  }

  .stem-slider-arrow {
    display: none;
  }

  .hero-network-container {
    width: 100%;
    top: 0;
    height: 100%;
    max-height: 480px;
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .stem-slide-title {
    font-size: clamp(25px, 6.5vw, 30px);
  }

  .stem-slide-subtitle {
    font-size: 14px;
    line-height: 1.5;
  }

  .stem-slide-cta-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .btn-slider-primary,
  .btn-slider-video {
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
  }

  .stem-slider-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stem-feature-badge {
    font-size: 12px;
  }
}

@media (max-width: 440px) {
  .stem-slider-features {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stem-feature-badge {
    font-size: 11.5px;
    padding: 4px 0;
  }

  .stem-slider-controls {
    bottom: 12px;
  }
}

/* ==========================================================================
   Hero Network Connections Animation Canvas (Shutterstock Inspired)
   Positioned strictly in the left white portion of the header slider
   ========================================================================== */
.hero-network-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 53%;
  height: 100%;
  z-index: 3;
  opacity: 0.6;
  pointer-events: none;
  overflow: hidden;
}

.hero-network-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
}