/* ==========================================================================
   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: var(--floating-script-top, 14%);
  left: var(--floating-script-left, 56%);
  right: var(--floating-script-right, auto);
  bottom: var(--floating-script-bottom, auto);
  z-index: 5;
  transform: rotate(var(--floating-script-rotate, -8deg));
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.45));
  animation: float-vertical var(--floating-script-speed, 7s) ease-in-out infinite alternate;
  will-change: transform;
}

/* Movement Direction Animations */
.stem-floating-script.anim-vertical {
  animation: float-vertical var(--floating-script-speed, 7s) ease-in-out infinite alternate !important;
}

.stem-floating-script.anim-horizontal {
  animation: float-horizontal var(--floating-script-speed, 7s) ease-in-out infinite alternate !important;
}

.stem-floating-script.anim-diagonal {
  animation: float-diagonal var(--floating-script-speed, 7s) ease-in-out infinite alternate !important;
}

.stem-floating-script.anim-pulse {
  animation: float-pulse var(--floating-script-speed, 7s) ease-in-out infinite alternate !important;
}

.stem-floating-script.anim-wobble {
  animation: float-wobble var(--floating-script-speed, 7s) ease-in-out infinite alternate !important;
}

.stem-floating-script.anim-none {
  animation: none !important;
}

@keyframes float-vertical {
  0% {
    transform: rotate(var(--floating-script-rotate, -8deg)) translateY(0px);
  }
  100% {
    transform: rotate(var(--floating-script-rotate, -8deg)) translateY(-18px);
  }
}

@keyframes float-horizontal {
  0% {
    transform: rotate(var(--floating-script-rotate, -8deg)) translateX(0px);
  }
  100% {
    transform: rotate(var(--floating-script-rotate, -8deg)) translateX(20px);
  }
}

@keyframes float-diagonal {
  0% {
    transform: rotate(var(--floating-script-rotate, -8deg)) translate(0px, 0px);
  }
  100% {
    transform: rotate(var(--floating-script-rotate, -8deg)) translate(16px, -16px);
  }
}

@keyframes float-pulse {
  0% {
    transform: rotate(var(--floating-script-rotate, -8deg)) scale(1);
  }
  100% {
    transform: rotate(var(--floating-script-rotate, -8deg)) scale(1.08);
  }
}

@keyframes float-wobble {
  0% {
    transform: rotate(calc(var(--floating-script-rotate, -8deg) - 2deg)) translateY(0);
  }
  100% {
    transform: rotate(calc(var(--floating-script-rotate, -8deg) + 3deg)) translateY(-12px);
  }
}

/* Placement Preset Classes */
.stem-floating-script.placement-safe-right {
  top: 14% !important;
  left: 56% !important;
  right: auto !important;
  bottom: auto !important;
}

.stem-floating-script.placement-center-right {
  top: 24% !important;
  left: 58% !important;
  right: auto !important;
  bottom: auto !important;
}

.stem-floating-script.placement-top-right {
  top: 8% !important;
  right: 8% !important;
  left: auto !important;
  bottom: auto !important;
}

.stem-floating-script.placement-far-right {
  top: 16% !important;
  right: 5% !important;
  left: auto !important;
  bottom: auto !important;
}

.stem-floating-script.placement-bottom-right {
  top: auto !important;
  bottom: 16% !important;
  right: 8% !important;
  left: auto !important;
}

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

.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-family: var(--hero-eyebrow-font, inherit);
  font-size: var(--hero-eyebrow-size, 13px);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--hero-eyebrow-color, var(--slider-teal));
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}

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

.stem-slide-teal {
  color: var(--hero-title-highlight-color, var(--slider-teal));
}

/* Subtitle */
.stem-slide-subtitle {
  font-family: var(--hero-subtitle-font, inherit);
  font-size: var(--hero-subtitle-size, 16px);
  line-height: 1.6;
  color: var(--hero-subtitle-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: var(--hero-btn-size, 15px);
  font-weight: 700;
  color: var(--hero-btn1-color, #FFFFFF) !important;
  background: var(--hero-btn1-bg, 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: var(--hero-btn-size, 14.5px);
  font-weight: 700;
  color: var(--hero-btn2-color, var(--slider-navy)) !important;
  background: var(--hero-btn2-bg, #FFFFFF);
  border: 1.5px solid var(--hero-btn2-border, #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(--hero-btn1-bg, 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: 12px;
  border-top: none;
  flex-wrap: nowrap;
}

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

.stem-feature-icon {
  width: 16px;
  height: 16px;
  color: var(--hero-badge-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 !important;
  }

  .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;
}