﻿/* Helix Win — scroll experience v1 (reveal + count-up + parallax) */
html.hx-fx {
  --hx-ease: cubic-bezier(.16, 1, .3, 1);
  --hx-ease-soft: cubic-bezier(.22, .61, .36, 1);
}

/* Scroll progress line */
#hx-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 2147483000;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #ff6b9d 0%, #a855f7 52%, #00c97a 100%);
  box-shadow: 0 0 14px rgba(255, 107, 157, .55);
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}
html.hx-fx.hx-scrolled #hx-scroll-progress { opacity: 1; }

/* Generic reveal */
html.hx-fx .hx-reveal {
  opacity: 0;
  translate: 0 40px;
  filter: blur(10px);
  transition:
    opacity 1s var(--hx-ease) var(--hx-delay, 0ms),
    translate 1s var(--hx-ease) var(--hx-delay, 0ms),
    filter 1s var(--hx-ease) var(--hx-delay, 0ms);
  will-change: opacity, translate, filter;
}
html.hx-fx .hx-reveal.hx-in {
  opacity: 1;
  translate: 0 0;
  filter: blur(0);
}

/* Headline reveal: blur + upward motion */
html.hx-fx .hx-title-reveal {
  position: relative;
  opacity: 0;
  translate: 0 46px;
  filter: blur(14px);
  transition:
    opacity 1.15s var(--hx-ease) var(--hx-delay, 0ms),
    translate 1.15s var(--hx-ease) var(--hx-delay, 0ms),
    filter 1.15s var(--hx-ease) var(--hx-delay, 0ms);
  will-change: opacity, translate, filter;
}
html.hx-fx .hx-title-reveal.hx-in {
  opacity: 1;
  translate: 0 0;
  filter: blur(0);
}

/* Gradient underline that grows after the headline */
html.hx-fx .hx-title-reveal::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 72px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6b9d 0%, #a855f7 52%, #00c97a 100%);
  transform: translateX(-50%) scaleX(0);
  transform-origin: 50% 50%;
  transition: transform 1.1s var(--hx-ease) calc(var(--hx-delay, 0ms) + 260ms);
  box-shadow: 0 0 18px rgba(255, 107, 157, .35);
}
html.hx-fx .hx-title-reveal.hx-in::after {
  transform: translateX(-50%) scaleX(1);
}
html.hx-fx .lnd-title::after {
  left: 0;
  width: 96px;
  transform: translateX(0) scaleX(0);
  transform-origin: 0 50%;
}
html.hx-fx .lnd-title.hx-in::after {
  transform: translateX(0) scaleX(1);
}
html.hx-fx .hx-title-reveal:not(.lnd-title) {
  padding-bottom: 12px;
}
html.hx-fx .hx-title-reveal:not(.lnd-title)::after {
  bottom: 0;
}

/* Shimmering letters (does not alter text nodes, so i18n keeps working) */
html.hx-fx .lnd-title em {
  background-image: linear-gradient(
    100deg,
    #ff6b9d 0%,
    #ffb3cf 26%,
    #ffffff 44%,
    #ff9cc4 60%,
    #ff6b9d 100%
  );
  background-size: 230% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: hx-letter-shimmer 5.6s linear infinite;
  filter: drop-shadow(0 0 20px rgba(255, 107, 157, .22));
}
html.hx-fx .hx-title-reveal:not(.lnd-title) {
  background-image: linear-gradient(
    100deg,
    #ffffff 0%,
    #ffffff 40%,
    #ffd9e8 50%,
    #ffffff 60%,
    #ffffff 100%
  );
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: hx-letter-shimmer 7.5s linear infinite;
}
@keyframes hx-letter-shimmer {
  0% { background-position: 120% 50%; }
  100% { background-position: -120% 50%; }
}

/* Numbers while counting */
html.hx-fx .hx-counting {
  font-variant-numeric: tabular-nums;
  scale: 1.04;
  transition: scale .22s ease;
}
html.hx-fx .lnd-stat-val.hx-counting {
  background-image: linear-gradient(
    100deg,
    #ff8cc8 0%,
    #ffd9e8 34%,
    #ffffff 50%,
    #ffd9e8 66%,
    #ff8cc8 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: hx-number-shimmer 1.25s linear infinite;
  filter: drop-shadow(0 0 18px rgba(255, 107, 157, .30));
}
@keyframes hx-number-shimmer {
  0% { background-position: 130% 50%; }
  100% { background-position: -130% 50%; }
}
html.hx-fx .hx-counted {
  animation: hx-count-pop .55s var(--hx-ease);
}
@keyframes hx-count-pop {
  0% { scale: 1; }
  42% { scale: 1.075; }
  100% { scale: 1; }
}

/* The old page-load animations are replaced by scroll-triggered reveals. */
html.hx-fx .hx-reveal.anim-slide,
html.hx-fx .hx-title-reveal.anim-slide {
  animation: none !important;
}

/* Keep floating cards and orbs smooth; reveal uses translate, not transform. */
html.hx-fx .lnd-win-card.hx-reveal {
  translate: 0 26px;
}
html.hx-fx .lnd-win-card.hx-reveal.hx-in {
  translate: 0 0;
}

/* Small glow on the live badge when it enters */
html.hx-fx .lnd-live-badge.hx-in {
  box-shadow: 0 0 0 1px rgba(0, 201, 122, .10), 0 0 28px rgba(0, 201, 122, .12);
}

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
  html.hx-fx .hx-reveal {
    opacity: 0 !important;
    translate: none !important;
    filter: none !important;
    transition: opacity .38s ease !important;
  }
  html.hx-fx .hx-reveal.hx-in {
    opacity: 1 !important;
  }
  html.hx-fx .hx-title-reveal {
    opacity: 0 !important;
    translate: none !important;
    filter: none !important;
    clip-path: none !important;
    transition: opacity .45s ease !important;
  }
  html.hx-fx .hx-title-reveal.hx-in {
    opacity: 1 !important;
  }
  html.hx-fx .hx-title-reveal::after {
    transform: translateX(-50%) scaleX(1) !important;
  }
  html.hx-fx .lnd-title::after {
    transform: translateX(0) scaleX(1) !important;
  }
  html.hx-fx .lnd-title em,
  html.hx-fx .hx-title-reveal:not(.lnd-title) {
    animation: none !important;
    filter: none !important;
  }
  html.hx-fx .hx-counted {
    animation: none !important;
  }
  html.hx-fx .hx-counting {
    scale: none !important;
    text-shadow: none !important;
  }
  #hx-scroll-progress {
    display: none;
  }
}

@media print {
  html.hx-fx .hx-reveal,
  html.hx-fx .hx-title-reveal {
    opacity: 1 !important;
    translate: none !important;
    filter: none !important;
    clip-path: none !important;
  }
  #hx-scroll-progress {
    display: none;
  }
}
