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

.qt {
  box-sizing: border-box;
  position: relative;
  width: min(320px, 92vw);
  margin: 0;
  padding: 16px 20px;
  border: 1px solid rgba(185, 160, 255, 0.55);
  border-radius: 16px;
  overflow: hidden;
  font-family: inherit;
  isolation: isolate;
}

.qt * {
  box-sizing: border-box;
}

.qt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #b9a0ff;
  opacity: 0.3;
}

.qt__label,
.qt__body {
  position: relative;
  z-index: 1;
  margin: 0;
  display: block;
}

.qt__label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: rgba(85, 55, 180, 0.9);
  transition-property: color;
  transition-duration: 140ms;
  transition-delay: 80ms;
}

.qt__body {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: #17141a;
}

.qt:hover .qt__label {
  color: rgb(60, 30, 150);
}

.qt.is-demo::before {
  transform-origin: left center;
  animation-name: qtFill;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

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

.qt.is-demo .qt__body {
  animation-name: qtBody;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes qtFill {
  0% {
    transform: scaleX(0);
  }
  18%, 74% {
    transform: scaleX(1);
  }
  96%, 100% {
    transform: scaleX(0);
  }
}
@keyframes qtLabel {
  0%, 7% {
    opacity: 0;
  }
  8%, 68% {
    opacity: 1;
  }
  72%, 100% {
    opacity: 0;
  }
}
@keyframes qtBody {
  0%, 10% {
    opacity: 0;
    transform: translateX(-10px);
  }
  26%, 70% {
    opacity: 1;
    transform: translateX(0);
  }
  76%, 100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .qt.is-demo::before,
  .qt.is-demo .qt__label,
  .qt.is-demo .qt__body {
    animation: none !important;
  }
}
@media (max-width: 340px) {
  .qt {
    padding: 12px 16px;
  }
  .qt__body {
    font-size: 13px;
  }
}
