/* ==========================================================================
   Homepage banner text — from the "landing page 2" design.
   Desktop: the normal headline. Phones: the headline is typed out live,
   letter by letter, then gently waves; lead/subtext hide and the buttons
   sit at the bottom. Script: assets/landing/js/hero-text.js
   ========================================================================== */
/* Big, Heavy, Impact Headline: Live Wave and Writing Container */
.sky-hero-headline {
  font-family: var(--font-display), 'Arial Black', Impact, sans-serif;
  font-size: clamp(44px, 6.6vw, 84px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #FFFFFF;
  margin-bottom: 12px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 1.15em;
  position: relative;
}

/* ==========================================================================
   LIVE WAVE AND WRITING STYLING & KEYFRAMES
   ========================================================================== */
.wave-writing-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.wave-writing-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* Individual letter in the wave */
.wave-char {
  display: inline-block;
  color: #FFFFFF !important;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
  opacity: 1;
  will-change: transform;
}

.wave-char.is-typing {
  opacity: 0;
  animation: charWaveEntrance 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.25) forwards;
}

.wave-char--space {
  width: 0.26em;
  display: inline-block;
}

.wave-break {
  display: block !important;
  flex-basis: 100% !important;
  width: 100% !important;
  height: 0 !important;
  margin: 4px 0 2px !important;
}

/* Kinetic Pop & Wave as letter is written live */
@keyframes charWaveEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.65);
    filter: blur(3px);
  }

  60% {
    transform: translateY(-8px) scale(1.12);
    filter: blur(0);
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Continuous traveling sinusoidal wave across the letters once written */
.wave-writing-text.has-wave-flow .wave-char {
  opacity: 1 !important;
  animation: continuousLetterWave 2.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  animation-delay: calc(var(--char-i) * 0.085s);
}

@keyframes continuousLetterWave {

  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }

  24% {
    transform: translateY(-9px);
    opacity: 1;
    text-shadow: 0 4px 22px rgba(255, 255, 255, 0.9), 0 2px 14px rgba(0, 0, 0, 0.95);
  }

  48% {
    transform: translateY(0);
    opacity: 1;
  }

  72% {
    transform: translateY(3px);
    opacity: 1;
  }
}

/* Sleek athletic typing cursor / caret */
.wave-typing-caret {
  display: inline-block;
  font-weight: 300;
  color: #FFDD00;
  margin-left: 2px;
  animation: caretBlink 0.65s ease-in-out infinite;
  text-shadow: 0 0 12px rgba(255, 221, 0, 0.85);
  font-size: 0.9em;
  line-height: 1;
  vertical-align: middle;
}

.wave-typing-caret.is-done {
  animation: caretFadeOut 1.1s forwards;
}

@keyframes caretBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes caretFadeOut {
  0% {
    opacity: 1;
  }

  70% {
    opacity: 0.5;
  }

  100% {
    opacity: 0;
  }
}

/* Animated Athletic SVG Wave Underline - only displayed on mobile */
.hero-wave-svg {
  display: none;
  width: clamp(140px, 36vw, 240px);
  height: 14px;
  margin: 6px auto 0;
  overflow: visible;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-wave-svg.is-active {
  opacity: 1;
  transform: translateY(0);
}

.hero-wave-path {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: waveDrawIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards, waveFlow 3.5s linear infinite 1.1s;
}

@keyframes waveDrawIn {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes waveFlow {
  0% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-6px) scaleY(1.15);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes btnShineSweep {
  0%, 65% { left: -100%; }
  100% { left: 200%; }
}

@media (max-width: 768px) {
  .sky-hero {
    height: clamp(560px, 90vh, 760px);
  }

  /* Rich cinematic gradient: provides crystal-clear contrast for animated text without obscuring gymnast above */
  .sky-slide-scrim {
    background: linear-gradient(to top,
        rgba(4, 8, 16, 0.95) 0%,
        rgba(4, 8, 16, 0.82) 26%,
        rgba(4, 8, 16, 0.45) 52%,
        rgba(4, 8, 16, 0.1) 70%,
        transparent 84%) !important;
  }

  .sky-hero-video--mobile,
  .sky-slide-media img {
    object-position: center top !important;
  }

  .sky-slide-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding-top: calc(var(--header-h, 60px) + 38px);
    padding-bottom: 12px;
    padding-inline: 16px;
    z-index: 6;
    box-sizing: border-box;
  }

  .sky-hero-center-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 390px;
    height: 100%;
    margin-inline: auto;
    padding: 0;
  }

  /* Mobile Banner: Remove lead & subtext paragraphs - only need headline & buttons */
  .sky-hero-lead,
  .sky-hero-subtext {
    display: none !important;
  }

  .sky-hero-btn-row {
    margin-top: auto !important;
    margin-bottom: 58px !important;
    z-index: 15;
    position: relative;
    gap: 10px !important;
  }

  .wave-break {
    display: block !important;
    flex-basis: 100% !important;
    width: 100% !important;
    height: 0 !important;
    margin: 4px 0 2px !important;
  }

  .sky-hero-headline {
    font-family: var(--font-body) !important;
    font-size: clamp(19px, 5.2vw, 25px) !important;
    line-height: 1.18 !important;
    letter-spacing: -0.01em !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    color: #FFFFFF !important;
    margin: 0 0 auto 0 !important;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.95), 0 1px 4px rgba(0, 0, 0, 0.95) !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    position: static !important;
    top: auto !important;
  }

  .wave-writing-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    font-family: var(--font-body) !important;
    font-weight: 900 !important;
    letter-spacing: -0.01em !important;
  }

  .wave-line {
    display: block !important;
    white-space: nowrap !important;
    line-height: 1.22 !important;
    font-family: var(--font-body) !important;
    font-weight: 900 !important;
    letter-spacing: -0.01em !important;
    text-align: center !important;
  }

  .wave-line-1 {
    margin-bottom: 3px !important;
  }

  .wave-line-2 {
    margin-bottom: 2px !important;
  }

  .hero-wave-svg {
    display: block !important;
    width: clamp(140px, 38vw, 200px);
    height: 14px;
    margin: 6px auto 16px;
    overflow: visible;
  }

  .sky-hero-btn-row {
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-nike-pill {
    padding: 0 20px;
    font-size: 13px;
    font-weight: 700;
    height: 38px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    letter-spacing: 0.01em;
  }

  .btn-nike-watch {
    background: rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    color: #FFFFFF !important;
  }

  /* Interactive subtle sweep on primary CTA */
  .sky-hero-btn-row .btn-nike-pill:first-child {
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.22);
  }

  .sky-hero-btn-row .btn-nike-pill:first-child::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: skewX(-20deg);
    animation: btnShineSweep 3.5s infinite 1.5s ease-in-out;
  }

  /* Mobile Wave and Writing adjustments */
  .hero-wave-svg {
    width: clamp(130px, 34vw, 180px);
    height: 12px;
    margin: 4px auto 0;
  }

}
