/* === article-graph.css — illustration styles for articles with SVGs/charts.
 * Loaded only when type=article-graph. After PE-068 + operator feedback,
 * the dark-theme body styling was removed; the article body now follows
 * the main-site `.prose` look (font-size 14px, dashed-border h2, accent h3,
 * light background). The SVG illustrations inside each `.inset` keep their
 * own dark background rect and light-text fills, so they read as embedded
 * dark-mode figures inside the otherwise light article — same as a
 * dark-mode screenshot in a light technical article.
 *
 * Scope of this file:
 *   - .scene-wrap / .hub / .fork-wrap / .chart-wrap — SVG containers
 *   - .inset / .inset-caption / .pull — illustration framing
 *   - .axes-legend / .legend / .chart-legend / .hub-legend — illustration legends
 *   - .pill / .ci-stage-controls — interactive controls (PE-083)
 *   - .code-intelligence-stack — scoped PE-083 rules
 */

.prose .scene-wrap,
.prose .hub,
.prose .fork-wrap,
.prose .chart-wrap {
  border-radius: 10px;
  overflow: hidden;
  margin: 24px 0;
}

.prose .scene-wrap {
  border: 1px solid var(--line, #1f2430);
}

.prose .inset {
  margin: 36px 0;
  padding: 22px 24px 18px;
  background: rgba(125, 139, 160, 0.06);
  border: 1px solid var(--line, #1f2430);
  border-radius: 10px;
  scroll-margin-top: 40px;
}
.prose .inset-compact { margin: 28px 0; padding: 18px 22px 14px; }
.prose .inset-caption {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent, #4dd0e1);
  margin-bottom: 10px;
  opacity: 0.9;
}
.prose .pull {
  font-size: 14px;
  color: var(--fg, #d2d8e2);
  border-left: 2px solid var(--accent, #4dd0e1);
  padding: 2px 0 2px 12px;
  margin: 14px 0 18px;
  line-height: 1.55;
}

.prose .axes-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--fg, #d2d8e2);
  list-style: none;
  padding: 0;
}
.prose .axes-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.prose .axes-legend li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #4dd0e1);
}

.prose .legend,
.prose .chart-legend,
.prose .hub-legend {
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11px;
  color: var(--fg, #d2d8e2);
}
.prose .chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.prose .legend-item { display: flex; align-items: center; gap: 6px; }
.prose .legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.prose .chart-legend .legend-item::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--c, var(--accent, #4dd0e1));
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 1px;
}
.prose .hub-legend .swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid #6ee7b7;
  margin-right: 6px;
  vertical-align: middle;
}
.prose .hub-legend .swatch.consumer { border-color: #4dd0e1; }

/* ============== INTERACTIVE PILL CONTROLS ============== */
.prose .pill {
  background: transparent;
  border: 1px solid var(--line, #1f2430);
  color: var(--fg, #d2d8e2);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.02em;
  min-height: 36px;
}
.prose .pill:hover { color: var(--accent, #4dd0e1); border-color: var(--accent, #4dd0e1); }
.prose .pill.active {
  color: #0b0d12;
  background: var(--accent, #4dd0e1);
  border-color: var(--accent, #4dd0e1);
}

/* ============== PE-083 (.code-intelligence-stack) ==============
 * Scene 2 (evidence loop) progressive enhancement + scoped layout for
 * all four PE-083 scenes. All selectors are prefixed with
 * .code-intelligence-stack so the rules cannot affect knowledge-vacuum
 * rendering. Stage emphasis is driven by JS-set data-ci-stage="0..3"
 * on #ci-scene-evidence-loop and ci-station-N classes assigned by the
 * DE-083b IIFE.
 */

.code-intelligence-stack .ci-stage-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.code-intelligence-stack .ci-stage-controls .pill {
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 999px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.code-intelligence-stack .ci-stage-controls .pill:hover {
  color: var(--accent, #4dd0e1);
  border-color: var(--accent, #4dd0e1);
}

.code-intelligence-stack .ci-stage-controls .pill:focus-visible {
  outline: 2px solid var(--accent, #4dd0e1);
  outline-offset: 2px;
}

.code-intelligence-stack .ci-stage-controls .pill[aria-pressed="true"] {
  color: #0b0d12;
  background: var(--accent, #4dd0e1);
  border-color: var(--accent, #4dd0e1);
}

/* JS-active emphasis: dim inactive stations so the active stage stands out.
 * The :not() pattern keeps the rule set small (4 selectors instead of 16)
 * and lets CSS rather than JS own the visual mapping. Without the
 * .prose-graph--js class (no JS), the rule does not apply, so the static
 * SVG renders with all stations at full opacity. */
.prose-graph--js .code-intelligence-stack #ci-scene-evidence-loop[data-ci-stage="0"] .ci-station:not(.ci-station-0),
.prose-graph--js .code-intelligence-stack #ci-scene-evidence-loop[data-ci-stage="1"] .ci-station:not(.ci-station-1),
.prose-graph--js .code-intelligence-stack #ci-scene-evidence-loop[data-ci-stage="2"] .ci-station:not(.ci-station-2),
.prose-graph--js .code-intelligence-stack #ci-scene-evidence-loop[data-ci-stage="3"] .ci-station:not(.ci-station-3) {
  opacity: 0.42;
}

.prose-graph--js .code-intelligence-stack #ci-scene-evidence-loop[data-ci-stage] .ci-station {
  transition: opacity 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .code-intelligence-stack .ci-stage-controls .pill,
  .prose-graph--js .code-intelligence-stack #ci-scene-evidence-loop[data-ci-stage] .ci-station {
    transition: none;
  }
}

@media (max-width: 720px) {
  .code-intelligence-stack .ci-stage-controls { gap: 6px; margin-bottom: 12px; }
  .code-intelligence-stack .ci-stage-controls .pill {
    font-size: 11px;
    padding: 6px 10px;
    min-height: 44px;
    min-width: 44px;
  }
}