/* ============================================
   LUSSA - Animations Stylesheet
   Keyframes, transitions, and scroll animations
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Pulse Dot Animation */
@keyframes pulse-dot {

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

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
}

/* Scroll Bounce */
@keyframes scroll-bounce {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(20px);
  }
}

/* Blink */
@keyframes blink {

  0%,
  50%,
  100% {
    opacity: 1;
  }

  25%,
  75% {
    opacity: 0;
  }
}

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Marquee */
@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Spin */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Float */
@keyframes float {

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

  50% {
    transform: translateY(-10px);
  }
}

/* Glow Pulse */
@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 20px var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 40px var(--accent-glow), 0 0 60px var(--accent-glow);
  }
}

/* Border Glow */
@keyframes borderGlow {

  0%,
  100% {
    border-color: var(--glass-border);
  }

  50% {
    border-color: var(--accent-primary);
  }
}

/* Scanline */
@keyframes scanline {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(100%);
  }
}

/* Loader Progress */
@keyframes loaderProgress {
  0% {
    width: 0%;
  }

  100% {
    width: 100%;
  }
}

/* Loader Fade Out */
@keyframes loaderFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ============================================
   GLITCH EFFECT
   ============================================ */
.glitch-text {
  position: relative;
  display: inline-block;
  color: var(--text-primary);
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.glitch-text::before {
  color: #ffd000;
  animation: glitch-1 3s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translateX(-2px);
}

.glitch-text::after {
  color: #b8a900;
  animation: glitch-2 2s infinite linear alternate-reverse;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translateX(2px);
}

@keyframes glitch-1 {

  0%,
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    transform: translateX(-2px);
  }

  20% {
    clip-path: polygon(0 15%, 100% 15%, 100% 20%, 0 20%);
    transform: translateX(3px);
  }

  40% {
    clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
    transform: translateX(-3px);
  }

  60% {
    clip-path: polygon(0 70%, 100% 70%, 100% 85%, 0 85%);
    transform: translateX(2px);
  }

  80% {
    clip-path: polygon(0 5%, 100% 5%, 100% 15%, 0 15%);
    transform: translateX(-1px);
  }
}

@keyframes glitch-2 {

  0%,
  100% {
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    transform: translateX(2px);
  }

  25% {
    clip-path: polygon(0 80%, 100% 80%, 100% 90%, 0 90%);
    transform: translateX(-2px);
  }

  50% {
    clip-path: polygon(0 50%, 100% 50%, 100% 55%, 0 55%);
    transform: translateX(4px);
  }

  75% {
    clip-path: polygon(0 20%, 100% 20%, 100% 35%, 0 35%);
    transform: translateX(-3px);
  }
}

/* Glitch on hover - more intense */
.glitch-text:hover::before {
  animation: glitch-intense-1 0.3s infinite linear;
}

.glitch-text:hover::after {
  animation: glitch-intense-2 0.3s infinite linear;
}

@keyframes glitch-intense-1 {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: translateX(-5px);
  }

  20% {
    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
    transform: translateX(5px);
  }

  40% {
    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
    transform: translateX(-3px);
  }

  60% {
    clip-path: polygon(0 10%, 100% 10%, 100% 30%, 0 30%);
    transform: translateX(4px);
  }

  80% {
    clip-path: polygon(0 70%, 100% 70%, 100% 90%, 0 90%);
    transform: translateX(-4px);
  }

  100% {
    clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
    transform: translateX(3px);
  }
}

@keyframes glitch-intense-2 {
  0% {
    clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
    transform: translateX(5px);
  }

  25% {
    clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%);
    transform: translateX(-4px);
  }

  50% {
    clip-path: polygon(0 40%, 100% 40%, 100% 70%, 0 70%);
    transform: translateX(6px);
  }

  75% {
    clip-path: polygon(0 80%, 100% 80%, 100% 100%, 0 100%);
    transform: translateX(-5px);
  }

  100% {
    clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%);
    transform: translateX(4px);
  }
}

/* ============================================
   LOADER ANIMATIONS
   ============================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.loader-logo {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.loader-text {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--text-primary);
  animation: loaderPulse 2s ease-in-out infinite;
}

@keyframes loaderPulse {

  0%,
  100% {
    opacity: 1;
    text-shadow: 0 0 20px var(--accent-glow);
  }

  50% {
    opacity: 0.7;
    text-shadow: 0 0 40px var(--accent-glow), 0 0 60px var(--accent-primary);
  }
}

.loader-bar {
  width: 200px;
  height: 2px;
  margin: 0 auto 1rem;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.loader-progress {
  height: 100%;
  background: var(--gradient-accent);
  animation: loaderProgress 2s ease-out forwards;
}

.loader-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent-primary);
  animation: blink 1s ease-in-out infinite;
}

/* ============================================
   CURSOR ANIMATIONS
   ============================================ */
.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  mix-blend-mode: difference;
}

.cursor-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s, width 0.3s, height 0.3s;
}

.cursor-ring {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  transition: transform 0.15s, width 0.3s, height 0.3s, opacity 0.3s;
}

/* Cursor hover states */
.cursor-follower.hovering .cursor-dot {
  transform: translate(-50%, -50%) scale(1.5);
}

.cursor-follower.hovering .cursor-ring {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 0.8;
}

.cursor-follower.clicking .cursor-dot {
  transform: translate(-50%, -50%) scale(0.5);
}

.cursor-follower.clicking .cursor-ring {
  transform: translate(-50%, -50%) scale(0.8);
}

/* Hide custom cursor on touch devices */
@media (hover: none) {
  .cursor-follower {
    display: none;
  }
}

