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

.ec {
  --h: clamp(148px, 58vh, 176px);
  width: min(300px, 90vw);
}

.ec__scroller {
  height: var(--h);
  overflow-y: auto;
  scrollbar-width: none;
}
.ec__scroller::-webkit-scrollbar {
  display: none;
}

.ec__doc {
  display: grid;
  gap: 12px;
  padding: 8px 0;
}

.ec__line {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.22);
}

.ec__line--short {
  width: 52%;
}

.ec__line--mid {
  width: 78%;
}

.ec__end {
  display: flex;
  align-items: flex-end;
  height: var(--h);
  view-timeline-name: --ec-end;
  view-timeline-axis: block;
}

.ec__bar {
  position: sticky;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 16px;
  background: #fff7e6;
  transform: translateY(140%);
  animation-name: ec-rise;
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-fill-mode: both;
  animation-timeline: --ec-end;
  animation-range: entry 0% entry 80%;
}

@keyframes ec-rise {
  from {
    transform: translateY(140%);
  }
  to {
    transform: translateY(0);
  }
}
.ec__txt {
  color: #17141a;
  font-size: 13px;
  line-height: 18px;
  font-weight: 800;
}

.ec__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #4cd4a6;
  color: #17141a;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  transform: scale(0.82);
  animation-name: ec-pop;
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-fill-mode: both;
  animation-timeline: --ec-end;
  animation-range: entry 24% entry 100%;
}

@keyframes ec-pop {
  from {
    transform: scale(0.82);
  }
  to {
    transform: scale(1);
  }
}
.ec.is-demo .ec__scroller {
  position: relative;
}

.ec.is-demo .ec__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  width: auto;
  animation-name: ec-rise-demo;
  animation-duration: 1s;
  animation-timing-function: ease-in;
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-timeline: auto;
}

.ec.is-demo .ec__btn {
  animation-name: ec-pop-demo;
  animation-duration: 1s;
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-timeline: auto;
}

@keyframes ec-rise-demo {
  0%, 16% {
    transform: translateY(220%);
  }
  70%, 100% {
    transform: translateY(0);
  }
}
@keyframes ec-pop-demo {
  0%, 72% {
    transform: scale(0.82);
  }
  88%, 100% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ec__bar {
    animation: none !important;
    transform: translateY(0);
  }
  .ec__btn {
    animation: none !important;
    transform: scale(1);
  }
}
