/* fx.css — reusable punk-impact hover animations (THUG-grind energy).
 *
 * Opt-in utility classes: add one to any interactive element, in a template, a page,
 * or a post body. Loaded site-wide (base + home), after the inline styles, so these
 * win on conflicts. Each CATEGORY has its own motion; the hot-pink screenprint offset
 * shadow (misregistered against a cyan edge) is the shared signature.
 *
 *   .fx-kick   text links  (navbar, inline links)  — sharp skew-jolt
 *   .fx-stomp  primary btn  (JACK IN / big CTA)     — heavy charge-in + shake
 *   .fx-pop    icon control (mute / viz / collapse) — spin-kick
 *   .fx-slam   block/card   (generic row, à la .rec)— single-direction slam
 *
 * All honor prefers-reduced-motion (motion drops, the color/shadow accent stays).
 * Uses --cyan (site accent); the pink is literal so it reads the same everywhere.
 */

/* --- .fx-kick : text links -------------------------------------------------- */
@keyframes fx-kick {
  0%   { transform: none; }
  25%  { transform: translateY(-5px) skewX(-13deg) scale(1.08); }  /* hard snap up */
  48%  { transform: translateY(1px)  skewX(5deg)   scale(.97); }   /* recoil down past */
  70%  { transform: translateY(-3px) skewX(-6deg)  scale(1.04); }
  100% { transform: translateY(-2px) skewX(-3deg)  scale(1.03); }  /* settle, cocked */
}
.fx-kick { display: inline-block; position: relative; transition: transform .12s ease, color .12s ease, text-shadow .12s ease; }
.fx-kick:hover {
  animation: fx-kick .24s cubic-bezier(.2,.9,.1,1) forwards;
  color: var(--cyan);
  text-shadow: 2px 2px 0 rgba(255,59,107,.9), -1px -1px 0 rgba(53,224,208,.55), 0 0 10px rgba(53,224,208,.4);
}

/* .fx-kickrow : wrap a ROW of .fx-kick links and the children slam like the
   record cards do — lift + tilt, alternating left on odd / right on even.
   The screenprint text-shadow + cyan color come from .fx-kick:hover above;
   this only swaps the motion. Reusable: any link row (the navbar, an inline
   list) that wants the card-grade punch instead of the single snap. */
@keyframes fx-kick-l {
  0%   { transform: none; }
  26%  { transform: translate(-3px,-8px) rotate(-5deg)  skewX(-6deg) scale(1.12); } /* hard slam up-left */
  50%  { transform: translate(2px,1px)   rotate(.4deg)  skewX(0)     scale(.96); }  /* recoil down past */
  74%  { transform: translate(-2px,-5px) rotate(-3deg)  skewX(-3deg) scale(1.06); }
  100% { transform: translate(0,-3px)    rotate(-2.4deg) skewX(-2deg) scale(1.05); } /* settle, cocked */
}
@keyframes fx-kick-r {
  0%   { transform: none; }
  26%  { transform: translate(3px,-8px)  rotate(5deg)   skewX(6deg)  scale(1.12); }
  50%  { transform: translate(-2px,1px)  rotate(-.4deg) skewX(0)     scale(.96); }
  74%  { transform: translate(2px,-5px)  rotate(3deg)   skewX(3deg)  scale(1.06); }
  100% { transform: translate(0,-3px)    rotate(2.4deg) skewX(2deg)  scale(1.05); }
}
/* The anchor is the stable hit box; the inner <span> carries the motion. A child
   transform never moves the parent's hit box, so :hover can't drop mid-slam and
   retrigger (the flicker you get when the whole link dodges the cursor at an edge). */
.fx-kickrow .fx-kick > span { display: inline-block; }
.fx-kickrow .fx-kick:hover { animation: none; }              /* parent stays put */
.fx-kickrow .fx-kick:nth-child(odd):hover  { z-index: 3; }
.fx-kickrow .fx-kick:nth-child(even):hover { z-index: 3; }
.fx-kickrow .fx-kick:nth-child(odd):hover > span  { animation: fx-kick-l .26s cubic-bezier(.18,.92,.1,1) forwards; }
.fx-kickrow .fx-kick:nth-child(even):hover > span { animation: fx-kick-r .26s cubic-bezier(.18,.92,.1,1) forwards; }

