/* Pipeline Builder — frontend (site design) */
.pipeline-wrap {
    --pl-bg: var(--mi-paper, #f4f4f2);
    --pl-text: var(--mi-ink, #111111);
    --pl-accent: var(--mi-ink, #111111);
    --pl-line: var(--mi-line, #d8d8d8);
    --pl-font: var(--mi-sans, "Space Grotesk", "Segoe UI", sans-serif);
    --pl-muted: var(--mi-muted, #555555);
    --pl-node: #ffffff;

    background: var(--pl-bg);
    color: var(--pl-text);
    font-family: var(--pl-font);
    padding: 28px 20px;
    margin: 2em 0;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--pl-line);
}

.pipeline-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 1;
}

.pipeline-svg {
    display: block;
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
}

.pipeline-node {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.pipeline-node.is-visible {
    opacity: 1;
}

.pipeline-node rect,
.pipeline-node polygon {
    fill: var(--pl-node);
    stroke: var(--pl-accent);
    transition: filter 0.2s ease;
}

.pipeline-node:hover rect,
.pipeline-node:hover polygon {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

.pipeline-node text {
    fill: var(--pl-text);
    font-family: var(--pl-font);
}

.pipeline-line {
    stroke: var(--pl-line);
    transition: opacity 0.3s;
}

.pipeline-edge-label,
.pipeline-lines text {
    fill: var(--pl-muted);
    font-family: var(--pl-font);
}

/* Keep site palette even if old meta colors linger in markup */
.mi-post__content .pipeline-wrap {
    background: var(--mi-paper, #f4f4f2) !important;
    color: var(--mi-ink, #111) !important;
    border-color: var(--mi-line, #d8d8d8);
}

.mi-post__content .pipeline-wrap .pipeline-node rect,
.mi-post__content .pipeline-wrap .pipeline-node polygon {
    fill: #fff !important;
    stroke: var(--mi-ink, #111) !important;
}

.mi-post__content .pipeline-wrap .pipeline-node text {
    fill: var(--mi-ink, #111) !important;
    font-family: var(--mi-sans, "Space Grotesk", sans-serif) !important;
}

.mi-post__content .pipeline-wrap .pipeline-line {
    stroke: var(--mi-line, #d8d8d8) !important;
}

.mi-post__content .pipeline-wrap .pipeline-lines text {
    fill: var(--mi-muted, #555) !important;
    font-family: var(--mi-sans, "Space Grotesk", sans-serif) !important;
}

@media (max-width: 768px) {
    .pipeline-wrap {
        padding: 16px 10px;
        overflow-x: auto;
    }

    .pipeline-svg {
        min-width: 420px;
    }
}
