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

.sp {
  --h: clamp(148px, 58vh, 176px);
  --frame: 168px;
  width: min(360px, 92vw);
}

.sp__scroller {
  height: var(--h);
  overflow-y: auto;
  scroll-timeline-name: --sp-scroll;
  scroll-timeline-axis: block;
  scrollbar-width: none;
}
.sp__scroller::-webkit-scrollbar {
  display: none;
}

.sp__pad {
  height: calc(var(--h) * 2.2);
}

.sp__pin {
  position: sticky;
  top: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.sp__window {
  width: var(--frame);
  height: 104px;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(23, 20, 26, 0.78);
}

.sp__strip {
  display: flex;
  width: max-content;
  animation-name: sp-scrub;
  animation-duration: 1s;
  animation-timing-function: steps(8, jump-none);
  animation-fill-mode: both;
  animation-timeline: --sp-scroll;
}

@keyframes sp-scrub {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-87.5%);
  }
}
.sp__frame {
  position: relative;
  flex: 0 0 var(--frame);
  width: var(--frame);
  height: 104px;
  overflow: hidden;
}

.sp__frame:nth-child(1) {
  --i: 0;
}

.sp__frame:nth-child(2) {
  --i: 1;
}

.sp__frame:nth-child(3) {
  --i: 2;
}

.sp__frame:nth-child(4) {
  --i: 3;
}

.sp__frame:nth-child(5) {
  --i: 4;
}

.sp__frame:nth-child(6) {
  --i: 5;
}

.sp__frame:nth-child(7) {
  --i: 6;
}

.sp__frame:nth-child(8) {
  --i: 7;
}

.sp__box {
  position: absolute;
  left: 40px;
  bottom: 20px;
  width: 88px;
  height: 40px;
  border-radius: 8px;
  background: #fff7e6;
}

.sp__lid {
  position: absolute;
  left: 40px;
  bottom: 60px;
  width: 88px;
  height: 12px;
  border-radius: 4px;
  background: #ffd23f;
  transform-origin: left bottom;
  transform: rotate(calc(var(--i) * -14deg));
}

.sp__item {
  position: absolute;
  left: 72px;
  bottom: 48px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4cd4a6;
  opacity: calc(var(--i) / 7);
  transform: translateY(calc(var(--i) * -6px));
}

.sp__hint {
  margin: 0;
  color: #17141a;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}

.sp.is-demo .sp__strip {
  animation-duration: 1s;
  animation-timing-function: steps(8, jump-none);
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-timeline: auto;
}

@media (prefers-reduced-motion: reduce) {
  .sp__strip {
    animation: none !important;
    transform: translateX(-62.5%);
  }
}
