/* Motion: animierte Erklaerszenen der Workshop-Seite (reines CSS, Steuerung in workshop.js).
   Ohne JS oder bei reduzierter Bewegung zeigt jede Szene ihr vollstaendiges Endbild. */

.motion {
  margin: 36px 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-dark);
  background: #050507;
  color: var(--on-dark);
  box-shadow: var(--shadow);
}
.motion .stage {
  position: relative;
  min-height: 300px;
  padding: 22px;
  font-size: 0.95rem;
}
.motion figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-dark);
  background: var(--black-2);
}
.m-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--on-dark);
}
.m-meta {
  font-size: 0.8rem;
  color: var(--on-dark-muted);
  margin-left: auto;
}
.m-btn {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-dark);
  background: var(--black-3);
  color: var(--on-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
.m-btn:hover {
  border-color: var(--mint);
}

.motion.js [data-step] {
  transition: opacity 0.45s ease, transform 0.45s ease, background 0.3s ease, border-color 0.3s ease;
}
.motion.js [data-step]:not(.on) {
  opacity: 0;
  transform: translateY(8px);
}

/* ---------- Szene A: Terminal ---------- */

.scene-term {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 760px) {
  .scene-term {
    grid-template-columns: minmax(0, 1fr);
  }
}
.term {
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  background: #0b0b0e;
  overflow: hidden;
}
.term-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #16161a;
  font-size: 0.75rem;
  color: var(--on-dark-muted);
}
.term-head i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3a40;
}
.term-head b {
  margin-left: 8px;
  font-weight: 500;
}
.term-body {
  padding: 12px 14px;
  min-height: 250px;
}
.term-body p {
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.55vw, 0.86rem);
  line-height: 1.45;
  color: var(--mint-light);
  white-space: nowrap;
  overflow: hidden;
}
.term-body .pr {
  color: var(--mint);
  margin-right: 6px;
}
.term-body .out {
  color: #9aa3a8;
}
.term-body .ok {
  color: #8ee6c9;
}
.term-body .warn {
  color: #ffcf66;
}
.tw {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}
.motion.live [data-step].on .tw {
  width: calc(var(--n) * 1ch);
  animation: m-type calc(var(--n) * 32ms) steps(var(--n), end) both;
}
@keyframes m-type {
  from {
    width: 0;
  }
}
.pbar {
  display: inline-block;
  width: 46%;
  height: 10px;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  vertical-align: middle;
  overflow: hidden;
}
.pfill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--mint);
}
.motion.live .prog.on .pfill {
  animation: m-fill 1.5s ease-out both;
}
@keyframes m-fill {
  from {
    width: 0;
  }
}
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  background: var(--mint-light);
  vertical-align: middle;
  animation: m-blink 1s steps(1) infinite;
}
@keyframes m-blink {
  50% {
    opacity: 0;
  }
}
.side {
  display: grid;
  gap: 12px;
}
.wait {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid rgba(255, 207, 102, 0.4);
  background: rgba(255, 207, 102, 0.08);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.9rem;
}
.wait b {
  display: block;
  color: #ffcf66;
  font-family: var(--font-display);
  margin-bottom: 2px;
}
.spin {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffcf66;
  border-radius: 50%;
  animation: m-spin 0.9s linear infinite;
}
@keyframes m-spin {
  to {
    transform: rotate(360deg);
  }
}
.browser {
  border: 1px solid var(--mint);
  border-radius: 12px;
  overflow: hidden;
  background: #0b0b0e;
  box-shadow: 0 10px 34px rgba(71, 182, 161, 0.25);
}
.b-bar {
  padding: 7px 12px;
  background: #16161a;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--on-dark-muted);
}
.b-body {
  padding: 16px 14px;
}
.b-body b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--mint);
}
.b-body span {
  font-size: 0.88rem;
  color: var(--on-dark-muted);
}

/* ---------- Szene B: Matrix an zwei Beispielen ---------- */

