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

.sp {
  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;
}

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

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

.sp__val {
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  color: #2f6df6;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.sp__rows {
  display: grid;
  grid-template-rows: 36px 36px 36px;
  gap: 4px;
  transition-property: grid-template-rows;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sp__rows[data-open="1"],
.sp__rows:has(.sp__row[data-i="0"]:hover),
.sp__rows:has(.sp__row[data-i="0"]:focus-visible) {
  grid-template-rows: 68px 20px 20px;
}

.sp__rows[data-open="2"],
.sp__rows:has(.sp__row[data-i="1"]:hover),
.sp__rows:has(.sp__row[data-i="1"]:focus-visible) {
  grid-template-rows: 20px 68px 20px;
}

.sp__rows[data-open="3"],
.sp__rows:has(.sp__row[data-i="2"]:hover),
.sp__rows:has(.sp__row[data-i="2"]:focus-visible) {
  grid-template-rows: 20px 20px 68px;
}

.sp__row {
  --open: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px max-content;
  align-items: center;
  column-gap: 8px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0);
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition-property: background-color, box-shadow;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.sp__rows[data-open="1"] .sp__row[data-i="0"],
.sp__row[data-i="0"]:is(:hover, :focus-visible) {
  --open: 1;
  background: #fff7e6;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.sp__rows[data-open="2"] .sp__row[data-i="1"],
.sp__row[data-i="1"]:is(:hover, :focus-visible) {
  --open: 1;
  background: #fff7e6;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.sp__rows[data-open="3"] .sp__row[data-i="2"],
.sp__row[data-i="2"]:is(:hover, :focus-visible) {
  --open: 1;
  background: #fff7e6;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.sp__name {
  font-size: 13px;
  line-height: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.sp__spark {
  display: block;
  width: 100%;
  height: 100%;
}

.sp__line {
  fill: none;
  stroke: #2f6df6;
  stroke-width: calc(2px + var(--open) * 1.5px);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition-property: stroke-width;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sp__base, .sp__axis line {
  fill: none;
  stroke: rgba(23, 20, 26, 0.35);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.sp__axis, .sp__base {
  opacity: var(--open);
}

.sp__peak {
  opacity: var(--open);
  transform-box: fill-box;
  transform-origin: center;
  transition-property: opacity, transform;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  transform: scale(0.85);
}

.sp__row:is(:hover, :focus-visible) .sp__peak,
.sp__rows[data-open="1"] .sp__row[data-i="0"] .sp__peak,
.sp__rows[data-open="2"] .sp__row[data-i="1"] .sp__peak,
.sp__rows[data-open="3"] .sp__row[data-i="2"] .sp__peak {
  transform: scale(1);
}

.sp__peak circle {
  fill: #c2361a;
}

.sp__peak text {
  fill: #c2361a;
  font-size: 10px;
  font-weight: 800;
}

.sp__num {
  position: relative;
  display: block;
  font-size: 15px;
  line-height: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.sp__num small {
  font-size: 10px;
  line-height: 18px;
  font-weight: 700;
  margin-left: 4px;
}

.sp__delta {
  position: absolute;
  top: 18px;
  right: 0;
  margin: 0;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(47, 109, 246, 0.12);
  color: #2f6df6;
  font-size: 10px;
  line-height: 14px;
  font-style: normal;
  font-weight: 800;
  opacity: var(--open);
  transition-property: opacity;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.sp.is-demo .sp__rows {
  animation-name: sp-rows-t;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes sp-rows-t {
  0%, 6% {
    grid-template-rows: 36px 36px 36px;
  }
  16%, 40% {
    grid-template-rows: 68px 20px 20px;
  }
  50%, 56% {
    grid-template-rows: 36px 36px 36px;
  }
  66%, 86% {
    grid-template-rows: 20px 68px 20px;
  }
  92%, 100% {
    grid-template-rows: 36px 36px 36px;
  }
}
.sp.is-demo .sp__row[data-i="0"] {
  animation-name: sp-row1;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes sp-row1 {
  0%, 6% {
    background-color: #ffffff;
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0);
  }
  16%, 40% {
    background-color: #fff7e6;
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  50%, 100% {
    background-color: #ffffff;
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0);
  }
}
.sp.is-demo .sp__row[data-i="1"] {
  animation-name: sp-row2;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes sp-row2 {
  0%, 56% {
    background-color: #ffffff;
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0);
  }
  66%, 86% {
    background-color: #fff7e6;
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  92%, 100% {
    background-color: #ffffff;
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0);
  }
}
.sp.is-demo .sp__row[data-i="0"] .sp__line {
  animation-name: sp-sw1;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes sp-sw1 {
  0%, 6% {
    stroke-width: 2px;
  }
  16%, 40% {
    stroke-width: 3.5px;
  }
  50%, 100% {
    stroke-width: 2px;
  }
}
.sp.is-demo .sp__row[data-i="1"] .sp__line {
  animation-name: sp-sw2;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes sp-sw2 {
  0%, 56% {
    stroke-width: 2px;
  }
  66%, 86% {
    stroke-width: 3.5px;
  }
  92%, 100% {
    stroke-width: 2px;
  }
}
.sp.is-demo .sp__row[data-i="0"] .sp__axis,
.sp.is-demo .sp__row[data-i="0"] .sp__base {
  animation-name: sp-ax1;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes sp-ax1 {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.sp.is-demo .sp__row[data-i="1"] .sp__axis,
.sp.is-demo .sp__row[data-i="1"] .sp__base {
  animation-name: sp-ax2;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes sp-ax2 {
  0% {
    opacity: 0;
  }
  64% {
    opacity: 1;
  }
  92% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.sp.is-demo .sp__row[data-i="0"] .sp__peak {
  animation-name: sp-pk1o, sp-pk1p;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite, infinite;
}

@keyframes sp-pk1o {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes sp-pk1p {
  0%, 14% {
    transform: scale(0.55);
  }
  22% {
    transform: scale(1.1);
  }
  30%, 100% {
    transform: scale(1);
  }
}
.sp.is-demo .sp__row[data-i="1"] .sp__peak {
  animation-name: sp-pk2o, sp-pk2p;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite, infinite;
}

@keyframes sp-pk2o {
  0% {
    opacity: 0;
  }
  64% {
    opacity: 1;
  }
  92% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes sp-pk2p {
  0%, 64% {
    transform: scale(0.55);
  }
  72% {
    transform: scale(1.1);
  }
  80%, 100% {
    transform: scale(1);
  }
}
.sp.is-demo .sp__row[data-i="0"] .sp__delta {
  animation-name: sp-dl1;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes sp-dl1 {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.sp.is-demo .sp__row[data-i="1"] .sp__delta {
  animation-name: sp-dl2;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes sp-dl2 {
  0% {
    opacity: 0;
  }
  64% {
    opacity: 1;
  }
  92% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .sp {
    padding: 8px;
    gap: 4px;
  }
  .sp__hint {
    display: none;
  }
  .sp__title {
    font-size: 12px;
    line-height: 16px;
  }
  .sp__val {
    font-size: 11px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp.is-demo .sp__rows,
  .sp.is-demo .sp__row,
  .sp.is-demo .sp__line,
  .sp.is-demo .sp__axis,
  .sp.is-demo .sp__base,
  .sp.is-demo .sp__peak,
  .sp.is-demo .sp__delta {
    animation: none !important;
  }
  .sp__rows,
  .sp__row,
  .sp__line,
  .sp__peak,
  .sp__delta {
    transition: none !important;
  }
}
