/* PureUpdate — « Pipeline » : circuit du hero, paquets, bus de page, transitions entre pages. */

/* ─── View Transitions entre pages (MPA) : la page « glisse » comme sur un convoyeur ─── */
@view-transition { navigation: auto; }

.header { view-transition-name: site-header; }

::view-transition-old(root) { animation: pu-vt-out 260ms cubic-bezier(.4,0,1,1) both; }
::view-transition-new(root) { animation: pu-vt-in 420ms cubic-bezier(0,0,.2,1) both; }

@keyframes pu-vt-out { to { opacity: 0; transform: translateX(-48px); } }
@keyframes pu-vt-in  { from { opacity: 0; transform: translateX(64px); } }

/* ─── circuit du hero ─── */
.pipeline {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pipeline-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pipeline .trace {
  fill: none;
  stroke: rgba(249, 115, 22, 0.22);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.pipeline .trace--ghost { stroke: rgba(249, 115, 22, 0.08); stroke-width: 1; }
.pipeline .via { fill: rgba(249, 115, 22, 0.45); }

.pipeline .trace--out { stroke: rgba(74, 222, 128, 0.22); }

.pipeline .pad {
  fill: var(--bg-base);
  stroke: rgba(249, 115, 22, 0.5);
  stroke-width: 1.5;
}

.pkt-track {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.pkt {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  will-change: transform, opacity;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1;
  white-space: nowrap;
  color: #fff7ed;
  padding: 5px 9px 5px 18px;
  border-radius: 99px;
  background: rgba(24, 24, 31, 0.92);
  border: 1px solid rgba(249, 115, 22, 0.55);
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.35);
}

.pkt::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.pkt--out { border-color: rgba(74, 222, 128, 0.55); box-shadow: 0 0 18px rgba(74, 222, 128, 0.28); color: #dcfce7; }
.pkt--out::before { background: #4ade80; box-shadow: 0 0 8px #4ade80; }

/* ─── bus de page (pages internes) ─── */
.page-bus {
  position: relative;
  width: min(420px, 70%);
  height: 1px;
  margin: 28px auto 0;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.35) 20%, rgba(249, 115, 22, 0.35) 80%, transparent);
}

.page-bus-pkt {
  position: absolute;
  top: -3px;
  left: 0;
  width: 10px;
  height: 7px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 12px 2px var(--accent-glow);
  opacity: 0;
}

/* ─── paquet qui longe la bordure d'une carte au survol ─── */
.card-tracer {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px var(--accent-glow);
  offset-path: inset(1px round var(--r-lg));
  offset-rotate: 0deg;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .pkt-track, .card-tracer { display: none; }
}
