/* ============================================
   TRAKITO - Scroll Animations CSS
   ============================================ */

/* Fade animations */
.anim-fade-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-fade-down {
  opacity: 0;
  transform: translateY(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-fade-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-fade-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-rotate {
  opacity: 0;
  transform: rotate(-5deg) scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active states */
.anim-fade-up.in-view,
.anim-fade-down.in-view,
.anim-fade-left.in-view,
.anim-fade-right.in-view,
.anim-scale.in-view,
.anim-rotate.in-view {
  opacity: 1;
  transform: translate(0) scale(1) rotate(0);
}

/* Stagger delays */
.anim-delay-1 { transition-delay: 0.1s; }
.anim-delay-2 { transition-delay: 0.2s; }
.anim-delay-3 { transition-delay: 0.3s; }
.anim-delay-4 { transition-delay: 0.4s; }
.anim-delay-5 { transition-delay: 0.5s; }
.anim-delay-6 { transition-delay: 0.6s; }
.anim-delay-7 { transition-delay: 0.7s; }
.anim-delay-8 { transition-delay: 0.8s; }

/* Parallax container */
.parallax-container {
  overflow: hidden;
  position: relative;
}

.parallax-bg {
  position: absolute;
  inset: -20%;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

/* Floating particles */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.3;
  animation: particleFloat 15s infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 20s; }
.particle:nth-child(2) { left: 30%; top: 60%; animation-delay: 3s; animation-duration: 18s; }
.particle:nth-child(3) { left: 50%; top: 30%; animation-delay: 6s; animation-duration: 22s; }
.particle:nth-child(4) { left: 70%; top: 70%; animation-delay: 2s; animation-duration: 16s; }
.particle:nth-child(5) { left: 90%; top: 40%; animation-delay: 5s; animation-duration: 24s; }
.particle:nth-child(6) { left: 20%; top: 80%; animation-delay: 1s; animation-duration: 19s; }
.particle:nth-child(7) { left: 60%; top: 50%; animation-delay: 4s; animation-duration: 21s; }
.particle:nth-child(8) { left: 80%; top: 10%; animation-delay: 7s; animation-duration: 17s; }

@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.4;
  }
  50% {
    transform: translateY(-100px) translateX(30px);
    opacity: 0.2;
  }
  90% {
    opacity: 0.4;
  }
}

/* Glow effects */
.glow-line {
  position: absolute;
  width: 300px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.3;
  animation: glowLineMove 6s ease-in-out infinite;
}

@keyframes glowLineMove {
  0%, 100% { transform: translateX(-100%); opacity: 0; }
  50% { transform: translateX(100%); opacity: 0.3; }
}

/* Scroll progress indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-blue);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* Smooth section transitions */
.section-transition {
  position: relative;
}

.section-transition::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

/* Counter animation */
.counter {
  display: inline-block;
}

/* Image reveal */
.image-reveal {
  position: relative;
  overflow: hidden;
}

.image-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-dark);
  transform-origin: right;
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-reveal.in-view::after {
  transform: scaleX(0);
}

/* Text reveal letter by letter */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.in-view span {
  transform: translateY(0);
}

/* Magnetic hover effect */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tilt card effect */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--primary);
  animation: blink 1s steps(1) infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Orbit animation for features */
.orbit-container {
  position: relative;
  width: 400px;
  height: 400px;
}

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  animation: orbitSpin 30s linear infinite;
}

@keyframes orbitSpin {
  100% { transform: rotate(360deg); }
}

/* Hover glow */
.hover-glow {
  position: relative;
}

.hover-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-blue);
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  filter: blur(16px);
  transition: opacity 0.3s ease;
}

.hover-glow:hover::before {
  opacity: 0.4;
}

/* Number counter */
.stat-number {
  font-size: 48px;
  font-weight: 900;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Slide-in line decoration */
.line-decoration {
  width: 60px;
  height: 3px;
  background: var(--gradient-blue);
  border-radius: 3px;
  margin-bottom: 20px;
}

.line-decoration.center {
  margin-left: auto;
  margin-right: auto;
}
