@media only screen and (min-width: 800px) {.d0headerspace {align-items: flex-start;}}

.glitch {
  position: relative;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* Fade-out effect */
.glitch.fade {
  opacity: 0;
  filter: blur(3px);
}

/* duplicate layers for RGB split */
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  clip: rect(0, 900px, 0, 0);
  opacity: 0;
}

/* activate glitch only during switch */
.glitch.glitch-active::before,
.glitch.glitch-active::after {
  opacity: 1;
}

.glitch.glitch-active::before {
  left: 2px;
  text-shadow: -2px 0 red;
  animation: glitch-anim 0.4s linear;
}

.glitch.glitch-active::after {
  left: -2px;
  text-shadow: -2px 0 blue;
  animation: glitch-anim2 0.4s linear;
}

/* glitch motion keyframes */
@keyframes glitch-anim {
  0% { clip: rect(10px, 9999px, 80px, 0); }
  20% { clip: rect(50px, 9999px, 100px, 0); }
  40% { clip: rect(30px, 9999px, 70px, 0); }
  60% { clip: rect(60px, 9999px, 90px, 0); }
  80% { clip: rect(40px, 9999px, 100px, 0); }
  100% { clip: rect(10px, 9999px, 60px, 0); }
}

@keyframes glitch-anim2 {
  0% { clip: rect(40px, 9999px, 90px, 0); }
  20% { clip: rect(20px, 9999px, 70px, 0); }
  40% { clip: rect(60px, 9999px, 100px, 0); }
  60% { clip: rect(30px, 9999px, 70px, 0); }
  80% { clip: rect(50px, 9999px, 80px, 0); }
  100% { clip: rect(40px, 9999px, 100px, 0); }
}
