/* ---------------------------------------------------------------------------
   Working on now: Pip at work, at the top of Pip's panel
   ---------------------------------------------------------------------------
   Pip on the left of a scene a row tall per business, dotted lines in each
   step's colour out to the businesses, each logo ringed by a spinning arc of
   that colour, its name in ink and what Pip is doing in the step's colour.
   The step's icon travels each line (offset-path) and the logo pulses as it
   lands; both share --dur and --delay so they stay in step.
   App: app/pulse-work.js.
   --------------------------------------------------------------------------- */

.pwork { display: flex; flex-direction: column; gap: 12px }

.pwork__scene { position: relative }
.pwork__lines { position: absolute; left: 0; top: 0; overflow: visible }
.pwork__line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 5; opacity: .45 }
.pwork__pip { position: absolute; left: 0; top: calc(var(--pip-y) - 34px) }

/* One business: logo with its spinning ring, then its name and the step. */
.pwork__row { position: absolute; left: 120px; right: 0; display: flex; align-items: center; gap: 12px; height: 44px }
.pwork__row--go { cursor: pointer; border-radius: 12px; margin-right: -8px; padding-right: 8px }
.pwork__row--go:hover .pwork__name { color: var(--coral) }
.pwork__row--go:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px }
.pwork__biz { position: relative; flex: 0 0 auto; width: 40px; height: 40px }
.pwork__logo {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--page); color: var(--text);
  font-size: 13px; font-weight: 600; box-shadow: 0 0 0 2px var(--card);
}
.pwork__logo img { width: 100%; height: 100%; object-fit: cover }
/* An import has no logo: its file glyph in the step's colour takes the place. */
.pwork__file { color: var(--stage); background: color-mix(in srgb, var(--stage) 12%, var(--card)) }
.pwork__file .ms { font-size: 20px }
.pwork__biz::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 3px solid var(--stage); border-right-color: transparent; border-bottom-color: transparent;
  animation: pworkSpin 1.1s linear infinite;
}
/* The pulse as the step's icon lands: a ring of its colour ripples out. */
.pwork__biz::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  animation: pworkLand var(--dur) linear infinite; animation-delay: var(--delay);
}
@keyframes pworkSpin { to { transform: rotate(360deg) } }
@keyframes pworkLand {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--stage) 60%, transparent) }
  18%, 100% { box-shadow: 0 0 0 10px transparent }
}
.pwork__words { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.pwork__name { font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.pwork__doing {
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: color-mix(in srgb, var(--stage) 72%, var(--text));
}

/* The step's icon, riding its line from Pip to the business. */
.pwork__travel {
  position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); border: 2px solid var(--stage); color: var(--stage);
  offset-rotate: 0deg; offset-distance: 0%; opacity: 0;
  animation: pworkTravel var(--dur) linear infinite; animation-delay: var(--delay);
}
.pwork__travel .ms { font-size: 13px; font-variation-settings: 'FILL' 1 }
@keyframes pworkTravel {
  0% { offset-distance: 0%; opacity: 0 }
  15%, 85% { opacity: 1 }
  100% { offset-distance: 100%; opacity: 0 }
}
.pwork__more { margin-left: 120px; font-size: 12.5px; font-weight: 500; color: var(--muted) }

@media (prefers-reduced-motion: reduce) {
  .pwork__biz::before, .pwork__biz::after { animation: none }
  .pwork__travel { display: none }
}
