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

@property --num {
  syntax: "<integer>";
  initial-value: 0;
  inherits: false;
}
.viewport {
  position: relative;
  width: min(100%, 220px);
  height: clamp(140px, 38vw, 170px);
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.track {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  text-align: center;
}
.card__num {
  --num: 0;
  counter-reset: num var(--num);
  display: block;
  font-weight: 800;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  color: #fff7e6;
}
.card__num::before {
  content: counter(num);
}
.card__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.card__label {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  font-size: clamp(11px, 3.2vw, 13px);
  line-height: 1;
  font-family: inherit;
  color: #17141a;
}
.card__num {
  animation-play-state: paused;
}
.card.is-counting .card__num {
  animation-play-state: running;
}

.viewport.is-demo .track {
  animation: scroll-pass 2s ease-out infinite;
}

.viewport.is-demo .card__num {
  animation: count-when-visible 2s ease-out infinite;
}

@keyframes scroll-pass {
  0% {
    transform: translateY(64px);
  }
  20%, 75% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-64px);
  }
}
@keyframes count-when-visible {
  0%, 20% {
    --num: 0;
  }
  60% {
    --num: 1280;
  }
  100% {
    --num: 1280;
  }
}
@media (prefers-reduced-motion: reduce) {
  .viewport.is-demo .track {
    animation: none;
    transform: translateY(0);
  }
  .viewport.is-demo .card__num {
    animation: none;
    --num: 1280;
  }
}