/* ============================================
   REVEAL ANIMATIONS (GSAP TARGETS)
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(50px);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s var(--ease-out-expo);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.8s var(--ease-out-expo);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.8s var(--ease-out-expo);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
  transition: all 0.8s var(--ease-out-expo);
}

/* Stagger children */
.stagger-children>* {
  opacity: 0;
  transform: translateY(30px);
}

.stagger-children.revealed>* {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s var(--ease-out-expo);
}

/* ============================================
   SCROLL-DRIVEN ANIMATIONS (CSS Native)
   ============================================ */
@supports (animation-timeline: view()) {
  .scroll-reveal {
    animation: scrollReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }

  @keyframes scrollReveal {
    from {
      opacity: 0;
      transform: translateY(50px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .scroll-scale {
    animation: scrollScale linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 50%;
  }

  @keyframes scrollScale {
    from {
      opacity: 0;
      transform: scale(0.8);
    }

    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .scroll-fade {
    animation: scrollFade linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }

  @keyframes scrollFade {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  /* Parallax effect */
  .scroll-parallax {
    animation: scrollParallax linear both;
    animation-timeline: scroll();
    animation-range: 0% 100%;
  }

  @keyframes scrollParallax {
    from {
      transform: translateY(-20%);
    }

    to {
      transform: translateY(20%);
    }
  }
}

/* ============================================
   HOVER ANIMATIONS
   ============================================ */

/* Lift on hover */
.hover-lift {
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Glow on hover */
.hover-glow {
  transition: box-shadow 0.3s;
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Scale on hover */
.hover-scale {
  transition: transform 0.3s var(--ease-out-expo);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Border glow on hover */
.hover-border-glow {
  transition: border-color 0.3s, box-shadow 0.3s;
}

.hover-border-glow:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Text underline animation */
.hover-underline {
  position: relative;
}

.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.3s var(--ease-out-expo);
}

.hover-underline:hover::after {
  width: 100%;
}

/* Icon rotate on hover */
.hover-icon-rotate svg,
.hover-icon-rotate i {
  transition: transform 0.3s var(--ease-out-expo);
}

.hover-icon-rotate:hover svg,
.hover-icon-rotate:hover i {
  transform: rotate(15deg);
}

/* Arrow slide on hover */
.hover-arrow-slide svg,
.hover-arrow-slide i {
  transition: transform 0.3s var(--ease-out-expo);
}

.hover-arrow-slide:hover svg,
.hover-arrow-slide:hover i {
  transform: translateX(4px);
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

/* Button ripple effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--accent-primary) 10%, transparent 10%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 1s;
}

.btn-ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* Button shine effect */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent);
  transition: left 0.5s;
}

.btn-shine:hover::before {
  left: 100%;
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

/* Card 3D tilt */
.card-tilt {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card-tilt:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
}

/* Card border animation */
.card-border-animate {
  position: relative;
}

.card-border-animate::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
    linear-gradient(135deg, var(--accent-primary), transparent, var(--accent-primary)) border-box;
  opacity: 0;
  transition: opacity 0.3s;
}

.card-border-animate:hover::before {
  opacity: 1;
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

/* Typewriter effect (JS controlled) */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--accent-primary);
  white-space: nowrap;
  animation: typewriterBlink 0.75s step-end infinite;
}

@keyframes typewriterBlink {

  from,
  to {
    border-color: transparent;
  }

  50% {
    border-color: var(--accent-primary);
  }
}

/* Text gradient animation */
.text-gradient-animate {
  background: linear-gradient(90deg,
      var(--accent-primary),
      var(--text-primary),
      var(--accent-primary));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textGradient 3s linear infinite;
}

@keyframes textGradient {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg,
      var(--bg-tertiary) 25%,
      var(--bg-elevated) 50%,
      var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Dots loading */
.dots-loading {
  display: flex;
  gap: 4px;
}

.dots-loading span {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: dotBounce 1.4s ease-in-out infinite;
}

.dots-loading span:nth-child(1) {
  animation-delay: 0s;
}

.dots-loading span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots-loading span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.counter-animate {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   CLIP PATH REVEAL
   ============================================ */
.clip-reveal {
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  transition: clip-path 0.8s var(--ease-out-expo);
}

.clip-reveal.revealed {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.clip-reveal-vertical {
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transition: clip-path 0.8s var(--ease-out-expo);
}

.clip-reveal-vertical.revealed {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* ============================================
   BACKGROUND ANIMATIONS
   ============================================ */

/* Gradient shift */
.bg-gradient-shift {
  background: linear-gradient(45deg,
      var(--bg-primary),
      var(--bg-secondary),
      var(--bg-tertiary),
      var(--bg-secondary));
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Noise overlay animation */
.noise-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  animation: noiseShift 0.5s steps(10) infinite;
}

@keyframes noiseShift {
  0% {
    transform: translate(0, 0);
  }

  10% {
    transform: translate(-5%, -5%);
  }

  20% {
    transform: translate(-10%, 5%);
  }

  30% {
    transform: translate(5%, -10%);
  }

  40% {
    transform: translate(-5%, 15%);
  }

  50% {
    transform: translate(-10%, 5%);
  }

  60% {
    transform: translate(15%, 0);
  }

  70% {
    transform: translate(0, 10%);
  }

  80% {
    transform: translate(-15%, 0);
  }

  90% {
    transform: translate(10%, 5%);
  }

  100% {
    transform: translate(5%, 0);
  }
}

/* ============================================
   PARTNER SCROLL ANIMATION
   ============================================ */
@keyframes partnerScroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* ============================================
   LOADER LOGO IMAGE
   ============================================ */
.loader-img {
  width: 150px;
  /* Adjust size as needed */
  height: auto;
  object-fit: contain;
  animation: loaderPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}