/*
 * Mint Addition, AI Automations: the four data and access scenario diagrams.
 * Source: Knowledge/Standards/ai-automations-data-and-access-scenarios.md, section 4.
 * Reads the site's tokens (design-tokens.css); every value has a fallback so the diagrams
 * still draw if a token is renamed. No build step.
 *
 * Each scenario is a <figure class="data-scenario"> holding two inline SVGs:
 *   .data-scenario-wide     (viewBox 880 wide)  shown when the stage is 640 px or wider;
 *   .data-scenario-stacked  (viewBox 280 wide)  shown below that, client side on top.
 * Text is 17 user units or more in the wide drawing and 13 or more in the stacked one,
 * so no label renders under 12 px at any width from 320 px up.
 */

.data-scenario {
    --diagram-panel: var(--color-raised, #14111D);
    --diagram-team-panel: var(--color-surface, #0C0A13);
    --diagram-group: var(--color-raised-high, #1C1828);
    --diagram-node: var(--color-ink, #07060B);
    --diagram-plate: var(--color-raised, #14111D);
    --diagram-edge: var(--color-line-strong, rgba(242, 239, 250, 0.22));
    --diagram-edge-soft: var(--color-line, rgba(242, 239, 250, 0.10));
    --diagram-text: var(--color-text, #F2EFFA);
    --diagram-muted: var(--color-text-muted, #B6B0C8);
    --diagram-hue: var(--service-hue, var(--color-ai-automations, #D07BFF));
    --diagram-hue-fill: var(--color-violet-depth, #1A0A26);

    margin: 0;
}

/* A light rendering for print, slides or a light page. The site itself is dark. */
.data-scenario-light .data-scenario,
.data-scenario.data-scenario-light {
    --diagram-panel: #FFFFFF;
    --diagram-team-panel: #F4F2F8;
    --diagram-group: #F1ECFA;
    --diagram-node: #FFFFFF;
    --diagram-plate: #FFFFFF;
    --diagram-edge: rgba(26, 20, 40, 0.30);
    --diagram-edge-soft: rgba(26, 20, 40, 0.14);
    --diagram-text: #17131F;
    --diagram-muted: #4F4862;
    --diagram-hue: #8A2DBF;
    --diagram-hue-fill: #F6EBFE;
}

/* ---------- Choosing the drawing by the space it has ---------- */

.data-scenario-stage {
    container-type: inline-size;
}

.data-scenario-wide,
.data-scenario-stacked {
    display: block;
    width: 100%;
    height: auto;
    margin-inline: auto;
    overflow: visible;
}

.data-scenario-wide {
    display: none;
    max-width: 960px;
}

.data-scenario-stacked {
    max-width: 440px;
}

@container (min-width: 640px) {
    .data-scenario-wide {
        display: block;
    }

    .data-scenario-stacked {
        display: none;
    }
}

/* ---------- Caption ---------- */

.data-scenario figcaption {
    max-width: var(--measure, 62ch);
    margin: var(--space-5, 24px) auto 0;
    color: var(--diagram-text);
    font-family: var(--font-body, "Hanken Grotesk", system-ui, sans-serif);
    font-size: var(--text-body, 1.0625rem);
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

/* ---------- Shapes ---------- */

.diagram-panel-client {
    fill: var(--diagram-panel);
    stroke: var(--diagram-edge);
    stroke-width: 1.5;
}

.diagram-panel-team {
    fill: var(--diagram-team-panel);
    stroke: var(--diagram-edge);
    stroke-width: 1.5;
}

.diagram-group {
    fill: var(--diagram-group);
    stroke: var(--diagram-edge-soft);
    stroke-width: 1.5;
}

.diagram-node {
    fill: var(--diagram-node);
    stroke: var(--diagram-edge);
    stroke-width: 1.5;
}

.diagram-node-automation {
    fill: var(--diagram-hue-fill);
    stroke: var(--diagram-hue);
    stroke-width: 2;
}

.diagram-node-outside {
    fill: none;
    stroke: var(--diagram-muted);
    stroke-width: 1.5;
    stroke-dasharray: 7 6;
}

.diagram-node-machine {
    fill: var(--diagram-node);
    stroke: var(--diagram-hue);
    stroke-width: 2;
}

.diagram-plate {
    fill: var(--diagram-plate);
}

/* A label that sits on the dividing line, inside the zones, takes the zones' tone. */
.diagram-plate-group {
    fill: var(--diagram-group);
}

.diagram-boundary {
    fill: none;
    stroke: var(--diagram-hue);
    stroke-width: 2.5;
}

.diagram-divider {
    fill: none;
    stroke: var(--diagram-muted);
    stroke-width: 2;
    stroke-dasharray: 2 7;
    stroke-linecap: round;
}

.diagram-arrow {
    fill: none;
    stroke: var(--diagram-muted);
    stroke-width: 2;
}

.diagram-arrowhead {
    fill: var(--diagram-muted);
}

.diagram-arrow-crossing {
    fill: none;
    stroke: var(--diagram-hue);
    stroke-width: 2.5;
}

.diagram-arrowhead-crossing,
.diagram-origin {
    fill: var(--diagram-hue);
}

.diagram-icon {
    fill: none;
    stroke: var(--diagram-text);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.diagram-icon-hue {
    fill: none;
    stroke: var(--diagram-hue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.diagram-switch-knob {
    fill: var(--diagram-hue);
}

.diagram-timeline-line {
    fill: none;
    stroke: var(--diagram-edge);
    stroke-width: 2;
}

.diagram-timeline-step {
    fill: var(--diagram-panel);
    stroke: var(--diagram-hue);
    stroke-width: 2;
}

/* ---------- Text ---------- */

.data-scenario svg text {
    font-family: var(--font-body, "Hanken Grotesk", system-ui, sans-serif);
    fill: var(--diagram-text);
}

.data-scenario .diagram-title {
    font-family: var(--font-display, "Archivo", system-ui, sans-serif);
    font-weight: 620;
    font-stretch: 108%;
}

.data-scenario .diagram-label {
    font-weight: 600;
}

.data-scenario .diagram-group-label,
.data-scenario .diagram-boundary-label {
    font-weight: 600;
    fill: var(--diagram-hue);
}

.data-scenario .diagram-note {
    font-weight: 500;
    fill: var(--diagram-muted);
}

.data-scenario .diagram-step-number {
    font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace);
    font-weight: 500;
    fill: var(--diagram-hue);
}

.data-scenario .diagram-middle {
    text-anchor: middle;
}

.data-scenario .diagram-end {
    text-anchor: end;
}

.data-scenario-wide .diagram-title {
    font-size: 22px;
}

.data-scenario-wide .diagram-label,
.data-scenario-wide .diagram-group-label,
.data-scenario-wide .diagram-boundary-label,
.data-scenario-wide .diagram-note,
.data-scenario-wide .diagram-step-number {
    font-size: 17px;
}

.data-scenario-stacked .diagram-title {
    font-size: 18px;
}

.data-scenario-stacked .diagram-label,
.data-scenario-stacked .diagram-group-label,
.data-scenario-stacked .diagram-boundary-label {
    font-size: 14px;
}

.data-scenario-stacked .diagram-note,
.data-scenario-stacked .diagram-step-number {
    font-size: 13px;
}
