/* scenes.css — looks for /sdk/scenes.js. Works on the site (global.css tokens) and inside labs
   (tfm-kit.css tokens): each colour falls back from one set to the other. */
[data-scene]{--sc-ink:var(--ink,#eef1f5); --sc-soft:var(--ink-soft,var(--soft,#aab2c0)); --sc-faint:var(--ink-faint,var(--faint,#7c8597));
  --sc-line:var(--line-strong,var(--line,#343c4a)); --sc-card:var(--paper,var(--glass,#161a22)); --sc-accent:var(--accent,var(--teal,#2dd4bf));
  --sc-mono:var(--mono,ui-monospace,Menlo,monospace); --h:190; display:block}

/* ---- pipeline */
.sc-pipeline{padding:1.2rem 1.2rem 1rem; border:1px solid var(--sc-line); border-radius:18px; background:linear-gradient(180deg, var(--sc-card), transparent)}
.sc-track{position:relative; overflow-x:auto; scrollbar-width:none; padding:2.6rem 0 .2rem}
.sc-steps{list-style:none; margin:0; padding:0; display:flex; min-width:max-content; position:relative}
.sc-steps li{--h:190; flex:1 0 118px; display:flex; justify-content:center; position:relative}
.sc-steps li+li::before{content:""; position:absolute; top:22px; right:50%; width:100%; height:2px; background:var(--sc-line)}
.sc-steps li:has(.done, .on)+li::before{background:linear-gradient(90deg, hsl(var(--h) 70% 55%), var(--sc-accent))}
.sc-step{position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:.45rem; background:none; border:0; cursor:pointer; padding:0 .3rem; text-align:center; color:inherit; font:inherit}
.sc-node{width:44px; height:44px; border-radius:50%; display:grid; place-items:center; font:700 .82rem var(--sc-mono); color:#fff; text-shadow:0 1px 3px rgb(0 0 0 / .7);
  background:radial-gradient(circle at 35% 30%, #fff 0 8%, hsl(var(--h) 75% 55%) 40%, hsl(var(--h) 60% 22%)); box-shadow:0 0 22px hsl(var(--h) 80% 50% / .5);
  filter:saturate(.25) brightness(.7); transition:filter .4s, transform .4s}
.sc-step.done .sc-node{filter:saturate(.7)}
.sc-step.on .sc-node{filter:none; transform:scale(1.15)}
.sc-name{font-size:.8rem; color:var(--sc-faint); max-width:112px; line-height:1.25}
.sc-step.on .sc-name{color:var(--sc-ink); font-weight:600}
.sc-token{position:absolute; left:0; top:0; z-index:2; transform:translate(calc(var(--x, 0px) - 50%), calc(var(--y, 0px) - 100%)); transition:transform .9s cubic-bezier(.6,0,.25,1);
  font:500 .72rem var(--sc-mono); white-space:nowrap; padding:.25rem .55rem; border-radius:7px; color:var(--sc-ink); background:var(--sc-card);
  border:1px solid hsl(var(--h) 70% 55%); box-shadow:0 0 18px hsl(var(--h) 80% 50% / .35)}
.sc-token[hidden], .sc-tx[hidden], .sc-link[hidden], .sc-play[hidden]{display:none}
.sc-caption{position:relative; margin-top:1rem; padding-right:2.6rem; min-height:7.5rem}
.sc-caption.sc-in{animation:sc-in .45s ease}
.sc-eyebrow{font:600 .72rem var(--sc-mono); letter-spacing:.12em; text-transform:uppercase; color:var(--sc-faint); margin:0 0 .4rem}
.sc-title{margin:0 0 .3rem; font-size:1.25rem; color:var(--sc-ink)}
.sc-tx{display:inline-block; margin:0 0 .45rem; font:500 .8rem var(--sc-mono); color:var(--sc-ink); padding:.15rem .45rem; border-radius:6px; background:hsl(var(--h) 70% 50% / .16)}
.sc-text{margin:0 0 .45rem; color:var(--sc-soft); max-width:62ch}
.sc-link{font-weight:600; font-size:.88rem; color:var(--sc-accent); text-decoration:none}
.sc-play{position:absolute; right:0; top:0; width:34px; height:34px; border-radius:50%; border:1px solid var(--sc-line); background:transparent; color:var(--sc-ink); cursor:pointer; font-size:.7rem}
@keyframes sc-in{from{opacity:0; transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){ .sc-token, .sc-node{transition:none} .sc-caption.sc-in{animation:none} }

/* ---- curves */
.sc-curves{padding:1rem 1.1rem; border:1px solid var(--sc-line); border-radius:18px; background:linear-gradient(180deg, var(--sc-card), transparent); color:var(--sc-ink)}
.sc-cnav{display:flex; flex-wrap:wrap; gap:.35rem; margin-bottom:.7rem}
.sc-cbtn{--h:190; padding:.3rem .7rem; border-radius:999px; border:1px solid var(--sc-line); background:transparent; color:var(--sc-soft); font:600 .8rem var(--sc-mono); cursor:pointer}
.sc-cbtn.on{color:var(--sc-ink); border-color:hsl(var(--h) 70% 55%); box-shadow:0 0 14px hsl(var(--h) 80% 50% / .35)}
.sc-crow{display:grid; grid-template-columns:minmax(0, 1.5fr) minmax(220px, 1fr); gap:1rem; align-items:start}
@media (max-width:720px){ .sc-crow{grid-template-columns:1fr} }
.sc-plot{width:100%; height:auto; display:block}
.sc-grid{stroke:var(--sc-line); stroke-width:.6; opacity:.5}
.sc-axis{stroke:var(--sc-soft); stroke-width:1}
.sc-tick{font:10px var(--sc-mono); fill:var(--sc-faint)}
.sc-curve{--h:190; opacity:0; transition:opacity .5s}
.sc-curve.past{opacity:.28}
.sc-curve.on{opacity:1}
.sc-line{fill:none; stroke:hsl(var(--h) 75% 58%); stroke-width:2.6; stroke-linecap:round}
.sc-curve.on .sc-line{filter:drop-shadow(0 0 6px hsl(var(--h) 80% 50% / .6))}
.sc-slope{fill:none; stroke:hsl(var(--h) 75% 70%); stroke-width:1.3; stroke-dasharray:4 4; opacity:0}
.sc-curve.on .sc-slope{opacity:.75}
.sc-probe{stroke:var(--sc-soft); stroke-dasharray:2 3; opacity:.7}
.sc-dot{fill:#fff; stroke:hsl(var(--h) 75% 58%); stroke-width:2}
.sc-uses{display:flex; flex-wrap:wrap; gap:.3rem; margin:.3rem 0 0}
.sc-use{font-size:.75rem; padding:.12rem .5rem; border-radius:999px; background:hsl(var(--h) 70% 50% / .16); color:var(--sc-ink)}
.sc-probe-row{display:flex; align-items:center; gap:.6rem; margin:0 0 .5rem; font:.78rem var(--sc-mono); color:var(--sc-soft)}
.sc-probe-row input{flex:0 0 220px; accent-color:hsl(var(--h) 75% 58%)}
.sc-read{flex:1; min-width:0; overflow-x:auto; white-space:nowrap}
/* inside the player, its caption bar already shows the step text */
.tfm-hosted .sc-curves .sc-text{display:none}

.sc-line.sc-draw{stroke-dasharray:1400; stroke-dashoffset:1400; animation:sc-draw 1.1s ease-out forwards}
@keyframes sc-draw{to{stroke-dashoffset:0}}
.sc-showall .sc-curve{opacity:.9}
.sc-showall .sc-curve .sc-slope{opacity:0}
/* in Compare all the step buttons double as the legend: each takes its curve's colour */
.sc-showall .sc-cbtn:not(.sc-all){color:var(--sc-ink); border-color:hsl(var(--h) 70% 55%); box-shadow:inset 0 -3px 0 hsl(var(--h) 75% 58%)}
.sc-all{margin-left:auto}
.sc-plot{cursor:ew-resize; touch-action:none; user-select:none; -webkit-user-select:none}
.sc-depth{margin-top:.6rem; display:grid; gap:.2rem}
.sc-depth-t{margin:0 0 .2rem; font-size:.78rem; color:var(--sc-faint)}
.sc-bar{display:grid; grid-template-columns:1.4rem 1fr 3.4rem; align-items:center; gap:.5rem; font:.72rem var(--sc-mono); color:var(--sc-soft)}
.sc-bar i{display:block; height:8px; border-radius:4px; background:hsl(var(--h) 75% 58%); box-shadow:0 0 10px hsl(var(--h) 80% 50% / .5); transition:width .5s ease; width:0}
@media (prefers-reduced-motion:reduce){ .sc-line.sc-draw{animation:none; stroke-dashoffset:0} .sc-bar i{transition:none} }

/* ---- threshold (scenes/threshold.js) */
.sc-thr{padding:1rem 1.1rem; border:1px solid var(--sc-line); border-radius:18px; background:linear-gradient(180deg, var(--sc-card), transparent); color:var(--sc-ink)}
.sc-thr-grid{display:grid; grid-template-columns:minmax(0, 1.6fr) minmax(240px, 1fr); gap:1.1rem; align-items:start}
@media (max-width:720px){ .sc-thr-grid{grid-template-columns:1fr} }
.sc-thr-plot{width:100%; height:auto; display:block; cursor:ew-resize; touch-action:none; user-select:none; -webkit-user-select:none}
.sc-thr-good{fill:hsl(175 70% 45% / .35); stroke:hsl(175 70% 55%); stroke-width:1.5}
.sc-thr-fraud{fill:hsl(350 80% 60% / .35); stroke:hsl(350 85% 65%); stroke-width:1.5}
.sc-thr-decl{fill:hsl(350 80% 55% / .08)}
.sc-thr-line{stroke:#f2c987; stroke-width:2.4}
.sc-thr-knob{fill:#f2c987; stroke:#fff; stroke-width:1.5}
.sc-thr-best{stroke:#6fe2b3; stroke-width:1.4; stroke-dasharray:4 4}
.sc-thr-lab{font:600 11px var(--sc-mono)} .sc-thr-lab.good{fill:hsl(175 70% 60%)} .sc-thr-lab.fraud{fill:hsl(350 85% 70%)} .sc-thr-lab.best{fill:#6fe2b3} .sc-thr-lab.line{fill:#f2c987}
.sc-thr-side{display:grid; gap:.35rem}
.sc-thr-row{display:flex; justify-content:space-between; gap:.6rem; padding:.35rem .6rem; border-radius:9px; background:rgb(255 255 255 / .04); font-size:.85rem; color:var(--sc-soft)}
.sc-thr-row b{font:600 .85rem var(--sc-mono); color:var(--sc-ink); white-space:nowrap}
.sc-thr-row.ok b{color:#6fe2b3} .sc-thr-row.bad b{color:#ff7565} .sc-thr-row.warn b{color:#f2c987} .sc-thr-row.best b{color:#6fe2b3}
.sc-thr-row.total{background:rgb(242 201 135 / .1)} .sc-thr-row.total b{font-size:1rem}
.sc-thr-verdict{margin:.2rem 0; font-size:.8rem; line-height:1.4; color:var(--sc-soft)} .sc-thr-verdict.win{color:#6fe2b3; font-weight:600}
.sc-thr-eco{display:grid; gap:.15rem; padding:.3rem .55rem; font:.75rem var(--sc-mono); color:var(--sc-soft)} .sc-thr-eco input{accent-color:#f2c987}
.sc-thr-go{justify-self:start; margin-top:.2rem}
.sc-thr-row,.sc-thr-eco{transition:box-shadow .35s, background .35s} .sc-thr-row.lit,.sc-thr-eco.lit{box-shadow:inset 0 0 0 1.5px #f2c987; background:rgb(242 201 135 / .1); border-radius:6px}
.tfm-film .sc-thr-eco input, .tfm-film .sc-thr-go{display:none}   /* a film is watched: the economics stay as text, the controls go */
.sc-thr .sc-caption{min-height:4.5rem; margin-top:.6rem}