/* --- .fx-stomp : primary buttons -------------------------------------------- */
@keyframes fx-stomp {
  0%   { transform: none; }
  22%  { transform: translateY(-4px) scale(1.06) rotate(-1.6deg); } /* charge up + overshoot */
  40%  { transform: translate(2px,1px) scale(.985) rotate(.7deg); } /* recoil */
  58%  { transform: translate(-2px,-2px) scale(1.03) rotate(-1.1deg); }
  78%  { transform: translate(1px,0) scale(1.01) rotate(.4deg); }
  100% { transform: translateY(-2px) scale(1.02) rotate(-.7deg); }  /* settle, cocked */
}
.fx-stomp { transition: transform .14s ease, box-shadow .14s ease; }
.fx-stomp:hover {
  animation: fx-stomp .3s cubic-bezier(.2,.85,.15,1) forwards;
  box-shadow: 5px 5px 0 rgba(255,59,107,.9), 0 0 0 1px var(--cyan), 0 0 20px rgba(53,224,208,.3);
}

/* --- .fx-pop : icon control buttons ---------------------------------------- */
@keyframes fx-pop {
  0%   { transform: none; }
  35%  { transform: scale(1.2) rotate(-13deg); }  /* spin-kick out */
  62%  { transform: scale(.97) rotate(6deg); }    /* snap back past */
  100% { transform: scale(1.09) rotate(-4deg); }  /* settle, cocked */
}
.fx-pop { transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease; }
.fx-pop:hover {
  animation: fx-pop .24s cubic-bezier(.2,.9,.1,1) forwards;
  box-shadow: 3px 3px 0 rgba(255,59,107,.88), 0 0 12px rgba(53,224,208,.35);
}

/* --- .fx-jab : filter chips / pills — a sharp overshoot jab ----------------- */
@keyframes fx-jab {
  0%   { transform: none; }
  30%  { transform: translateY(-3px) skewX(-11deg) scale(1.12); } /* hard jab out */
  55%  { transform: translateY(0)    skewX(3deg)   scale(.98); }  /* recoil */
  100% { transform: translateY(-2px) skewX(-5deg)  scale(1.06); } /* settle, cocked */
}
.fx-jab { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease; }
.fx-jab:hover {
  animation: fx-jab .22s cubic-bezier(.2,.9,.1,1) forwards; border-color: var(--cyan);
  box-shadow: 3px 3px 0 rgba(255,59,107,.9), 0 0 10px rgba(53,224,208,.35);
}

/* --- .fx-slam : generic block/card (the record-row slam, single direction) -- */
@keyframes fx-slam {
  0%   { transform: none; }
  26%  { transform: translate(-4px,-12px) rotate(-3.6deg) skewX(-4.5deg) scale(1.045); }
  50%  { transform: translate(3px,0) rotate(-.3deg) skewX(0) scale(.995); }
  74%  { transform: translate(-2px,-8px) rotate(-2.6deg) skewX(-2deg) scale(1.03); }
  100% { transform: translate(0,-6px) rotate(-2deg) skewX(-1.6deg) scale(1.02); }
}
.fx-slam { transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .16s ease; }
.fx-slam:hover {
  animation: fx-slam .24s cubic-bezier(.18,.92,.1,1) forwards; z-index: 2;
  box-shadow: 6px 6px 0 rgba(255,59,107,.95), 0 0 0 1px var(--cyan), 0 16px 30px rgba(0,0,0,.6), 0 0 24px rgba(53,224,208,.25);
}

/* --- .fx-glitch : signature wordmark glitch — RGB chromatic split + sliced
   displacement in the site's cyan + hot-pink. Needs data-text="<the text>" so the
   ghost layers can mirror it. Distinct from the impact buttons: this is a digital
   signal glitch, not a physical slam. */
