html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.glitch {
  position: relative;
  font-weight: 800;
  font-size: clamp(26px, 8.4vw, 42px);
  line-height: 1.2;
  font-family: inherit;
  text-align: center;
}

.glitch__base, .glitch__r, .glitch__b {
  display: block;
  margin: 0;
}

.glitch__base {
  color: #fff7e6;
}

.glitch__r, .glitch__b {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
}

.glitch__r {
  color: #c2361a;
  animation: glitch-r 2s linear infinite;
}

.glitch__b {
  color: #2f6df6;
  animation: glitch-b 2s linear infinite;
}

.glitch .letter {
  display: inline-block;
  animation: letter-blur-in 2s ease-out infinite;
  animation-delay: calc(var(--i) * 25ms + var(--n) * 50ms);
}

@keyframes glitch-r {
  0% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
  8% {
    transform: translateX(-6px);
    clip-path: inset(12% 0 58% 0);
  }
  16% {
    transform: translateX(4px);
    clip-path: inset(48% 0 14% 0);
  }
  24% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
  50% {
    transform: translateX(-4px);
    clip-path: inset(20% 0 40% 0);
  }
  58% {
    transform: translateX(5px);
    clip-path: inset(55% 0 8% 0);
  }
  66% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
  100% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
}
@keyframes glitch-b {
  0% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
  8% {
    transform: translateX(6px);
    clip-path: inset(58% 0 10% 0);
  }
  16% {
    transform: translateX(-4px);
    clip-path: inset(14% 0 48% 0);
  }
  24% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
  50% {
    transform: translateX(4px);
    clip-path: inset(40% 0 22% 0);
  }
  58% {
    transform: translateX(-5px);
    clip-path: inset(8% 0 55% 0);
  }
  66% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
  100% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
}
@keyframes letter-blur-in {
  0%, 2% {
    filter: blur(8px);
  }
  10%, 100% {
    filter: blur(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .glitch__r, .glitch__b {
    animation: none;
    opacity: 0;
  }
  .glitch .letter {
    animation: none;
    filter: none;
  }
}
