// ─── UI UTILITIES ────────────────────────────────────────────────────── const { useEffect, useRef, useState, useMemo, useCallback } = React; function CursorDot() { const ref = useRef(null); const [visible, setVisible] = useState(false); const [expand, setExpand] = useState(false); useEffect(() => { let raf = 0; let tx = 0, ty = 0, cx = 0, cy = 0; const onMove = (e) => { tx = e.clientX; ty = e.clientY; setVisible(true); }; const onLeave = () => setVisible(false); const sel = "a, button, .btn, .case-card, .specialty-card, .plan-card, .t-card, [data-magnetic]"; const onOver = (e) => { if (e.target.closest?.(sel)) setExpand(true); }; const onOut = (e) => { if (e.target.closest?.(sel)) setExpand(false); }; window.addEventListener("mousemove", onMove); window.addEventListener("mouseleave", onLeave); document.addEventListener("mouseover", onOver); document.addEventListener("mouseout", onOut); const tick = () => { cx += (tx - cx) * 0.22; cy += (ty - cy) * 0.22; if (ref.current) ref.current.style.transform = `translate(${cx}px, ${cy}px) translate(-50%, -50%)`; raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick); return () => { cancelAnimationFrame(raf); window.removeEventListener("mousemove", onMove); window.removeEventListener("mouseleave", onLeave); document.removeEventListener("mouseover", onOver); document.removeEventListener("mouseout", onOut); }; }, []); return