@keyframes fx-glitch-main {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-1px,1px) skewX(-2deg); }
  50% { transform: translate(1px,-1px); }
  75% { transform: translate(-1px,0) skewX(2deg); }
}
@keyframes fx-glitch-a { /* cyan ghost, shifted left, slicing */
  0%   { transform: translate(-2px,0); clip-path: inset(0 0 70% 0); }
  25%  { transform: translate(-3px,1px); clip-path: inset(42% 0 20% 0); }
  50%  { transform: translate(-2px,-1px); clip-path: inset(72% 0 0 0); }
  75%  { transform: translate(-3px,0); clip-path: inset(10% 0 55% 0); }
  100% { transform: translate(-2px,0); clip-path: inset(30% 0 40% 0); }
}
@keyframes fx-glitch-b { /* hot-pink ghost, shifted right, slicing */
  0%   { transform: translate(2px,0); clip-path: inset(60% 0 10% 0); }
  25%  { transform: translate(3px,-1px); clip-path: inset(20% 0 52% 0); }
  50%  { transform: translate(2px,1px); clip-path: inset(0 0 75% 0); }
  75%  { transform: translate(3px,0); clip-path: inset(50% 0 22% 0); }
  100% { transform: translate(2px,0); clip-path: inset(35% 0 35% 0); }
}
.fx-glitch { position: relative; display: inline-block; cursor: pointer; -webkit-user-select: none; user-select: none; }
.fx-glitch::before, .fx-glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  opacity: 0; pointer-events: none; mix-blend-mode: screen;
}
.fx-glitch:hover { animation: fx-glitch-main .22s steps(2,end) infinite; }
.fx-glitch:hover::before { opacity: 1; color: #35e0d0; animation: fx-glitch-a .2s steps(2,end) infinite; }
.fx-glitch:hover::after  { opacity: 1; color: #ff3b6b; animation: fx-glitch-b .18s steps(2,end) infinite; }

/* --- .fx-slap : "slapper" search input — screenprint SLAM on focus + mechanical
   chromatic KICK per keystroke. Put .fx-slap on the input and wrap it in .fx-slap-wrap;
   fxinput.js toggles .fx-hit on the wrapper each keystroke (slam-on-focus is pure CSS).
   The slam settles to a calm screenprint so the bar stays typeable. The kick rides the
   WRAP, not the input, so it never shares an animation slot with the slam (no re-fire).
   Keyframe names are distinct from the .fx-slam card class on purpose. ------------- */
@keyframes fx-slam-in {
  0%   { transform: translate(0,0) skewX(0) scale(1); }
  28%  { transform: translate(-3px,-5px) skewX(-3deg) scale(1.03); box-shadow: 7px 7px 0 var(--hot), 0 0 0 1px var(--cyan), 0 0 24px rgba(53,224,208,.45); } /* SLAM */
  52%  { transform: translate(2px,1px) skewX(1deg) scale(.992); box-shadow: 3px 3px 0 rgba(255,59,107,.6); }                                               /* recoil */
  78%  { transform: translate(-1px,-1px) skewX(-.6deg) scale(1.006); }
  100% { transform: translate(0,0) skewX(0) scale(1); box-shadow: 2px 2px 0 rgba(255,59,107,.4), 0 0 0 1px var(--cyan), 0 0 10px rgba(53,224,208,.18); }    /* calm rest */
}
.fx-slap { transition: border-color .15s ease; }
.fx-slap:focus {
  border-color: var(--cyan);
  box-shadow: 2px 2px 0 rgba(255,59,107,.4), 0 0 0 1px var(--cyan), 0 0 10px rgba(53,224,208,.18);
  animation: fx-slam-in .3s cubic-bezier(.2,.85,.15,1) 1;
}
.fx-slap-wrap { position: relative; }
@keyframes fx-slap-kick {
  0%   { transform: translateX(0) scale(1); box-shadow: none; }
  35%  { transform: translateX(-2px) scale(1.012); box-shadow: -5px 0 0 var(--cyan), 5px 0 0 var(--hot), 0 0 16px rgba(53,224,208,.3); } /* chromatic crack */
  100% { transform: translateX(0) scale(1); box-shadow: none; }
}
.fx-slap-wrap.fx-hit { animation: fx-slap-kick .12s ease-out 1; }

/* --- .fx-switch : segmented toggle (the viz switch) — a hard press-then-punch,
   like slamming a physical switch, with the shared hot-pink screenprint. Put it on
   each segment; position:relative lets the popped one layer over its neighbour.
   The toggle's container must NOT clip overflow or the punch gets cut off. */
@keyframes fx-switch {
  0%   { transform: none; }
  25%  { transform: translateY(1px)  scale(.94)  skewX(3deg); }    /* press in */
  55%  { transform: translateY(-2px) scale(1.08) skewX(-4deg); }   /* punch out, overshoot */
  100% { transform: translateY(0)    scale(1.03) skewX(-1.5deg); } /* settle, cocked */
}
.fx-switch { position: relative; transition: transform .12s ease, box-shadow .12s ease, color .12s ease; }
.fx-switch:hover {
  animation: fx-switch .24s cubic-bezier(.2,.9,.1,1) forwards; z-index: 2;
  box-shadow: 3px 3px 0 rgba(255,59,107,.9), 0 0 10px rgba(53,224,208,.35);
}

@media (prefers-reduced-motion: reduce) {
  .fx-kick:hover, .fx-stomp:hover, .fx-pop:hover, .fx-jab:hover, .fx-slam:hover, .fx-switch:hover { animation: none; transform: none; }
  .fx-kickrow .fx-kick:nth-child(odd):hover > span, .fx-kickrow .fx-kick:nth-child(even):hover > span { animation: none; transform: none; }
  .fx-glitch:hover { animation: none; }
  .fx-glitch:hover::before, .fx-glitch:hover::after { opacity: 0; } /* no RGB-split flicker */
  .fx-slap:focus, .fx-slap-wrap.fx-hit { animation: none; }
}
