/* =========================================================
   Interactive Process Timeline — serpentine "journey" layout.
   Steps flow left→right, drop down, flow right→left, drop
   down again, so the full section width is used. An SVG path
   (built by JS from the cards' real positions) snakes through
   the grid gutters; the progress stroke and traveling pin
   follow the active step. Dark-theme tokens throughout.
   ========================================================= */

/* Full-bleed the outer wrap so the journey grid can breathe
   across the whole viewport instead of hugging the left edge. */
.proc-wrap {
  margin: 0 auto;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 0 clamp(24px, 6vw, 96px);
  box-sizing: border-box;
}

.proc-hint {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.8;
  text-align: center;
}

/* --- The journey grid --- */
.proc-list {
  list-style: none;
  padding: 0;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem);
}

/* Serpentine placement: DOM (and tab) order stays 01…07, but the
   visual order snakes — 01→02, then 03 sits under 02 so the eye
   travels back 03→04, then down and across again 05→06, with the
   baseline card 07 spanning the full row. */
@media (min-width: 901px) {
  .proc-list { grid-template-columns: 1fr 1fr; }
  .proc-row:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  .proc-row:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  .proc-row:nth-of-type(3) { grid-column: 2; grid-row: 2; }
  .proc-row:nth-of-type(4) { grid-column: 1; grid-row: 2; }
  .proc-row:nth-of-type(5) { grid-column: 1; grid-row: 3; }
  .proc-row:nth-of-type(6) { grid-column: 2; grid-row: 3; }
  .proc-row:nth-of-type(7) { grid-column: 1 / -1; grid-row: 4; }
}

/* --- The snaking path (SVG injected by JS) --- */
.proc-rail {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.proc-path-svg {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

.proc-path-base {
  fill: none;
  stroke: rgba(20, 10, 45, 0.16);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

.proc-path-fill {
  fill: none;
  stroke: var(--accent-2, #B2ED3A);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(13,13,13, 0.45));
  transition: stroke-dashoffset 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pin: sits on the active card's edge, where the path enters it.
   A sibling of the cards (not inside .proc-rail) so it can render
   above them. JS drives left/top; hidden until first positioned. */
.proc-rail-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent-2);
  box-shadow: 0 0 14px 4px rgba(13,13,13, 0.35), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: top 0.45s cubic-bezier(0.4, 0, 0.2, 1), left 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}
.proc-rail-pin.is-ready { opacity: 1; }

/* Soft, blurred glow that breathes outward from the pin — two waves
   staggered half a cycle apart for a continuous, seamless pulse. */
.proc-rail-pin::before,
.proc-rail-pin::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13,13,13, 0.55) 0%, rgba(13,13,13, 0.22) 45%, rgba(13,13,13, 0) 72%);
  filter: blur(1px);
  opacity: 0;
  animation: proc-pin-glow 2.4s cubic-bezier(0.35, 0, 0.25, 1) infinite;
  will-change: transform, opacity;
  pointer-events: none;
}
.proc-rail-pin::after {
  animation-delay: 1.2s;
}
@keyframes proc-pin-glow {
  0%   { transform: scale(0.55); opacity: 0; }
  18%  { opacity: 0.85; }
  100% { transform: scale(2.6); opacity: 0; }
}
/* Small spinning arc inside the pin for an "active" feel */
.proc-rail-pin-spin {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-2);
  border-right-color: var(--accent-2);
  animation: proc-pin-spin 1.1s linear infinite;
}
@keyframes proc-pin-spin {
  to { transform: rotate(360deg); }
}

/* --- Step cards --- */
.proc-row {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.proc-row:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
}
.proc-row:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 4px;
}

/* the old rail dots are replaced by the card states themselves */
.proc-node { display: none; }

/* --- Typography & Content --- */
.proc-num {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0.3;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.proc-content {
  padding-right: 3.2rem;
}
.proc-phase {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}
.proc-phase--launch { background: rgba(20,10,45,0.05); color: var(--text-muted); }
.proc-phase--scale  { background: rgba(13,13,13,0.12); color: var(--accent-ink); }
.proc-phase--all    { background: rgba(13,13,13,0.85); color: #fff; }
.proc-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: var(--text);
}
.proc-desc {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Metadata (Rules & Settings) — now lives inside the card,
   pinned to the bottom so paired cards line up cleanly --- */
.proc-meta {
  width: auto;
  margin-top: auto;
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  border-radius: 0;
}
.proc-content { margin-bottom: 1.25rem; }
.meta-label {
  display: block;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}
.meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.meta-list li {
  margin-bottom: 0.4rem;
  padding-left: 0.9rem;
  position: relative;
}
.meta-list li::before {
  content: "\2013";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.meta-list strong {
  color: var(--text);
}

/* --- Full-width variant (Baseline settings) --- */
.proc-row--full .proc-meta {
  border: 1px solid rgba(13,13,13,0.3);
  background: rgba(13,13,13,0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0;
}
.proc-row--full .meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
  row-gap: 0.4rem;
}

/* --- State Styles (Completed and Active Steps) --- */
.proc-row.is-passed { border-color: rgba(13,13,13,0.30); }
.proc-row.is-passed .proc-num { color: var(--accent-ink); opacity: 0.55; }
.proc-row.is-current {
  border-color: rgba(13,13,13,0.55);
  box-shadow: 0 4px 28px rgba(13,13,13,0.25);
}
.proc-row.is-current .proc-num { color: var(--text); opacity: 0.9; }

/* --- Mobile --- */
@media (max-width: 600px) {
  .proc-content { padding-right: 2.6rem; }
  .proc-num { font-size: 1.7rem; }
  .proc-row--full .meta-list { grid-template-columns: 1fr; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .proc-path-fill, .proc-rail-pin, .proc-row, .proc-num {
    transition: none;
  }
  .proc-rail-pin::before, .proc-rail-pin::after, .proc-rail-pin-spin {
    animation: none;
    display: none;
  }
}
