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

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

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

.sm__panel {
  box-sizing: border-box;
  width: clamp(184px, 58vw, 216px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sm__label {
  margin: 0;
  font-weight: 700;
  font-size: clamp(11px, 2.8vw, 13px);
  line-height: 1;
  letter-spacing: 0.16em;
  color: #17141a;
}

.sm__rail {
  position: relative;
  box-sizing: border-box;
  width: 124px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(23, 20, 26, 0.95), rgba(23, 20, 26, 0.78));
  box-shadow: inset 0 3px 6px rgba(23, 20, 26, 0.9), inset 0 -1px 0 rgba(255, 247, 230, 0.22);
}

.sm__band {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 56px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c2361a, rgba(23, 20, 26, 0.55));
  box-shadow: inset 0 2px 3px rgba(23, 20, 26, 0.5);
}

.sm__handle {
  --travel: 56px;
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 2;
  box-sizing: border-box;
  width: 56px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, rgba(255, 247, 230, 0.92) 58%, rgba(23, 20, 26, 0.22));
  box-shadow: 0 3px 6px rgba(23, 20, 26, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateX(0);
  transition: transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

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

.sm__grip {
  position: absolute;
  left: calc(50% - 9px);
  top: calc(50% - 7px);
  width: 18px;
  height: 14px;
  background: linear-gradient(90deg, rgba(23, 20, 26, 0.34) 2px, transparent 2px) 0 0/8px 100% repeat-x, linear-gradient(90deg, rgba(255, 255, 255, 0.9) 1px, transparent 1px) 3px 0/8px 100% repeat-x;
}

.sm__state {
  position: relative;
  margin: 0;
  width: 108px;
  height: 18px;
}

.sm__wordOn, .sm__wordOff {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(12px, 3vw, 14px);
  line-height: 1;
  color: #17141a;
}

.sm__wordOff {
  display: none;
}

.sm.is-muted .sm__handle {
  transform: translateX(var(--travel));
}

.sm.is-muted .sm__wordOn {
  display: none;
}

.sm.is-muted .sm__wordOff {
  display: flex;
}

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

@keyframes smSlide {
  0% {
    transform: translateX(0);
  }
  8% {
    transform: translateX(0);
  }
  36% {
    transform: translateX(calc(var(--travel) + 4px));
  }
  42% {
    transform: translateX(calc(var(--travel) - 2px));
  }
  46% {
    transform: translateX(var(--travel));
  }
  72% {
    transform: translateX(var(--travel));
  }
  82% {
    transform: translateX(-4px);
  }
  86% {
    transform: translateX(2px);
  }
  90% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}
.sm.is-demo .sm__wordOff {
  display: flex;
  opacity: 0;
}

.sm.is-demo .sm__wordOn {
  opacity: 1;
}

.sm.is-demo .sm__wordOff {
  animation-name: smWordOff;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes smWordOff {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  84% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.sm.is-demo .sm__wordOn {
  animation-name: smWordOn;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes smWordOn {
  0% {
    opacity: 1;
  }
  40% {
    opacity: 0;
  }
  84% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@media (max-width: 340px) {
  .sm__panel {
    gap: 8px;
    padding: 12px;
    width: clamp(160px, 82vw, 184px);
  }
  .sm__rail {
    width: 108px;
    height: 40px;
  }
  .sm__band {
    width: 48px;
    height: 32px;
  }
  .sm__handle {
    --travel: 52px;
    width: 48px;
    height: 32px;
  }
  .sm__state {
    width: 96px;
    height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sm .sm__handle {
    transition: none !important;
  }
  .sm.is-demo .sm__handle {
    animation: none !important;
    transform: translateX(0) !important;
  }
  .sm.is-demo .sm__wordOff {
    animation: none !important;
    opacity: 0 !important;
  }
  .sm.is-demo .sm__wordOn {
    animation: none !important;
    opacity: 1 !important;
  }
}
