/* a gift from us
   Pulsar Interactive's glitch: small sparks of cyan #05F9FE and magenta #D646FF on a dark
   canvas, never large fills. On this page: the header logo (.pg-glitch-img on the mark,
   .pg-glitch-text on the wordmark), calm most of the time, then a short burst; and the demo
   phone's Glitch chip, which splits on hover (.pg-glitch-hover).
   Everything below is what makes the effect happen; the last block turns it off for anyone who
   asks for reduced motion. */

/* Pulsar glitch effects — cyan #05F9FE / magenta #D646FF sparks on dark #1C1C1C.
   Drop-in stylesheet. Apply via the .pg-* classes or reference the keyframes directly. */

/* ---- Keyframes ---- */
/* Intermittent chromatic aberration on text: calm ~90% of the loop, then a burst */
@keyframes pg-rgb{0%,91%,100%{text-shadow:none;transform:none}92%{text-shadow:-2px 0 #05F9FE,2px 0 #D646FF}94%{text-shadow:2px 0 #05F9FE,-2px 0 #D646FF;transform:translateX(1px)}96%{text-shadow:-1px 0 #D646FF,1px 0 #05F9FE;transform:none}98%{text-shadow:1.5px 0 #05F9FE,-1.5px 0 #D646FF}}
/* Continuous chromatic aberration on text */
@keyframes pg-rgb-loop{0%,100%{text-shadow:-2px 0 #05F9FE,2px 0 #D646FF}25%{text-shadow:2px 0 #05F9FE,-2px 0 #D646FF}50%{text-shadow:-1px 0 #D646FF,1px 0 #05F9FE}75%{text-shadow:1.5px 0 #05F9FE,-1.5px 0 #D646FF}}
/* CRT phosphor flicker (opacity dips) */
@keyframes pg-flicker{0%,93%,100%{opacity:1}94%{opacity:.55}95%{opacity:1}97%{opacity:.75}98%{opacity:1}}
/* Chromatic aberration for images/logos/SVG (drop-shadow based) — intermittent */
@keyframes pg-img-rgb{0%,90%,100%{filter:none;transform:none}91%{filter:drop-shadow(-2px 0 rgba(5,249,254,.9)) drop-shadow(2px 0 rgba(214,70,255,.9))}93%{filter:drop-shadow(2.5px 0 rgba(5,249,254,.9)) drop-shadow(-2.5px 0 rgba(214,70,255,.9));transform:translateX(1px)}95%{filter:drop-shadow(-1px 0 rgba(214,70,255,.9)) drop-shadow(1px 0 rgba(5,249,254,.9));transform:none}97%{filter:drop-shadow(1.5px 0 rgba(5,249,254,.9)) drop-shadow(-1.5px 0 rgba(214,70,255,.9))}}
/* Same, continuous */
@keyframes pg-img-rgb-loop{0%,100%{filter:drop-shadow(-2px 0 rgba(5,249,254,.85)) drop-shadow(2px 0 rgba(214,70,255,.85))}25%{filter:drop-shadow(2px 0 rgba(5,249,254,.85)) drop-shadow(-2px 0 rgba(214,70,255,.85));transform:translateX(1px)}50%{filter:drop-shadow(-1px 0 rgba(214,70,255,.85)) drop-shadow(1px 0 rgba(5,249,254,.85));transform:none}75%{filter:drop-shadow(1.5px 0 rgba(5,249,254,.85)) drop-shadow(-1.5px 0 rgba(214,70,255,.85))}}
/* Expanding pulsar ring */
@keyframes pg-ring{0%{transform:scale(.25);opacity:.9}100%{transform:scale(1.7);opacity:0}}
/* Scanline sweep top→bottom */
@keyframes pg-scanmove{0%{top:-10%}100%{top:110%}}
/* Animated cyan→magenta gradient edge */
@keyframes pg-grad{0%{background-position:0% 0}100%{background-position:200% 0}}

/* ---- Utility classes ---- */
.pg-glitch-text{animation:pg-rgb 4s steps(1) infinite}
.pg-glitch-text-loop{animation:pg-rgb-loop 2.8s steps(1) infinite}
.pg-flicker{animation:pg-flicker 3.4s linear infinite}
.pg-glitch-img{display:inline-flex;animation:pg-img-rgb 6s steps(1) infinite}
.pg-glitch-img-loop{display:inline-flex;animation:pg-img-rgb-loop 2.6s steps(1) infinite}
.pg-glitch-hover:hover{text-shadow:-2.5px 0 rgba(5,249,254,.9),2.5px 0 rgba(214,70,255,.9)}
.pg-glitch-img-hover:hover{animation:pg-img-rgb-loop .5s steps(1) infinite}
/* 3px animated glitch edge — put on a bar at the top of a card */
.pg-glitch-edge{height:3px;background:linear-gradient(90deg,#05F9FE,#D646FF,#05F9FE);background-size:200% 100%;animation:pg-grad 3s linear infinite}
/* Scanline sweep — parent needs position:relative;overflow:hidden */
.pg-scanline{position:absolute;left:0;right:0;height:2px;background:linear-gradient(90deg,transparent,#05F9FE,transparent);opacity:.7;animation:pg-scanmove 3s linear infinite}
/* Pulsar ring — absolutely position inside a square relative container; stagger with animation-delay */
.pg-ring{position:absolute;inset:0;border:1px solid #05F9FE;border-radius:50%;animation:pg-ring 2.4s cubic-bezier(0.23,1,0.32,1) infinite}
.pg-ring--magenta{border-color:#D646FF}

/* ---- CRT overlay (optional, fixed full-screen, dark themes only) ---- */
.pg-crt-scanlines{position:fixed;inset:0;z-index:200;pointer-events:none;background:repeating-linear-gradient(0deg,rgba(0,0,0,.12) 0px,rgba(0,0,0,.12) 1px,transparent 1px,transparent 3px);mix-blend-mode:multiply}
.pg-crt-vignette{position:fixed;inset:0;z-index:201;pointer-events:none;background:radial-gradient(ellipse at center,transparent 55%,rgba(0,0,0,.35) 100%)}

/* ---- Accessibility: always kill glitch motion ---- */
@media (prefers-reduced-motion: reduce){
  .pg-glitch-text,.pg-glitch-text-loop,.pg-flicker,.pg-glitch-img,.pg-glitch-img-loop,
  .pg-glitch-img-hover:hover,.pg-glitch-edge,.pg-scanline,.pg-ring{animation:none !important}
}
