html, body {
  margin: 0;
  overflow: hidden;
}

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

.btn {
  box-sizing: border-box;
  position: relative;
  width: 240px;
  height: 64px;
  border: none;
  background: none;
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
}

.btn__fill {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(47, 109, 246, 0.14);
  opacity: 0;
}

.btn__label {
  position: relative;
  z-index: 1;
}

.btn__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.btn__rect {
  fill: none;
  stroke: #2f6df6;
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.btn:hover .btn__rect {
  animation: draw-hover 600ms ease-out 1 forwards;
}

.btn__fill {
  transition: opacity 300ms ease-out 220ms;
}

.btn:hover .btn__fill {
  opacity: 1;
}

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

.stage.is-demo .btn__rect {
  animation: draw 2s ease-out infinite;
}

.stage.is-demo .btn__fill {
  animation: fill-in 2s ease-out infinite;
}

@keyframes draw {
  0%, 12% {
    stroke-dashoffset: 100;
  }
  55% {
    stroke-dashoffset: 0;
  }
  92% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 100;
  }
}
@keyframes draw-hover {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}
@keyframes fill-in {
  0%, 55% {
    opacity: 0;
  }
  72%, 92% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover .btn__rect, .stage.is-demo .btn__rect {
    animation: none;
    stroke-dashoffset: 0;
  }
  .btn:hover .btn__fill, .stage.is-demo .btn__fill {
    animation: none;
    opacity: 1;
  }
}
