/* TensorLynx · Coupled fluid, structural and thermal engineering (coupled-fsi-cht-multiphysics).
   Page-only drawings and motion. Every selector is scoped under .tx-p-fsi. Colour grammar of the page:
   cyan = flow side and data travelling solid -> fluid (displacement, temperature), amber = solid side, heat and data
   travelling fluid -> solid (force, heat flux). Shape repeats the meaning (diamond in, circle out) so nothing is
   carried by colour alone. Transforms, opacity and stroke only; final states under .tx-reduced and without JS. */

.tx-p-fsi { --fsi-c: var(--tx-cyan); --fsi-a: var(--tx-amber); --fsi-g: var(--tx-green); }
.tx-p-fsi .fsi-h1 { max-width: 21ch; font-size: clamp(2.3rem, 1.7rem + 3vw, 4.1rem); }

/* ---- SVG type --------------------------------------------------------------------------------------------------- */
.tx-p-fsi svg text { font-family: var(--font-mono); fill: var(--tx-muted); }
.tx-p-fsi .fsi-t-big { font-size: 20px; font-weight: 600; letter-spacing: .14em; fill: var(--tx-ink); }
.tx-p-fsi .fsi-t-md { font-family: var(--font-sans); font-size: 18px; font-weight: 600; fill: var(--tx-ink); }
.tx-p-fsi .fsi-t-sm { font-size: 15px; }
.tx-p-fsi .fsi-t-xs { font-size: 12.5px; letter-spacing: .04em; }
.tx-p-fsi .fsi-t-k { font-size: 14px; fill: var(--tx-ink); font-weight: 600; }
.tx-p-fsi .fsi-t-ink { fill: var(--tx-ink); }
.tx-p-fsi .fsi-t-accent { fill: var(--fsi-c); }
.tx-p-fsi .fsi-t-amber { fill: var(--fsi-a); }

