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

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

.btn {
  position: relative;
  border: 0;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff7e6;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(194, 54, 26, 0.42), 0 0 0 0 rgba(194, 54, 26, 0.24);
  opacity: 0;
  pointer-events: none;
}

.btn__icon {
  font-size: 28px;
  line-height: 1;
  color: rgba(194, 54, 26, 0.72);
  transition: color 220ms;
}

.btn:active {
  animation: jitter 140ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.btn:active::after {
  animation: ripple-wave 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.btn:active .btn__icon {
  color: #c2361a;
}

.btn.is-demo {
  animation: jitter-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

.btn.is-demo::after {
  animation: ripple-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

.btn.is-demo .btn__icon {
  animation: fill-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

@keyframes jitter {
  0% {
    transform: scale(1) translate(0, 0);
  }
  25% {
    transform: scale(1.18) translate(-2px, 1px);
  }
  50% {
    transform: scale(1.1) translate(2px, -1px);
  }
  75% {
    transform: scale(1.16) translate(-1px, 1px);
  }
  100% {
    transform: scale(1) translate(0, 0);
  }
}
@keyframes jitter-loop {
  0%, 30% {
    transform: scale(1) translate(0, 0);
  }
  38% {
    transform: scale(1.18) translate(-2px, 1px);
  }
  46% {
    transform: scale(1.1) translate(2px, -1px);
  }
  54% {
    transform: scale(1.16) translate(-1px, 1px);
  }
  62%, 100% {
    transform: scale(1) translate(0, 0);
  }
}
@keyframes fill-loop {
  0%, 30% {
    color: rgba(194, 54, 26, 0.72);
  }
  50%, 100% {
    color: #c2361a;
  }
}
@keyframes ripple-wave {
  0% {
    box-shadow: 0 0 0 0 rgba(194, 54, 26, 0.42), 0 0 0 0 rgba(194, 54, 26, 0.24);
    opacity: 1;
  }
  40% {
    box-shadow: 0 0 0 8px rgba(194, 54, 26, 0.18), 0 0 0 3px rgba(194, 54, 26, 0.22);
    opacity: 0.6;
  }
  100% {
    box-shadow: 0 0 0 16px rgba(194, 54, 26, 0), 0 0 0 12px rgba(194, 54, 26, 0);
    opacity: 0;
  }
}
@keyframes ripple-loop {
  0%, 30% {
    box-shadow: 0 0 0 0 rgba(194, 54, 26, 0.42), 0 0 0 0 rgba(194, 54, 26, 0.24);
    opacity: 1;
  }
  46% {
    box-shadow: 0 0 0 8px rgba(194, 54, 26, 0.18), 0 0 0 3px rgba(194, 54, 26, 0.22);
    opacity: 0.6;
  }
  62%, 100% {
    box-shadow: 0 0 0 16px rgba(194, 54, 26, 0), 0 0 0 12px rgba(194, 54, 26, 0);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active {
    animation: none;
  }
  .btn:active::after {
    animation: none !important;
    opacity: 0;
  }
  .btn:active .btn__icon {
    color: #c2361a;
  }
  .btn.is-demo, .btn.is-demo .btn__icon {
    animation: none;
  }
  .btn.is-demo::after {
    animation: none !important;
    opacity: 0;
  }
}
