/* =========================================================
   LeanFlow case study (loaded after redesign.css and insights.css)
   Layout concept: the article column breaks out to full width for the
   architecture, which plays the agent's query step by step. Blue marks
   the active path; amber is kept for the one live packet moving along it.
   ========================================================= */

:root {
    --lf-gov: var(--navy);
    --lf-ctx: var(--blue);
    --lf-data: #3E6FA8;
    --lf-ai: #0A3460;
    --lf-ext: #8C9DB1;
    --lf-q: var(--blue);
    --lf-llm: var(--ink);
    --lf-ing: #6E8399;
    --lf-raise: 0 1px 2px rgba(0, 30, 60, .06), 0 6px 18px rgba(0, 30, 60, .07);
}

/* ---------- reading progress ---------- */
.lf-progress { position: fixed; left: 0; right: 0; top: var(--header-h); height: 2px; z-index: 60; pointer-events: none; }
.lf-progress i { display: block; height: 100%; width: 100%; background: var(--blue); transform: scaleX(0); transform-origin: left; }

/* ---------- hero ---------- */
.lf-hero { position: relative; overflow: hidden; isolation: isolate; }
.lf-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .9; }
.lf-name { display: inline-flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.lf-name b { font: 400 1.05rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--white); }
.lf-name span { font-size: 0.9rem; color: var(--haze); }
.lf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 40px; border-top: 1px solid var(--line-navy); }
.lf-stat { padding: 20px 20px 4px 0; border-right: 1px solid var(--line-navy); min-width: 0; }
.lf-stat + .lf-stat { padding-left: 20px; }
.lf-stat:last-child { border-right: 0; }
.lf-stat .v { display: block; font: 400 clamp(2rem, 4vw, 2.8rem)/1 var(--display); letter-spacing: -0.02em; color: var(--white); font-variant-numeric: tabular-nums; }
.lf-stat .k { display: block; margin-top: 8px; font-size: 0.88rem; color: var(--haze); line-height: 1.4; }
.lf-stat:first-child .v { color: var(--signal); }

/* ---------- full-width breakout inside the article ---------- */
.article-body .lf-wide { max-width: calc(1120px + var(--gutter) * 2); margin: 2.4em auto 2.6em; }
.lf-figure { margin: 0; }
.lf-fig-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 14px 32px; margin-bottom: 18px; }
.lf-fig-head h2 { margin: 0 !important; }
.lf-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font: 400 0.84rem/1.3 var(--sans); color: var(--slate); }
.lf-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lf-legend .sw { width: 11px; height: 11px; border-radius: 2px; }
.lf-legend .ln { width: 22px; height: 0; border-top: 2px solid; }
.sw.r-gov { background: var(--lf-gov); } .sw.r-ctx { background: var(--lf-ctx); } .sw.r-data { background: var(--lf-data); } .sw.r-ai { background: var(--lf-ai); }
.ln.q { border-color: var(--lf-q); } .ln.llm { border-color: var(--lf-llm); } .ln.ing { border-color: var(--lf-ing); border-top-style: dashed; }

.lf-stage { position: relative; background: var(--white); border: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.lf-stage-inner { position: relative; margin: 24px auto; }
.lf-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; font-family: var(--sans); }
.lf-canvas > * { position: absolute; }

