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);
}

.btn {
  box-sizing: border-box;
  position: relative;
  width: 240px;
  height: 64px;
  border: none;
  border-radius: 999px;
  background: #2f6df6;
  color: #fff7e6;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition: background-color 220ms ease-in-out;
}

.btn__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.btn__loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}

.btn__track {
  position: relative;
  width: 168px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.25);
  overflow: hidden;
}

.btn__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  border-radius: 999px;
  background: #fff7e6;
  transform: translateX(-60px);
}

.btn.is-busy {
  background: #6f67b4;
}

.btn.is-busy .btn__label {
  opacity: 0;
}

.btn.is-busy .btn__loader {
  opacity: 1;
}

.btn__label, .btn__loader {
  transition: opacity 220ms ease-in-out;
}

.btn.is-busy .btn__bar {
  animation: bar-run 1s ease-in-out infinite;
}

.btn:focus-visible {
  outline: 3px solid #ffd23f;
  outline-offset: 4px;
}

.stage.is-demo .btn {
  animation: busy-bg 2s ease-in-out infinite;
}

.stage.is-demo .btn__label {
  animation: label-out 2s ease-in-out infinite;
}

.stage.is-demo .btn__loader {
  animation: loader-in 2s ease-in-out infinite;
}

.stage.is-demo .btn__bar {
  animation: bar-run 1s ease-in-out infinite;
}

@keyframes busy-bg {
  0%, 15% {
    background: #2f6df6;
  }
  25%, 85% {
    background: #6f67b4;
  }
  95%, 100% {
    background: #2f6df6;
  }
}
@keyframes label-out {
  0%, 15% {
    opacity: 1;
  }
  25%, 85% {
    opacity: 0;
  }
  95%, 100% {
    opacity: 1;
  }
}
@keyframes loader-in {
  0%, 15% {
    opacity: 0;
  }
  25%, 85% {
    opacity: 1;
  }
  95%, 100% {
    opacity: 0;
  }
}
@keyframes bar-run {
  0% {
    transform: translateX(-60px);
  }
  100% {
    transform: translateX(168px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .btn, .stage.is-demo .btn__label,
  .stage.is-demo .btn__loader, .stage.is-demo .btn__bar {
    animation: none;
  }
  .stage.is-demo .btn__bar {
    transform: translateX(54px);
  }
}
