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

@property --t {
  syntax: "<integer>";
  initial-value: 9;
  inherits: true;
}
.counter {
  --t: 9;
  text-align: center;
  color: #fff7e6;
}
.counter__num {
  counter-reset: t var(--t);
  display: block;
  font-weight: 800;
  font-size: clamp(44px, 14vw, 72px);
  line-height: 1;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.counter__num::before {
  content: counter(t);
}
.counter__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.counter__bar {
  display: block;
  width: clamp(90px, 26vw, 130px);
  height: 6px;
  margin: clamp(10px, 3vw, 14px) auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.counter__bar::after {
  content: "";
  display: block;
  height: 100%;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(calc(var(--t) / 9));
}
.counter__label {
  display: block;
  margin-top: clamp(6px, 2vw, 10px);
  font-weight: 600;
  font-size: clamp(12px, 3.4vw, 15px);
  line-height: 1;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.6);
}

.counter.is-demo {
  animation: count-down 2s ease-out infinite;
}

@keyframes count-down {
  0% {
    --t: 9;
    color: #fff7e6;
  }
  60% {
    --t: 3;
    color: #fff7e6;
  }
  85% {
    --t: 0;
    color: #c2361a;
  }
  100% {
    --t: 0;
    color: #c2361a;
  }
}
@media (prefers-reduced-motion: reduce) {
  .counter.is-demo {
    animation: none;
    --t: 0;
    color: #c2361a;
  }
}
