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 --p {
  syntax: "<integer>";
  inherits: true;
  initial-value: 0;
}
.dl {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(280px, 86vw);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.dl__btn {
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 48px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background-color: #fff7e6;
  color: #17141a;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.dl__btn:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 3px;
}

.dl__fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-image: linear-gradient(90deg, #2f6df6 0 calc(var(--p) * 1%), transparent calc(var(--p) * 1%) 100%);
}

.dl__face {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
}

.dl__ic {
  display: inline-flex;
  flex: 0 0 auto;
}

.dl__ic svg {
  display: block;
}

.dl__t {
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.dl__pct::after {
  counter-reset: p var(--p);
  content: counter(p) "%";
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dl:not(.is-demo) .dl__btn[data-state=idle] .dl__face[data-face=idle],
.dl:not(.is-demo) .dl__btn[data-state=busy] .dl__face[data-face=busy],
.dl:not(.is-demo) .dl__btn[data-state=done] .dl__face[data-face=done] {
  opacity: 1;
}

.dl:not(.is-demo) .dl__btn[data-state=busy] .dl__face[data-face=busy] {
  color: #fff7e6;
}

.dl:not(.is-demo) .dl__btn[data-state=done] .dl__fill {
  background-image: none;
  background-color: #4cd4a6;
}

.dl__note {
  margin: 0;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: #fff7e6;
}

.dl.is-demo .dl__btn {
  animation-name: dl-p, dl-skin;
  animation-duration: 2s, 2s;
  animation-timing-function: linear, steps(1, end);
  animation-iteration-count: infinite, infinite;
}

@keyframes dl-p {
  0% {
    --p: 0;
  }
  12% {
    --p: 0;
  }
  78% {
    --p: 100;
  }
  100% {
    --p: 100;
  }
}
@keyframes dl-skin {
  0% {
    background-color: #fff7e6;
  }
  82% {
    background-color: #4cd4a6;
  }
  88% {
    background-color: #fff7e6;
  }
  100% {
    background-color: #fff7e6;
  }
}
.dl.is-demo .dl__face {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.dl.is-demo .dl__face[data-face=idle] {
  animation-name: dl-idle;
}

.dl.is-demo .dl__face[data-face=busy] {
  animation-name: dl-busy;
}

.dl.is-demo .dl__face[data-face=done] {
  animation-name: dl-done;
}

@keyframes dl-idle {
  0% {
    opacity: 1;
  }
  12% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes dl-busy {
  0% {
    opacity: 0;
    color: #17141a;
  }
  12% {
    opacity: 1;
    color: #17141a;
  }
  40% {
    opacity: 1;
    color: #fff7e6;
  }
  82% {
    opacity: 0;
    color: #fff7e6;
  }
  100% {
    opacity: 0;
    color: #fff7e6;
  }
}
@keyframes dl-done {
  0% {
    opacity: 0;
  }
  82% {
    opacity: 1;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.dl.is-demo .dl__fill {
  animation-name: dl-veil;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes dl-veil {
  0% {
    opacity: 1;
  }
  82% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@media (max-width: 340px) {
  .dl {
    gap: 8px;
  }
  .dl__btn {
    height: 44px;
  }
  .dl__t {
    font-size: 13px;
    line-height: 18px;
  }
  .dl__note {
    font-size: 11px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dl.is-demo .dl__btn,
  .dl.is-demo .dl__face,
  .dl.is-demo .dl__fill {
    animation: none !important;
  }
  .dl.is-demo .dl__face[data-face=idle] {
    opacity: 1;
  }
}
