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

@property --ratio {
  syntax: "<number>";
  inherits: true;
  initial-value: 1.25;
}
.ts {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: min(100%, 400px);
  padding: 12px;
  border: 1px solid rgba(255, 247, 230, 0.16);
  border-radius: 16px;
  background: rgba(255, 247, 230, 0.05);
  overflow: hidden;
}

.ts__bar {
  display: flex;
  gap: 8px;
}

.ts__pick {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.12);
  color: #fff7e6;
  cursor: pointer;
  font-family: ui-monospace, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.ts__pick[aria-pressed=true] {
  background: #0a4fe8;
  color: #fff7e6;
}

.ts__pick:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

.ts__ladder {
  --base: 11;
  --ratio: 1.25;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ts__rung {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ts__glyph {
  flex: 1 1 auto;
  min-width: 0;
  color: #fff7e6;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts__rung--1 .ts__glyph {
  font-size: calc(var(--base) * 1px);
}

.ts__rung--2 .ts__glyph {
  font-size: calc(var(--base) * var(--ratio) * 1px);
}

.ts__rung--3 .ts__glyph {
  font-size: calc(var(--base) * var(--ratio) * var(--ratio) * 1px);
}

.ts__rung--4 .ts__glyph {
  font-size: calc(var(--base) * var(--ratio) * var(--ratio) * var(--ratio) * 1px);
}

.ts__rung--5 .ts__glyph {
  font-size: calc(var(--base) * var(--ratio) * var(--ratio) * var(--ratio) * var(--ratio) * 1px);
}

.ts__px {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 15px;
}

.ts__v {
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
  color: #5b8cf8;
  font-family: ui-monospace, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 15px;
}

.ts.is-a .ts__v--a, .ts.is-b .ts__v--b, .ts.is-c .ts__v--c {
  opacity: 1;
}

.ts__beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 28px;
  background: linear-gradient(180deg, rgba(91, 140, 248, 0), rgba(91, 140, 248, 0.22), rgba(91, 140, 248, 0));
  opacity: 0;
  pointer-events: none;
}

.ts.is-demo .ts__ladder {
  animation-name: tsRatio;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.ts.is-demo .ts__v--a {
  animation-name: tsShowA;
}

.ts.is-demo .ts__v--b {
  animation-name: tsShowB;
}

.ts.is-demo .ts__v--c {
  animation-name: tsShowC;
}

.ts.is-demo .ts__v {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.ts.is-demo .ts__pick:nth-child(1) {
  animation-name: tsPickA;
}

.ts.is-demo .ts__pick:nth-child(2) {
  animation-name: tsPickB;
}

.ts.is-demo .ts__pick:nth-child(3) {
  animation-name: tsPickC;
}

.ts.is-demo .ts__pick {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.ts.is-demo .ts__beam {
  animation-name: tsBeam;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

@keyframes tsRatio {
  0% {
    --ratio: 1.125;
  }
  34% {
    --ratio: 1.25;
  }
  67%, 100% {
    --ratio: 1.333;
  }
}
@keyframes tsShowA {
  0% {
    opacity: 1;
  }
  34%, 100% {
    opacity: 0;
  }
}
@keyframes tsShowB {
  0% {
    opacity: 0;
  }
  34% {
    opacity: 1;
  }
  67%, 100% {
    opacity: 0;
  }
}
@keyframes tsShowC {
  0% {
    opacity: 0;
  }
  67%, 100% {
    opacity: 1;
  }
}
@keyframes tsPickA {
  0% {
    background-color: #0a4fe8;
  }
  34%, 100% {
    background-color: rgba(255, 247, 230, 0.12);
  }
}
@keyframes tsPickB {
  0% {
    background-color: rgba(255, 247, 230, 0.12);
  }
  34% {
    background-color: #0a4fe8;
  }
  67%, 100% {
    background-color: rgba(255, 247, 230, 0.12);
  }
}
@keyframes tsPickC {
  0% {
    background-color: rgba(255, 247, 230, 0.12);
  }
  67%, 100% {
    background-color: #0a4fe8;
  }
}
@keyframes tsBeam {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  6% {
    opacity: 1;
    transform: translateY(0);
  }
  86% {
    opacity: 1;
    transform: translateY(260px);
  }
  92%, 100% {
    opacity: 0;
    transform: translateY(260px);
  }
}
@media (max-width: 340px) {
  .ts {
    gap: 4px;
    padding: 8px;
  }
  .ts__ladder {
    --base: 9;
  }
  .ts__pick {
    font-size: 10px;
  }
  .ts__px {
    width: 40px;
  }
  .ts__v {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ts.is-demo .ts__ladder,
  .ts.is-demo .ts__v,
  .ts.is-demo .ts__pick,
  .ts.is-demo .ts__beam {
    animation: none !important;
  }
  .ts.is-demo .ts__beam {
    opacity: 0 !important;
  }
  .ts.is-demo.is-b .ts__v--b {
    opacity: 1 !important;
  }
}
