/* Flowcharts (flowchart.js): shapes on the page's surfaces, tinted by
   what they are, after Everforest's accents: starts and ends (stadiums,
   circles) green, decisions yellow, data blue, subroutines aqua, and
   preparation (hexagons) purple; text stays in the text colour, so it
   keeps its contrast on every tint. Links run in the muted ink. Wider
   than the text, a chart scrolls sideways at full size rather than
   shrinking its labels. */
.md-flow {
	display: flex;
	margin: 0 0 var(--s4);
	padding-block: var(--s2);
	overflow-x: auto;
}

.md-flow .flow {
	flex: none;
	margin-inline: auto;
	overflow: visible;
	font-family: "Comic Mono", monospace;
	font-size: 13px;
}

.flow text {
	fill: var(--text);
	text-anchor: middle;
	dominant-baseline: central;
}

.flow-shape {
	--tint: var(--muted);
	fill: color-mix(in srgb, var(--tint) 10%, var(--surface));
	stroke: color-mix(in srgb, var(--tint) 45%, var(--border));
	stroke-width: 1.25;
}

.flow-stadium .flow-shape,
.flow-circle .flow-shape {
	--tint: var(--green);
}

.flow-diamond .flow-shape {
	--tint: var(--yellow);
}

.flow-cylinder .flow-shape {
	--tint: var(--blue);
}

.flow-subroutine .flow-shape {
	--tint: var(--aqua);
}

.flow-hexagon .flow-shape {
	--tint: var(--purple);
}

.flow-line {
	fill: none;
	stroke: var(--muted);
	stroke-width: 1.5;
	stroke-linecap: round;
}

.flow-dotted .flow-line {
	stroke-dasharray: 2 5;
}

.flow-thick .flow-line {
	stroke-width: 3;
}

.flow-head {
	fill: var(--muted);
	stroke: var(--muted);
	stroke-width: 1;
	stroke-linejoin: round;
}

.flow-label rect {
	fill: var(--bg);
	stroke: var(--hairline);
}

.flow-label text {
	fill: var(--muted);
	font-size: 12px;
}

.flow-group rect {
	fill: color-mix(in srgb, var(--text) 3%, transparent);
	stroke: var(--hairline);
	stroke-dasharray: 4 4;
}

.flow-group text {
	fill: var(--muted);
	font-size: 12px;
	text-anchor: start;
}

/* Signals running the links, and the ring a node they reach sends out
   (flowchart.js). */
.flow-signal {
	fill: var(--accent);
	pointer-events: none;
}

.flow-ripple {
	fill: none;
	stroke: var(--accent);
	stroke-width: 1.5;
	transform-box: fill-box;
	transform-origin: center;
	pointer-events: none;
}

/* Pointing at a node brings it and its links forward. */
.flow :is(.flow-node, .flow-edge, .flow-label) {
	transition: opacity 200ms var(--ease-effects);
}

.flow.flow-focus :is(.flow-node, .flow-edge):not(.flow-near),
.flow.flow-focus .flow-label {
	opacity: 0.3;
}

.flow.flow-focus .flow-edge.flow-near .flow-line {
	stroke: var(--accent);
}

.flow.flow-focus .flow-edge.flow-near .flow-head {
	fill: var(--accent);
	stroke: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
	.flow-shape,
	.flow :is(.flow-node, .flow-edge, .flow-label) {
		transition: none;
	}
}
