/* implementation.css - the Implementation page's figures (templates in implementation.html) and render blocks (implementation.js) */

.im-fig,
.im-render,
.im-sum,
.im-heading {
    --im-panel: #F9FAFC;
    --im-panel-line: #D8E0E8;
    --im-ink: #26323C;
    --im-muted: #5C6873;
    --im-water: #DCEBF5;
    --im-water2: #E3F0F8;
    --im-water3: #F2F6FA;
    --im-steel: #E8ECF0;
    --im-steel-line: #8D9BAA;
    --im-pipe: #C8D2DC;
    --im-pipe-in: #D6E8F3;
    --im-flow: #3A87BE;
    --im-amber: #D9921E;
    --im-amber-ink: #A3630A;
    --im-amber-fill: #FFF6E3;
    --im-orange: #E58A2E;
    --im-orange-ink: #B05A14;
    --im-peach: #FDEBD9;
    --im-peach-2: #F9CFA0;
    --im-cell: #E7D2A0;
    --im-cell-line: #CDA968;
    --im-cell-dot: #F4E8CA;
    --im-cell-ink: #7E5F24;
    --im-green: #D2EAD7;
    --im-green-top: #E4F2E7;
    --im-green-line: #80BD8E;
    --im-green-dark: #6F8E76;
    --im-purple: #8A63C8;
    --im-purple-fill: #CDBBF0;
    --im-teal: #81D3BF;
    --im-teal-line: #3E9C83;
    --im-liquid: #EFE0C2;
    --im-liquid-line: #D6C29B;
    --im-zoom: rgba(120,135,150,0.13);
    --im-zoom-line: #9AA8B6;
    --im-badge: #26323C;
    --im-badge-ink: #FFFFFF;
    --im-foam: #FFFFFF;
    --im-foam-bg: #F2F5F9;
    --im-foam-line: #AAB6C2;
    --im-blue: #5B9BD5;
    --im-blue-line: #2F6EA8;
    --im-blue-ink: #2F6EA8;
    --im-blue-box: #EAF2FB;
    --im-blue-box-line: #7FA8D6;
    --im-red: #E07A5F;
    --im-red-ink: #C4553A;
    --im-air: #5C6F86;
    --im-air-ink: #5C7A99;
    --im-bug: #ABDDB6;
    --im-bug-line: #5BAE6E;
    --im-heat: #E07A5F;
    --im-revenue: #E7EFFB;
    --im-revenue-line: #3D7FD6;
}

html[data-dark] .im-fig,
html[data-dark] .im-render,
html[data-dark] .im-sum {
    --im-panel: #1E2420;
    --im-panel-line: rgba(255,255,255,0.12);
    --im-ink: #E6ECE8;
    --im-muted: #A9B4AE;
    --im-water: #213441;
    --im-water2: #1E303B;
    --im-water3: #232C33;
    --im-steel: #2A3137;
    --im-steel-line: #7E8C99;
    --im-pipe: #3A444D;
    --im-pipe-in: #2A4252;
    --im-flow: #5CA8DC;
    --im-amber: #E0A53A;
    --im-amber-ink: #EDB95E;
    --im-amber-fill: #33291A;
    --im-orange: #F09A4A;
    --im-orange-ink: #F4AE6E;
    --im-peach: #3E2F23;
    --im-peach-2: #8A5E33;
    --im-cell: #7A6540;
    --im-cell-line: #B0904F;
    --im-cell-dot: #94804F;
    --im-cell-ink: #E6CC92;
    --im-green: #243A2B;
    --im-green-top: #2C4634;
    --im-green-line: #6DAF7E;
    --im-green-dark: #8FB89A;
    --im-purple: #A98AE2;
    --im-purple-fill: #4E4270;
    --im-teal: #4FA892;
    --im-teal-line: #7FD1BC;
    --im-liquid: #3B3326;
    --im-liquid-line: #6B5C40;
    --im-zoom: rgba(170,185,200,0.10);
    --im-zoom-line: #7E8C99;
    --im-badge: #E6ECE8;
    --im-badge-ink: #171B18;
    --im-foam: #2F383F;
    --im-foam-bg: #262E34;
    --im-foam-line: #7F8D99;
    --im-blue: #6FAEE3;
    --im-blue-line: #A6CCF0;
    --im-blue-ink: #8CC0EE;
    --im-blue-box: #1F2E3D;
    --im-blue-box-line: #5E8FC4;
    --im-red: #EE8E74;
    --im-red-ink: #F29C84;
    --im-air: #9AB0C8;
    --im-air-ink: #A9C2DB;
    --im-bug: #3D6A49;
    --im-bug-line: #7CC48F;
    --im-revenue: #1E2E42;
    --im-revenue-line: #6FA6EA;
}