/* ---- Hero: two meshes, one wall ------------------------------------------------------------------------------- */
.tx-p-fsi .fsi-hero { aspect-ratio: auto; min-height: 0; }
.tx-p-fsi .fsi-hero svg { height: auto; }
.tx-p-fsi .fsi-frame { fill: rgba(18, 22, 27, .72); stroke: var(--tx-line); }
.tx-p-fsi .fsi-mesh path { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tx-p-fsi .fsi-mesh--fluid path { stroke: rgba(57, 208, 224, .26); }
.tx-p-fsi .fsi-mesh--solid path { stroke: rgba(242, 163, 58, .3); }
.tx-p-fsi .fsi-heat { opacity: .85; }
.tx-p-fsi .fsi-nodes--fluid rect { fill: var(--fsi-c); }
.tx-p-fsi .fsi-nodes--solid circle { fill: var(--fsi-a); stroke: var(--surface-0); stroke-width: 1.5; }
.tx-p-fsi .fsi-iface { fill: none; stroke: var(--tx-ink); stroke-width: 2.5; }
.tx-p-fsi .fsi-iface-glow { fill: none; stroke: var(--fsi-c); stroke-width: 12; opacity: .16; }
.tx-p-fsi .fsi-bow { transform-box: view-box; transform-origin: 300px 260px; }
.tx-p-fsi .fsi-streams path { fill: none; stroke-width: 2; stroke-linecap: round; opacity: .7; }
.tx-p-fsi .fsi-pk { opacity: 0; transform-box: view-box; }
.tx-p-fsi .fsi-pk--in rect, .tx-p-fsi .fsi-key-in { fill: var(--fsi-a); }
.tx-p-fsi .fsi-pk--out circle, .tx-p-fsi .fsi-key-out { fill: var(--fsi-c); }
.tx-p-fsi .fsi-pk rect, .tx-p-fsi .fsi-pk circle { filter: drop-shadow(0 0 5px currentColor); stroke: var(--surface-0); stroke-width: 1.5; }
.tx-p-fsi .fsi-hud-bg { fill: rgba(10, 12, 15, .9); stroke: var(--accent-border); }
.tx-p-fsi .fsi-tol { stroke: var(--fsi-g); stroke-width: 1.5; stroke-dasharray: 4 4; }
.tx-p-fsi .fsi-res rect { fill: var(--fsi-c); transition: opacity .35s var(--ease-out); }
.tx-p-fsi .fsi-res rect:last-child { fill: var(--fsi-g); }
.tx-p-fsi .fsi-hero[data-k="1"] .fsi-res rect:nth-child(n+2),
.tx-p-fsi .fsi-hero[data-k="2"] .fsi-res rect:nth-child(n+3),
.tx-p-fsi .fsi-hero[data-k="3"] .fsi-res rect:nth-child(n+4),
.tx-p-fsi .fsi-hero[data-k="4"] .fsi-res rect:nth-child(n+5),
.tx-p-fsi .fsi-hero[data-k="5"] .fsi-res rect:nth-child(n+6),
.tx-p-fsi .fsi-hero[data-k="6"] .fsi-res rect:nth-child(n+7) { opacity: .13; }
.tx-p-fsi .fsi-cap { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; margin-top: .4rem; font-size: var(--step-xs); color: var(--tx-muted); }

/* entrance: meshes draw, wall settles, then the exchange runs (continuous parts live inside [data-tx-loop]) */
.js .tx-p-fsi .fsi-hero .fsi-mesh { animation: fsi-in 1.4s var(--ease-out) both; }
.js .tx-p-fsi .fsi-hero .fsi-mesh--solid { animation-delay: .25s; }
.js .tx-p-fsi .fsi-hero .fsi-nodes { animation: fsi-in 1s var(--ease-out) .7s both; }
.tx-p-fsi .fsi-hero .fsi-bow { animation: fsi-bow 4.4s ease-in-out infinite; }
.tx-p-fsi .fsi-hero .fsi-heat { animation: fsi-heat 4.4s ease-in-out infinite; }
.tx-p-fsi .fsi-hero .fsi-pk--in { animation: fsi-pk-in 2.2s var(--ease-out) var(--d, 0s) infinite; }
.tx-p-fsi .fsi-hero .fsi-pk--out { animation: fsi-pk-out 2.2s var(--ease-out) var(--d, 0s) infinite; }
@keyframes fsi-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fsi-bow { 0%, 100% { transform: scaleX(.86); } 50% { transform: scaleX(1.16); } }
@keyframes fsi-heat { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes fsi-pk-in { 0% { opacity: 0; transform: translateX(0); } 18% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(124px); } }
@keyframes fsi-pk-out { 0% { opacity: 0; transform: translateX(0); } 18% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(-124px); } }

