/* ══════════════════════════════════════════════
   Pipeline Section
   ══════════════════════════════════════════════ */

.pipeline-section {
  position: relative;
  z-index: 10;
  background: var(--bg);
  padding: 100px 24px 100px;
  max-width: 100vw;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.pipeline-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.pipeline-header {
  text-align: center;
  margin-bottom: 48px;
}

/* Flow track */
.pipeline-flow {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 10px 0 20px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.pipeline-flow::-webkit-scrollbar { display: none; }

.pipe-step {
  flex: 1;
  min-width: 0;
  position: relative;
  text-align: center;
  padding: 0 6px;
  opacity: 0;
  transform: translateY(16px);
}

.pipe-step.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.pipe-step:nth-child(1).visible { transition-delay: 0s; }
.pipe-step:nth-child(2).visible { transition-delay: 0.07s; }
.pipe-step:nth-child(3).visible { transition-delay: 0.14s; }
.pipe-step:nth-child(4).visible { transition-delay: 0.21s; }
.pipe-step:nth-child(5).visible { transition-delay: 0.28s; }
.pipe-step:nth-child(6).visible { transition-delay: 0.35s; }

/* Node circle */
.pipe-node {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 53, 0.25);
  background: rgba(255, 107, 53, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pipe-node::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  animation: nodePulse 2.5s ease-in-out infinite;
}

.pipe-step:nth-child(2) .pipe-node::after { animation-delay: 0.3s; }
.pipe-step:nth-child(3) .pipe-node::after { animation-delay: 0.6s; }
.pipe-step:nth-child(4) .pipe-node::after { animation-delay: 0.9s; }
.pipe-step:nth-child(5) .pipe-node::after { animation-delay: 1.2s; }
.pipe-step:nth-child(6) .pipe-node::after { animation-delay: 1.5s; }

@keyframes nodePulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Connection line between nodes */
.pipe-step:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  right: -50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.06));
}

/* Flowing particle on the line */
.pipe-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 18px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  animation: flowParticle 3s linear infinite;
}

.pipe-step:nth-child(2):not(:last-child)::after { animation-delay: 0.5s; }
.pipe-step:nth-child(3):not(:last-child)::after { animation-delay: 1.0s; }
.pipe-step:nth-child(4):not(:last-child)::after { animation-delay: 1.5s; }
.pipe-step:nth-child(5):not(:last-child)::after { animation-delay: 2.0s; }

@keyframes flowParticle {
  0% { left: calc(50% + 18px); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { left: calc(100% + 10px); opacity: 0; }
}

.pipe-step .pipe-label {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.pipe-step .pipe-desc {
  font-size: 0.65rem;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.4);
}

/* Output format badge */
.pipeline-output {
  text-align: center;
  margin-top: 36px;
  opacity: 0;
  transform: translateY(12px);
}

.pipeline-output.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s;
}

.pipe-output-badge {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.35);
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.pipe-output-badge span {
  color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .pipeline-section { padding: 60px 16px 70px; }
  .pipeline-flow { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .pipe-step { flex: 0 0 calc(33.33% - 10px); min-width: 80px; }
  .pipe-step:not(:last-child)::before,
  .pipe-step:not(:last-child)::after { display: none; }
}

@media (max-width: 480px) {
  .pipe-step { flex: 0 0 calc(50% - 10px); }
}
