/* --- hero --- */
.text-gradient {
  background: linear-gradient(100deg, #2c84fa 10%, #7cb5ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* --- pipeline demo: code --- */
.demo-code {
  counter-reset: line;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #e6e1e8;
}

.demo-line {
  display: block;
  white-space: pre;
  padding-right: 1.25rem;
  border-left: 2px solid transparent;
  transition: background-color 0.25s, border-color 0.25s;
}

.demo-line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 2.25rem;
  padding-right: 0.9rem;
  text-align: right;
  color: #4d4c56;
  transition: color 0.25s;
}

.demo-line[data-stage] { cursor: default; }

.demo-line[data-state="active"],
.demo-line.is-focused {
  background: rgb(44 132 250 / 0.12);
  border-left-color: #2c84fa;
}

.demo-line[data-state="active"]::before { color: #2c84fa; }

.demo-line[data-state="partial"]::before { color: #7cb5ff; }

.demo-line[data-state="done"]::before {
  content: "✓";
  color: #2c84fa;
}

.demo-line[data-state="crashed"] {
  background: rgb(244 63 94 / 0.14);
  border-left-color: #f43f5e;
}

.demo-line[data-state="crashed"]::before {
  content: "✕";
  color: #f43f5e;
}

/* --- pipeline demo: graph --- */
.demo-graph {
  display: block;
  overflow: visible;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.demo-header {
  font-size: 10.5px;
  fill: #6b6a75;
  transition: fill 0.2s;
}

.demo-header.is-focused { fill: #7cb5ff; }

.demo-edge {
  fill: none;
  stroke: #3a3940;
  stroke-width: 1.5;
  transition: stroke 0.3s, opacity 0.3s;
}

.demo-edge[data-state="lit"] { stroke: rgb(44 132 250 / 0.6); }

.demo-edge[data-state="skipped"] {
  stroke-dasharray: 3 4;
  opacity: 0.5;
}

.demo-packet {
  fill: #a9cdff;
  filter: drop-shadow(0 0 4px #2c84fa);
}

.demo-node {
  transition: opacity 0.2s;
}

.demo-node.is-dimmed { opacity: 0.3; }

.demo-node rect {
  fill: #27262b;
  stroke: #44434d;
  stroke-width: 1.25;
  transition: fill 0.3s, stroke 0.3s;
}

.demo-node text {
  font-size: 10.5px;
  fill: #8b8a92;
  pointer-events: none;
  transition: fill 0.3s;
}

.demo-node[data-state="ready"] rect {
  stroke: #8b8a92;
  stroke-dasharray: 3 2;
}

.demo-node[data-state="ready"] text { fill: #e6e1e8; }

.demo-node[data-state="running"] rect {
  fill: rgb(44 132 250 / 0.18);
  stroke: #2c84fa;
  animation: demo-pulse 1s ease-in-out infinite;
}

.demo-node[data-state="running"] text { fill: #f5f6fa; }

.demo-node[data-state="done"] rect {
  fill: #2c84fa;
  stroke: #2c84fa;
}

.demo-node[data-state="done"] text { fill: #fff; }

.demo-node[data-state="crashed"] rect {
  fill: rgb(244 63 94 / 0.22);
  stroke: #f43f5e;
}

.demo-node[data-state="crashed"] text { fill: #fecdd3; }

.demo-node[data-state="crashed"] { animation: demo-shake 0.4s ease-in-out; }

.demo-node[data-state="skipped"] { opacity: 0.35; }

.demo-node[data-state="skipped"] rect { stroke-dasharray: 3 3; }

.demo-node[data-state="skipped"] text { text-decoration: line-through; }

.demo-badge {
  fill: #fbbf24;
  stroke: #1a191d;
  stroke-width: 1.5;
  display: none;
}

.demo-node.is-recovered .demo-badge { display: block; }

@keyframes demo-pulse {
  50% { filter: drop-shadow(0 0 6px rgb(44 132 250 / 0.8)); }
}

@keyframes demo-shake {
  25% { translate: -2px 0; }
  75% { translate: 2px 0; }
}

/* --- pipeline demo: chrome --- */
.demo-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #44434d;
  color: #8b8a92;
}

.demo-status i {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: currentColor;
}

.demo-status[data-state="running"] { color: #7cb5ff; border-color: rgb(44 132 250 / 0.4); }
.demo-status[data-state="running"] i { animation: demo-blink 1s infinite; }
.demo-status[data-state="recovering"] { color: #fbbf24; border-color: rgb(251 191 36 / 0.4); }
.demo-status[data-state="recovering"] i { animation: demo-blink 0.5s infinite; }
.demo-status[data-state="complete"] { color: #4ade80; border-color: rgb(74 222 128 / 0.35); }

@keyframes demo-blink {
  50% { opacity: 0.25; }
}

.demo-worker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 6.5rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  border: 1px solid #44434d;
  background: #201f23;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #e6e1e8;
  transition: border-color 0.2s, background-color 0.2s;
}

.demo-worker i {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #6b6a75;
}

.demo-worker em {
  font-style: normal;
  color: #8b8a92;
}

.demo-worker[data-state="busy"] { border-color: rgb(44 132 250 / 0.5); }
.demo-worker[data-state="busy"] i { background: #2c84fa; }
.demo-worker[data-state="busy"] em { color: #7cb5ff; }

.demo-worker[data-state="dead"] {
  border-color: rgb(244 63 94 / 0.6);
  background: rgb(244 63 94 / 0.1);
}

.demo-worker[data-state="dead"] i { background: #f43f5e; }
.demo-worker[data-state="dead"] em { color: #fda4af; }

.demo-log {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  min-height: calc(4 * 1.6em);
}

.demo-log li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #a3a2ab;
  opacity: 0.55;
  transition: opacity 0.3s;
  animation: demo-log-in 0.25s ease-out;
}

.demo-log li span {
  display: inline-block;
  width: 3.75rem;
  color: #6b6a75;
}

.demo-log li:last-child { opacity: 1; }
.demo-log li[data-tone="info"] { color: #7cb5ff; }
.demo-log li[data-tone="success"] { color: #4ade80; }
.demo-log li[data-tone="warn"] { color: #fbbf24; }
.demo-log li[data-tone="error"] { color: #fb7185; }

@keyframes demo-log-in {
  from { opacity: 0; transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .demo-node[data-state="running"] rect,
  .demo-node[data-state="crashed"],
  .demo-status i,
  .demo-log li {
    animation: none !important;
  }
}
