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

.wh {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, 90vw);
  overflow: hidden;
  color: #fff7e6;
}

.wh__scale,
.wh__row {
  display: grid;
  grid-template-columns: clamp(16px, 6vw, 40px) minmax(0, 1fr) clamp(62px, 22vw, 84px);
  gap: 8px;
  align-items: center;
}

.wh__marks {
  display: flex;
  justify-content: space-between;
}

.wh__marks span {
  font-size: clamp(8px, 2.4vw, 10px);
  line-height: 12px;
  font-weight: 500;
  color: rgba(255, 247, 230, 0.55);
}

.wh__day {
  font-size: clamp(9px, 3vw, 12px);
  line-height: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.wh__ab {
  display: none;
}

.wh__axis {
  position: relative;
  height: clamp(20px, 6.5vw, 26px);
}

.wh__rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: clamp(10px, 3.4vw, 14px);
  translate: 0 -50%;
  border-radius: 999px;
  background-color: rgba(255, 247, 230, 0.14);
  background-image: repeating-linear-gradient(90deg, rgba(255, 247, 230, 0.34) 0 1px, rgba(255, 247, 230, 0) 1px 25%);
}

.wh__pos {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  transform: translateX(calc(var(--s) * 100%));
}

.wh__bar {
  position: absolute;
  left: 0;
  top: 50%;
  width: calc((var(--e) - var(--s)) * 100%);
  height: clamp(10px, 3.4vw, 14px);
  translate: 0 -50%;
  border-radius: 999px;
  background-color: #4cd4a6;
}

.wh__h {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
}

.wh__h--s {
  transform: translateX(calc(var(--s) * 100%));
}

.wh__h--e {
  transform: translateX(calc(var(--e) * 100%));
}

.wh__grip {
  position: absolute;
  left: 0;
  top: 50%;
  width: clamp(12px, 4vw, 16px);
  height: clamp(12px, 4vw, 16px);
  translate: -50% -50%;
  border-radius: 50%;
  background-color: #fff7e6;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
}

.wh__grip:focus-visible {
  outline: 3px solid #4cd4a6;
  outline-offset: 2px;
}

.wh__read {
  position: relative;
  height: 14px;
}

.wh__read span {
  position: absolute;
  right: 0;
  top: 0;
  font-size: clamp(8px, 2.6vw, 11px);
  line-height: 14px;
  font-weight: 700;
  white-space: nowrap;
  color: rgba(255, 247, 230, 0.88);
}

.wh__read span[data-k="2"] {
  opacity: 0;
}

.wh.is-demo .wh__row[data-d=wed] .wh__bar,
.wh.is-demo .wh__row[data-d=wed] .wh__h--e {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.wh.is-demo .wh__row[data-d=wed] .wh__bar {
  animation-name: wh-grow;
}

.wh.is-demo .wh__row[data-d=wed] .wh__h--e {
  animation-name: wh-end;
}

@keyframes wh-grow {
  0%, 10% {
    width: 37.5%;
  }
  36%, 52% {
    width: 50%;
  }
  78%, 100% {
    width: 37.5%;
  }
}
@keyframes wh-end {
  0%, 10% {
    transform: translateX(79.167%) scale(1);
  }
  36% {
    transform: translateX(91.667%) scale(1.18);
  }
  42%, 52% {
    transform: translateX(91.667%) scale(1);
  }
  78%, 100% {
    transform: translateX(79.167%) scale(1);
  }
}
.wh.is-demo .wh__row[data-d=wed] .wh__read span {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.wh.is-demo .wh__row[data-d=wed] .wh__read span[data-k="1"] {
  animation-name: wh-t1;
}

.wh.is-demo .wh__row[data-d=wed] .wh__read span[data-k="2"] {
  animation-name: wh-t2;
}

@keyframes wh-t1 {
  0% {
    opacity: 1;
  }
  36% {
    opacity: 0;
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes wh-t2 {
  0% {
    opacity: 0;
  }
  36% {
    opacity: 1;
  }
  78% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.wh.is-demo .wh__row:not([data-d=wed]) {
  animation-name: wh-glow;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.wh.is-demo .wh__row[data-d=tue] {
  animation-delay: 120ms;
}

.wh.is-demo .wh__row[data-d=thu] {
  animation-delay: 240ms;
}

.wh.is-demo .wh__row[data-d=fri] {
  animation-delay: 360ms;
}

@keyframes wh-glow {
  0% {
    opacity: 0.55;
  }
  22% {
    opacity: 1;
  }
  48%, 100% {
    opacity: 0.55;
  }
}
@media (max-width: 340px) {
  .wh {
    gap: 4px;
  }
  .wh__scale,
  .wh__row {
    gap: 4px;
  }
  .wh__full {
    display: inline-block;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .wh__ab {
    display: inline;
  }
  .wh__read {
    height: 12px;
  }
  .wh__read span {
    line-height: 12px;
  }
  .wh__marks span {
    line-height: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wh.is-demo .wh__row,
  .wh.is-demo .wh__bar,
  .wh.is-demo .wh__h--e,
  .wh.is-demo .wh__read span {
    animation: none !important;
  }
  .wh.is-demo .wh__read span[data-k="2"] {
    opacity: 0;
  }
}
