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

.ng {
  box-sizing: border-box;
  width: min(100%, 432px);
}

.ng__svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.ng__node rect {
  fill: #17141a;
}

.ng__node .ng__ico {
  color: #fff7e6;
}

.ng__nm {
  font-weight: 800;
  font-size: 13px;
  fill: #fff7e6;
  dominant-baseline: central;
}

.ng__port {
  stroke: #fff7e6;
  stroke-width: 2;
  cursor: crosshair;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: transform 220ms ease-out;
}

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

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

.ng__port:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.ng__port--in.is-near,
.ng__port--out.is-armed {
  transform: scale(1.7);
}

.ng__wire {
  stroke: #17141a;
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0;
  pointer-events: none;
}

.ng__temp {
  stroke: rgba(23, 20, 26, 0.55);
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0;
  pointer-events: none;
}

.ng__cursor {
  opacity: 0;
  color: #17141a;
  pointer-events: none;
}

.ng__cursor path {
  stroke: #fff7e6;
  stroke-width: 16;
  stroke-linejoin: round;
  paint-order: stroke;
}

.ng__hint {
  font-weight: 700;
  font-size: 13px;
  fill: rgba(23, 20, 26, 0.82);
}

.ng.is-demo .ng__cursor {
  animation-name: ngCursorMove;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ng.is-demo .ng__temp {
  stroke-dasharray: var(--len);
  animation-name: ngTempDraw;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ng.is-demo .ng__wire {
  animation-name: ngCommit;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ng.is-demo .ng__port--in {
  animation-name: ngSnap;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes ngCursorMove {
  0% {
    opacity: 0;
    transform: translate(136px, 49px);
  }
  6% {
    opacity: 1;
    transform: translate(136px, 49px);
  }
  8% {
    opacity: 1;
    transform: translate(136px, 49px);
  }
  20.5% {
    opacity: 1;
    transform: translate(168px, 60px);
  }
  33% {
    opacity: 1;
    transform: translate(190px, 84px);
  }
  45.5% {
    opacity: 1;
    transform: translate(212px, 108px);
  }
  58% {
    opacity: 1;
    transform: translate(244px, 119px);
  }
  70% {
    opacity: 1;
    transform: translate(244px, 119px);
  }
  78% {
    opacity: 0;
    transform: translate(244px, 119px);
  }
  79% {
    opacity: 0;
    transform: translate(136px, 49px);
  }
  100% {
    opacity: 0;
    transform: translate(136px, 49px);
  }
}
@keyframes ngTempDraw {
  0%, 7% {
    opacity: 0;
    stroke-dashoffset: var(--len);
  }
  8% {
    opacity: 1;
    stroke-dashoffset: var(--len);
  }
  58% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
  61% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
  62% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}
@keyframes ngCommit {
  0%, 60% {
    opacity: 0;
  }
  61% {
    opacity: 1;
  }
  86% {
    opacity: 1;
  }
  87% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ngSnap {
  0%, 52% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.7);
  }
  72% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ng.is-demo .ng__cursor,
  .ng.is-demo .ng__temp,
  .ng.is-demo .ng__wire,
  .ng.is-demo .ng__port--in {
    animation-name: none !important;
  }
  .ng.is-demo .ng__wire {
    opacity: 1 !important;
  }
  .ng.is-demo .ng__temp {
    opacity: 0 !important;
  }
  .ng__port {
    transition: none !important;
  }
}