/* ── sub-heading ── */
.im-heading { margin-top: 2.2rem; margin-bottom: -0.3rem; }
.im-heading-title { margin: 0; line-height: 1.25; letter-spacing: -0.02em; }
.im-heading--h3 .im-heading-title { font-size: clamp(1.15rem, 2.4vw, 1.4rem); }
.im-heading--h4 .im-heading-title { font-size: 1.05rem; }

/* ── figures: wider than the text, the drawing scrolls sideways on a phone ── */
.im-fig,
.im-sum,
.content-block.im-render {
    max-width: 980px;
    margin: 2rem auto;
}
.content-embed:has(.im-fig),
.content-embed:has(.im-sum) { max-width: 980px; }

.im-fig-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-strong);
}
.im-fig-sub {
    margin: 0.15rem 0 0.9rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.im-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border-radius: 14px;
}
.im-scroll:focus-visible { outline: 3px solid var(--im-flow); outline-offset: 2px; }

.im-svg {
    display: block;
    width: 100%;
    min-width: 680px;
    height: auto;
    font-family: 'Manrope', sans-serif;
}

.im-fig-cap {
    margin: 0.9rem 0 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.im-fig-cap strong,
.im-sum-cap strong { color: var(--text-strong); }

/* ── svg text ── */
.im-svg text { font-size: 13.5px; fill: var(--im-ink); }
.im-svg .t-b { font-weight: 700; }
.im-svg .t-reg { font-weight: 400; }
.im-svg .t-h { font-size: 17px; font-weight: 700; }
.im-svg .t-sub { font-size: 13px; font-weight: 400; }
.im-svg .t-m { fill: var(--im-muted); }
.im-svg .t-sm { font-size: 12px; }
.im-svg .t-xs { font-size: 11px; }
.im-svg .t-lg { font-size: 15.5px; }
.im-svg .t-i { font-style: italic; }
.im-svg .mid { text-anchor: middle; }
.im-svg .t-amb { fill: var(--im-amber-ink); font-weight: 700; }
.im-svg .t-or { fill: var(--im-orange-ink); }
.im-svg .t-blue { fill: var(--im-blue-ink); }
.im-svg .t-brown { fill: var(--im-cell-ink); }
.im-svg .t-pu { fill: var(--im-purple); }
.im-svg .t-red { fill: var(--im-red-ink); }
.im-svg .t-air { fill: var(--im-air-ink); }
.im-svg .badge-t { fill: var(--im-badge-ink); font-size: 13px; font-weight: 700; text-anchor: middle; }
.im-svg .badge-t--sm { font-size: 11px; }

/* ── svg shapes ── */
.im-svg .panel { fill: var(--im-panel); stroke: var(--im-panel-line); stroke-width: 1.5; }
.im-svg .badge { fill: var(--im-badge); }
.im-svg .frame { fill: none; stroke: var(--im-panel-line); stroke-width: 1.5; }
.s-flow { fill: none; stroke: var(--im-flow); stroke-width: 2.5; stroke-linecap: round; }
.s-or { fill: none; stroke: var(--im-orange); stroke-width: 3; stroke-linecap: round; }
.s-or.s-thin { stroke-width: 2; }
.s-pu { fill: none; stroke: var(--im-purple); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.s-air { fill: none; stroke: var(--im-air); stroke-width: 2.5; stroke-linecap: round; }
.im-svg .s-grey { stroke: var(--im-steel-line); stroke-width: 1.4; }
.im-svg .s-dots { stroke: var(--im-flow); stroke-width: 2.2; stroke-dasharray: 0.1 6; stroke-linecap: round; }
.m-flow { fill: var(--im-flow); }
.m-or { fill: var(--im-orange); }
.m-pu { fill: var(--im-purple); }
.m-air { fill: var(--im-air); }
.m-grey { fill: var(--im-steel-line); }
.s-tbc { fill: none; stroke: var(--im-amber); stroke-width: 2; stroke-dasharray: 6 4; }
.r-tbc { fill: var(--im-amber-fill); stroke: var(--im-amber); stroke-width: 2; stroke-dasharray: 6 4; }
.im-svg .s-tick { stroke: var(--im-muted); stroke-width: 1.4; }
.im-svg .lead { stroke: var(--im-muted); stroke-width: 1.3; }
.im-svg .lead-dot,
.im-svg .dot { fill: var(--im-muted); }
.im-svg .lead-purple { stroke: var(--im-purple); stroke-width: 1.4; }
.im-svg .lead-grey { stroke: var(--im-steel-line); stroke-width: 1.4; }
.im-svg .lead-teal { stroke: var(--im-teal-line); stroke-width: 1.4; }
.im-svg .lead-red { stroke: var(--im-red); stroke-width: 1.4; }
.im-svg .lead-blue { stroke: var(--im-blue); stroke-width: 1.4; }
.im-svg .pipe { fill: var(--im-pipe-in); stroke: var(--im-pipe); stroke-width: 1.5; }
.im-svg .pipe-path { fill: none; stroke: var(--im-pipe); stroke-width: 12; stroke-linejoin: round; }
.im-svg .stub { fill: var(--im-pipe-in); }
.im-svg .pump { fill: #E3E6F3; stroke: #7D86AE; stroke-width: 2.5; }
.im-svg .pump-x { stroke: #7D86AE; stroke-width: 5; stroke-linecap: round; }
.im-svg .pump-hub { fill: #7D86AE; }
.im-svg .housing { fill: var(--im-steel); stroke: var(--im-steel-line); stroke-width: 4; }
.im-svg .water { fill: var(--im-water); stroke: var(--im-pipe); stroke-width: 1.2; }
.im-svg .water2 { fill: var(--im-water2); }
.im-svg .water3 { fill: var(--im-water3); }
.im-svg .sheets rect { fill: url(#f1-dots); stroke: var(--im-cell-line); stroke-width: 1.4; }
.pt-cell { fill: var(--im-cell); }
.pt-dot { fill: var(--im-cell-dot); }
.im-svg .zoom-ring { fill: none; stroke: var(--im-ink); stroke-width: 2.4; }
.im-svg .zoom-ring--thick { stroke-width: 3; }
.im-svg .zoom { fill: var(--im-zoom); }
.im-svg .zoom-line { fill: none; stroke: var(--im-zoom-line); stroke-width: 1.2; }
.im-svg .elu-chan { fill: var(--im-peach); stroke: var(--im-peach-2); stroke-width: 1; }
.im-svg .ht-box { fill: var(--im-peach); stroke: var(--im-orange); stroke-width: 2; }
.im-svg .ht-fill { fill: var(--im-peach-2); }
.im-svg .bio { fill: var(--im-green); stroke: var(--im-green-line); stroke-width: 3; }
.im-svg .bio-top { fill: var(--im-green-top); }
.im-svg .bio-imp { stroke: var(--im-green-dark); stroke-width: 4; }
.im-svg .bio-bar { fill: var(--im-green-dark); }
.im-svg .bubble { fill: var(--im-foam); stroke: var(--im-green-line); stroke-width: 1.6; }
.im-svg .fib-o use { fill: none; stroke: var(--im-cell-line); stroke-width: 9.5; }
.im-svg .fib-i use { fill: none; stroke: var(--im-cell-dot); stroke-width: 4.5; }
.im-svg .fibre-band { fill: var(--im-cell); }
.im-svg .fibre-edge { stroke: var(--im-cell-line); stroke-width: 2; }
.im-svg .fibre-grain { fill: none; stroke: var(--im-cell-line); stroke-width: 1.2; opacity: 0.7; }
.mol circle { fill: #8CC8EE; stroke: #3A87BE; stroke-width: 1.2; }
.mol rect,
.mol path { fill: #B7C0CA; stroke: #7D8894; stroke-width: 1.2; }
.cbm { fill: var(--im-teal); stroke: var(--im-teal-line); stroke-width: 2.4; }
.linker { fill: none; stroke: var(--im-steel-line); stroke-width: 3; stroke-linecap: round; }
.hyt { fill: var(--im-purple-fill); stroke: var(--im-purple); stroke-width: 2.4; }
.ht { fill: #F2A65A; stroke: #D9782B; stroke-width: 1.8; stroke-linejoin: round; }
.ht-stick { stroke: #D9782B; stroke-width: 2; stroke-linecap: round; }
.im-svg .pocket { fill: none; stroke: #6B45B0; stroke-width: 4; stroke-linecap: round; }
.sw-cell { fill: var(--im-cell); stroke: var(--im-cell-line); stroke-width: 1.5; }

/* figure 2 */
.im-svg .box { fill: var(--im-panel); stroke: var(--im-pipe); stroke-width: 2.5; }
.liquid { fill: var(--im-liquid); }
.liquid-panel { stroke: var(--im-liquid-line); stroke-width: 1.6; }
.im-svg .heat { fill: none; stroke: var(--im-heat); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.im-svg .heat-wave { fill: none; stroke: var(--im-heat); stroke-width: 2; opacity: 0.75; stroke-linecap: round; }
.im-svg .outline-dark { fill: var(--im-panel); stroke: var(--im-ink); stroke-width: 3; }
.im-svg .cap { fill: var(--im-steel); stroke: var(--im-steel-line); stroke-width: 2; }
.im-svg .foam-bg { fill: var(--im-foam-bg); }
.foam circle { fill: var(--im-foam); stroke: var(--im-foam-line); stroke-width: 1.4; }
.im-svg .vessel { fill: none; stroke: var(--im-steel-line); stroke-width: 3; }
.im-svg .vessel-big { stroke-width: 4; }
.im-svg .vessel-sm { fill: var(--im-foam-bg); stroke: var(--im-steel-line); stroke-width: 2.5; }
.im-svg .foam-liq { fill: var(--im-water3); }
.im-svg .shaft { stroke: var(--im-steel-line); stroke-width: 4; }
.im-svg .impeller { fill: #7A84AE; }
.im-svg .bubbles-sm circle { fill: var(--im-foam); stroke: var(--im-steel-line); stroke-width: 1.2; }
.im-svg .funnel { fill: var(--im-panel); stroke: var(--im-steel-line); stroke-width: 2.5; stroke-linejoin: round; }
.cell { fill: var(--im-bug); stroke: var(--im-bug-line); stroke-width: 1.6; }
.cell-slit { stroke: var(--im-bug-line); stroke-width: 1.6; stroke-linecap: round; }
.im-svg .pdot { fill: var(--im-purple); }
.im-svg .rl-box { fill: var(--im-blue-box); stroke: var(--im-blue-box-line); stroke-width: 2.5; }
.rl-head { fill: var(--im-blue); stroke: var(--im-blue-line); stroke-width: 1.4; }
.rl-tail { fill: none; stroke: var(--im-red); stroke-width: 2; stroke-linecap: round; }
.im-svg .rl-tail--big { stroke-width: 3.5; }
.im-svg .flask { fill: var(--im-liquid); stroke: var(--im-steel-line); stroke-width: 2; stroke-linejoin: round; }
.im-svg .green-box { fill: var(--im-green); stroke: var(--im-green-line); stroke-width: 2.5; }
.im-svg .leaf { fill: var(--im-bug); stroke: var(--im-bug-line); stroke-width: 1.4; }
.im-svg .jacket { fill: var(--im-water); stroke: var(--im-pipe); stroke-width: 2; }
.im-svg .level { stroke: var(--im-flow); stroke-width: 1.3; stroke-dasharray: 4 3; }
.im-svg .probe { stroke: #7A84AE; stroke-width: 3; }
.im-svg .probe-head { fill: #E3E6F6; stroke: #7A84AE; stroke-width: 2; }
.im-svg .air-pipe { fill: var(--im-steel); stroke: var(--im-pipe); stroke-width: 1.5; }
.im-svg .sparger { fill: #9AA4AE; }
.im-svg .sparger-holes circle { fill: #FFFFFF; }
.im-svg .bubble-big { fill: var(--im-foam); stroke: var(--im-steel-line); stroke-width: 1.6; }
.im-svg .air { fill: var(--im-foam-bg); stroke: #7FA0BD; stroke-width: 2.5; }

/* ── legend ── */
.im-legend {
    margin-top: 0.9rem;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--im-panel-line);
    border-radius: 14px;
    background: var(--im-panel);
}
.im-legend-title { margin: 0 0 0.45rem; font-size: 0.85rem; font-weight: 700; color: var(--im-ink); }
.im-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1.4rem;
}
.im-legend-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.3;
    color: var(--im-ink);
}
.im-legend-list svg { flex: none; width: 36px; height: 14px; overflow: visible; }

/* ── renders: labels over the picture, or its numbered key ── */
.im-render { margin-inline: auto; }
.im-render-frame {
    position: relative;
    container-type: inline-size;
    overflow: hidden;
    border-radius: 18px;
    background: #F9FBEF;
    line-height: 0;
}
.im-render-frame img { display: block; width: 100%; height: auto; }
.im-callouts .im-render-frame { min-width: 560px; }

/* the label sits where the picture's own text was; x is its start (left) or end (right) */
.im-callout {
    position: absolute;
    top: var(--y);
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35cqi;
    font-family: 'Manrope', sans-serif;
    line-height: 1.15;
    white-space: nowrap;
}
.im-callout--left { left: var(--x); }
.im-callout--right { right: calc(100% - var(--x)); text-align: right; }
.im-callout strong { font-size: 1.55cqi; font-weight: 700; color: #111111; }
.im-callout span { font-size: 1.22cqi; color: #444444; }

.im-key {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column;
    grid-template-rows: repeat(4, auto);
    gap: 0.7rem 1.6rem;
}
.im-key li { display: flex; align-items: flex-start; gap: 0.65rem; }
.im-key-n {
    flex: none;
    display: grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: #1E2A38;
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 700;
}
html[data-dark] .im-key-n { background: #E6ECE8; color: #171B18; }
.im-key-words { display: flex; flex-direction: column; gap: 0.1rem; padding-top: 0.15rem; }
.im-key-words strong { font-size: 0.95rem; color: var(--text-strong); }
.im-key-words span { font-size: 0.85rem; color: var(--text-muted); }

@media (max-width: 560px) {
    .im-key { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
}

/* ── to sum up: the steps in a row, each output under its step ── */
.im-sum { margin-inline: auto; }
.im-sum-title { margin: 0 0 1.1rem; font-size: 1.05rem; font-weight: 700; color: var(--text-strong); }
.im-sum-cols {
    --gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: auto auto;
    column-gap: var(--gap);
    row-gap: 3.2rem;
}
/* subgrid keeps every step, and every output, the same height */
.im-sum-col { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
.im-sum-box {
    position: relative;
    margin: 0;
    padding: 0.85rem 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    text-align: center;
    border: 1.5px solid var(--im-panel-line);
    border-radius: 10px;
    background: var(--im-panel);
    color: var(--im-ink);
}
.im-sum-box strong { font-size: 0.92rem; }
.im-sum-box span { font-size: 0.82rem; line-height: 1.4; }
.im-sum-box.is-revenue { background: var(--im-revenue); border: 2px solid var(--im-revenue-line); }

/* arrows: right between steps, down from a step to its output */
.im-sum-col + .im-sum-col > .im-sum-box:first-child::before,
.im-sum-out::before {
    content: '';
    position: absolute;
    background: var(--im-steel-line);
}
.im-sum-col + .im-sum-col > .im-sum-box:first-child::before {
    right: 100%;
    top: 50%;
    width: calc(var(--gap) - 6px);
    height: 1.5px;
    margin-right: 3px;
}
.im-sum-col + .im-sum-col > .im-sum-box:first-child::after,
.im-sum-out::after {
    content: '';
    position: absolute;
    border: 5px solid transparent;
}
.im-sum-col + .im-sum-col > .im-sum-box:first-child::after {
    right: calc(100% + 3px);
    top: calc(50% - 4.25px);
    border-left: 7px solid var(--im-steel-line);
    border-right: 0;
}
.im-sum-out::before { bottom: calc(100% + 3px); left: calc(50% - 0.75px); width: 1.5px; height: calc(3.2rem - 6px); }
.im-sum-out::after { bottom: calc(100% + 3px); left: calc(50% - 5px); border-top: 7px solid var(--im-steel-line); border-bottom: 0; }

.im-sum-cap { margin: 1rem 0 0; font-size: 0.85rem; color: var(--text-muted); }

/* phone: the steps run down, each output to its right */
@media (max-width: 700px) {
    .im-sum-cols { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 2.2rem; }
    .im-sum-col { grid-row: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; column-gap: var(--gap); row-gap: 0; }
    .im-sum-col + .im-sum-col > .im-sum-box:first-child::before { right: auto; top: auto; bottom: calc(100% + 3px); left: calc(50% - 0.75px); width: 1.5px; height: calc(2.2rem - 6px); margin: 0; }
    .im-sum-col + .im-sum-col > .im-sum-box:first-child::after { right: auto; top: auto; bottom: calc(100% + 3px); left: calc(50% - 5px); border: 5px solid transparent; border-top: 7px solid var(--im-steel-line); border-bottom: 0; }
    .im-sum-out::before { bottom: auto; top: 50%; left: auto; right: calc(100% + 3px); height: 1.5px; width: calc(var(--gap) - 6px); }
    .im-sum-out::after { bottom: auto; top: calc(50% - 5px); left: auto; right: calc(100% + 3px); border: 5px solid transparent; border-left: 7px solid var(--im-steel-line); border-right: 0; }
}

/* Windows High Contrast: boxes keep a system border */
@media (forced-colors: active) {
    .im-sum-box, .im-legend { border-color: CanvasText; }
    .im-sum-box.is-revenue { border-width: 3px; }
}

/* the long title would run past the edge of a phone: it scales with the screen instead of stopping at 4rem */
@media (max-width: 560px) {
    .team-hero-clean h1 {
        left: 1.25rem;
        font-size: calc((100vw - 2.25rem) / 7.05 * var(--fs-scale, 1));
        letter-spacing: -0.047em;
    }
}
