/* =========================================================
   ARIA GHOST GRID FORCE-SPIN FIX v4
   This makes the grid visibly move even though the geometry is symmetrical.
   Place at the VERY BOTTOM of:
   /assets/css/aria-event-horizon-no-overlap-v3.css
========================================================= */

/* Keep SVG parts from becoming CSS grid */
.aehGhostGeometry,
.aehSpiderLightning{
  display:block!important;
  overflow:visible!important;
}

.aehGhostGeometry circle,
.aehGhostGeometry polygon,
.aehGhostGeometry line,
.aehSpiderLightning path,
.aehSpiderLightning defs,
.aehSpiderLightning linearGradient,
.aehSpiderLightning stop{
  display:initial!important;
  visibility:visible!important;
}

/* Spin the actual ghost-grid SVG */
.aehGhostGeometry,
.ghost-geometry{
  --ghostSpinSpeed:14s;
  --ghostGridScale:1;
  display:block!important;
  visibility:visible!important;
  transform-origin:50% 50%!important;
  transform-box:view-box!important;
  animation:aehGhostGridForceSpin var(--ghostSpinSpeed) linear infinite!important;
  will-change:transform, opacity, filter;
}

/* Make movement visible: spinning grid + moving light trace on lines */
.aehGhostGeometry circle,
.aehGhostGeometry polygon,
.aehGhostGeometry line,
.ghost-geometry circle,
.ghost-geometry polygon,
.ghost-geometry line{
  stroke-dasharray:7 5!important;
  animation:aehGhostStrokeFlow 2.8s linear infinite!important;
}

/* Normal state: faint but moving */
.aehPortalTarget .aehGhostGeometry,
#ariaPortal .aehGhostGeometry,
.aria-portal .aehGhostGeometry,
.portal .aehGhostGeometry,
.aria-stage .ghost-geometry{
  opacity:.24!important;
  filter:
    drop-shadow(0 0 6px rgba(255,228,138,.18))
    drop-shadow(0 0 12px rgba(25,247,230,.10))!important;
}

/* Hover: wake it up */
#ariaPortal:hover .aehGhostGeometry,
.aria-portal:hover .aehGhostGeometry,
.portal:hover .aehGhostGeometry,
.aria-stage:hover .aehGhostGeometry,
.aehPortalTarget.aehHover .aehGhostGeometry,
.aria-stage:hover .ghost-geometry,
.aehPortalTarget.aehHover .ghost-geometry{
  --ghostSpinSpeed:8s;
  --ghostGridScale:1.04;
  opacity:.58!important;
  filter:
    drop-shadow(0 0 10px rgba(255,228,138,.40))
    drop-shadow(0 0 18px rgba(25,247,230,.26))!important;
}

/* Speaking: faster golden lock-spin */
.aehPortalTarget.aehSpeaking .aehGhostGeometry,
.aria-stage.is-speaking .ghost-geometry{
  --ghostSpinSpeed:5.5s;
  --ghostGridScale:1.07;
  opacity:.68!important;
  filter:
    drop-shadow(0 0 12px rgba(255,228,138,.52))
    drop-shadow(0 0 22px rgba(25,247,230,.25))!important;
}

/* Listening: green/cyan spin */
.aehPortalTarget.aehListening .aehGhostGeometry,
.aria-stage.is-listening .ghost-geometry{
  --ghostSpinSpeed:6.5s;
  --ghostGridScale:1.06;
  opacity:.66!important;
  filter:
    drop-shadow(0 0 12px rgba(56,255,117,.45))
    drop-shadow(0 0 22px rgba(25,247,230,.34))!important;
}

.aehPortalTarget.aehListening .aehGhostGeometry circle,
.aehPortalTarget.aehListening .aehGhostGeometry polygon,
.aehPortalTarget.aehListening .aehGhostGeometry line,
.aria-stage.is-listening .ghost-geometry circle,
.aria-stage.is-listening .ghost-geometry polygon,
.aria-stage.is-listening .ghost-geometry line{
  stroke:rgba(56,255,117,.58)!important;
}

/* Rotation + pulse. The translateZ helps the browser repaint it. */
@keyframes aehGhostGridForceSpin{
  0%{
    transform:translateZ(0) scale(var(--ghostGridScale)) rotate(0deg);
  }
  100%{
    transform:translateZ(0) scale(var(--ghostGridScale)) rotate(360deg);
  }
}

/* Makes motion obvious even with symmetrical sacred geometry */
@keyframes aehGhostStrokeFlow{
  0%{
    stroke-dashoffset:0;
  }
  100%{
    stroke-dashoffset:-48;
  }
}

/* Small exception: if the user's OS requests reduced motion, slow it down instead of killing it */
@media (prefers-reduced-motion: reduce){
  .aehGhostGeometry,
  .ghost-geometry{
    --ghostSpinSpeed:45s!important;
  }

  .aehGhostGeometry circle,
  .aehGhostGeometry polygon,
  .aehGhostGeometry line,
  .ghost-geometry circle,
  .ghost-geometry polygon,
  .ghost-geometry line{
    animation-duration:9s!important;
  }
}
