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

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

.sg {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.sg__bar {
  position: relative;
  box-sizing: border-box;
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background-color: #17141a;
}

.sg__pill {
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 80px;
  border-radius: 999px;
  background-color: #ffd23f;
  transform: translateX(0);
}

.sg__seg {
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  width: 80px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background-color: transparent;
  color: #fff7e6;
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.sg__seg:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 2px;
}

.sg__seg[aria-checked=true] {
  color: #17141a;
}

.sg:not(.is-demo) .sg__pill {
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sg:not(.is-demo) .sg__bar[data-at="1"] .sg__pill {
  transform: translateX(80px);
}

.sg:not(.is-demo) .sg__bar[data-at="2"] .sg__pill {
  transform: translateX(160px);
}

.sg__note {
  margin: 0;
  max-width: 288px;
  text-align: center;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: #17141a;
}

.sg.is-demo .sg__pill {
  animation-name: sg-slide;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes sg-slide {
  0% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(0);
  }
  34% {
    transform: translateX(80px);
  }
  50% {
    transform: translateX(80px);
  }
  64% {
    transform: translateX(160px);
  }
  76% {
    transform: translateX(160px);
  }
  90% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}
.sg.is-demo .sg__seg {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.sg.is-demo .sg__seg[data-at="0"] {
  animation-name: sg-a;
}

.sg.is-demo .sg__seg[data-at="1"] {
  animation-name: sg-b;
}

.sg.is-demo .sg__seg[data-at="2"] {
  animation-name: sg-c;
}

@keyframes sg-a {
  0% {
    color: #17141a;
  }
  26% {
    color: #fff7e6;
  }
  84% {
    color: #17141a;
  }
  100% {
    color: #17141a;
  }
}
@keyframes sg-b {
  0% {
    color: #fff7e6;
  }
  26% {
    color: #17141a;
  }
  58% {
    color: #fff7e6;
  }
  100% {
    color: #fff7e6;
  }
}
@keyframes sg-c {
  0% {
    color: #fff7e6;
  }
  58% {
    color: #17141a;
  }
  84% {
    color: #fff7e6;
  }
  100% {
    color: #fff7e6;
  }
}
@media (max-width: 340px) {
  .sg {
    gap: 8px;
  }
  .sg__note {
    font-size: 11px;
    line-height: 16px;
    max-width: 200px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sg.is-demo .sg__pill,
  .sg.is-demo .sg__seg {
    animation: none !important;
  }
  .sg:not(.is-demo) .sg__pill {
    transition: none !important;
  }
  .sg.is-demo .sg__seg[data-at="0"] {
    color: #17141a;
  }
}
