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

.flow {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  display: block;
  overflow: visible;
}

.edge {
  fill: none;
  stroke: #17141a;
  stroke-opacity: 0.28;
  stroke-width: 3;
  stroke-linecap: round;
}

.edge--flow {
  stroke: #2f6df6;
  stroke-opacity: 1;
  stroke-dasharray: 10 14;
  animation: flow 2s linear infinite;
}

@keyframes flow {
  to {
    stroke-dashoffset: -48;
  }
}
.node__box {
  fill: transparent;
  stroke: #17141a;
  stroke-opacity: 0.45;
  stroke-width: 2;
  rx: 8px;
}

.node__name {
  fill: #17141a;
  font-weight: 700;
  font-size: 17px;
  font-family: -apple-system, "Segoe UI", sans-serif;
}

.node__type {
  fill: #17141a;
  fill-opacity: 0.72;
  font-weight: 500;
  font-size: 12px;
  font-family: -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
}

.node--trigger .node__box {
  stroke-dasharray: 6 5;
}

.node .node__box {
  animation: box-lit 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  animation-delay: calc(var(--i) * 2s / 3);
}

@keyframes box-lit {
  0%, 100% {
    stroke: #17141a;
    stroke-opacity: 0.45;
    stroke-width: 2;
  }
  12%, 32% {
    stroke: #2f6df6;
    stroke-opacity: 1;
    stroke-width: 4;
  }
  50% {
    stroke: #17141a;
    stroke-opacity: 0.45;
    stroke-width: 2;
  }
}
.pulse {
  fill: #2f6df6;
  offset-distance: 0%;
  offset-rotate: 0deg;
  animation: travel 2s ease-out infinite;
  animation-delay: calc(var(--i) * 2s / 3);
}

@keyframes travel {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  45% {
    offset-distance: 100%;
    opacity: 1;
  }
  55%, 100% {
    offset-distance: 100%;
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .edge--flow, .node, .node .node__box, .pulse {
    animation: none;
  }
  .edge--flow {
    stroke-dasharray: none;
  }
  .pulse {
    display: none;
  }
}
