
/* Critical Graffix Hex Glitch Background Test
   Subtle anomaly system: normal drift + rare controlled glitches */

body::before {
  animation:
    cgHexTranslate 55s linear infinite,
    cgHexBreath 10s ease-in-out infinite,
    cgHexGlitch 38s steps(1,end) infinite !important;
}

/* Rare micro-glitch: brief RGB offset and displacement */
@keyframes cgHexGlitch {
  0%, 88%, 100% {
    transform: translate(0,0);
    filter: none;
  }

  89% {
    transform: translate(-3px,1px);
    filter:
      drop-shadow(3px 0 rgba(255,50,160,.35))
      drop-shadow(-3px 0 rgba(0,220,255,.35));
  }

  90% {
    transform: translate(2px,-1px);
    filter:
      drop-shadow(-2px 0 rgba(255,50,160,.45))
      drop-shadow(2px 0 rgba(0,220,255,.45));
  }

  91% {
    transform: translate(0,0);
    filter: none;
  }
}

/* Small glitch events on signal sparks */
.signal-layer .spark {
  animation:
    cgSparkFlash 10s ease-in-out infinite,
    cgSparkGlitch 47s steps(1,end) infinite !important;
}

@keyframes cgSparkGlitch {
  0%, 93%, 100% {
    transform: scale(1);
  }
  94% {
    transform: scale(1.8) translateX(5px);
    filter: hue-rotate(30deg);
  }
  95% {
    transform: scale(.7) translateX(-4px);
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::before,
  .signal-layer .spark {
    animation: none !important;
  }
}
