/* ============================================================
   KRAFT — Schritt-Animation "Ein Rechner. Ein ganzes Team."
   Nutzt die Marken-Tokens aus kraft.css: ein Akzent, kein Grün,
   Archivo für Schlagzeilen, JetBrains Mono für Beschriftungen.
   ============================================================ */

.anim {
  margin-top: clamp(40px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ink-2);
  padding: clamp(22px, 3.5vw, 40px);
  overflow: hidden;
}

.anim__head { text-align: center; margin-bottom: clamp(26px, 4vw, 44px); }
.anim__head h3 {
  font-family: var(--sans); font-weight: 900;
  font-size: clamp(22px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.05;
}

.anim__scene { position: relative; }

/* ---------- Geräte ---------- */

.anim__master, .anim__helper {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center;
}
.anim__device { display: flex; align-items: center; justify-content: center; height: 70px; }
.anim__device i {
  display: block; width: 58px; height: 58px;
  background: var(--fg-2);
  -webkit-mask: var(--ic) center / contain no-repeat;
          mask: var(--ic) center / contain no-repeat;
  transition: background .3s var(--ease);
}
.anim__master .anim__device { height: 96px; }
.anim__master .anim__device i { width: 84px; height: 84px; background: var(--fg); }
.anim__name { font-size: 13.5px; font-weight: 500; color: var(--fg); }
.anim__sub { font-size: 11.5px; color: var(--fg-3); }

/* ---------- Arbeitspakete ---------- */

.anim__rack {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  min-height: 38px; position: relative;
}
.anim__rack--main { width: 230px; flex-wrap: wrap; }
.anim__rack--worker { width: 76px; }

.anim__tile {
  position: relative; width: 30px; height: 30px; flex: none;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.anim__tile i {
  display: block; width: 17px; height: 17px;
  background: var(--fg-3);
  -webkit-mask: var(--ic) center / contain no-repeat;
          mask: var(--ic) center / contain no-repeat;
  transition: background .3s var(--ease);
}
/* Fertig = gefüllt im Akzent. Kein zweiter Farbton. */
.anim__tile.is-done { background: var(--signal); border-color: var(--signal); }
.anim__tile.is-done i { background: #fff; }

.anim__tile.is-merged {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--signal); border-color: var(--signal);
}
.anim__tile.is-merged i { width: 20px; height: 20px; background: #fff; }

.anim__fly { position: absolute; z-index: 5; pointer-events: none; }

/* ---------- Auslastung ---------- */

.anim__meter { width: min(260px, 100%); margin-top: 10px; }
.anim__meter-top {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--fg-3);
}
.anim__gauge {
  height: 6px; margin: 10px 0 8px; border-radius: 3px;
  background: var(--ink-3); overflow: hidden;
}
.anim__gauge span {
  display: block; height: 100%; width: 18%;
  background: var(--signal); border-radius: 3px;
  transition: width .12s linear;
}
.anim__note { font-size: 11.5px; color: var(--fg-3); }

/* ---------- Beispiele ---------- */

.anim__examples {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 6px 16px; max-width: 520px; margin: 16px auto 0;
  font-size: 11.5px; color: var(--fg-3);
}
.anim__examples b { color: var(--fg-2); font-weight: 400; }
.anim__examples span:last-child { flex-basis: 100%; text-align: center; color: var(--fg-2); }

/* ---------- KRAFT-Knoten ---------- */

.anim__hub { text-align: center; }
.anim__stem { width: 2px; height: 26px; background: var(--line); margin: 0 auto; }
.anim__hub-card {
  width: 190px; max-width: 100%; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--ink-3); padding: 16px 14px;
}
.anim__hub-mark {
  display: block; width: 104px; height: 46px; margin: 0 auto 8px;
  background: var(--fg);
  -webkit-mask: url('assets/kraft-logo.png') center / contain no-repeat;
          mask: url('assets/kraft-logo.png') center / contain no-repeat;
}
.anim__hub-card div { font-size: 11px; color: var(--fg-3); }

/* ---------- Verbindungen ---------- */

.anim__net { position: relative; }
.anim__wires { width: 100%; height: 82px; display: block; overflow: visible; }
.anim__wires path {
  fill: none; stroke: var(--line); stroke-width: 2;
  stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.anim__wires path.is-live { stroke: var(--signal); }
.anim__plug {
  position: absolute; left: 0; top: 0; margin: -11px 0 0 -11px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: var(--ink-2); border-radius: 50%;
}
/* Ein gedrehtes Stecker-Symbol ist bei 15px nicht mehr lesbar.
   Ein gefüllter Punkt im Akzent zeigt den Anschlusspunkt klarer. */
.anim__plug i {
  display: block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-dim);
}

.anim__helpers { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.anim__helper::before {
  content: ''; display: block; width: 18px; height: 4px;
  border-radius: 2px; background: var(--line); order: -1;
}
.anim__helper .anim__device { order: 0; }
.anim__helper .anim__name { order: 1; }
.anim__helper .anim__rack { order: 2; }
.anim__helper .anim__state { order: 3; }

.anim__state {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 20px; font-size: 11px; color: var(--fg-3);
}
.anim__spin { display: inline-flex; }
.anim__spin i {
  display: block; width: 13px; height: 13px; background: var(--signal);
  -webkit-mask: url('assets/icons/loader-circle.svg') center / contain no-repeat;
          mask: url('assets/icons/loader-circle.svg') center / contain no-repeat;
}

/* ---------- Erzählung und Steuerung ---------- */

.anim__narration { text-align: center; margin: clamp(24px, 4vw, 38px) auto 16px; max-width: 540px; }
.anim__journey { display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 14px; }
.anim__journey span { width: 20px; height: 3px; border-radius: 2px; background: var(--ink-3); transition: background .3s var(--ease); }
.anim__journey span.is-passed { background: var(--signal); }
.anim__title {
  font-family: var(--sans); font-weight: 800; font-size: clamp(17px, 2vw, 22px);
  letter-spacing: -.028em; line-height: 1.15; margin-bottom: 8px;
}
.anim__detail { min-height: 40px; font-size: 13px; color: var(--fg-2); line-height: 1.6; }

.anim__nav { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.anim__foot { text-align: center; margin-top: 20px; font-size: 11px; color: var(--fg-3); }

.anim [hidden] { display: none !important; }

@media (max-width: 620px) {
  .anim__rack--main { width: 100%; }
  .anim__helpers { gap: 4px; }
  .anim__device { height: 54px; }
  .anim__device i { width: 40px; height: 40px; }
  .anim__name { font-size: 12px; }
  .anim__rack--worker { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .anim * { transition: none !important; }
}