/* ---- Problem: three reports converge on one interface (scroll-linked by --p) ---------------------------------- */
.tx-p-fsi .fsi-kpis { margin-top: 1.8rem; }
.tx-p-fsi .fsi-ref { font-family: var(--font-mono); font-size: .8em; color: var(--tx-cyan); text-decoration: none; }
.tx-p-fsi .fsi-silo svg { padding: .6rem; }
.tx-p-fsi .fsi-sheet { --q: clamp(0, calc((var(--p, 1) - .12) * 1.9), 1); transform-box: view-box; transform-origin: 300px 158px; }
.tx-p-fsi .fsi-sheet rect { fill: var(--surface-2); stroke: var(--border-strong); }
.tx-p-fsi .fsi-lines { fill: none; stroke: var(--border-strong); stroke-width: 6; stroke-linecap: round; }
.tx-p-fsi .fsi-spark { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.tx-p-fsi .fsi-spark--c { stroke: var(--fsi-c); }
.tx-p-fsi .fsi-spark--a { stroke: var(--fsi-a); }
.tx-p-fsi .fsi-spark--v { stroke: var(--tx-violet); }
.tx-p-fsi .fsi-sheet--l { transform: translateX(calc(var(--q) * 150px)) rotate(calc(var(--q) * -4deg)); }
.tx-p-fsi .fsi-sheet--r { transform: translateX(calc(var(--q) * -150px)) rotate(calc(var(--q) * 4deg)); }
.tx-p-fsi .fsi-sheet--m { transform: translateY(calc(var(--q) * -6px)); }
.tx-p-fsi .fsi-gap { --q: clamp(0, calc((var(--p, 1) - .12) * 1.9), 1); opacity: calc(1 - var(--q)); }
.tx-p-fsi .fsi-gap path { stroke: var(--tx-red); stroke-width: 2; stroke-dasharray: 5 6; }
.tx-p-fsi .fsi-joined { --q: clamp(0, calc((var(--p, 1) - .45) * 2.4), 1); opacity: var(--q); }
.tx-p-fsi .fsi-joined line { stroke: var(--fsi-c); stroke-width: 4; filter: drop-shadow(0 0 8px var(--fsi-c)); }
.tx-p-fsi .fsi-sheet, .tx-p-fsi .fsi-gap, .tx-p-fsi .fsi-joined { transition: transform .25s linear, opacity .25s linear; }

/* ---- How: the sticky stage builds the case step by step ----------------------------------------------------------- */
.tx-p-fsi .fsi-blk--fluid { fill: rgba(57, 208, 224, .05); }
.tx-p-fsi .fsi-blk--solid { fill: rgba(242, 163, 58, .05); }
.tx-p-fsi .fsi-st-heat { opacity: .35; transition: opacity .8s var(--ease-out); }
.tx-p-fsi .fsi-st-iface { stroke: var(--tx-ink); stroke-width: 3; }
.tx-p-fsi .fsi-chip { fill: var(--accent-soft); stroke: var(--accent-border); }
.tx-p-fsi .fsi-chip--a { fill: var(--accent-2-soft); stroke: rgba(242, 163, 58, .4); }
.tx-p-fsi .fsi-pick { stroke: var(--fsi-c); stroke-width: 10; stroke-dasharray: 6 6; opacity: .6; }
.tx-p-fsi .fsi-pill, .tx-p-fsi .fsi-inset { fill: rgba(10, 12, 15, .9); stroke: var(--tx-line); }
.tx-p-fsi .fsi-arrow { stroke-width: 3; stroke-dasharray: 12 7; }
.tx-p-fsi .fsi-arrow--a { stroke: var(--fsi-a); }
.tx-p-fsi .fsi-arrow--c { stroke: var(--fsi-c); }
.tx-p-fsi .fsi-map path { fill: none; stroke: var(--tx-muted); stroke-width: 1.2; }
.tx-p-fsi .fsi-fn rect { fill: var(--fsi-c); }
.tx-p-fsi .fsi-sn circle { fill: var(--fsi-a); }
.tx-p-fsi .fsi-res--st rect { transform-box: fill-box; transform-origin: 50% 100%; }
.tx-p-fsi .fsi-bal--a { fill: var(--fsi-a); }
.tx-p-fsi .fsi-bal--c { fill: var(--fsi-c); }
.tx-p-fsi .fsi-bal { transform-box: fill-box; transform-origin: 0 50%; }
.tx-p-fsi .fsi-verdict { fill: rgba(79, 209, 139, .14); stroke: rgba(79, 209, 139, .55); }
.tx-p-fsi .fsi-part { transition: opacity .6s var(--ease-out); }
.js .tx-p-fsi .fsi-steps .fsi-part { opacity: .1; }
.js .tx-p-fsi .fsi-steps[data-active="1"] .fsi-p1,
.js .tx-p-fsi .fsi-steps[data-active="2"] .fsi-p2,
.js .tx-p-fsi .fsi-steps[data-active="3"] .fsi-p3,
.js .tx-p-fsi .fsi-steps[data-active="4"] .fsi-p4,
.js .tx-p-fsi .fsi-steps[data-active="5"] .fsi-p5 { opacity: 1; }
.js .tx-p-fsi .fsi-steps[data-active="2"] .fsi-p1,
.js .tx-p-fsi .fsi-steps[data-active="3"] :is(.fsi-p1, .fsi-p2),
.js .tx-p-fsi .fsi-steps[data-active="4"] :is(.fsi-p1, .fsi-p2, .fsi-p3),
.js .tx-p-fsi .fsi-steps[data-active="5"] :is(.fsi-p1, .fsi-p2, .fsi-p3, .fsi-p4) { opacity: .34; }
.tx-p-fsi .fsi-steps[data-active="2"] .fsi-arrow { animation: fsi-dash 1.1s linear infinite; }
.tx-p-fsi .fsi-steps[data-active="2"] .fsi-arrow--c { animation-direction: reverse; }
.tx-p-fsi .fsi-steps:is([data-active="2"], [data-active="5"]) .fsi-st-heat { opacity: 1; }
.tx-p-fsi .fsi-steps[data-active="1"] .fsi-pick { animation: fsi-blink 1.6s ease-in-out infinite; }
.tx-p-fsi .fsi-steps[data-active="4"] .fsi-res--st rect { animation: fsi-grow .7s var(--ease-out) both; }
.tx-p-fsi .fsi-steps[data-active="5"] .fsi-bal { animation: fsi-fill 1.2s var(--ease-out) both; }
.tx-p-fsi .fsi-res--st rect:nth-child(2) { animation-delay: .15s !important; }
.tx-p-fsi .fsi-res--st rect:nth-child(3) { animation-delay: .3s !important; }
.tx-p-fsi .fsi-res--st rect:nth-child(4) { animation-delay: .45s !important; }
.tx-p-fsi .fsi-res--st rect:nth-child(5) { animation-delay: .6s !important; }
.tx-p-fsi .fsi-res--st rect:nth-child(6) { animation-delay: .75s !important; }
.tx-p-fsi .fsi-res--st rect:nth-child(7) { animation-delay: .9s !important; }
.tx-p-fsi .fsi-bal--c { animation-delay: .2s !important; }
@keyframes fsi-dash { to { stroke-dashoffset: -38; } }
@keyframes fsi-blink { 50% { opacity: .2; } }
@keyframes fsi-grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes fsi-fill { from { transform: scaleX(.15); } to { transform: none; } }

/* ---- Depth: coupling graph and tabs -------------------------------------------------------------------------------- */
.tx-p-fsi .fsi-depth { margin-top: 2.5rem; }
.tx-p-fsi .fsi-depth svg { padding: .8rem; }
.tx-p-fsi .fsi-edge { fill: none; stroke: var(--tx-muted); stroke-width: 2.2; }
.tx-p-fsi .fsi-edge--a { stroke: var(--fsi-a); }
.tx-p-fsi .fsi-edge--c { stroke: var(--fsi-c); }
.tx-p-fsi .fsi-node rect { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; transition: stroke var(--dur-base), fill var(--dur-base); }
.tx-p-fsi .fsi-node--a rect { stroke: rgba(242, 163, 58, .5); }
.tx-p-fsi .fsi-node--c rect { stroke: var(--accent-border); }
.tx-p-fsi .fsi-node:is(:hover, :focus-visible) rect { stroke: var(--fsi-c); fill: var(--surface-3); }
.tx-p-fsi .fsi-node:focus-visible { outline: none; }
.tx-p-fsi .fsi-node:focus-visible rect { stroke: var(--tx-amber); stroke-width: 2.5; }
.tx-p-fsi .fsi-panel { border: 1px solid var(--tx-line); border-radius: var(--radius-lg); background: var(--surface-1); padding: clamp(1.1rem, .9rem + .8vw, 1.6rem); color: var(--tx-muted); }
.tx-p-fsi .fsi-panel p { margin: 0 0 .9rem; }
.tx-p-fsi .fsi-panel p:last-child { margin-bottom: 0; }
.tx-p-fsi .fsi-panel i { color: var(--tx-ink); font-style: italic; }
.tx-p-fsi .fsi-eq { font-family: var(--font-mono); font-size: var(--step-sm); color: var(--tx-ink); background: var(--surface-0); border: 1px solid var(--tx-line); border-left: 3px solid var(--fsi-c); border-radius: var(--radius-sm); padding: .8rem 1rem; overflow-x: auto; }
.tx-p-fsi .fsi-mini { width: 100%; border-collapse: collapse; font-size: var(--step-sm); margin: 0 0 1rem; }
.tx-p-fsi .fsi-mini th, .tx-p-fsi .fsi-mini td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--tx-line); vertical-align: top; }
.tx-p-fsi .fsi-mini thead th { font-family: var(--font-mono); font-size: var(--step-xs); text-transform: uppercase; letter-spacing: .06em; }
.tx-p-fsi .fsi-mini tbody th { color: var(--tx-ink); font-weight: 600; }
.tx-p-fsi .fsi-mini td { font-family: var(--font-mono); color: var(--tx-ink); }
.tx-p-fsi .fsi-panel .tx-ticks { margin: 0; }
.tx-p-fsi .fsi-panel .tx-badge { margin-left: .3rem; vertical-align: middle; }

