@property --i {
  syntax: "<integer>";
  initial-value: 4;
  inherits: true;
}
@property --y {
  syntax: "<length>";
  initial-value: 27px;
  inherits: true;
}
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);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ch {
  --i: 4;
  --y: 27px;
  box-sizing: border-box;
  width: min(392px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.ch__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.ch__title {
  font-size: 13px;
  line-height: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ch__val {
  font-size: 13px;
  line-height: 18px;
  font-weight: 800;
  color: #2f6df6;
  font-variant-numeric: tabular-nums;
}

.ch__plot {
  position: relative;
}

.ch__svg {
  display: block;
  width: 100%;
  height: auto;
}

.ch__grid line {
  stroke: rgba(23, 20, 26, 0.14);
  stroke-width: 1;
}

.ch__line {
  fill: none;
  stroke: #2f6df6;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ch__dots circle {
  fill: #ffffff;
  stroke: #2f6df6;
  stroke-width: 2;
}

.ch__cursor {
  transform: translateX(calc(var(--i) * 26px + 14px));
  opacity: 0;
}

.ch__x {
  stroke: #17141a;
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}

.ch__mark {
  transform: translateY(var(--y));
}

.ch__ring {
  fill: none;
  stroke: #17141a;
  stroke-width: 2.5;
}

.ch__tip {
  transform: translateY(var(--y));
}

.ch__tipbox {
  transform-box: fill-box;
  transform-origin: center;
}

.ch__tipbox rect {
  fill: #17141a;
}

.ch__tipbox text {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.ch__hot {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: crosshair;
}

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

.ch__hint {
  margin: 0;
  padding: 0 4px;
  font-size: 11px;
  line-height: 16px;
  color: rgba(23, 20, 26, 0.62);
}

.ch:not(.is-demo) .ch__cursor {
  opacity: 1;
  transition-property: transform;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

.ch:not(.is-demo) .ch__mark,
.ch:not(.is-demo) .ch__tip {
  transition-property: transform;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

.ch.is-demo .ch__cursor {
  animation-name: ch-x;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  opacity: 1;
}

@keyframes ch-x {
  0% {
    transform: translateX(calc(4 * 26px + 14px));
  }
  28% {
    transform: translateX(calc(8 * 26px + 14px));
  }
  56% {
    transform: translateX(calc(11 * 26px + 14px));
  }
  84% {
    transform: translateX(calc(4 * 26px + 14px));
  }
  100% {
    transform: translateX(calc(4 * 26px + 14px));
  }
}
.ch.is-demo .ch__mark,
.ch.is-demo .ch__tip {
  animation-name: ch-y;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes ch-y {
  0% {
    transform: translateY(27px);
  }
  28% {
    transform: translateY(29px);
  }
  56% {
    transform: translateY(25px);
  }
  84% {
    transform: translateY(27px);
  }
  100% {
    transform: translateY(27px);
  }
}
.ch.is-demo .ch__ring {
  animation-name: ch-ring;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes ch-ring {
  0%, 28%, 56%, 84% {
    transform: scale(0.45);
  }
  14%, 42%, 70%, 96% {
    transform: scale(1.12);
  }
  22%, 50%, 78%, 100% {
    transform: scale(1);
  }
}
.ch.is-demo .ch__tipbox {
  animation-name: ch-tipbox;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes ch-tipbox {
  0%, 28%, 56%, 84% {
    transform: translateY(7px) scale(0.8);
  }
  16%, 44%, 72%, 98% {
    transform: translateY(0) scale(1.04);
  }
  24%, 52%, 80%, 100% {
    transform: translateY(0) scale(1);
  }
}
@media (max-width: 340px) {
  .ch {
    padding: 8px;
    gap: 4px;
  }
  .ch__hint {
    display: none;
  }
  .ch__title, .ch__val {
    font-size: 12px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ch.is-demo .ch__cursor,
  .ch.is-demo .ch__mark,
  .ch.is-demo .ch__tip,
  .ch.is-demo .ch__ring,
  .ch.is-demo .ch__tipbox {
    animation: none !important;
  }
  .ch:not(.is-demo) .ch__cursor,
  .ch:not(.is-demo) .ch__mark,
  .ch:not(.is-demo) .ch__tip {
    transition: none !important;
  }
  .ch.is-demo .ch__cursor {
    opacity: 1;
    transform: translateX(calc(4 * 26px + 14px));
  }
  .ch.is-demo .ch__mark,
  .ch.is-demo .ch__tip {
    transform: translateY(27px);
  }
}
