/* ============================================================
   PROCESS — interactive timeline.
   Layered after css/services.css.
   ============================================================ */

.process-timeline {
  position: relative;
  margin-top: 24px;
  padding: 0 8px;
  --progress: 0%;          /* set by JS based on mouse X (or scroll fallback) */
  --active: 0;             /* 0..3, current dominant step */
}

/* Continuous track behind the steps (desktop) */
.process-track {
  position: absolute;
  top: var(--track-top, 41px); /* JS measures real node center; 41px = 32px step pad + 9px node half */
  left: 12.5%;             /* center of first step (1/8) */
  right: 12.5%;            /* center of last step  */
  height: 2px;
  pointer-events: none;
  z-index: 0;
}
.process-track-line,
.process-track-fill {
  position: absolute; inset: 0;
  border-radius: 2px;
}
.process-track-line {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}
.process-track-fill {
  width: var(--progress);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 60%, transparent);
  transition: width .35s cubic-bezier(.2,.8,.2,1);
}

/* Grid sits above the track */
.process-timeline .process-grid {
  position: relative;
  z-index: 1;
  align-items: flex-start;
}

/* Override existing connector hide — track replaces it */
.process-timeline .process-connector { display: none; }

/* Steps */
.process-timeline .process-step {
  position: relative;
  cursor: default;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.process-timeline .process-step:hover { transform: translateY(-4px); }

/* Node dot on the timeline */
.process-node {
  width: 18px; height: 18px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--bg-darker, #0d0d12);
  border: 2px solid color-mix(in srgb, var(--primary) 30%, transparent);
  position: relative;
  display: grid; place-items: center;
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.process-node span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 35%, transparent);
  transition: background .3s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}

/* Active states based on data-step relative to --active (set inline by JS) */
.process-timeline .process-step.is-reached .process-node {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.process-timeline .process-step.is-reached .process-node span {
  background: var(--primary);
}
.process-timeline .process-step.is-active .process-node {
  border-color: var(--accent);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent),
    0 0 22px color-mix(in srgb, var(--accent) 60%, transparent);
  transform: scale(1.15);
}
.process-timeline .process-step.is-active .process-node span {
  background: var(--accent);
  transform: scale(1.4);
}
.process-timeline .process-step.is-active .process-number {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: scale(1.04);
}
.process-timeline .process-step .process-number {
  display: inline-block;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), color .3s ease;
}

/* Subtle pulse on active node */
.process-timeline .process-step.is-active .process-node::before {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  animation: nodePulse 1.6s ease-out infinite;
  pointer-events: none;
}
@keyframes nodePulse {
  0%   { transform: scale(.85); opacity: .9; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Mobile: vertical track */
@media (max-width: 768px) {
  .process-track {
    top: 0; bottom: 0; left: 12px;
    right: auto;
    width: 2px; height: auto;
  }
  .process-track-fill {
    width: 100%;
    height: var(--progress, 0%);
    background: linear-gradient(180deg, var(--primary), var(--accent));
  }
  .process-timeline .process-grid {
    align-items: stretch;
  }
  .process-timeline .process-step {
    text-align: left;
    padding-left: 36px;
    padding-right: 16px;
  }
  .process-node {
    position: absolute;
    left: 4px; top: 24px;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .process-track-fill,
  .process-timeline .process-step,
  .process-timeline .process-step .process-node,
  .process-timeline .process-step .process-number {
    transition: none !important;
    animation: none !important;
  }
}
