/* ==========================================================================
   TitanAxe homepage motion — scroll entrance / exit (both themes)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .ta-reveal,
  .ta-reveal-child,
  .ta-hero-copy > *,
  .ta-hero-viz {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* Section-level reveal */
.ta-reveal {
  --ta-reveal-y: 56px;
  --ta-reveal-blur: 10px;
  --ta-reveal-dur: 0.85s;
  --ta-reveal-ease: cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translate3d(0, var(--ta-reveal-y), 0) scale(0.985);
  filter: blur(var(--ta-reveal-blur));
  transition:
    opacity var(--ta-reveal-dur) var(--ta-reveal-ease),
    transform var(--ta-reveal-dur) var(--ta-reveal-ease),
    filter var(--ta-reveal-dur) var(--ta-reveal-ease);
  will-change: opacity, transform, filter;
}

.ta-reveal.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

.ta-reveal.is-out {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(0.99);
  filter: blur(6px);
  transition-duration: 0.5s;
  pointer-events: none;
}

.ta-reveal[data-reveal="left"] {
  transform: translate3d(-48px, 28px, 0) scale(0.985);
}
.ta-reveal[data-reveal="left"].is-in {
  transform: translate3d(0, 0, 0) scale(1);
}
.ta-reveal[data-reveal="left"].is-out {
  transform: translate3d(-28px, 20px, 0);
}

.ta-reveal[data-reveal="right"] {
  transform: translate3d(48px, 28px, 0) scale(0.985);
}
.ta-reveal[data-reveal="right"].is-in {
  transform: translate3d(0, 0, 0) scale(1);
}
.ta-reveal[data-reveal="right"].is-out {
  transform: translate3d(28px, 20px, 0);
}

.ta-reveal[data-reveal="scale"] {
  transform: translate3d(0, 24px, 0) scale(0.94);
}
.ta-reveal[data-reveal="scale"].is-in {
  transform: translate3d(0, 0, 0) scale(1);
}
.ta-reveal[data-reveal="scale"].is-out {
  transform: translate3d(0, 20px, 0) scale(0.96);
}

/* Re-enter while scrolling up: start slightly above */
.ta-reveal.is-out[data-enter-from="up"] {
  transform: translate3d(0, -36px, 0) scale(0.99);
}
.ta-reveal[data-reveal="left"].is-out[data-enter-from="up"] {
  transform: translate3d(-28px, -24px, 0);
}
.ta-reveal[data-reveal="right"].is-out[data-enter-from="up"] {
  transform: translate3d(28px, -24px, 0);
}

/* Staggered children */
.ta-reveal-stagger .ta-reveal-child {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  filter: blur(6px);
  transition:
    opacity 0.7s var(--ta-reveal-ease),
    transform 0.7s var(--ta-reveal-ease),
    filter 0.7s var(--ta-reveal-ease);
  transition-delay: calc(var(--ta-i, 0) * 70ms);
}

.ta-reveal.is-in .ta-reveal-child {
  opacity: 1;
  transform: none;
  filter: none;
}

.ta-reveal.is-out .ta-reveal-child {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  filter: blur(4px);
  transition-duration: 0.4s;
  transition-delay: calc(var(--ta-i, 0) * 40ms);
}

