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

.sw {
  position: relative;
  box-sizing: border-box;
  width: min(312px, 92vw);
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.sw__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
}

.sw__title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.sw__attr {
  margin: 0;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}
.sw__attr code {
  font-family: "Consolas", "Menlo", monospace;
}

.sw__view {
  height: 168px;
  overflow-y: auto;
  padding: 0 12px;
  outline: none;
}

.sw__track {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 96px;
}

.sw__hint {
  margin: 0;
  box-sizing: border-box;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
  border: 1px dashed rgba(23, 20, 26, 0.28);
  border-radius: 12px;
  padding: 12px 0;
  text-align: center;
}

.sw__card {
  box-sizing: border-box;
  margin-top: 120px;
  padding: 16px;
  border-radius: 16px;
  background: #0a4fe8;
  color: #fff7e6;
}

.sw__line {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.sw__word {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  transition-property: opacity, transform;
  transition-duration: 220ms, 420ms;
  transition-timing-function: ease-out, cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i) * var(--stagger, 90ms)), calc(var(--i) * var(--stagger, 90ms));
}

.sw__card.is-visible .sw__word {
  opacity: 1;
  transform: none;
}

.sw__meta {
  margin: 8px 0 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff7e6;
}

.sw__filler {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
  border-radius: 12px;
  background: rgba(23, 20, 26, 0.06);
  padding: 24px 0;
  text-align: center;
}

.sw__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(23, 20, 26, 0.12);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.sw__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2f6df6;
}

.sw.is-demo .sw__track {
  animation-name: sw-flow;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.sw.is-demo .sw__line {
  animation-name: sw-cut;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}
.sw.is-demo .sw__word {
  animation-name: sw-show, sw-rise;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
  animation-delay: calc(0.4s + var(--i) * var(--stagger, 90ms)), calc(0.4s + var(--i) * var(--stagger, 90ms));
}
.sw.is-demo .sw__dot {
  animation-name: sw-blink;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes sw-flow {
  0%, 8% {
    transform: translateY(0);
  }
  20%, 84% {
    transform: translateY(-144px);
  }
  86%, 100% {
    transform: translateY(0);
  }
}
@keyframes sw-cut {
  0%, 84% {
    opacity: 1;
  }
  86%, 96% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes sw-show {
  0% {
    opacity: 0;
  }
  2%, 100% {
    opacity: 1;
  }
}
@keyframes sw-rise {
  0% {
    transform: translateY(14px);
  }
  20%, 100% {
    transform: none;
  }
}
@keyframes sw-blink {
  0% {
    background: rgba(23, 20, 26, 0.2);
  }
  24% {
    background: #2f6df6;
  }
  88% {
    background: rgba(23, 20, 26, 0.2);
  }
}
@media (max-width: 340px) {
  .sw {
    width: 100%;
  }
  .sw__view {
    height: 112px;
  }
  .sw__line {
    font-size: 18px;
  }
  .sw__card {
    margin-top: 96px;
  }
  .sw__filler {
    padding: 16px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sw__word {
    transition: none !important;
  }
  .sw.is-demo .sw__track,
  .sw.is-demo .sw__line,
  .sw.is-demo .sw__word,
  .sw.is-demo .sw__dot {
    animation: none !important;
  }
  .sw.is-demo .sw__word {
    opacity: 1 !important;
    transform: none !important;
  }
  .sw.is-demo .sw__dot {
    background: #2f6df6 !important;
  }
}
