/* =============================================
   MAINLER.RU — Animation Classes & Keyframes
   Used with GSAP ScrollTrigger + CSS fallbacks
   ============================================= */

/* --- Base animation states (before GSAP triggers) --- */
.reveal {
  opacity: 0;
  will-change: transform, opacity;
}

.reveal-up {
  opacity: 0;
  transform: translateY(60px);
  will-change: transform, opacity;
}

.reveal-down {
  opacity: 0;
  transform: translateY(-60px);
  will-change: transform, opacity;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-80px);
  will-change: transform, opacity;
}

.reveal-right {
  opacity: 0;
  transform: translateX(80px);
  will-change: transform, opacity;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  will-change: transform, opacity;
}

.reveal-scale-up {
  opacity: 0;
  transform: scale(0) translateY(40px);
  will-change: transform, opacity;
}

.reveal-rotate-left {
  opacity: 0;
  transform: translateX(-80px) rotate(-5deg);
  will-change: transform, opacity;
}

.reveal-rotate-right {
  opacity: 0;
  transform: translateX(80px) rotate(5deg);
  will-change: transform, opacity;
}

/* --- Word/Char split wrappers --- */
.split-word {
  display: inline-block;
  overflow: hidden;
}

.split-word__inner {
  display: inline-block;
  will-change: transform;
}

.split-line {
  overflow: hidden;
}

/* --- Clip-path reveals --- */
.clip-reveal {
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

.clip-reveal-top {
  clip-path: inset(0 0 100% 0);
  will-change: clip-path;
}

.clip-reveal-sides {
  clip-path: inset(0 50% 0 50%);
  will-change: clip-path;
}

/* --- Parallax attribute markers --- */
[data-parallax] {
  will-change: transform;
}

/* --- Tilt card (3D) --- */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.tilt-card__inner {
  transition: transform 0.4s var(--ease-out);
  transform-style: preserve-3d;
}

.tilt-card__float {
  transform: translateZ(30px);
}

/* --- Horizontal scroll section --- */
/* overflow handled by GSAP pin — do not set overflow:hidden here */

.hscroll-track {
  display: flex;
  gap: 24px;
  width: max-content;
}

.hscroll-item {
  flex-shrink: 0;
  width: clamp(260px, 30vw, 360px);
}

/* --- Counter animation --- */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* --- Draw SVG --- */
.svg-draw path {
  stroke-dasharray: var(--path-length, 1000);
  stroke-dashoffset: var(--path-length, 1000);
  will-change: stroke-dashoffset;
}

/* --- Glow effect --- */
.glow-red {
  text-shadow: 0 0 40px rgba(230,51,18,0.5),
               0 0 80px rgba(230,51,18,0.2);
}

.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    text-shadow: 0 0 20px rgba(230,51,18,0.3),
                 0 0 40px rgba(230,51,18,0.1);
  }
  50% {
    text-shadow: 0 0 40px rgba(230,51,18,0.6),
                 0 0 80px rgba(230,51,18,0.3),
                 0 0 120px rgba(230,51,18,0.1);
  }
}

/* --- Center line draw (comparison) --- */
.center-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 0;
  background: var(--primary);
  transform: translateX(-50%);
  will-change: height;
}

/* --- Stagger children delay helpers --- */
.stagger-children > *:nth-child(1) { --stagger-delay: 0s; }
.stagger-children > *:nth-child(2) { --stagger-delay: 0.1s; }
.stagger-children > *:nth-child(3) { --stagger-delay: 0.15s; }
.stagger-children > *:nth-child(4) { --stagger-delay: 0.2s; }
.stagger-children > *:nth-child(5) { --stagger-delay: 0.25s; }
.stagger-children > *:nth-child(6) { --stagger-delay: 0.3s; }

/* --- Magnetic effect container --- */
.magnetic {
  transition: transform 0.3s var(--ease-out);
}

/* --- Image reveal --- */
.img-reveal {
  position: relative;
  overflow: hidden;
}

.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform-origin: right;
  will-change: transform;
}

/* --- Gradient text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Loading skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--charcoal) 25%, #2a2a2a 50%, var(--charcoal) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Float animation --- */
.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* --- Reduced motion override --- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-up,
  .reveal-down,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-scale-up,
  .reveal-rotate-left,
  .reveal-rotate-right {
    opacity: 1 !important;
    transform: none !important;
  }

  .clip-reveal,
  .clip-reveal-top,
  .clip-reveal-sides {
    clip-path: none !important;
  }

  .split-word__inner {
    transform: none !important;
  }

  .svg-draw path {
    stroke-dashoffset: 0 !important;
  }

  .float,
  .glow-pulse {
    animation: none !important;
  }
}
