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

.ng {
  box-sizing: border-box;
  width: min(100%, 432px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.ng__node rect {
  fill: #fff7e6;
  stroke: rgba(23, 20, 26, 0.35);
  stroke-width: 1;
}

.ng__node .ng__ico {
  color: #17141a;
}

.ng__nm {
  font-weight: 800;
  font-size: 12px;
  fill: #17141a;
  dominant-baseline: central;
}

.ng__port {
  stroke: #fff7e6;
  stroke-width: 2;
}

.ng__port--out {
  fill: #ff4d1f;
}

.ng__port--in {
  fill: #2f6df6;
}

.ng__wire {
  stroke: #ffd23f;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: var(--len);
  stroke-dashoffset: 0;
}

.ng__cap {
  font-size: 12px;
}

.ng__capk {
  font-weight: 600;
  fill: rgba(255, 247, 230, 0.78);
}

.ng__capv {
  font-weight: 800;
  fill: #ffd23f;
}

.ng__bar {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.ng__btn {
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(9px, 2.6vw, 11px);
  line-height: 1.6;
  padding: 4px 16px;
  border-radius: 999px;
  cursor: pointer;
  background: none;
  border: 1px solid rgba(255, 247, 230, 0.55);
  color: #fff7e6;
  transition: background 220ms ease-out, color 220ms ease-out;
}

.ng__btn.is-on {
  background: #fff7e6;
  border-color: #fff7e6;
  color: #17141a;
}

.ng.is-demo .ng__wire {
  animation-name: ngWireDraw;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes ngWireDraw {
  0% {
    stroke-dashoffset: var(--len);
  }
  60% {
    stroke-dashoffset: 0;
  }
  78% {
    stroke-dashoffset: 0;
  }
  88% {
    stroke-dashoffset: var(--len);
  }
  100% {
    stroke-dashoffset: var(--len);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .ng {
    gap: 4px;
  }
  .ng__btn {
    padding: 0 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ng.is-demo .ng__wire {
    animation-name: none !important;
    stroke-dashoffset: 0 !important;
  }
  .ng__btn {
    transition: none !important;
  }
}
