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

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

.sd {
  position: relative;
  box-sizing: border-box;
  width: min(236px, 92vw);
  display: grid;
  justify-items: end;
  gap: 4px;
}

.sd__hint {
  display: inline-grid;
  margin: 0;
  color: rgba(255, 247, 230, 0.62);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.sd__hint-a,
.sd__hint-b {
  grid-area: 1/1;
}

.sd__hint-b {
  opacity: 0;
  color: #2f6df6;
}

.sd.is-open .sd__hint-a {
  opacity: 0;
}

.sd.is-open .sd__hint-b {
  opacity: 1;
}

.sd__menu {
  display: grid;
  justify-items: end;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sd__item {
  display: grid;
}

.sd__sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 168px;
  margin: 0;
  padding: 0 8px 0 12px;
  border: 1px solid rgba(255, 247, 230, 0.18);
  border-radius: 999px;
  background: rgb(18.1176470588%, 16.7450980392%, 18.1960784314%);
  color: #fff7e6;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transform: translateY(12px) scale(0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 140ms linear;
}

.sd__sub:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.sd__tag {
  order: 0;
}

.sd__ic {
  order: 1;
  display: inline-flex;
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.12);
}

.sd.is-open .sd__sub {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.sd__item:nth-child(1) .sd__sub {
  transition-delay: 0ms;
}

.sd__item:nth-child(2) .sd__sub {
  transition-delay: 40ms;
}

.sd__item:nth-child(3) .sd__sub {
  transition-delay: 80ms;
}

.sd__dock {
  display: grid;
}

.sd__fab {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #2f6df6;
  color: #fff7e6;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.sd__fab:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.sd__plus {
  display: inline-flex;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sd.is-open .sd__plus {
  transform: rotate(45deg);
}

.sd__fab:active .sd__plus {
  transform: rotate(45deg) scale(0.92);
}

@keyframes sd-in-1 {
  0%, 11% {
    transform: translateY(12px) scale(0.6);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  12.01%, 24% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  72% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  78% {
    transform: translateY(8px) scale(0.6);
    opacity: 0;
  }
  78.01%, 100% {
    transform: translateY(12px) scale(0.6);
    opacity: 0;
  }
}
@keyframes sd-in-2 {
  0%, 19% {
    transform: translateY(12px) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  20.01%, 32% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  78% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  84% {
    transform: translateY(8px) scale(0.6);
    opacity: 0;
  }
  84.01%, 100% {
    transform: translateY(12px) scale(0.6);
    opacity: 0;
  }
}
@keyframes sd-in-3 {
  0%, 27% {
    transform: translateY(12px) scale(0.6);
    opacity: 0;
  }
  28% {
    opacity: 1;
  }
  28.01%, 40% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  84% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  90% {
    transform: translateY(8px) scale(0.6);
    opacity: 0;
  }
  90.01%, 100% {
    transform: translateY(12px) scale(0.6);
    opacity: 0;
  }
}
@keyframes sd-turn {
  0%, 10% {
    transform: rotate(0deg);
  }
  24% {
    transform: rotate(45deg);
  }
  84% {
    transform: rotate(45deg);
  }
  94%, 100% {
    transform: rotate(0deg);
  }
}
@keyframes sd-press {
  0%, 8% {
    transform: scale(1);
  }
  12% {
    transform: scale(0.92);
  }
  18%, 100% {
    transform: scale(1);
  }
}
@keyframes sd-hint-a {
  0%, 27% {
    opacity: 1;
  }
  28%, 89% {
    opacity: 0;
  }
  90%, 100% {
    opacity: 1;
  }
}
@keyframes sd-hint-b {
  0%, 27% {
    opacity: 0;
  }
  28%, 89% {
    opacity: 1;
  }
  90%, 100% {
    opacity: 0;
  }
}
.sd.is-demo .sd__item:nth-child(1) .sd__sub {
  animation-name: sd-in-1;
}
.sd.is-demo .sd__item:nth-child(2) .sd__sub {
  animation-name: sd-in-2;
}
.sd.is-demo .sd__item:nth-child(3) .sd__sub {
  animation-name: sd-in-3;
}
.sd.is-demo .sd__sub {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.sd.is-demo .sd__plus {
  animation-name: sd-turn;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.sd.is-demo .sd__fab {
  animation-name: sd-press;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}
.sd.is-demo .sd__hint-a {
  animation-name: sd-hint-a;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}
.sd.is-demo .sd__hint-b {
  animation-name: sd-hint-b;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@media (max-width: 340px) {
  .sd {
    gap: 4px;
  }
  .sd__hint {
    font-size: 11px;
  }
  .sd__menu {
    gap: 4px;
  }
  .sd__sub {
    min-width: 140px;
    font-size: 11px;
  }
  .sd__ic {
    width: 18px;
    height: 18px;
  }
  .sd__fab {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sd.is-demo .sd__sub,
  .sd.is-demo .sd__plus,
  .sd.is-demo .sd__fab,
  .sd.is-demo .sd__hint-a,
  .sd.is-demo .sd__hint-b {
    animation: none !important;
    transform: none !important;
  }
  .sd.is-demo .sd__sub {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .sd.is-demo .sd__plus {
    transform: rotate(45deg) !important;
  }
  .sd.is-demo .sd__hint-a {
    opacity: 0 !important;
  }
  .sd.is-demo .sd__hint-b {
    opacity: 1 !important;
  }
}