/* Hero load-in (always plays once) */
.ta-hero-copy > * {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  animation: taHeroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.ta-hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
.ta-hero-copy > *:nth-child(2) { animation-delay: 0.16s; }
.ta-hero-copy > *:nth-child(3) { animation-delay: 0.28s; }
.ta-hero-copy > *:nth-child(4) { animation-delay: 0.4s; }
.ta-hero-copy > *:nth-child(5) { animation-delay: 0.5s; }

.ta-hero-viz {
  opacity: 0;
  transform: translate3d(40px, 20px, 0) scale(0.96);
  animation: taHeroIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

@keyframes taHeroIn {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Premium signal rail / scan accents (both themes) — fixed with network */
.ta-home-signal {
  position: fixed;
  inset: 0;
  height: 100vh;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ta-home-signal__rail {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(95, 177, 115, 0.35) 18%,
    rgba(95, 177, 115, 0.08) 50%,
    rgba(95, 177, 115, 0.35) 82%,
    transparent 100%
  );
  opacity: 0.55;
}

.ta-home-signal__rail--l { left: clamp(1rem, 6vw, 4.5rem); }
.ta-home-signal__rail--r { right: clamp(1rem, 6vw, 4.5rem); }

.ta-home-signal__pulse {
  position: absolute;
  left: 50%;
  width: 2px;
  height: 72px;
  margin-left: -1px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, #5fb173, transparent);
  box-shadow: 0 0 18px rgba(95, 177, 115, 0.65);
  animation: taSignalFall 7.5s linear infinite;
  opacity: 0.7;
}

.ta-home-signal__pulse--a { left: clamp(1rem, 6vw, 4.5rem); animation-delay: 0s; }
.ta-home-signal__pulse--b { left: auto; right: clamp(1rem, 6vw, 4.5rem); animation-delay: 2.4s; }
.ta-home-signal__pulse--c { left: 50%; animation-delay: 4.2s; opacity: 0.35; height: 48px; }

@keyframes taSignalFall {
  0% { top: -10%; opacity: 0; }
  12% { opacity: 0.85; }
  88% { opacity: 0.85; }
  100% { top: 110%; opacity: 0; }
}

.ta-home-signal__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(95, 177, 115, 0.045),
    transparent
  );
  animation: taScanSweep 11s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes taScanSweep {
  0%, 100% { top: -10%; opacity: 0; }
  15% { opacity: 1; }
  50% { top: 70%; opacity: 0.7; }
  85% { opacity: 0; }
  100% { top: 110%; }
}

/* Section frame accents */
.ta-home-after > section.ta-reveal {
  position: relative;
}

.ta-home-after > section.ta-reveal > *:not(.ta-section-frame):not(.ta-features-glow):not(.ta-eco-grid-bg):not(.ta-products-mesh):not(.ta-moves-glow):not(.ta-moves-dots):not(.ta-industries-mesh):not(.ta-cta-glow) {
  position: relative;
  z-index: 1;
}

.ta-section-frame {
  position: absolute;
  inset: 1.25rem clamp(0.75rem, 3vw, 2rem);
  border: 1px solid rgba(95, 177, 115, 0.08);
  border-radius: 18px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.ta-section-frame::before,
.ta-section-frame::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #5fb173;
  border-style: solid;
  opacity: 0.7;
}

.ta-section-frame::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
  border-radius: 4px 0 0 0;
}

.ta-section-frame::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 4px 0;
}

.ta-reveal.is-in > .ta-section-frame {
  opacity: 1;
  transform: scale(1);
}

/* Feature icons pulse when section is in */
.ta-reveal.is-in .ta-feature-icon-ring {
  animation: taRingPulse 2.8s ease-in-out infinite;
}

@keyframes taRingPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(95, 177, 115, 0.25), inset 0 0 10px rgba(95, 177, 115, 0.06); }
  50% { box-shadow: 0 0 22px rgba(95, 177, 115, 0.45), inset 0 0 14px rgba(95, 177, 115, 0.12); }
}

/* Hover lift for cards when section live */
.ta-reveal.is-in .ta-prod-card,
.ta-reveal.is-in .ta-eco-panel,
.ta-reveal.is-in .ta-tt-card,
.ta-reveal.is-in .ta-moves-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.ta-reveal.is-in .ta-prod-card:hover,
.ta-reveal.is-in .ta-eco-panel:hover,
.ta-reveal.is-in .ta-tt-card:hover,
.ta-reveal.is-in .ta-moves-card:hover {
  transform: translateY(-6px);
}
