/* "The street": interactive visual for the case From wish to production */

.street {
  margin: 32px 0 8px;
}

.street-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 16px;
}
.street-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text);
  border: var(--line-w) solid var(--line);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.street-switch::before {
  content: "";
  width: 12px;
  height: 12px;
  border: var(--line-w) solid currentColor;
}
.street-switch[aria-pressed="true"]::before {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  box-shadow: var(--glow);
}
.street-switch[data-switch="agents"][aria-pressed="true"]::before {
  background: var(--green);
  border-color: var(--green);
  box-shadow: var(--green-glow);
}
.street .btn {
  padding: 8px 18px;
}

.street-lane {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: var(--line-w) solid var(--line);
  border-right: 0;
  filter: var(--line-glow);
}
@media (max-width: 720px) {
  .street-lane {
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 0;
  }
}

.station {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 230px;
  padding: 14px 14px 34px;
  border-right: var(--line-w) solid var(--line);
  background: var(--bg);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
@media (max-width: 720px) {
  .station {
    border-bottom: var(--line-w) solid var(--line);
    min-height: 190px;
  }
}
.station .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.station strong {
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  line-height: 1.15;
}
.station .who {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Manual work: dotted, hatched stations */
.station[data-who="manual"] {
  background-image: repeating-linear-gradient(
    -59deg,
    var(--line-soft) 0 1px,
    transparent 1px 10px
  );
}
.station[data-who="manual"] .who {
  color: var(--text);
}
.station[data-who="auto"] .who {
  color: var(--accent);
}
.station[data-who="agent"] .who {
  color: var(--green);
}
.station[data-who="human"] .who {
  color: var(--text);
}

/* Progress bar at the bottom of the station whose turn it is */
.station .wait {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 6px;
  border: 1px solid var(--line-soft);
}
.station .wait::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--accent-fill);
}
.station.busy .wait::after {
  transform: scaleX(1);
  transition: transform var(--wait, 600ms) linear;
}
.station.done .wait::after {
  transform: scaleX(1);
}
.station[data-who="agent"] .wait::after {
  background: var(--green);
}
.station.fail {
  box-shadow: inset 0 0 0 3px var(--accent);
}
.station.fail .who::after {
  content: " · vast";
  color: var(--accent);
}

/* Acceptance criteria: only in the street */
.criteria {
  display: none;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--muted);
}
.street.has-criteria .criteria {
  display: block;
}
.criteria li {
  position: relative;
  margin-bottom: 4px;
  padding-left: 16px;
}
.criteria li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--muted);
}
.criteria li.ok {
  color: var(--text);
}
.criteria li.ok::before {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
}

/* The work (yellow) and the agent (green, the only green element) */
.street .token,
.street .agent {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  opacity: 0;
  pointer-events: none;
}
.street.ready .token,
.street.ready .agent {
  transition: left 0.4s ease, top 0.4s ease, opacity 0.25s ease;
}
.street .token {
  background: var(--accent-fill);
  box-shadow: var(--glow);
}
.street .agent {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: var(--green);
  box-shadow: var(--green-glow);
}
.street .token.shown,
.street .agent.shown {
  opacity: 1;
}
.street .token.stuck {
  background: transparent;
  border: 3px solid var(--accent);
}

.street-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 12px;
}
.street-status {
  flex: 1 1 320px;
  min-height: 3.2em;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.street-status::before {
  content: "→ ";
  color: var(--accent);
}
.street-counter {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.street-counter b {
  font-size: 1.4rem;
  color: var(--accent);
  text-shadow: var(--glow);
}
.street[data-state="agents"] .street-counter b {
  color: var(--green);
  text-shadow: var(--green-glow);
}

@media (prefers-reduced-motion: reduce) {
  .street.ready .token,
  .street.ready .agent {
    transition: none;
  }
  .station.busy .wait::after {
    transition: none;
  }
}
