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

.iconbtn {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  width: clamp(52px, 14vw, 64px);
  height: clamp(52px, 14vw, 64px);
  display: grid;
  place-items: center;
  background: rgba(23, 20, 26, 0.08);
  color: #17141a;
  -webkit-tap-highlight-color: transparent;
}

.iconbtn:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 3px;
}

.iconbtn__stack {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.ic {
  grid-area: 1/1;
  fill: currentColor;
  transition: opacity 220ms ease-out;
}

.ic--dots {
  opacity: 1;
}

.ic--x {
  opacity: 0;
}

.iconbtn[aria-expanded=true] .ic--dots {
  opacity: 0;
}

.iconbtn[aria-expanded=true] .ic--x {
  opacity: 1;
}

.iconbtn.is-demo .ic--dots {
  animation: dots-loop 2s ease-out infinite;
}

.iconbtn.is-demo .ic--x {
  animation: x-loop 2s ease-out infinite;
}

@keyframes dots-loop {
  0%, 15% {
    opacity: 1;
  }
  40%, 60% {
    opacity: 0;
  }
  85%, 100% {
    opacity: 1;
  }
}
@keyframes x-loop {
  0%, 15% {
    opacity: 0;
  }
  40%, 60% {
    opacity: 1;
  }
  85%, 100% {
    opacity: 0;
  }
}
.fx {
  grid-area: 1/1;
  fill: currentColor;
  pointer-events: none;
}

.fx__halo {
  fill: none;
  stroke: #17141a;
  stroke-width: 0.8;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

@keyframes halo-ring {
  0% {
    opacity: 0.55;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}
.fx__spark {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 1px #17141a);
}

@keyframes spark-pop {
  0% {
    opacity: 0.95;
    transform: scale(1.8);
  }
  60% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  100% {
    opacity: 0;
    transform: scale(0.3);
  }
}
.fx__bit {
  opacity: 0;
  transform: translate(0, 0);
  animation: bit-fly 420ms ease-out forwards;
}

@keyframes bit-fly {
  0% {
    opacity: 0.9;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.3);
  }
}
@media (prefers-reduced-motion: reduce) {
  .iconbtn.is-demo .ic--dots, .iconbtn.is-demo .ic--x {
    animation: none;
  }
  .ic {
    transition: none;
  }
  .fx {
    display: none;
  }
}
