/* the-eight-hour-silence.css
   Post-specific styles for two interactive figures + a couple of inline marks.
   Palette accent: amber (the warning colour). Phosphor stays the page base. */

:root {
  --ehs-amber: #ffaa00;
  --ehs-amber-dim: #7a4400;
  --ehs-amber-glow: rgba(255, 170, 0, 0.35);
  --ehs-red: #ff3333;
  --ehs-red-glow: rgba(255, 51, 51, 0.4);
  --ehs-grey: #444;
}

.ehs-mark-ok { color: var(--green); font-weight: 700; margin-left: 6px; }
.ehs-mark-bad { color: var(--ehs-red); font-weight: 700; margin-left: 6px; }

/* === Figure shell shared by both visuals === */
.ehs-fig {
  border: 1px solid var(--border);
  background: var(--bg-terminal);
  padding: 20px;
  margin: 28px 0;
}
.ehs-figcap {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* === Visual 1: spawn flow === */
.ehs-flow-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
}
.ehs-flow {
  width: 100%;
  height: auto;
  min-width: 640px;
  display: block;
}
.ehs-flow .ehs-stage rect {
  fill: #001100;
  stroke: var(--green-dim);
  stroke-width: 1;
  transition: stroke 0.2s, fill 0.2s, filter 0.2s;
}
.ehs-flow .ehs-stage-label {
  fill: var(--green);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}
.ehs-flow .ehs-stage-sub {
  fill: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}
.ehs-flow .ehs-stage-hot rect {
  stroke: var(--ehs-amber);
  stroke-width: 2;
  fill: rgba(255, 170, 0, 0.08);
  filter: drop-shadow(0 0 8px var(--ehs-amber-glow));
}
.ehs-flow .ehs-mark circle {
  fill: var(--ehs-amber-dim);
  stroke: var(--ehs-amber);
  stroke-width: 1;
  transition: fill 0.2s, transform 0.2s, filter 0.2s;
}
.ehs-flow .ehs-mark text {
  fill: #000;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
}
.ehs-flow .ehs-mark-hot circle {
  fill: var(--ehs-amber);
  filter: drop-shadow(0 0 6px var(--ehs-amber-glow));
}

.ehs-bug-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ehs-bug {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  background: #000;
  border: 1px solid var(--border);
  color: var(--white);
  padding: 12px 14px;
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: 'JetBrains Mono', monospace;
}
.ehs-bug:hover { border-color: var(--ehs-amber); }
.ehs-bug.ehs-bug-active {
  border-color: var(--ehs-amber);
  background: rgba(255, 170, 0, 0.06);
  box-shadow: inset 0 0 0 1px var(--ehs-amber);
}
.ehs-bug-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--ehs-amber);
  color: #000;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 12px;
}
.ehs-bug-text strong { color: var(--ehs-amber); }

/* === Visual 2: fan-out simulator === */
.ehs-sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.ehs-sim-modes {
  display: inline-flex;
  border: 1px solid var(--green-dim);
  margin-right: auto;
}
.ehs-sim-mode {
  background: #000;
  color: var(--text-muted);
  border: none;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ehs-sim-mode + .ehs-sim-mode { border-left: 1px solid var(--green-dim); }
.ehs-sim-mode:hover { color: var(--green); }
.ehs-sim-mode.ehs-sim-mode-on {
  background: var(--green);
  color: #000;
  font-weight: 700;
}
.ehs-sim-play, .ehs-sim-reset {
  background: #000;
  color: var(--green);
  border: 1px solid var(--green-dim);
  padding: 8px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ehs-sim-play:hover, .ehs-sim-reset:hover {
  background: var(--green);
  color: #000;
}

.ehs-sim-stage {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.ehs-worker {
  border: 1px solid var(--border);
  background: #000;
  padding: 12px 8px 10px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  transition: border-color 0.2s, background 0.2s;
}
.ehs-worker-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}
.ehs-worker-state {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  min-height: 14px;
  margin-bottom: 8px;
}
.ehs-worker-bar {
  width: 100%;
  height: 4px;
  background: #111;
  position: relative;
  overflow: hidden;
}
.ehs-worker-bar span {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: var(--green);
  transition: width 0.5s ease-out;
}
.ehs-worker.ehs-w-active {
  border-color: var(--green);
  animation: ehs-pulse 0.7s ease-in-out infinite;
}
.ehs-worker.ehs-w-spawned {
  border-color: var(--green);
  background: rgba(0, 255, 65, 0.04);
}
.ehs-worker.ehs-w-spawned .ehs-worker-state { color: var(--green); }
.ehs-worker.ehs-w-throttled {
  border-color: var(--ehs-amber);
  background: rgba(255, 170, 0, 0.06);
}
.ehs-worker.ehs-w-throttled .ehs-worker-state { color: var(--ehs-amber); }
.ehs-worker.ehs-w-throttled .ehs-worker-bar span { background: var(--ehs-amber); }
.ehs-worker.ehs-w-failed {
  border-color: var(--ehs-red);
  background: rgba(255, 51, 51, 0.06);
}
.ehs-worker.ehs-w-failed .ehs-worker-state { color: var(--ehs-red); }
.ehs-worker.ehs-w-failed .ehs-worker-bar span { background: var(--ehs-red); }
.ehs-worker.ehs-w-never {
  border-color: var(--ehs-grey);
  opacity: 0.5;
}
.ehs-worker.ehs-w-never .ehs-worker-state { color: var(--ehs-grey); }

@keyframes ehs-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.5); }
  50% { box-shadow: 0 0 12px 2px rgba(0, 255, 65, 0.5); }
}

.ehs-sim-counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.ehs-counter {
  border: 1px solid var(--border);
  background: #000;
  padding: 8px 10px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}
.ehs-c-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.ehs-c-num {
  display: block;
  font-size: 20px;
  font-weight: 700;
}
.ehs-c-spawned .ehs-c-num { color: var(--green); }
.ehs-c-deferred .ehs-c-num { color: var(--ehs-amber); }
.ehs-c-failed .ehs-c-num { color: var(--ehs-red); }
.ehs-c-missing .ehs-c-num { color: var(--ehs-grey); }

.ehs-sim-narration {
  border-left: 3px solid var(--green-dim);
  padding: 10px 14px;
  background: rgba(0, 255, 65, 0.02);
  font-size: 12px;
  color: var(--white);
  line-height: 1.6;
  font-style: italic;
}

@media (max-width: 600px) {
  .ehs-bug-list { grid-template-columns: 1fr; }
  .ehs-sim-stage { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .ehs-worker { padding: 8px 4px; }
  .ehs-worker-name { font-size: 11px; }
  .ehs-worker-state { font-size: 8px; }
  .ehs-sim-counters { grid-template-columns: repeat(2, 1fr); }
  .ehs-sim-controls { gap: 6px; }
}