.lf-region { border: 1.25px dashed var(--blue); border-radius: 2px; }
.lf-rlabel { display: flex; align-items: center; gap: 6px; font: 400 11.5px/1 var(--mono); color: var(--blue); }
.lf-grp { border: 1px solid var(--line); background: var(--paper); border-radius: 2px; }
.lf-gh { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 30px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); }
.lf-gs { font: 400 10.5px var(--mono); color: var(--slate); white-space: nowrap; }
.lf-grp.node { background: #F7F9FC; }
.lf-grp.node .lf-gh { background: var(--navy); color: var(--white); border-bottom: 0; }
.lf-grp.node .lf-gs { color: var(--haze); }
.lf-grp.ext { background: transparent; border-style: dashed; }
.lf-grp.store { background: var(--blue-soft); }
.lf-grp.plat { background: transparent; }

.lf-card { display: flex; gap: 9px; align-items: flex-start; padding: 9px 10px; background: var(--white); border: 1px solid #C9D4E0; border-radius: 2px;
    transition: opacity .35s ease, transform .35s var(--ease), box-shadow .35s ease, border-color .35s ease; }
.lf-card.tall { flex-direction: column; gap: 10px; }
.lf-card.mini { align-items: center; padding: 6px 10px; }
.lf-ic { flex: none; width: 28px; height: 28px; border-radius: 2px; display: grid; place-items: center; color: var(--white); background: var(--lf-data); }
.r-gov .lf-ic { background: var(--lf-gov); } .r-ctx .lf-ic { background: var(--lf-ctx); } .r-ai .lf-ic { background: var(--lf-ai); }
.r-ext .lf-ic { background: var(--paper); color: var(--slate); border: 1px solid var(--line); }
.r-plain .lf-ic { background: transparent; color: var(--slate); width: 18px; height: 18px; }
.r-ext { border-style: dashed; }
.lf-ct { min-width: 0; display: grid; gap: 3px; }
.lf-cn { font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.lf-cd { font-size: 11px; line-height: 1.35; color: var(--slate); }
.lf-card.mini .lf-cn { font-weight: 500; font-size: 12px; }
.lf-note { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--slate); border-left: 2px solid var(--line); padding-left: 10px; }

.lf-wires { left: 0; top: 0; overflow: visible; pointer-events: none; }
.lf-w { fill: none; stroke-width: 1.4; stroke-linejoin: round; transition: opacity .35s ease; }
.lf-w.bus, .lf-w.q { stroke: var(--lf-q); }
.lf-w.llm { stroke: var(--lf-llm); stroke-width: 1.5; }
.lf-w.ing { stroke: var(--lf-ing); stroke-dasharray: 5 4; }
.lf-w.dash { stroke-dasharray: 4 4; }
.lf-ahp { fill: var(--slate); }
.lf-lb { font: 400 10.5px var(--mono); fill: var(--slate); }
.lf-bd circle { fill: var(--navy); stroke: var(--white); stroke-width: 2; }
.lf-bd text { fill: var(--white); font: 600 10.5px var(--mono); text-anchor: middle; }
.lf-bd.b-m circle { fill: var(--ink); }
.lf-bd.b-i circle { fill: var(--lf-ing); }
.lf-bd { transition: opacity .35s ease; }
.lf-flow { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 9; opacity: 0; }
.lf-packet { fill: var(--signal); stroke: var(--white); stroke-width: 2; opacity: 0; }

/* entrance: cards rise in order, wires draw (only when script has marked the figure) */
.lf-pre .lf-card, .lf-pre .lf-grp, .lf-pre .lf-note { opacity: 0; transform: translateY(10px); }
.lf-pre .lf-w { stroke-dashoffset: var(--len); stroke-dasharray: var(--len); }
.lf-pre .lf-bd { opacity: 0; }
.lf-in .lf-card, .lf-in .lf-grp, .lf-in .lf-note { transition-delay: calc(var(--i, 0) * 28ms); }
.lf-in .lf-w { transition: stroke-dashoffset 1.4s var(--ease) .5s; }
.lf-in .lf-bd { transition-delay: 1.3s; }

/* playing a path: everything else steps back */
.lf-playing .lf-card { opacity: .32; }
.lf-playing .lf-w { opacity: .18; }
.lf-playing .lf-bd { opacity: .25; }
.lf-playing .lf-card.on { opacity: 1; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), var(--lf-raise); transform: translateY(-2px); }
.lf-playing .lf-bd.on { opacity: 1; }
.lf-playing .lf-bd.on circle { fill: var(--blue); }
.lf-playing .lf-flow { opacity: 1; animation: lf-dash 0.9s linear infinite; }
.lf-playing .lf-packet { opacity: 1; }
@keyframes lf-dash { to { stroke-dashoffset: -22; } }