.scene-mx {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .scene-mx {
    grid-template-columns: minmax(0, 1fr);
  }
}
.mx-col {
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  background: var(--black-2);
  padding: 16px;
}
.mx-k {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--mint);
}
.mx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--border-dark);
  font-size: 0.88rem;
}
.pips {
  display: inline-flex;
  gap: 5px;
}
.pips i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.motion.js .pips[data-step]:not(.on) {
  opacity: 1;
  transform: none;
}
.pips.on.v1 i:nth-child(-n + 1),
.pips.on.v2 i:nth-child(-n + 2),
.pips.on.v3 i:nth-child(-n + 3),
.pips.on.v4 i:nth-child(-n + 4),
.pips.on.v5 i,
.motion:not(.js) .pips.v1 i:nth-child(-n + 1),
.motion:not(.js) .pips.v2 i:nth-child(-n + 2),
.motion:not(.js) .pips.v3 i:nth-child(-n + 3),
.motion:not(.js) .pips.v4 i:nth-child(-n + 4),
.motion:not(.js) .pips.v5 i {
  background: var(--mint);
  border-color: var(--mint);
}
.mx-res {
  margin-top: 12px;
}
.mx-sum {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.mx-sum b {
  font-size: 2.2rem;
  margin-right: 6px;
}
.mx-sum .eig {
  color: var(--mint);
  text-transform: uppercase;
}
.mx-sum .cld {
  color: #d6d6d6;
  text-transform: uppercase;
}
.mx-bar {
  position: relative;
  display: grid;
  grid-template-columns: 7fr 5fr 5fr;
  height: 8px;
  margin: 10px 0 2px;
}
.mx-bar span {
  display: block;
}
.mx-bar span:nth-child(1) {
  background: #3a3a3a;
  border-radius: 99px 0 0 99px;
}
.mx-bar span:nth-child(2) {
  background: var(--mint-dark);
}
.mx-bar span:nth-child(3) {
  background: var(--mint);
  border-radius: 0 99px 99px 0;
}
.mx-mark {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 18px;
  margin-left: -2px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 2px var(--black);
}
.mx-mark.m16 {
  left: 75%;
}
.mx-mark.m9 {
  left: 31.25%;
}
.mx-veto {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #ff8fbe;
}
.mx-cap {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

/* ---------- Szene C: Korrektur oder Vorfall ---------- */

.scene-hitl {
  display: grid;
  gap: 14px;
}
.lane {
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  background: var(--black-2);
  padding: 14px 16px;
}
.lane-t {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lane.good .lane-t {
  color: var(--mint);
}
.lane.bad .lane-t {
  color: #ff8fbe;
}
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.flow li {
  position: relative;
  background: #0f0f12;
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 600;
}
.flow li small {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  color: var(--on-dark-muted);
}
.flow li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -17px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-dark-muted);
}
.flow li.human {
  border-color: var(--mint);
}
.flow li.fix {
  background: rgba(71, 182, 161, 0.18);
  border-color: var(--mint);
}
.flow li.skip {
  border-style: dashed;
  border-color: #ff8fbe;
}
.flow li.incident {
  background: rgba(224, 31, 115, 0.2);
  border-color: var(--pink);
}
@media (max-width: 760px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .flow li:not(:last-child)::after {
    content: "↓";
    right: auto;
    left: 50%;
    top: auto;
    bottom: -18px;
    transform: translateX(-50%);
  }
}
.hitl-cap {
  margin: 4px 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.wait p {
  margin: 0;
}

/* Kacheln im Videobereich, die auf fertige Animationen verweisen */
a.video-slot.ready {
  display: block;
  border-style: solid;
  border-color: var(--mint);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
a.video-slot.ready:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}
a.video-slot.ready .state {
  color: var(--mint-ink);
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .spin {
    animation: none;
  }
  .motion.js [data-step] {
    transition: none;
  }
}