/* ---- Proof: measured charts and case cards -------------------------------------------------------------------------- */
.tx-p-fsi .fsi-charts { display: grid; gap: var(--tx-gap); margin: 2.5rem 0 var(--tx-gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.tx-p-fsi .fsi-charts svg { padding: .6rem .4rem 0; }
.tx-p-fsi .fsi-axis { stroke: var(--border-strong); stroke-width: 1.5; }
.tx-p-fsi .fsi-grid { stroke: var(--tx-line); stroke-dasharray: 3 5; }
.tx-p-fsi .fsi-bars rect { fill: var(--fsi-c); transform-box: fill-box; transform-origin: 50% 100%; transition: transform 1s var(--ease-out) calc(var(--i, 0) * 110ms); }
.tx-p-fsi .fsi-bars .fsi-bar-end { fill: var(--fsi-g); }
.tx-p-fsi .fsi-hbars rect { fill: var(--fsi-a); transform-box: fill-box; transform-origin: 0 50%; transition: transform 1s var(--ease-out) calc(var(--i, 0) * 110ms); }
.js .tx-p-fsi .fsi-charts [data-tx-reveal] :is(.fsi-bars, .fsi-hbars) rect { transform: scale(0); }
.js .tx-p-fsi .fsi-charts .is-in .fsi-bars rect { transform: none; }
.js .tx-p-fsi .fsi-charts .is-in .fsi-hbars rect { transform: none; }
.tx-p-fsi .fsi-bars rect:hover, .tx-p-fsi .fsi-hbars rect:hover { filter: brightness(1.25); }
.tx-p-fsi .fsi-cases .tx-card p + p { margin-top: .9rem; }
.tx-p-fsi .fsi-note { margin-top: var(--tx-gap); max-width: 90ch; }

/* ---- Value ------------------------------------------------------------------------------------------------------------ */
.tx-p-fsi .fsi-roles { margin-top: 2rem; }
.tx-p-fsi .fsi-apps { margin: var(--tx-gap) 0 2.5rem; }
.tx-p-fsi .fsi-app { border-top: 2px solid var(--fsi-a); padding-top: 1rem; }
.tx-p-fsi .fsi-app:nth-child(even) { border-top-color: var(--fsi-c); }
.tx-p-fsi .fsi-app h3 { font-size: var(--step-md); margin: 0 0 .4rem; }
.tx-p-fsi .fsi-app p { margin: 0; color: var(--tx-muted); font-size: var(--step-sm); }
.tx-p-fsi .fsi-app .tx-badge { margin-top: .5rem; }
.tx-p-fsi a:not(.btn) { color: var(--tx-cyan); text-underline-offset: 3px; }

/* ---- Reduced motion and no-JS: the final, complete picture ---------------------------------------------------------- */
.tx-reduced .tx-p-fsi .fsi-pk { opacity: 1; }
.tx-reduced .tx-p-fsi .fsi-pk--in { transform: translateX(62px); }
.tx-reduced .tx-p-fsi .fsi-pk--out { transform: translateX(-62px); }
.tx-reduced .tx-p-fsi :is(.fsi-bars, .fsi-hbars) rect { transform: none !important; transition: none !important; }
.tx-reduced .tx-p-fsi .fsi-sheet, .tx-reduced .tx-p-fsi .fsi-gap, .tx-reduced .tx-p-fsi .fsi-joined, .tx-reduced .tx-p-fsi .fsi-part { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .tx-p-fsi .fsi-pk { opacity: 1; }
  .tx-p-fsi .fsi-pk--in { transform: translateX(62px); }
  .tx-p-fsi .fsi-pk--out { transform: translateX(-62px); }
  .js .tx-p-fsi .fsi-charts [data-tx-reveal] :is(.fsi-bars, .fsi-hbars) rect { transform: none; }
}
html:not(.js) .tx-p-fsi .fsi-pk { opacity: 1; }
html:not(.js) .tx-p-fsi .fsi-pk--in { transform: translateX(62px); }
html:not(.js) .tx-p-fsi .fsi-pk--out { transform: translateX(-62px); }
