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

.pm {
  width: min(360px, 84vw);
}

.pm__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pm__bar {
  position: relative;
  display: flex;
  height: 4px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.16);
  overflow: hidden;
  margin-bottom: 12px;
}

.pm__fill {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  height: 100%;
  width: 33.3333333333%;
  border-radius: 999px;
  background: #2f6df6;
  transition: width 300ms ease-out;
}

.pm__seg {
  position: relative;
  z-index: 1;
  flex: 1;
  cursor: pointer;
}

#pm-2:checked ~ .pm__bar .pm__fill {
  width: 66.6666666667%;
}

#pm-3:checked ~ .pm__bar .pm__fill {
  width: 100%;
}

.pm__viewport {
  overflow: hidden;
  border-radius: 16px;
}

.pm__track {
  display: flex;
  width: 400%;
  transform: translateX(0%);
  transition: transform 300ms ease-out;
}

#pm-2:checked ~ .pm__viewport .pm__track {
  transform: translateX(calc(-25% - 12px));
}

#pm-3:checked ~ .pm__viewport .pm__track {
  transform: translateX(calc(-50% - 24px));
}

.pm__slide {
  flex: 0 0 25%;
  aspect-ratio: 16/9;
  margin-right: 12px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: end start;
  box-sizing: border-box;
}

.pm__slide:last-child {
  margin-right: 0;
}

.pm__slide::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.pm__slide::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -6%;
  height: 48%;
  background: rgba(23, 20, 26, 0.24);
  clip-path: polygon(0% 100%, 20% 40%, 40% 66%, 58% 26%, 76% 60%, 100% 34%, 100% 100%);
}

.pm__slide--1 {
  background: linear-gradient(135deg, #2f6df6, #d6ddeb);
}

.pm__slide--2 {
  background: linear-gradient(135deg, #ff4d1f, #ebdbd6);
}

.pm__slide--3 {
  background: linear-gradient(135deg, #17141a, #4a3f5c);
}

.pm__cap {
  position: relative;
  z-index: 1;
  margin: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.38);
  color: #fff7e6;
  font-weight: 600;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1;
  font-family: inherit;
}

.pm.is-demo .pm__track {
  animation: pm-track 2s ease-out infinite;
}

.pm.is-demo .pm__fill {
  animation: pm-fill 2s ease-out infinite;
}

@keyframes pm-track {
  0%, 8% {
    transform: translateX(0%);
  }
  31%, 39% {
    transform: translateX(calc(-25% - 12px));
  }
  62%, 70% {
    transform: translateX(calc(-50% - 24px));
  }
  92%, 100% {
    transform: translateX(calc(-75% - 36px));
  }
}
@keyframes pm-fill {
  0%, 8% {
    width: 33.3333333333%;
  }
  31%, 39% {
    width: 66.6666666667%;
  }
  62%, 66% {
    width: 100%;
  }
  88%, 100% {
    width: 33.3333333333%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pm__track, .pm__fill {
    transition: none;
  }
  .pm.is-demo .pm__track, .pm.is-demo .pm__fill {
    animation: none !important;
  }
}
