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;
  margin: 0;
  font-weight: 800;
  font-size: clamp(26px, 8.2vw, 42px);
  line-height: 1.2;
  font-family: inherit;
  text-align: center;
}

.glitch__base, .glitch__r, .glitch__b {
  display: block;
  grid-area: 1/1;
}

.glitch {
  display: grid;
}

.glitch__base {
  background: linear-gradient(90deg, #c2361a, #2f6df6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: hue-jump 2s steps(2, jump-none) infinite;
}

.glitch__r, .glitch__b {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 7px);
  mask-image: repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 7px);
}

.glitch__r {
  color: #c2361a;
  animation: mask-jump-r 2s steps(2, jump-none) infinite;
}

.glitch__b {
  color: #2f6df6;
  animation: mask-jump-b 2s steps(2, jump-none) infinite;
}

@keyframes mask-jump-r {
  0%, 40%, 100% {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
    opacity: 0;
  }
  45%, 55% {
    -webkit-mask-position: 0 3px;
    mask-position: 0 3px;
    opacity: 0.9;
  }
}
@keyframes mask-jump-b {
  0%, 60%, 100% {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
    opacity: 0;
  }
  65%, 75% {
    -webkit-mask-position: 0 -3px;
    mask-position: 0 -3px;
    opacity: 0.9;
  }
}
@keyframes hue-jump {
  0%, 48%, 52%, 100% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(35deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .glitch__base {
    animation: none;
  }
  .glitch__r, .glitch__b {
    animation: none;
    opacity: 0;
  }
}
