/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  bhava-animate.css  — Bhāva Tech  ✨ Motion & Delight Layer         ║
   ║  Add in <head> after bhava-enhance.css                              ║
   ║    <link rel="stylesheet" href="bhava-animate.css">                 ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

/* ── CURSOR SPARKLE ── */
.bt-sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: sparkleLife 0.7s var(--bt-ease, cubic-bezier(.16,1,.3,1)) forwards;
}
@keyframes sparkleLife {
  0%   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0); }
}

/* ── CURSOR DOT (centre) ── */
#bt-cursor-dot {
  position: fixed;
  width: 8px; height: 8px;
  background: #c4b5fd;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transition: transform 0.12s ease, opacity 0.2s ease;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}
#bt-cursor-ring {
  position: fixed;
  width: 32px; height: 32px;
  border: 1.5px solid rgba(167,139,250,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99997;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease,
              border-color 0.3s ease, transform 0.07s linear;
}
body:has(button:hover) #bt-cursor-ring,
body:has(a:hover)      #bt-cursor-ring {
  width: 48px; height: 48px;
  border-color: rgba(167,139,250,0.9);
}

/* ── FLOATING BRAIN PARTICLES (hero emojis) ── */
.bt-float-emoji {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  animation: floatUp var(--dur, 8s) var(--delay, 0s) ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(167,139,250,0.6));
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg) scale(0.8); }
  15%  { opacity: 0.55; }
  80%  { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-120px) rotate(20deg) scale(1.1); }
}

/* ── TYPEWRITER CURSOR ── */
.bt-typewriter::after {
  content: '|';
  color: var(--bt-accent, #a78bfa);
  animation: blink 0.8s step-end infinite;
  font-weight: 300;
  margin-left: 2px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── 3D TILT CARDS ── */
.bt-tilt {
  transform-style: preserve-3d;
  transition: transform 0.08s linear, box-shadow 0.35s ease;
  will-change: transform;
}
.bt-tilt:hover {
  box-shadow: 0 30px 70px rgba(0,0,0,0.5) !important;
}
.bt-tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%),
              rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.bt-tilt:hover .bt-tilt-shine { opacity: 1; }

/* ── RIPPLE ON BUTTONS ── */
.bt-ripple-host { position: relative; overflow: hidden; }
.bt-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: rippleOut 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

/* ── STAGGERED SECTION REVEAL ── */
.bt-reveal {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.7s var(--bt-ease, cubic-bezier(.16,1,.3,1)),
              clip-path 0.7s var(--bt-ease);
}
.bt-reveal.bt-in {
  opacity: 1;
  clip-path: inset(0 0 0% 0);
}

/* stagger delays for siblings */
.bt-reveal:nth-child(1) { transition-delay: 0s;    }
.bt-reveal:nth-child(2) { transition-delay: 0.08s; }
.bt-reveal:nth-child(3) { transition-delay: 0.16s; }
.bt-reveal:nth-child(4) { transition-delay: 0.24s; }
.bt-reveal:nth-child(5) { transition-delay: 0.32s; }
.bt-reveal:nth-child(6) { transition-delay: 0.40s; }

/* ── GLOW PULSE on stats ── */
.bt-glow-pulse {
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 8px currentColor, 0 0 16px currentColor; }
  50%       { text-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 0 60px currentColor; }
}

/* ── MAGNETIC BUTTON WRAPPER ── */
.bt-magnetic {
  display: inline-block;
  transition: transform 0.3s var(--bt-ease, cubic-bezier(.16,1,.3,1));
}

/* ── FLOW PIPELINE: sequential lighting ── */
.flow-node { transition: transform 0.4s var(--bt-ease), box-shadow 0.4s ease; }
.flow-node.bt-lit.fn1 {
  border-color: rgba(52,211,153,0.8) !important;
  box-shadow: 0 0 32px rgba(52,211,153,0.55) !important;
  transform: scale(1.08);
}
.flow-node.bt-lit.fn2 {
  border-color: rgba(6,182,212,0.8) !important;
  box-shadow: 0 0 32px rgba(6,182,212,0.55) !important;
  transform: scale(1.08);
}
.flow-node.bt-lit.fn3 {
  border-color: rgba(251,191,36,0.8) !important;
  box-shadow: 0 0 32px rgba(251,191,36,0.55) !important;
  transform: scale(1.08);
}
.flow-node.bt-lit.fn4 {
  border-color: rgba(255,255,255,0.8) !important;
  box-shadow: 0 0 32px rgba(255,255,255,0.45) !important;
  transform: scale(1.08);
}

/* ── CONFETTI PIECES ── */
.bt-confetti {
  position: fixed;
  width: 9px; height: 9px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 99996;
  animation: confettiFall var(--cf-dur, 1.2s) var(--cf-delay, 0s) ease-in forwards;
}
@keyframes confettiFall {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(var(--cf-x), var(--cf-y)) rotate(var(--cf-r)) scale(0.3); opacity: 0; }
}

