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

.sg {
  display: grid;
  place-items: center;
  width: 100%;
}

.sg__track {
  --travel: 116px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 240px;
  height: 48px;
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.1), rgba(255, 247, 230, 0.02) 30%, rgba(23, 20, 26, 0.35)), #0a4fe8;
  box-shadow: inset 0 1px 0 rgba(255, 247, 230, 0.28), inset 0 -1px 0 rgba(23, 20, 26, 0.45), 0 10px 22px rgba(0, 0, 0, 0.4);
}

.sg__knob {
  position: absolute;
  left: 8px;
  top: 4px;
  width: 108px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.16), rgba(255, 247, 230, 0.02) 34%, rgba(0, 0, 0, 0.38)), #17141a;
  box-shadow: inset 0 1px 0 rgba(255, 247, 230, 0.3), 0 4px 10px rgba(0, 0, 0, 0.5);
  transform: translateX(0);
  transition: transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.sg__knob::before, .sg__knob::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 6px;
  height: 16px;
  background-image: linear-gradient(90deg, rgba(255, 247, 230, 0.22) 0 2px, transparent 2px 4px, rgba(255, 247, 230, 0.22) 4px 6px);
}

.sg__knob::before {
  left: 12px;
}

.sg__knob::after {
  right: 12px;
}

.sg__cell {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  color: rgba(255, 247, 230, 0.85);
}

.sg__cell[aria-pressed=true] {
  color: #fff7e6;
}

.sg__cell:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

.sg.is-week .sg__knob {
  transform: translateX(var(--travel));
}

.sg.is-demo .sg__knob {
  animation-name: sgSweep;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes sgSweep {
  0%, 8% {
    transform: translateX(0);
  }
  24% {
    transform: translateX(calc(var(--travel) + 4px));
  }
  30%, 50% {
    transform: translateX(var(--travel));
  }
  66% {
    transform: translateX(-4px);
  }
  72%, 100% {
    transform: translateX(0);
  }
}
.sg.is-demo .sg__cell {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.sg.is-demo .sg__cell:first-child {
  animation-name: sgDayCut;
}

.sg.is-demo .sg__cell:last-child {
  animation-name: sgWeekCut;
}

@keyframes sgDayCut {
  0%, 30% {
    color: #fff7e6;
  }
  34%, 72% {
    color: rgba(255, 247, 230, 0.85);
  }
  76%, 100% {
    color: #fff7e6;
  }
}
@keyframes sgWeekCut {
  0%, 30% {
    color: rgba(255, 247, 230, 0.85);
  }
  34%, 72% {
    color: #fff7e6;
  }
  76%, 100% {
    color: rgba(255, 247, 230, 0.85);
  }
}
@media (max-width: 340px) {
  .sg__track {
    --travel: 96px;
    width: 200px;
    height: 44px;
  }
  .sg__knob {
    width: 88px;
    height: 36px;
  }
  .sg__knob::before, .sg__knob::after {
    top: 10px;
    height: 14px;
  }
  .sg__cell {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sg .sg__knob {
    transition: none !important;
  }
  .sg.is-demo .sg__knob {
    animation: none !important;
  }
  .sg.is-demo .sg__cell {
    animation: none !important;
  }
}
