@property --p {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}
@property --d {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}
html, body {
  margin: 0;
  overflow: hidden;
}

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

.sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 164px;
  justify-content: center;
}

.sm:focus-visible {
  outline: 2px solid #0a4fe8;
  outline-offset: 3px;
  border-radius: 12px;
}

.sm__svg {
  transform: rotate(-90deg);
}

.sm__track {
  fill: none;
  stroke: rgba(23, 20, 26, 0.16);
  stroke-width: 8;
}

.sm__ring {
  fill: none;
  stroke: #0a4fe8;
  stroke-width: 8;
  stroke-linecap: round;
  --circ: 0;
  --p: 0;
  stroke-dasharray: var(--circ);
  stroke-dashoffset: calc(var(--circ) * (1 - var(--p) / 100));
  transition: stroke-dashoffset 220ms linear;
}

.sm__check {
  fill: none;
  stroke: #0a4fe8;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(90deg);
  transform-origin: 60px 60px;
  --checklen: 0;
  --d: 0;
  stroke-dasharray: var(--checklen);
  stroke-dashoffset: calc(var(--checklen) * (1 - var(--d) / 100));
  opacity: 0;
}

.sm__ring {
  opacity: 1;
}

.sm.is-done .sm__ring {
  opacity: 0;
  transition: opacity 140ms linear;
}

.sm.is-done .sm__check {
  opacity: 1;
  transition: stroke-dashoffset 600ms ease-out, opacity 140ms linear;
}

.sm.is-done .sm__check {
  --d: 100;
}

.sm__bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sm__label {
  font-weight: 600;
  font-size: 11px;
  color: rgba(23, 20, 26, 0.82);
}

.sm__meta {
  font-weight: 500;
  font-size: 10px;
  color: rgba(23, 20, 26, 0.62);
}

@keyframes smRingArc {
  0% {
    --p: 0;
  }
  66% {
    --p: 100;
    animation-timing-function: steps(1, end);
  }
  67% {
    opacity: 0;
  }
  88% {
    opacity: 0;
  }
  92% {
    opacity: 0;
    --p: 0;
  }
  94% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    --p: 0;
  }
}
@keyframes smCheckDraw {
  0%, 66% {
    opacity: 0;
    --d: 0;
  }
  67% {
    opacity: 1;
    animation-timing-function: ease-out;
  }
  80% {
    --d: 100;
  }
  88% {
    --d: 100;
    opacity: 1;
  }
  92% {
    opacity: 0;
    --d: 0;
  }
  100% {
    opacity: 0;
    --d: 0;
  }
}
.is-demo .sm__ring {
  animation-name: smRingArc;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.is-demo .sm__check {
  animation-name: smCheckDraw;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@media (max-width: 340px) {
  .sm__svg {
    width: 60px;
    height: 60px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .sm__ring, .is-demo .sm__check {
    animation: none !important;
  }
  .is-demo .sm__ring {
    opacity: 0 !important;
  }
  .is-demo .sm__check {
    opacity: 1 !important;
    --d: 100 !important;
  }
}
