/* ============================================================
   FX — lightweight, GPU-friendly background + spotlight
   (no per-cell DOM, no SVG path animation — reliable, never glitches)
   ============================================================ */

/* ---- Grainy texture background (pure CSS, fine fractal-noise dither) ---- */
.gridbg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.22'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  -webkit-mask-image: radial-gradient(125% 95% at 50% 32%, #000 48%, transparent 90%);
          mask-image: radial-gradient(125% 95% at 50% 32%, #000 48%, transparent 90%);
}
/* a soft blue glow wanders across the grid (one element, transform-only) */
.gridbg::after {
  content: ""; position: absolute; width: 55%; padding-bottom: 55%;
  left: 0; top: 0; border-radius: 50%; will-change: transform;
  background: radial-gradient(circle, rgba(10,111,240,0.08), transparent 64%);
  filter: blur(40px);
  animation: gridWander 30s ease-in-out infinite;
}
@keyframes gridWander {
  0%   { transform: translate(-8%, 4%) scale(1); }
  25%  { transform: translate(55%, 26%) scale(1.12); }
  50%  { transform: translate(78%, 60%) scale(0.95); }
  75%  { transform: translate(24%, 40%) scale(1.06); }
  100% { transform: translate(-8%, 4%) scale(1); }
}
.gridbg--center::after { animation-name: gridWanderC; }
@keyframes gridWanderC {
  0%   { transform: translate(18%, 6%) scale(1); }
  33%  { transform: translate(46%, 34%) scale(1.1); }
  66%  { transform: translate(24%, 52%) scale(0.96); }
  100% { transform: translate(18%, 6%) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .gridbg::after { animation: none; transform: translate(30%, 22%); } }

/* click ripple — transient cells light up outward from the click (no permanent DOM) */
.gfx-ripple { position: absolute; pointer-events: none; opacity: 0; border-radius: 2px;
  background: rgba(10,111,240,0.5); animation: rippleCell .7s ease-out forwards; }
@keyframes rippleCell {
  0%   { opacity: 0; transform: scale(0.35); }
  30%  { opacity: 0.55; }
  100% { opacity: 0; transform: scale(1); }
}

/* ---- Spotlight cards (cursor glow — one var update, cheap) ---- */
.spotlight { position: relative; isolation: isolate; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0;
  opacity: 0; transition: opacity .4s var(--ease); pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
              rgba(10,111,240,0.05), transparent 64%);
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }
