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

.pd {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(320px, 90vw);
}

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

.pd__wrap {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
}

.pd__av {
  display: grid;
  place-items: center;
  width: 64px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #9791c9;
  color: #fff7e6;
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  -webkit-mask-image: radial-gradient(circle 11px at 82% 82%, transparent 98%, #000 100%);
  mask-image: radial-gradient(circle 11px at 82% 82%, transparent 98%, #000 100%);
}

.pd__dot {
  position: absolute;
  left: 82%;
  top: 82%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #479082;
  transform: translate(-50%, -50%);
}

.pd__meta {
  display: grid;
  gap: 4px;
}

.pd__name {
  margin: 0;
  color: #17141a;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.pd__state {
  margin: 0;
  color: #17141a;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
}

.pd__state span {
  display: none;
}

.pd[data-state=online] .pd__state span[data-key=online],
.pd[data-state=away] .pd__state span[data-key=away],
.pd[data-state=busy] .pd__state span[data-key=busy] {
  display: inline;
}

.pd[data-state=online] .pd__dot {
  background: #479082;
}

.pd[data-state=away] .pd__dot {
  background: #4a4452;
}

.pd[data-state=busy] .pd__dot {
  background: #c2361a;
}

.pd__btn {
  margin: 0;
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: #17141a;
  color: #ffd23f;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pd__btn:hover {
  transform: translateY(-2px);
}

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

.pd.is-demo .pd__dot {
  animation-name: pdDotCut, pdDotBeat;
  animation-duration: 2s, 1000ms;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite, infinite;
}

.pd.is-demo .pd__state {
  display: grid;
}

.pd.is-demo .pd__state span {
  display: inline;
  grid-area: 1/1;
  opacity: 0;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.pd.is-demo .pd__state span[data-key=online] {
  animation-name: pdTxtOnline;
}

.pd.is-demo .pd__state span[data-key=away] {
  animation-name: pdTxtAway;
}

.pd.is-demo .pd__state span[data-key=busy] {
  animation-name: pdTxtBusy;
}

@keyframes pdDotCut {
  0% {
    background-color: #479082;
  }
  34% {
    background-color: #4a4452;
  }
  67% {
    background-color: #c2361a;
  }
  88%, 100% {
    background-color: #479082;
  }
}
@keyframes pdDotBeat {
  0% {
    scale: 1;
  }
  50% {
    scale: 1.35;
  }
  100% {
    scale: 1;
  }
}
@keyframes pdTxtOnline {
  0% {
    opacity: 1;
  }
  34% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes pdTxtAway {
  0% {
    opacity: 0;
  }
  34% {
    opacity: 1;
  }
  67% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes pdTxtBusy {
  0% {
    opacity: 0;
  }
  67% {
    opacity: 1;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .pd {
    gap: 12px;
  }
  .pd__body {
    gap: 12px;
  }
  .pd__name {
    font-size: 14px;
  }
  .pd__state {
    font-size: 12px;
  }
  .pd__btn {
    padding: 4px 16px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pd__dot {
    animation: none !important;
  }
  .pd__state {
    display: block !important;
  }
  .pd__state span {
    display: none !important;
    opacity: 1 !important;
    animation: none !important;
  }
  .pd[data-state=online] .pd__state span[data-key=online],
  .pd[data-state=away] .pd__state span[data-key=away],
  .pd[data-state=busy] .pd__state span[data-key=busy] {
    display: inline !important;
  }
  .pd__btn {
    transition: none !important;
  }
}
