/* ── PARTICLES ── */
#particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── TYPING CURSOR ── */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--primary);
  font-weight: 300;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── COUNT-UP ── */
.stat-value.counting {
  display: inline-block;
}

/* ── 3D TILT ── */
.tilt-3d {
  transform-style: preserve-3d;
  perspective: 800px;
}
.tilt-3d .tilt-inner {
  transition: transform 0.2s ease;
  transform-style: preserve-3d;
}

/* ── MAGNETIC BUTTON ── */
.magnetic-btn {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── FLOATING ELEMENT ── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}
@keyframes float-delayed {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}
.float-anim { animation: float 4s ease-in-out infinite; }
.float-anim-delayed { animation: float-delayed 5s ease-in-out infinite 1s; }

/* ── RIPPLE EFFECT ── */
.ripple-btn {
  position: relative;
  overflow: hidden;
}
.ripple-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.35);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* ── GLOW CARDS ── */
.glow-card {
  position: relative;
  overflow: hidden;
}
.glow-card::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--accent-rgb),0.045) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}
.glow-card:hover::before {
  opacity: 1;
}

/* ── STAGGER REVEAL ── */
.stagger-children > .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.stagger-children > .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.stagger-children > .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.stagger-children > .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.stagger-children > .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }
.stagger-children > .animate-on-scroll:nth-child(7) { transition-delay: 0.6s; }
.stagger-children > .animate-on-scroll:nth-child(8) { transition-delay: 0.7s; }

/* ── SCROLL ANIMATIONS DIFFERENT DIRECTIONS ── */
.animate-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-rotate {
  opacity: 0;
  transform: rotate(-3deg) scale(0.95);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-left.visible,
.animate-right.visible,
.animate-scale.visible,
.animate-rotate.visible {
  opacity: 1;
  transform: none;
}

/* ── SECTION REVEAL ── */
.section-reveal {
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}
.section-reveal.section-active {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* ── SPARKLE CURSOR ── */
#sparkle-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}
.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  pointer-events: none;
  animation: sparkle-fade 0.8s ease-out forwards;
}
@keyframes sparkle-fade {
  0% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0) translateY(-30px); }
}

/* ── PRELOADER ── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}
.preloader-logo {
  width: 80px;
  height: auto;
  animation: pulse-logo 1.5s ease-in-out infinite;
}
@keyframes pulse-logo {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}
.preloader-bar {
  width: 200px;
  height: 3px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.preloader-bar-inner {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-2));
  border-radius: 4px;
  animation: preload-fill 1.2s ease-in-out forwards;
}
@keyframes preload-fill {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ── IMAGE PARALLAX ON HOVER ── */
.parallax-img {
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.parallax-img:hover {
  transform: scale(1.08) translateY(-4px);
}

/* ── GRADIENT BORDER ANIMATION ── */
.gradient-border {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(45deg, var(--primary), var(--accent-2), var(--primary));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.gradient-border:hover::before {
  opacity: 0;
}

/* ── SMOOTH SECTION DIVIDERS ── */
.section-divider-top {
  position: relative;
}
.section-divider-top::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.6;
}
