/* =========================================================
   RedLine · Animations kit
   Drop-in motion layer — safe, opt-in, respects reduced motion
   ========================================================= */

/* ---------- Keyframes ---------- */
@keyframes rl-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}

@keyframes rl-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

@keyframes rl-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@keyframes rl-orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(40px, -30px) scale(1.06); }
  66%  { transform: translate(-30px, 20px) scale(0.96); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes rl-arrow-slide {
  0%, 100% { transform: translateX(0);   opacity: 0.45; }
  50%      { transform: translateX(4px); opacity: 1; }
}

@keyframes rl-shimmer {
  0%   { left: -80%; }
  60%  { left: 130%; }
  100% { left: 130%; }
}

@keyframes rl-float-up {
  0%   { transform: translateY(0) scale(0); opacity: 0; }
  10%  { transform: translateY(-20px) scale(1); opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-110vh) scale(0.5); opacity: 0; }
}

/* =========================================================
   1. SCROLL REVEAL
   Add data-anim to any element. Add data-anim-delay="0.2" for delay.
   Add data-anim-stagger="80" on a container to stagger its children.
   ========================================================= */
[data-anim] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.9, 0.3, 1),
    transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: opacity, transform;
}
[data-anim].rl-in {
  opacity: 1;
  transform: none;
}
[data-anim="fade"]  { transform: none; }
[data-anim="left"]  { transform: translateX(-24px); }
[data-anim="right"] { transform: translateX(24px); }
[data-anim="scale"] { transform: scale(0.94); }
[data-anim="left"].rl-in,
[data-anim="right"].rl-in,
[data-anim="scale"].rl-in { transform: none; }

[data-anim-stagger] > * {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s cubic-bezier(0.2, 0.9, 0.3, 1),
    transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1);
}
[data-anim-stagger].rl-in > * {
  opacity: 1;
  transform: none;
}

/* =========================================================
   2. AMBIENT ORBS
   The kit auto-drifts any .soft-orb / .rl-orb you already have.
   ========================================================= */
.soft-orb, .rl-orb {
  animation: rl-orb-drift 22s ease-in-out infinite;
  will-change: transform;
}
.soft-orb.orb-1, .rl-orb.delay-1 { animation-delay: -6s; }
.soft-orb.orb-2, .rl-orb.delay-2 { animation-delay: -12s; }
.soft-orb.orb-3, .rl-orb.delay-3 { animation-delay: -18s; }

/* =========================================================
   3. MICRO-MOTION HELPERS
   ========================================================= */
.rl-bob        { animation: rl-bob 3.2s ease-in-out infinite; }
.rl-bob.delay-1 { animation-delay: 0.3s; }
.rl-bob.delay-2 { animation-delay: 0.6s; }
.rl-bob.delay-3 { animation-delay: 0.9s; }

.rl-float      { animation: rl-float 4s ease-in-out infinite; }

/* Arrows that pulse gently (used in "More" links, jump pills) */
.rl-arrow i { animation: rl-arrow-slide 1.8s ease-in-out infinite; }

/* Gradient border sweep on hover — add to featured cards */
.rl-gradient-border { position: relative; }
.rl-gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(239, 68, 68, 0.55),
    rgba(251, 191, 36, 0.55),
    rgba(59, 130, 246, 0.55),
    rgba(239, 68, 68, 0.55));
  background-size: 300% 300%;
  animation: rl-gradient-shift 6s ease-in-out infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.rl-gradient-border:hover::before { opacity: 1; }

/* Button shimmer — add class rl-shimmer-btn to primary CTAs */
.rl-shimmer-btn { position: relative; overflow: hidden; }
.rl-shimmer-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%);
  transform: skewX(-20deg);
  animation: rl-shimmer 3.6s ease-in-out infinite;
  pointer-events: none;
}

/* Card hover lift */
.rl-lift {
  transition:
    transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.rl-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   4. SCROLL PROGRESS BAR (auto-injected)
   ========================================================= */
#rl-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #EF4444, #FBBF24, #3B82F6, #FBBF24);
  background-size: 200% 100%;
  animation: rl-gradient-shift 4s linear infinite;
  z-index: 9999;
  transition: width 0.15s linear;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

/* =========================================================
   5. NAV SHRINK ON SCROLL
   ========================================================= */
.rl-nav-shrink { transition: padding 0.3s ease, background 0.3s ease; }
.rl-nav-shrink.rl-scrolled {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* =========================================================
   6. CURSOR SPOTLIGHT (desktop only, auto-injected)
   ========================================================= */
.rl-spotlight {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.055), transparent 65%);
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.rl-spotlight.rl-active { opacity: 1; }

/* =========================================================
   7. FLOATING PARTICLES (auto-injected into .bg / #ambient-bg)
   ========================================================= */
.rl-particles-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.rl-particles-layer > * {
  animation-name: rl-float-up;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

/* =========================================================
   8. BUTTON PRESS FEEDBACK
   ========================================================= */
.btn, .c-btn, button {
  transition: transform 0.15s ease;
}

/* =========================================================
   9. RESPECT REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .rl-bob,
  .rl-float,
  .soft-orb, .rl-orb,
  .rl-arrow i,
  .rl-shimmer-btn::after,
  .rl-gradient-border::before,
  #rl-progress,
  .rl-particles-layer > * {
    animation: none !important;
  }
  [data-anim],
  [data-anim-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .btn, .c-btn, button { transition: none !important; }
}
