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

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

.editor {
  position: relative;
  width: min(420px, 94vw);
  border-radius: 16px;
  background: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  overflow: hidden;
}

.editor__head {
  display: flex;
  align-items: center;
  column-gap: 8px;
  padding: 4px 12px;
  border-bottom: 2px solid rgba(255, 247, 230, 0.14);
}

.editor__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd23f;
}

.editor__name {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(10px, 2.4vw, 13px);
  font-weight: 700;
  color: rgba(255, 247, 230, 0.85);
}

.editor__rows {
  list-style: none;
  margin: 0;
  padding: 8px 12px 8px;
  display: grid;
  row-gap: 4px;
}

.cl {
  position: relative;
  border-radius: 4px;
  padding: 4px 4px 4px 8px;
  min-height: clamp(18px, 6vw, 30px);
  display: flex;
  align-items: center;
}

.cl__bar {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 999px;
  background: transparent;
}

.cl__txt {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(8.5px, 2.1vw, 12px);
  color: rgba(255, 247, 230, 0.92);
  white-space: nowrap;
}

.cl__txt::before {
  content: attr(data-t);
}

.editor__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0 calc(50% - 7px), rgba(255, 210, 63, 0.3) calc(50% - 7px) calc(50% + 7px), transparent calc(50% + 7px) 100%);
  background-size: 100% 220%;
  opacity: 0;
}

.editor__badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  margin: 0;
  border-radius: 999px;
  background: #c2361a;
  color: #fff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: clamp(10px, 2.4vw, 13px);
  font-weight: 800;
  padding: 4px 12px;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.stage.is-demo .editor__scan {
  animation: scan-down 2s ease-out infinite;
}

.stage.is-demo .cl {
  animation: cl-pass 2s linear infinite;
  animation-delay: calc(var(--i) * 0.19s);
}

.stage.is-demo .cl__bar {
  animation: bar-grow 2s ease-out infinite;
  animation-delay: calc(var(--i) * 0.19s);
}

.stage.is-demo .editor__badge {
  animation: badge-in 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

@keyframes scan-down {
  0% {
    opacity: 1;
    background-position: 0 -130%;
  }
  70% {
    opacity: 1;
    background-position: 0 130%;
  }
  75%, 100% {
    opacity: 0;
    background-position: 0 130%;
  }
}
@keyframes cl-pass {
  0%, 6% {
    background: transparent;
  }
  15% {
    background: rgba(255, 210, 63, 0.16);
  }
  26%, 100% {
    background: transparent;
  }
}
@keyframes bar-grow {
  0%, 10% {
    transform: scaleY(0);
    background: #c2361a;
  }
  20% {
    transform: scaleY(1);
    background: #c2361a;
  }
  100% {
    transform: scaleY(1);
    background: #c2361a;
  }
}
@keyframes badge-in {
  0%, 64% {
    transform: scale(0) translateY(4px);
    opacity: 0;
  }
  72% {
    transform: scale(1.2) translateY(0);
    opacity: 1;
  }
  78%, 95% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(0.5);
    opacity: 0;
  }
}
.stage.is-demo .cl:nth-child(2) .cl__bar,
.stage.is-demo .cl:nth-child(4) .cl__bar {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .editor__scan,
  .stage.is-demo .cl,
  .stage.is-demo .cl__bar,
  .stage.is-demo .editor__badge {
    animation: none;
  }
  .editor__scan {
    opacity: 0;
  }
  .cl:nth-child(1), .cl:nth-child(3), .cl:nth-child(5) {
    background: rgba(194, 54, 26, 0.3);
  }
  .cl:nth-child(1) .cl__bar, .cl:nth-child(3) .cl__bar, .cl:nth-child(5) .cl__bar {
    transform: scaleY(1);
    background: #c2361a;
  }
}
@media (max-width: 359px) {
  .editor__head {
    padding: 0 8px;
  }
  .editor__rows {
    padding: 4px 8px;
    row-gap: 4px;
  }
  .cl {
    min-height: 16px;
    padding: 0 0 0 8px;
  }
}
