html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ff4d1f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.lnh {
  position: relative;
  box-sizing: border-box;
  padding-bottom: 48px;
}

.pane {
  box-sizing: border-box;
  width: 288px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  background: #17141a;
  color: #fff7e6;
}

.pane__head {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  background: rgba(255, 247, 230, 0.06);
  border-bottom: 1px solid rgba(255, 247, 230, 0.12);
}

.pane__lang {
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 247, 230, 0.72);
  text-transform: uppercase;
}

.pane__body {
  position: relative;
  box-sizing: border-box;
  padding: 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 18px;
}

.pane__body pre, .pane__body code {
  margin: 0;
  font: inherit;
}

.lines {
  counter-reset: ln;
  display: block;
}

.ln {
  position: relative;
  display: block;
  box-sizing: border-box;
  padding-left: 24px;
  color: #fff7e6;
  white-space: pre;
  border-radius: 4px;
}

.ln::before {
  counter-increment: ln;
  content: counter(ln);
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  text-align: right;
  color: rgba(255, 247, 230, 0.72);
  user-select: none;
}

.ln.is-called {
  cursor: pointer;
  background: rgba(76, 212, 166, 0.1);
}

.ln.is-called:focus-visible {
  outline: 2px solid #4cd4a6;
  outline-offset: 1px;
}

.ln.is-called::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 4px;
  background: #4cd4a6;
  transform-origin: top center;
  transform: scaleY(0);
}

.lnh.is-open .ln.is-called {
  background: rgba(76, 212, 166, 0.22);
  transition: background 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lnh.is-open .ln.is-called::after {
  transform: scaleY(1);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tooltip {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 142px;
  margin-top: 8px;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 247, 230, 0.96);
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  opacity: 0;
  transform-origin: top center;
  transform: translateY(6px) scale(0.96);
  pointer-events: none;
}

.lnh.is-open .tooltip {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lnh__cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 12px;
  height: 12px;
  border: 2px solid #fff7e6;
  border-radius: 50%;
  background: #17141a;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  pointer-events: none;
  opacity: 0;
  transform: translate(16px, 20px);
}

.lnh.is-demo .lnh__cursor {
  opacity: 1;
}

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

.lnh.is-demo .ln.is-called {
  animation-name: lnh-bg;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.lnh.is-demo .ln.is-called::after {
  animation-name: lnh-bar;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.lnh.is-demo .lnh__cursor {
  animation-name: lnh-cursor;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes lnh-tooltip {
  0%, 9% {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  19% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  94% {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  100% {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
}
@keyframes lnh-bg {
  0%, 18% {
    background: rgba(76, 212, 166, 0.1);
  }
  20% {
    background: rgba(76, 212, 166, 0.24);
  }
  74% {
    background: rgba(76, 212, 166, 0.24);
  }
  92% {
    background: rgba(76, 212, 166, 0.1);
  }
  100% {
    background: rgba(76, 212, 166, 0.1);
  }
}
@keyframes lnh-bar {
  0%, 20% {
    transform: scaleY(0);
  }
  34% {
    transform: scaleY(1);
  }
  78% {
    transform: scaleY(1);
  }
  94% {
    transform: scaleY(0);
  }
  100% {
    transform: scaleY(0);
  }
}
@keyframes lnh-cursor {
  0%, 2% {
    transform: translate(16px, 20px);
  }
  18% {
    transform: translate(150px, 84px);
  }
  34% {
    transform: translate(180px, 84px);
  }
  52% {
    transform: translate(140px, 84px);
  }
  72% {
    transform: translate(170px, 84px);
  }
  86%, 100% {
    transform: translate(16px, 20px);
  }
}
@media (max-width: 340px) {
  .lnh {
    padding-bottom: 32px;
  }
  .pane {
    width: 100%;
  }
  .pane__body {
    font-size: 10px;
    line-height: 16px;
    padding: 8px;
  }
  .ln {
    padding-left: 20px;
  }
  .tooltip {
    top: 124px;
    margin-top: 4px;
    left: 8px;
    right: 8px;
    padding: 4px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lnh.is-demo .tooltip,
  .lnh.is-demo .ln.is-called,
  .lnh.is-demo .ln.is-called::after,
  .lnh.is-demo .lnh__cursor {
    animation: none !important;
  }
  .lnh.is-demo .lnh__cursor {
    opacity: 0;
  }
  .lnh.is-demo .tooltip {
    opacity: 0;
  }
}