/* ── ACHIEVEMENT POP (brain gym tap unlock) ── */
.bt-achievement {
  position: fixed;
  bottom: 90px; right: 24px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  padding: 14px 20px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 8px 30px rgba(124,58,237,0.5);
  z-index: 9998;
  display: flex; align-items: center; gap: 10px;
  transform: translateX(200%);
  transition: transform 0.5s cubic-bezier(.16,1,.3,1);
  max-width: 260px;
  pointer-events: none;
}
.bt-achievement.show { transform: translateX(0); }
.bt-achievement-icon { font-size: 1.5rem; }

/* ── SHIMMER TEXT HIGHLIGHT ── */
.bt-highlight {
  position: relative;
  display: inline-block;
}
.bt-highlight::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, #7c3aed, #06b6d4, #fbbf24);
  background-size: 200% 100%;
  animation: lineShimmer 3s linear infinite;
  border-radius: 2px;
}
@keyframes lineShimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ── WAVE DIVIDER ── */
.bt-wave-divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin: 0;
  display: block;
}
.bt-wave-divider svg { display: block; width: 100%; }
.bt-wave-fill-1 { fill: rgba(167,139,250,0.06); }
.bt-wave-fill-2 { fill: rgba(6,182,212,0.04); }

/* ── BOUNCING SCROLL ARROW in hero ── */
.bt-scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.5;
  animation: scrollBounce 2s ease-in-out infinite;
  z-index: 2;
}
.bt-scroll-hint span {
  display: block;
  width: 20px; height: 20px;
  border-right: 2px solid #c4b5fd;
  border-bottom: 2px solid #c4b5fd;
  transform: rotate(45deg);
  animation: scrollFade 2s ease-in-out infinite;
}
.bt-scroll-hint span:nth-child(2) { animation-delay: 0.2s; margin-top: -10px; }
.bt-scroll-hint span:nth-child(3) { animation-delay: 0.4s; margin-top: -10px; }
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}
@keyframes scrollFade {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── METHOD CARD ICON BOUNCE ON HOVER ── */
.method-card:hover .mc-icon {
  animation: iconBounce 0.5s cubic-bezier(.16,1,.3,1) forwards !important;
}
@keyframes iconBounce {
  0%   { transform: translateY(0) scale(1) rotate(0deg); }
  40%  { transform: translateY(-14px) scale(1.25) rotate(-8deg); }
  70%  { transform: translateY(-8px) scale(1.15) rotate(4deg); }
  100% { transform: translateY(-7px) scale(1.1) rotate(0deg); }
}

/* ── GAME CARD ICON SPIN ON HOVER ── */
.g-card:hover .g-icon {
  animation: iconSpin 0.6s cubic-bezier(.16,1,.3,1) forwards !important;
}
@keyframes iconSpin {
  0%   { transform: scale(1) rotate(0deg); }
  50%  { transform: scale(1.35) rotate(-12deg); }
  100% { transform: scale(1.2) rotate(-5deg); }
}

/* ── STAT NUMBER FLASH on count complete ── */
.stat-num.bt-done {
  animation: numFlash 0.5s ease-out;
}
@keyframes numFlash {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); color: #fff; }
  100% { transform: scale(1); }
}

/* ── ORBITING STAR around hero badge ── */
@keyframes orbitStar {
  from { transform: rotate(0deg) translateX(38px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(38px) rotate(-360deg); }
}
.bt-orbit-star {
  position: absolute;
  font-size: 12px;
  pointer-events: none;
  animation: orbitStar 4s linear infinite;
  z-index: 3;
}

/* ── GAIN CARD entrance from bottom ── */
.gain-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--bt-ease, cubic-bezier(.16,1,.3,1)),
              transform 0.7s var(--bt-ease),
              box-shadow 0.4s ease !important;
}
.gain-card.bt-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── COLLABORATION CARD FLIP REVEAL ── */
.collab-card,
[class*="collab"] .card-inner,
[class*="collab-grid"] > div {
  transition: transform 0.5s var(--bt-ease),
              border-color 0.4s ease,
              box-shadow 0.4s ease !important;
}

/* ── REDUCED MOTION: kill everything ── */
@media (prefers-reduced-motion: reduce) {
  .bt-sparkle, .bt-float-emoji, .bt-confetti,
  .bt-achievement, .bt-scroll-hint,
  .bt-reveal, .bt-tilt, .bt-glow-pulse { animation: none !important; }
  .bt-reveal { opacity: 1 !important; clip-path: none !important; }
  .gain-card { opacity: 1 !important; transform: none !important; }
}
