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

.stage {
  display: grid;
  place-items: center;
  align-content: center;
  row-gap: 16px;
}

.pipe {
  display: flex;
  align-items: center;
  column-gap: 8px;
  width: min(450px, 94vw);
}

.node {
  position: relative;
  border-radius: 16px;
  min-height: clamp(44px, 13vw, 64px);
  flex: 1;
  display: grid;
  place-items: center;
  align-content: center;
  row-gap: 4px;
  padding: 4px;
}

.node__tag {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(8px, 1.9vw, 10.5px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 1;
}

.node--key {
  background: #fff7e6;
  color: #17141a;
}

.node--key .node__tag {
  color: #0a4fe8;
}

.node--key .node__txt {
  color: #17141a;
}

.node--fn {
  background: #2f6df6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  flex: 0.8;
}

.node--fn .node__txt {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(14px, 3.4vw, 20px);
  font-weight: 700;
  color: #fff;
}

.node--out {
  background: #fff7e6;
}

.node--out .node__tag {
  color: #c2361a;
}

.node__val {
  font-size: clamp(13px, 3.2vw, 19px);
  font-weight: 800;
  color: #17141a;
}

.node__txt {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(10px, 2.5vw, 14.5px);
  font-weight: 700;
}

.wire {
  flex: 0.5;
  height: 4px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #fff7e6 0 10px, rgba(255, 247, 230, 0.18) 10px 20px);
}

.belt {
  width: min(450px, 94vw);
  height: 10px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(255, 247, 230, 0.35) 0 14px, rgba(255, 247, 230, 0.06) 14px 28px);
}

.stage.is-demo .node--key {
  animation: key-pulse 2s ease-out infinite;
}

.stage.is-demo .wire--in {
  animation: wire-flow 2s linear infinite;
}

.stage.is-demo .node--fn {
  animation: fn-glow 2s ease-out infinite;
}

.stage.is-demo .wire--out {
  animation: wire-flow 2s linear infinite;
  animation-delay: 0.34s;
}

.stage.is-demo .node--out {
  animation: out-pop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

.stage.is-demo .belt {
  animation: belt-run 300ms linear infinite;
}

@keyframes key-pulse {
  0%, 4% {
    transform: scale(1);
  }
  12% {
    transform: scale(1.06);
  }
  20%, 100% {
    transform: scale(1);
  }
}
@keyframes wire-flow {
  0%, 8% {
    opacity: 0.25;
    background-position: 0 0;
  }
  12% {
    opacity: 1;
  }
  34% {
    opacity: 1;
    background-position: 40px 0;
  }
  40%, 100% {
    opacity: 0.25;
    background-position: 40px 0;
  }
}
@keyframes fn-glow {
  0%, 26% {
    transform: scale(1);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  38% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(47, 109, 246, 0.35), 0 14px 24px rgba(23, 20, 26, 0.32);
  }
  52%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
}
@keyframes out-pop {
  0%, 44% {
    transform: scale(0.6);
    opacity: 0;
  }
  56% {
    transform: scale(1.12);
    opacity: 1;
  }
  62%, 94% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.7);
    opacity: 0;
  }
}
@keyframes belt-run {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 28px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .node--key,
  .stage.is-demo .wire--in,
  .stage.is-demo .node--fn,
  .stage.is-demo .wire--out,
  .stage.is-demo .node--out,
  .stage.is-demo .belt {
    animation: none;
  }
  .node--out {
    opacity: 1;
  }
}
