/* Reviewed in-repository diagrams, never arbitrary SVG from the CMS. */
.article-diagram { width: 100%; max-width: 100%; min-width: 0; padding: 16px; border: 1px solid var(--border); background: var(--surface); }
.article-diagram svg { display: block; width: 100%; max-width: 100%; height: auto; font-family: var(--font-family); }
.article-diagram .diagram-mobile { display: none; }
.article-diagram figcaption { margin-top: 16px; white-space: pre-line; }
@media (max-width: 799px) {
  .article-diagram { padding: 8px; }
  .article-diagram .diagram-wide { display: none; }
  .article-diagram .diagram-mobile { display: block; max-width: 480px; margin-inline: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  /* Plays once on scroll; armed diagrams wait in their start state. */
  .article-diagram.is-armed .diagram-node { opacity: .12; transform: translateY(6px); }
  .article-diagram.is-armed .diagram-edge { opacity: 0; }
  .article-diagram.is-playing .diagram-node { animation: diagram-reveal 560ms cubic-bezier(.2, .7, .2, 1) both; }
  .article-diagram.is-playing .diagram-edge { animation: diagram-draw 560ms cubic-bezier(.4, 0, .2, 1) both; }
  .article-diagram.is-playing .diagram-step-1 { animation-delay: 600ms; }
  .article-diagram.is-playing .diagram-step-2 { animation-delay: 1200ms; }
  .article-diagram.is-playing .diagram-step-3 { animation-delay: 1800ms; }
  .article-diagram.is-playing .diagram-step-4 { animation-delay: 2400ms; }
}
@keyframes diagram-reveal { from { opacity: .12; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes diagram-draw { 0% { opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; } 25% { opacity: 1; } 100% { opacity: 1; stroke-dasharray: 1; stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .article-diagram .diagram-node, .article-diagram .diagram-edge { animation: none !important; opacity: 1 !important; transform: none !important; }
}
