.glitch-button,
.glitch-button:after {
  display: inline-block;
  text-decoration: none;
  font-family: 'Roboto';
  width: 150px;
  height: 40px;
  line-height: 40px;
  font-size: 14px;
  background: linear-gradient(45deg, transparent 5%, #a72943 5%);
  border: 0;
  color: #fff;
  letter-spacing: 2px;
  box-shadow: 6px 0px 0px #262626;
  outline: transparent;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  text-align: center;
  cursor: pointer;
}

.glitch-button:after {
  --slice-0: inset(50% 50% 50% 50%);
  --slice-1: inset(80% -6px 0 0);
  --slice-2: inset(50% -6px 30% 0);
  --slice-3: inset(10% -6px 85% 0);
  --slice-4: inset(40% -6px 43% 0);
  --slice-5: inset(80% -6px 5% 0);

  content: 'Join Now';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 3%,
    #00e6f6 3%,
    #00e6f6 5%,
    #e21840 5%
  );
  text-shadow: -3px -3px 0px #f8f005, 3px 3px 0px #00e6f6;
  clip-path: var(--slice-0);
}

.glitch-button:hover:after {
  animation: 1s glitch-btn;
  animation-timing-function: steps(2, end);
}

.glitch-button:hover {
  color: inherit;
}

@keyframes glitch-btn {
  0% {
    clip-path: var(--slice-1);
    transform: translate(-20px, -10px);
  }
  10% {
    clip-path: var(--slice-3);
    transform: translate(10px, 10px);
  }
  20% {
    clip-path: var(--slice-1);
    transform: translate(-10px, 10px);
  }
  30% {
    clip-path: var(--slice-3);
    transform: translate(0px, 5px);
  }
  40% {
    clip-path: var(--slice-2);
    transform: translate(-5px, 0px);
  }
  50% {
    clip-path: var(--slice-3);
    transform: translate(5px, 0px);
  }
  60% {
    clip-path: var(--slice-4);
    transform: translate(5px, 10px);
  }
  70% {
    clip-path: var(--slice-2);
    transform: translate(-10px, 10px);
  }
  80% {
    clip-path: var(--slice-5);
    transform: translate(20px, -10px);
  }
  90% {
    clip-path: var(--slice-1);
    transform: translate(-10px, 0px);
  }
  100% {
    clip-path: var(--slice-1);
    transform: translate(0);
  }
}

.glitch-text {
  display: grid;
  grid-template-columns: 1fr;
  color: white;
}

.glitch-text span {
  font-size: 20px;
}

.glitch-text span,
.glitch-text h1 {
  grid-row-start: 1;
  grid-column-start: 1;
  --stack-height: calc(100% / var(--stacks) - 1px);
  --inverse-index: calc(calc(var(--stacks) - 1) - var(--index));
  --clip-top: calc(var(--stack-height) * var(--index));
  --clip-bottom: calc(var(--stack-height) * var(--inverse-index));
  clip-path: inset(var(--clip-top) 0 var(--clip-bottom) 0);
  animation: glitch-text-init 300ms cubic-bezier(0.46, 0.29, 0, 1.24) 1
      backwards calc(var(--index) * 120ms),
    glitch-text 2s ease infinite 4s alternate-reverse;
}

.glitch-text span:nth-child(odd) {
  --glitch-translate: 8px;
}
.glitch-text span:nth-child(even) {
  --glitch-translate: -8px;
}

@keyframes glitch-text-init {
  0% {
    opacity: 0;
    transform: translateX(-50%);
    text-shadow: -3px 4px 0 red, 3px -4px 0 blue;
  }
  60% {
    opacity: 0.5;
    transform: translateX(50%);
  }
  80% {
    transform: none;
    opacity: 1;
    text-shadow: 3px -4px 0 red, -3px 4px 0 blue;
  }
  100% {
    text-shadow: none;
  }
}

@keyframes glitch-text {
  0% {
    text-shadow: -3px 4px 0 red, 3px -4px 0 blue;
    transform: translate(var(--glitch-translate));
  }
  2% {
    text-shadow: 3px -4px 0 red, -3px 4px 0 blue;
  }
  4%,
  100% {
    text-shadow: none;
    transform: none;
  }
}

@media only screen and (max-width: 575px) {
  .glitch-text span {
    font-size: 16px;
  }
}
