/* Zenix-style motion — scroll reveals, hero entrance, floating orbs */

:root {
  --anim-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --anim-duration: 0.85s;
}

/* ---- Hero background effects ---- */
.hero__bg {
  overflow: hidden;
}

.hero__grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(68, 87, 195, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 87, 195, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  animation: gridDrift 24s linear infinite;
}

@keyframes gridDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(48px, 48px); }
}

.hero__orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}

.orb--1 {
  width: 420px;
  height: 420px;
  top: -8%;
  right: -6%;
  background: radial-gradient(circle, rgba(68, 87, 195, 0.45), transparent 70%);
  animation: orbFloat1 14s ease-in-out infinite;
}

.orb--2 {
  width: 320px;
  height: 320px;
  bottom: 5%;
  left: -8%;
  background: radial-gradient(circle, rgba(35, 189, 184, 0.4), transparent 70%);
  animation: orbFloat2 18s ease-in-out infinite;
}

.orb--3 {
  width: 200px;
  height: 200px;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle, rgba(0, 63, 192, 0.25), transparent 70%);
  animation: orbFloat3 12s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.08); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(20px, -25px); }
  66% { transform: translate(-25px, 15px); }
}

/* ---- Hero entrance ---- */
.anim-hero {
  opacity: 0;
  transform: translateY(36px);
}

.hero.is-loaded .anim-hero {
  animation: heroEnter var(--anim-duration) var(--anim-ease) forwards;
}

.hero.is-loaded .eyebrow.anim-hero { animation-delay: 0.05s; }
.hero.is-loaded h1.anim-hero { animation-delay: 0.18s; }
.hero.is-loaded .lead.anim-hero { animation-delay: 0.32s; }
.hero.is-loaded .hero__actions.anim-hero { animation-delay: 0.46s; }
.hero.is-loaded .anim-hero--right { animation-delay: 0.58s; }

@keyframes heroEnter {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero.is-loaded .anim-hero--right {
  animation-name: heroEnterRight;
}

@keyframes heroEnterRight {
  from {
    opacity: 0;
    transform: translateX(48px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Text reveal clip */
.text-reveal {
  display: inline-block;
  overflow: hidden;
}

.hero.is-loaded .text-reveal {
  animation: textReveal 1s var(--anim-ease) 0.2s both;
}

.hero.is-loaded .text-reveal--accent {
  animation-delay: 0.35s;
  background: var(--gradient-teal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating hero card */
.float-card {
  animation: cardFloat 5s ease-in-out infinite;
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero.is-loaded .float-card {
  animation: cardFloat 5s ease-in-out 1.2s infinite;
}

/* ---- Scroll progress bar ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  background: rgba(0, 63, 192, 0.08);
}

.scroll-progress__bar {
  height: 100%;
  width: 100%;
  background: var(--gradient-teal);
  transform: scaleX(0);
  transform-origin: left center;
}

/* GSAP scroll targets — initial state set by GSAP */
.scroll-item,
.scroll-reveal {
  will-change: transform, opacity, filter;
}

/* ---- Scroll animations (legacy fallback) ---- */
[data-animate] {
  opacity: 0;
  transition:
    opacity var(--anim-duration) var(--anim-ease),
    transform var(--anim-duration) var(--anim-ease);
  will-change: opacity, transform;
}

[data-animate].is-visible {
  opacity: 1;
  transform: none !important;
}

[data-animate="fade-up"] { transform: translateY(50px); }
[data-animate="fade-down"] { transform: translateY(-40px); }
[data-animate="fade-left"] { transform: translateX(-50px); }
[data-animate="fade-right"] { transform: translateX(50px); }
[data-animate="zoom-in"] { transform: scale(0.88); }
[data-animate="zoom-out"] { transform: scale(1.08); }

/* ---- Button shine (Zenix-style CTA) ---- */
.btn--shine {
  position: relative;
  overflow: hidden;
}

.btn--shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.btn--shine:hover::after {
  left: 140%;
}

/* ---- Card hover glow ---- */
.card {
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-teal);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card:hover::before { opacity: 1; }

.card__icon {
  transition: transform 0.4s var(--anim-ease), background 0.4s ease, color 0.4s ease;
}

.card:hover .card__icon {
  transform: scale(1.1) rotate(-4deg);
}

/* Step pulse on number */
.step__num {
  transition: color 0.3s ease, transform 0.3s ease;
}

.step:hover .step__num {
  transform: scale(1.15);
  filter: brightness(1.2);
}

/* Header entrance */
.header {
  transform: translateY(-100%);
  animation: headerSlide 0.7s var(--anim-ease) 0.1s forwards;
}

@keyframes headerSlide {
  to { transform: translateY(0); }
}

/* CTA subtle pulse */
.cta .btn--white {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta.is-inview .btn--white {
  animation: ctaPulse 2.5s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}

/* Parallax layer */
.hero__orbs.parallax-active .orb {
  transition: transform 0.15s ease-out;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none !important;
  }

  .anim-hero {
    opacity: 1;
    transform: none;
  }

  .header { transform: none; }
}
