/* ─────────────────────────────────────────────
   Hero pipeline graphic
   A stack of raw videos is fed into the Shotwell hub one by one; each comes
   back out as a smaller, annotated clip — segmented and graded pass/fail —
   that stays on screen and accumulates in a grid.
   ───────────────────────────────────────────── */

.hero-inner--wide {
  width: 100%;
  max-width: 1460px;
}

.pipeline-frame {
  position: relative;
  width: 100%;
  margin: 8px auto 40px;
  /* height set by JS scaler */
}

.pipeline {
  position: absolute;
  top: 0;
  left: 50%;
  transform-origin: top center;
  transform: translateX(-50%) scale(1);
  width: 1400px;
}

.pl-grid {
  position: relative;
  display: grid;
  grid-template-columns: 300px 280px 1fr;
  align-items: center;
  z-index: 2;
}

/* Connector wires sit behind the cards */
.pl-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.pl-wire {
  fill: none;
  stroke: rgba(42, 42, 50, 0.4);
  stroke-width: 1.5;
}

.pl-wire--in {
  transition: opacity 0.4s var(--ease-out);
}

/* output connectors only appear with their card */
.pl-out-wire {
  fill: none;
  stroke: rgba(42, 42, 50, 0.32);
  stroke-width: 1.5;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.pl-out-wire[data-on="true"] {
  opacity: 1;
}

/* ─── Column 1: incoming stack of raw videos ─── */

.pl-in {
  position: relative;
  height: 100%;
  min-height: 520px;
}

.vid-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  background: #ECECEC;
  border: 1px solid rgba(42, 42, 50, 0.12);
  border-radius: 10px;
  padding: 7px;
  box-shadow: 0 1px 0 rgba(42, 42, 50, 0.04), 0 18px 44px -26px rgba(42, 42, 50, 0.4);
  opacity: 0;
  transform-origin: center;
  transition: transform 0.6s var(--ease-out), opacity 0.5s var(--ease-out);
}

.vid-card .vid-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center top, rgba(42, 42, 50, 0.08), transparent 60%),
    #D7D7D7;
}

.vid-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #1a1a1f;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.vid-card video.is-ready { opacity: 1; }

.vid-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 2px;
}

.vid-tri {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 8px solid var(--color-text);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}

.vid-track {
  position: relative;
  flex: 1 1 auto;
  height: 3px;
  border-radius: 2px;
  background: rgba(42, 42, 50, 0.16);
  overflow: hidden;
}

.vid-track i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--color-text);
}

.vid-len {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
  font-variant-numeric: tabular-nums;
}

.vid-card--ghost { filter: saturate(0.9); }

.pl-in-label {
  position: absolute;
  left: 50%;
  top: calc(50% + 132px);
  transform: translateX(calc(-50% - 26px));
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.pl-out-label {
  width: 100%;
  max-width: 460px;
  margin-bottom: 20px;
  text-align: center;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

/* ─── Column 2: Shotwell hub ─── */

.pl-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pl-logo {
  position: relative;
  width: 188px;
  height: 188px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border: 1.5px solid rgba(42, 42, 50, 0.5);
  border-radius: 40px;
  box-shadow: 0 1px 0 rgba(42, 42, 50, 0.04), 0 26px 60px -30px rgba(42, 42, 50, 0.5);
  z-index: 3;
}

.pl-logo img {
  width: 116px;
  height: 116px;
  object-fit: contain;
}

.pl-logo::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: 40px;
  border: 2px solid var(--color-text);
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
}

.pl-logo[data-pulse="true"]::after {
  animation: pl-pulse 1.1s var(--ease-out);
}

@keyframes pl-pulse {
  0%   { opacity: 0.5; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.22); }
}

.pl-hub-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  color: var(--color-text);
  line-height: 1;
}

.pl-hub-name span { color: var(--color-accent); }

/* ─── Column 3: annotated output clips ─── */

.pl-out {
  position: relative;
  width: 100%;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding-left: 16px;
}

.out-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--color-bg-alt);
  border: 1px solid rgba(42, 42, 50, 0.12);
  border-radius: 10px;
  padding: 13px 16px 15px;
  box-shadow: 0 1px 0 rgba(42, 42, 50, 0.04), 0 16px 36px -24px rgba(42, 42, 50, 0.45);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.out-card[data-shown="true"] {
  opacity: 1;
  transform: translateX(0);
}

.out-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

/* segmented, colour-coded timeline */
.out-bar {
  position: relative;
  display: flex;
  gap: 2px;
  height: 11px;
  margin: 0;
}

.out-seg {
  height: 100%;
  border-radius: 2px;
  background: rgba(42, 42, 50, 0.18);
  transform: scaleY(0.5);
  transform-origin: center;
  opacity: 0.55;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.out-card[data-shown="true"] .out-seg { transform: scaleY(1); opacity: 1; }

.out-seg[data-status="pass"] { background: #2F7A3E; }
.out-seg[data-status="fail"] { background: #B53D2F; }
.out-seg[data-status="none"] { background: rgba(42, 42, 50, 0.22); }

.out-play {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  border-radius: 2px;
  background: var(--color-text);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.5);
  transform: translateX(-1px);
  transition: left 0.08s linear;
}

.out-foot {
  display: none;
}

.out-name {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.out-tally {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.out-tally .pass,
.out-tally .fail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.out-tally .pass { color: #2F7A3E; }
.out-tally .fail { color: #B53D2F; }

.out-tally .pass::before { content: '✓'; font-weight: 700; }
.out-tally .fail::before { content: '✕'; font-weight: 700; }

@media (max-width: 600px) {
  .pipeline-frame { margin-bottom: 28px; }
}
