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 {
  position: relative;
  width: min(100%, 416px);
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 8px;
  background: #fff7e6;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.ng__board {
  position: relative;
  height: clamp(140px, 44vw, 196px);
  overflow: hidden;
  border-radius: 12px;
  background-color: #ffffff;
  background-image: linear-gradient(to right, rgba(23, 20, 26, 0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(23, 20, 26, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
}

.ng__chip {
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 2;
  background: #17141a;
  color: #fff7e6;
  border-radius: 999px;
  padding: 0 8px;
  font-weight: 700;
  font-size: 8px;
  line-height: 1.6;
}

.ng__wires {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.ng__wire {
  fill: none;
  stroke: #2f6df6;
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.ng__node {
  position: absolute;
  width: 56%;
  height: 18%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff7e6;
  border: 1px solid rgba(23, 20, 26, 0.2);
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.ng__node--a {
  left: 6%;
  top: 8%;
}

.ng__node--b {
  left: 34%;
  top: 42%;
}

.ng__node--c {
  left: 6%;
  top: 74%;
}

.ng__name {
  font-weight: 700;
  font-size: clamp(7px, 2vw, 9px);
  line-height: 1.1;
  color: #17141a;
}

.ng__port {
  position: absolute;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #2f6df6;
  transform: translateX(-50%);
}

.ng__port--in {
  top: -4px;
}

.ng__port--out {
  bottom: -4px;
}

.ng__panel {
  height: clamp(140px, 44vw, 196px);
  overflow: hidden;
  border-radius: 12px;
  background: #17141a;
  display: flex;
  flex-direction: column;
}

.ng__head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  flex: 0 0 auto;
}

.ng__brace {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.72);
  flex: 0 0 auto;
}

.ng__file {
  font-weight: 700;
  font-size: 8px;
  line-height: 1.4;
  color: #fff7e6;
  flex: 1 1 auto;
}

.ng__ico {
  width: 12px;
  height: 12px;
  display: block;
}

.ng__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #2f6df6;
  color: #fff7e6;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 140ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ng__copy:active {
  transform: scale(0.92);
}

.ng__code {
  margin: 0;
  padding: 4px 8px;
  overflow: hidden;
  flex: 1 1 auto;
  font-family: ui-monospace, "Consolas", "Courier New", monospace;
  font-size: clamp(5px, 1.8vw, 8px);
  line-height: 1.3;
  color: #fff7e6;
  white-space: pre;
}

.ng__line {
  display: block;
}

.ng__toast {
  position: absolute;
  right: 20px;
  bottom: 20px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff7e6;
  color: #17141a;
  border-radius: 999px;
  padding: 4px 12px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  font-weight: 700;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
}

.ng__tick {
  display: inline-flex;
  color: #2f6df6;
  flex: 0 0 auto;
}

.ng__toast.is-on {
  opacity: 1;
  transform: translateY(0);
}

.ng.is-demo .ng__line:nth-child(-n+16) {
  animation-name: ngLine;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ng.is-demo .ng__line:nth-child(1) {
  animation-delay: 0ms;
}

.ng.is-demo .ng__line:nth-child(2) {
  animation-delay: 22ms;
}

.ng.is-demo .ng__line:nth-child(3) {
  animation-delay: 44ms;
}

.ng.is-demo .ng__line:nth-child(4) {
  animation-delay: 66ms;
}

.ng.is-demo .ng__line:nth-child(5) {
  animation-delay: 88ms;
}

.ng.is-demo .ng__line:nth-child(6) {
  animation-delay: 110ms;
}

.ng.is-demo .ng__line:nth-child(7) {
  animation-delay: 132ms;
}

.ng.is-demo .ng__line:nth-child(8) {
  animation-delay: 154ms;
}

.ng.is-demo .ng__line:nth-child(9) {
  animation-delay: 176ms;
}

.ng.is-demo .ng__line:nth-child(10) {
  animation-delay: 198ms;
}

.ng.is-demo .ng__line:nth-child(11) {
  animation-delay: 220ms;
}

.ng.is-demo .ng__line:nth-child(12) {
  animation-delay: 242ms;
}

.ng.is-demo .ng__line:nth-child(13) {
  animation-delay: 264ms;
}

.ng.is-demo .ng__line:nth-child(14) {
  animation-delay: 286ms;
}

.ng.is-demo .ng__line:nth-child(15) {
  animation-delay: 308ms;
}

.ng.is-demo .ng__line:nth-child(16) {
  animation-delay: 330ms;
}

@keyframes ngLine {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  13% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.ng.is-demo .ng__toast {
  animation-name: ngToastCut;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes ngToastCut {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  70.5% {
    opacity: 1;
    transform: translateY(0);
  }
  84.5% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 0;
    transform: translateY(6px);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .ng {
    padding: 8px;
    gap: 4px;
  }
  .ng__head {
    padding: 0 4px;
  }
  .ng__code {
    padding: 0 4px;
  }
  .ng__file {
    font-size: 7px;
  }
  .ng__copy {
    width: 16px;
    height: 16px;
  }
  .ng__ico {
    width: 10px;
    height: 10px;
  }
  .ng__toast {
    right: 12px;
    bottom: 12px;
    font-size: 8px;
    padding: 0 8px;
  }
  .ng__chip {
    font-size: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ng.is-demo .ng__line,
  .ng.is-demo .ng__toast {
    animation: none !important;
  }
  .ng.is-demo .ng__line {
    opacity: 1 !important;
    transform: none !important;
  }
  .ng.is-demo .ng__toast {
    opacity: 1 !important;
    transform: none !important;
  }
  .ng__copy {
    transition: none !important;
  }
}
