/* ============================================
   Ledge Top Technologies — Animations Layer
   ============================================ */

/* ---------- Reduced motion support ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .particle-canvas,
  .scroll-progress {
    display: none !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Scroll Progress Bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), #fbbf24, var(--color-accent));
  background-size: 200% 100%;
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
  animation: gradient-shift 3s linear infinite;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ---------- Particle Canvas ---------- */
.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.hero .particle-canvas { z-index: 0; }

/* ---------- Scroll Reveals ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--left  { transform: translateX(-50px); }
.reveal--right { transform: translateX(50px); }
.reveal--left.visible,
.reveal--right.visible { transform: translateX(0); }
.reveal--scale { transform: scale(0.92) translateY(30px); }
.reveal--scale.visible { transform: scale(1) translateY(0); }
.reveal--rotate { transform: rotate(-2deg) translateY(30px); }
.reveal--rotate.visible { transform: rotate(0) translateY(0); }

/* Stagger delays applied via data-delay */
[data-delay="1"] { transition-delay: 0.10s; }
[data-delay="2"] { transition-delay: 0.20s; }
[data-delay="3"] { transition-delay: 0.30s; }
[data-delay="4"] { transition-delay: 0.40s; }
[data-delay="5"] { transition-delay: 0.50s; }
[data-delay="6"] { transition-delay: 0.60s; }
[data-delay="7"] { transition-delay: 0.70s; }
[data-delay="8"] { transition-delay: 0.80s; }

/* ---------- Glow / Halo ---------- */
.glow-accent { text-shadow: 0 0 30px rgba(249,115,22,0.35), 0 0 60px rgba(249,115,22,0.15); }
.glow-white  { text-shadow: 0 0 30px rgba(255,255,255,0.25), 0 0 60px rgba(255,255,255,0.10); }

.glow-ring {
  position: relative;
}
.glow-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(249,115,22,0.35), rgba(59,130,246,0.25), rgba(34,197,94,0.25));
  filter: blur(14px);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}
.glow-ring:hover::before { opacity: 1; }

/* ---------- Gradient Backgrounds ---------- */
.gradient-animated {
  background: linear-gradient(135deg, #0f172a, #1e293b, #0f172a, #1e3a5f);
  background-size: 300% 300%;
  animation: gradient-pan 12s ease infinite;
}
@keyframes gradient-pan {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animated-fast {
  background: linear-gradient(135deg, #f97316, #fbbf24, #f97316, #ea580c);
  background-size: 300% 300%;
  animation: gradient-pan 4s ease infinite;
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

/* ---------- Magnetic Button ---------- */
.magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* ---------- Tilt Card ---------- */
.tilt-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---------- Shimmer Sweep ---------- */
.shimmer {
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.12),
    transparent
  );
  transform: skewX(-18deg);
  animation: shimmer-sweep 4s ease-in-out infinite;
}
@keyframes shimmer-sweep {
  0%   { left: -75%; }
  40%  { left: 125%; }
  100% { left: 125%; }
}

/* ---------- Pulse Dot / Badge ---------- */
.pulse-dot {
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 10px; height: 10px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- Typewriter Cursor ---------- */
.typewriter-cursor {
  display: inline;
  border-right: 2px solid currentColor;
  animation: blink-caret 0.85s step-end infinite;
}
@keyframes blink-caret {
  0%, 100% { border-color: currentColor; }
  50%      { border-color: transparent; }
}

/* ---------- Float / Bob Animation ---------- */
.float {
  animation: float-y 4s ease-in-out infinite;
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ---------- Hero Entrance ---------- */
@keyframes hero-enter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-animate-in > * {
  opacity: 0;
  animation: hero-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-animate-in > *:nth-child(1) { animation-delay: 0.10s; }
.hero-animate-in > *:nth-child(2) { animation-delay: 0.25s; }
.hero-animate-in > *:nth-child(3) { animation-delay: 0.40s; }

/* ---------- Section Label Underline Sweep ---------- */
.section-label.sweep::after {
  content: '';
  display: block;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--color-accent), #fbbf24);
  margin-top: 4px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.section-label.sweep.visible::after {
  width: 100%;
}

/* ---------- Link Underline Expand ---------- */
.link-fancy {
  position: relative;
  display: inline-block;
}
.link-fancy::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  width: 0; height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease, left 0.3s ease;
}
.link-fancy:hover::after {
  width: 100%; left: 0;
}

/* ---------- Ripple Click Effect ---------- */
.ripple {
  position: relative;
  overflow: hidden;
}
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: ripple-anim 0.7s linear;
  pointer-events: none;
}
@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---------- Counter Roll-Up ---------- */
.counter-roll {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ---------- Parallax Container Helpers ---------- */
.parallax-slow { will-change: transform; }

/* ---------- Entrance Animations (keyframe classes) ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.animate-fadeInUp    { animation: fadeInUp 0.8s cubic-bezier(0.22,1,0.36,1) both; }
.animate-fadeInDown  { animation: fadeInDown 0.8s cubic-bezier(0.22,1,0.36,1) both; }
.animate-fadeInLeft  { animation: fadeInLeft 0.8s cubic-bezier(0.22,1,0.36,1) both; }
.animate-fadeInRight { animation: fadeInRight 0.8s cubic-bezier(0.22,1,0.36,1) both; }

/* Stagger nth-child delays (generic, max 8) */
.stagger-children > *:nth-child(1) { animation-delay: 0.08s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.16s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.24s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.32s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.40s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.48s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.56s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.64s; }

/* ---------- Card shine on hover ---------- */
.card-shine {
  position: relative;
  overflow: hidden;
}
.card-shine::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  z-index: 1;
}
.card-shine:hover::before {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Smooth image zoom ---------- */
.img-zoom {
  overflow: hidden;
  border-radius: var(--radius);
}
.img-zoom img {
  transition: transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.img-zoom:hover img {
  transform: scale(1.05);
}

/* ---------- Screen reader only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