/* player controls */
.lf-player { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 28px; align-items: center; padding: 18px 22px; background: var(--navy); color: var(--mist); }
.lf-tabs { display: inline-flex; border: 1px solid var(--line-navy); border-radius: 2px; overflow: hidden; }
.lf-tab { font: 500 0.88rem var(--sans); color: var(--haze); background: transparent; border: 0; padding: 9px 14px; cursor: pointer; }
.lf-tab[aria-selected="true"] { background: var(--white); color: var(--navy); }
.lf-caption { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start; min-height: 3.2em; }
.lf-caption .n { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 0.9rem var(--mono); color: var(--navy); background: var(--signal); }
.lf-caption .c { font: 400 0.8rem/1.2 var(--mono); color: var(--haze); }
.lf-caption .t { font-size: 0.98rem; line-height: 1.5; color: var(--white); }
.lf-ctrls { display: inline-flex; gap: 8px; }
.lf-btn { width: 40px; height: 40px; border-radius: 2px; border: 1px solid var(--line-navy); background: transparent; color: var(--mist); display: grid; place-items: center; cursor: pointer; }
.lf-btn:hover { border-color: var(--mist); color: var(--white); }
.lf-btn.play { background: var(--signal); color: var(--navy); border-color: var(--signal); }
.lf-btn svg { width: 16px; height: 16px; }
.lf-dots { grid-column: 1 / -1; display: flex; gap: 6px; }
.lf-dots button { flex: 1; height: 4px; border: 0; padding: 0; border-radius: 2px; background: rgba(227, 235, 244, .18); cursor: pointer; position: relative; overflow: hidden; }
.lf-dots button i { position: absolute; inset: 0; background: var(--signal); transform: scaleX(0); transform-origin: left; }
.lf-dots button.done i { transform: scaleX(1); }
.lf-dots button.now i { animation: lf-fill var(--dur, 3.6s) linear forwards; }
.lf-dots.paused button.now i { animation-play-state: paused; }
@keyframes lf-fill { to { transform: scaleX(1); } }
.lf-figcap { font-family: var(--sans); font-size: 0.86rem; color: var(--slate); margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.lf-figcap a { font-weight: 500; }
.lf-scrollhint { display: none; }

/* ---------- layer table chips ---------- */
.lic { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 8px; vertical-align: 0; }
.lic.r-gov { background: var(--lf-gov); } .lic.r-ctx { background: var(--lf-ctx); } .lic.r-data { background: var(--lf-data); } .lic.r-ai { background: var(--lf-ai); }
table.data td .lic-note { display: block; font-size: 0.82rem; color: var(--slate); }

/* ---------- model routing calculator ---------- */
.lf-calc { background: var(--white); border: 1px solid var(--line); padding: 24px 24px 20px; margin: 1.6em 0; font-family: var(--sans); }
.lf-calc-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: end; margin-bottom: 20px; }
.lf-calc label { display: block; font-size: 0.9rem; color: var(--ink); font-weight: 500; margin-bottom: 10px; }
.lf-calc label output { font-family: var(--mono); color: var(--blue); font-weight: 400; margin-left: 6px; }
.lf-range { width: 100%; accent-color: var(--blue); }
.lf-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.lf-seg button { font: 500 0.86rem var(--sans); background: var(--white); color: var(--slate); border: 0; border-left: 1px solid var(--line); padding: 8px 12px; cursor: pointer; }
.lf-seg button:first-child { border-left: 0; }
.lf-seg button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.lf-split { display: flex; height: 34px; border-radius: 2px; overflow: hidden; background: var(--paper); margin-bottom: 8px; }
.lf-split span { display: block; height: 100%; transition: width .5s var(--ease); }
.lf-split .s1 { background: #6FA8E6; } .lf-split .s3 { background: var(--navy); }
.lf-split-l { display: flex; justify-content: space-between; gap: 12px; font-size: 0.82rem; color: var(--slate); margin-bottom: 18px; }
.lf-result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.lf-result div { padding: 16px 16px 0 0; }
.lf-result div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.lf-result .v { display: block; font: 400 2.2rem/1 var(--display); letter-spacing: -0.02em; color: var(--blue); font-variant-numeric: tabular-nums; }
.lf-result .k { display: block; font-size: 0.86rem; color: var(--slate); margin-top: 6px; }

/* ---------- cost bars ---------- */
.lf-cost { background: var(--white); border: 1px solid var(--line); padding: 22px 24px 18px; margin: 1.6em 0 0.8em; font-family: var(--sans); }
.lf-cost-title { font-weight: 600; font-size: 1rem; margin-bottom: 18px; color: var(--ink); }
.lf-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 6px 18px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.lf-row:first-of-type { border-top: 0; }
.lf-row .l { font-size: 0.92rem; color: var(--ink); line-height: 1.35; }
.lf-row .l small { display: block; font-size: 0.8rem; color: var(--slate); }
.lf-row .bl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lf-row .bar { height: 22px; border-radius: 2px; background: #C9D4E0; width: var(--w); flex: none; transform-origin: left; }
.lf-row.us .bar { background: var(--blue); }
.lf-row.us .l { font-weight: 600; color: var(--blue); }
.lf-row .num { font: 400 1rem var(--mono); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lf-row.us .num { color: var(--blue); }
.anim .lf-row .bar { transform: scaleX(0); }
.anim.in .lf-row .bar { transform: scaleX(1); transition: transform 1.2s var(--ease) calc(var(--d, 0) * 140ms); }

/* ---------- left-out list ---------- */
.lf-out { list-style: none; padding: 0 !important; border-top: 1px solid var(--line); }
.lf-out li { padding: 14px 0 12px; border-bottom: 1px solid var(--line); margin: 0; }
.lf-out b { font-family: var(--sans); font-weight: 600; font-size: 1.02rem; position: relative; display: inline-block; }
.lf-out b::after { content: ""; position: absolute; left: -2px; right: -2px; top: 54%; height: 1.5px; background: #B4501A; transform-origin: left; }
.anim .lf-out b::after, .lf-out.anim b::after { transform: scaleX(0); }
.lf-out.anim.in b::after { transform: scaleX(1); transition: transform .6s var(--ease); }
.lf-out.anim.in li:nth-child(2) b::after { transition-delay: .15s; }
.lf-out.anim.in li:nth-child(3) b::after { transition-delay: .3s; }
.lf-out.anim.in li:nth-child(4) b::after { transition-delay: .45s; }
.lf-out.anim.in li:nth-child(5) b::after { transition-delay: .6s; }
.lf-out span { display: block; font-family: var(--serif); font-size: 1.06rem; color: var(--slate); margin-top: 2px; }

/* ---------- generic reveal ---------- */
.anim[data-reveal] { opacity: 0; transform: translateY(14px); }
.anim[data-reveal].in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s var(--ease); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
    .lf-player { grid-template-columns: minmax(0, 1fr) auto; }
    .lf-caption { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
    .lf-stats { grid-template-columns: 1fr 1fr 1fr; }
    .lf-stat { padding-right: 10px; }
    .lf-stat + .lf-stat { padding-left: 10px; }
    .lf-row { grid-template-columns: 1fr; }
    .lf-calc-top, .lf-result { grid-template-columns: 1fr; }
    .lf-result div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 14px; }
    .lf-scrollhint { display: block; font: 400 0.8rem var(--sans); color: var(--slate); margin: 0 0 8px; }
    .lf-player { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .lf-pre .lf-card, .lf-pre .lf-grp, .lf-pre .lf-note, .lf-pre .lf-bd { opacity: 1; transform: none; }
    .lf-pre .lf-w { stroke-dasharray: none; stroke-dashoffset: 0; }
    .lf-playing .lf-flow { animation: none; stroke-dasharray: none; }
    .anim[data-reveal] { opacity: 1; transform: none; }
    .anim .lf-row .bar { transform: none; }
    .lf-out.anim b::after { transform: none; }
    .lf-dots button.now i { animation: none; transform: scaleX(1); }
}

/* article-body sets serif on every p; components inside it keep the interface face */
.article-body .lf-note { font-family: var(--sans); font-size: 11.5px; line-height: 1.45; color: var(--slate); margin: 0; }
.article-body .lf-cost-title { font-family: var(--sans); font-size: 1rem; line-height: 1.4; font-weight: 600; margin: 0 0 14px; }
.article-body .lf-scrollhint { font-family: var(--sans); }
.lf-gh span:first-child, .lf-gs { white-space: nowrap; }
.lf-gs { font-size: 10px; }
table.lf-table td:first-child { white-space: nowrap; }
.article-cta .btn-signal, .article-cta .btn-signal:hover { color: var(--navy); text-decoration: none; }
.lf-card { padding: 8px; gap: 8px; }
.lf-ic { width: 24px; height: 24px; }
.lf-ic svg { width: 14px; height: 14px; }
.lf-cn { font-size: 12px; }
.lf-cd { font-size: 10.5px; }
.lf-playing .lf-card, .lf-playing .lf-bd, .lf-playing .lf-grp { transition-delay: 0s !important; }
@media (max-width: 760px) {
    .lf-row .bar { width: calc(var(--w) * 0.8); }
    .lf-row .num { font-size: 0.92rem; }
}
.lf-tab { white-space: nowrap; }
@media (max-width: 760px) {
    table.lf-table { min-width: 620px; }
    table.lf-table td:first-child { white-space: normal; }
}

/* =========================================================
   Home-page highlight
   ========================================================= */
.lfh { padding: 104px 0; background: var(--white); border-bottom: 1px solid var(--line); }
.lfh-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 72px; align-items: center; }
.lfh-kicker { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font-size: 0.92rem; color: var(--blue); font-weight: 500; }
.lfh-new { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy); background: var(--signal); padding: 6px 8px; border-radius: 2px; }
.lfh-name { font: 400 0.95rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); margin: 0 0 14px; }
.lfh h2 { font: 400 clamp(2.1rem, 3.8vw, 3.2rem)/1.06 var(--display); letter-spacing: -0.024em; margin-bottom: 22px; }
.lfh-lede { color: var(--slate); font-size: 1.08rem; max-width: 540px; margin: 0 0 22px; }
.lfh-stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 32px; padding: 0; list-style: none; max-width: 560px; }
.lfh-stack li { font: 400 0.8rem/1 var(--mono); color: var(--ink); border: 1px solid var(--line); background: var(--paper); padding: 7px 9px; border-radius: 2px; }
.lfh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.lfh-link { font-weight: 500; }
.lfh .lf-cost { margin: 0; padding: 26px 28px 20px; }
.lfh .lf-cost-title { font-family: var(--sans); font-weight: 600; font-size: 1rem; margin: 0 0 12px; }
.lfh .lf-row { grid-template-columns: 170px minmax(0, 1fr); }
.lfh-cap { margin: 14px 0 0; font-size: 0.84rem; color: var(--slate); }
.anim .lfh-stack li, .lfh-stack.anim li { opacity: 0; transform: translateY(6px); }
.lfh-stack.anim.in li { opacity: 1; transform: none; transition: opacity .4s ease, transform .4s var(--ease); }
.lfh-stack.anim.in li:nth-child(2) { transition-delay: .06s; } .lfh-stack.anim.in li:nth-child(3) { transition-delay: .12s; }
.lfh-stack.anim.in li:nth-child(4) { transition-delay: .18s; } .lfh-stack.anim.in li:nth-child(5) { transition-delay: .24s; }
.lfh-stack.anim.in li:nth-child(6) { transition-delay: .3s; } .lfh-stack.anim.in li:nth-child(7) { transition-delay: .36s; }
.lfh-stack.anim.in li:nth-child(8) { transition-delay: .42s; } .lfh-stack.anim.in li:nth-child(9) { transition-delay: .48s; }
@media (max-width: 980px) {
    .lfh { padding: 80px 0; }
    .lfh-grid { grid-template-columns: 1fr; gap: 44px; }
}
@media (max-width: 760px) {
    .lfh { padding: 64px 0; }
    .lfh .lf-row { grid-template-columns: 1fr; }
    .lfh .lf-cost { padding: 20px 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .lfh-stack.anim li { opacity: 1; transform: none; }
}

/* insights index: the case study gets its own full-width card */
.notes-feature { margin-bottom: 56px; }
.notes-feature .note.lead { grid-column: 1 / -1; grid-row: auto; margin-bottom: 0; }
.notes-feature .note.lead a { min-height: 340px; }
/* bars scale to the space left after the label, so the largest never pushes its value out */
.lf-row .bar, .lf-row .bar { width: calc((100% - 132px) * var(--k, 0.5)); min-width: 6px; }
@media (max-width: 760px) { .lf-row .bar { width: calc((100% - 120px) * var(--k, 0.5)); } }

/* tagline under the LeanFlow headline */
.lf-sub { margin: -10px 0 26px; font: 400 clamp(1.25rem, 2.2vw, 1.6rem)/1.3 var(--display); color: var(--signal); letter-spacing: -0.01em; }
.lfh-sub { margin: -8px 0 22px; font: 400 clamp(1.2rem, 2vw, 1.5rem)/1.3 var(--display); color: var(--blue); }
