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

.as {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(360px, 90vw);
}

.as__shapes {
  display: flex;
  gap: 8px;
}

.as__shape-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  border: 2px solid #4a4452;
  border-radius: 999px;
  background: transparent;
  color: #4a4452;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1), color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.as__shape-btn:hover {
  background: rgba(74, 68, 82, 0.08);
}

.as__shape-btn:focus-visible {
  outline: 2px solid #9791c9;
  outline-offset: 3px;
}

.as__shape-btn[aria-pressed=true] {
  background: #4a4452;
  color: #fff7e6;
}

.as__swatch {
  width: 14px;
  height: 14px;
  background: currentColor;
}

.as__swatch--circle {
  clip-path: circle(50%);
}

.as__swatch--squircle {
  clip-path: inset(0 round 34%);
}

.as__swatch--hex {
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.as__row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.as__slot {
  display: block;
  width: var(--size);
}

.as__av {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: var(--size);
  aspect-ratio: 1;
  background: #9791c9;
  color: #fff7e6;
  font-weight: 700;
  font-size: calc(var(--size) * 0.4);
  line-height: 1;
  border: calc(var(--size) / 14) solid #4a4452;
}

.as[data-shape=circle] .as__av {
  clip-path: circle(50%);
}

.as[data-shape=squircle] .as__av {
  clip-path: inset(0 round 34%);
}

.as[data-shape=hex] .as__av {
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.as.is-demo .as__slot {
  animation-name: asPop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
  animation-delay: var(--pop-delay, 0ms);
  animation-fill-mode: backwards;
}

.as.is-demo .as__av {
  animation-name: asShape;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes asPop {
  0% {
    scale: 0.4;
  }
  16% {
    scale: 1.1;
  }
  28% {
    scale: 1;
  }
  100% {
    scale: 1;
  }
}
@keyframes asShape {
  0% {
    clip-path: circle(50%);
  }
  34% {
    clip-path: inset(0 round 34%);
  }
  67% {
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  }
  88%, 100% {
    clip-path: circle(50%);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .as {
    gap: 12px;
  }
  .as__row {
    gap: 8px;
  }
  .as__shape-btn {
    padding: 4px 12px;
    font-size: 12px;
  }
  .as__swatch {
    width: 12px;
    height: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .as__slot {
    animation: none !important;
  }
  .as__av {
    animation: none !important;
  }
  .as__shape-btn {
    transition: none !important;
  }
}
