/* Diagrams A: fig-hero, fig-situation, fig-garage, fig-stack, fig-revenue-tree.
   Every rule is scoped under its figure id. Colors come only from the CSS variables in style.css.
   The markup is the finished picture; idle motion lives in the no-preference block of each figure. */

/* ===== fig-hero ===== */
#fig-hero .fig-hero-svg{max-width:460px;margin:0 auto}
#fig-hero .fig-hero-ground{stroke:var(--line);stroke-width:2}
#fig-hero .fig-hero-pylon{fill:none;stroke:var(--power);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
#fig-hero .fig-hero-wire{fill:none;stroke:var(--power);stroke-width:2;stroke-linecap:round}
#fig-hero .fig-hero-pulse{fill:none;stroke:var(--surface);stroke-width:3;stroke-linecap:round;stroke-dasharray:2 14}
#fig-hero .fig-hero-cool{fill:var(--power-wash);stroke:var(--power);stroke-width:1.5}
#fig-hero .fig-hero-bld{fill:var(--buildings-wash);stroke:var(--buildings);stroke-width:2}
#fig-hero .fig-hero-rack{fill:var(--compute-wash);stroke:var(--compute);stroke-width:1.5}
#fig-hero .fig-hero-led{fill:var(--compute)}
#fig-hero .fig-hero-chip{fill:var(--chips)}
#fig-hero .fig-hero-pin{fill:none;stroke:var(--chips);stroke-width:1.5;stroke-linecap:round}
#fig-hero .fig-hero-slot{fill:none;stroke:var(--compute);stroke-width:1.2;stroke-linecap:round}
#fig-hero .fig-hero-pipe{stroke:var(--cash);stroke-width:2.5;stroke-linecap:round}
#fig-hero .fig-hero-arrow{fill:var(--cash)}
#fig-hero .fig-hero-coin circle{fill:var(--cash)}
#fig-hero .fig-hero-dollar{fill:var(--on-color);font-size:15px;font-weight:600;text-anchor:middle}
#fig-hero .fig-hero-t{font-size:15px;font-weight:600;text-anchor:middle}
#fig-hero .fig-hero-bar-p{fill:var(--power)}
#fig-hero .fig-hero-bar-b{fill:var(--buildings)}
#fig-hero .fig-hero-bar-c{fill:var(--compute)}
#fig-hero .fig-hero-bar-h{fill:var(--chips)}
#fig-hero .fig-hero-bar-m{fill:var(--cash)}

#fig-hero .fig-hero-tiles{list-style:none;margin:16px 0 0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
#fig-hero .fig-hero-tile{display:grid;grid-template-columns:112px minmax(0,1fr);gap:4px 12px;align-items:center;background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
#fig-hero .fig-hero-tile p{margin:0}
#fig-hero .fig-hero-num{font:600 24px/1.1 var(--serif);font-variant-numeric:tabular-nums;color:var(--ink);white-space:nowrap}
#fig-hero .fig-hero-cap{font-size:16px;line-height:1.3;font-weight:600;color:var(--ink)}
#fig-hero .fig-hero-note{font-size:14px;line-height:1.4;color:var(--muted);margin-top:2px}
@media (min-width:600px){
  #fig-hero .fig-hero-tiles{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  #fig-hero .fig-hero-tile{display:block;padding:14px 16px}
  #fig-hero .fig-hero-num{font-size:30px;margin-bottom:6px}
}

@media (prefers-reduced-motion:no-preference){
  @keyframes fig-hero-flow{to{stroke-dashoffset:-32}}
  @keyframes fig-hero-blink{0%,100%{opacity:1}50%{opacity:.25}}
  @keyframes fig-hero-drift{0%{transform:translateX(-10px);opacity:0}25%{opacity:1}75%{opacity:1}100%{transform:translateX(12px);opacity:0}}
  #fig-hero .fig-hero-pulse{animation:fig-hero-flow 1.6s linear infinite}
  #fig-hero .fig-hero-led-a{animation:fig-hero-blink 2.4s ease-in-out infinite}
  #fig-hero .fig-hero-led-b{animation:fig-hero-blink 3.1s ease-in-out .7s infinite}
  #fig-hero .fig-hero-led-c{animation:fig-hero-blink 3.7s ease-in-out 1.3s infinite}
  #fig-hero .fig-hero-coin-a{animation:fig-hero-drift 3s ease-in-out infinite}
  #fig-hero .fig-hero-coin-b{animation:fig-hero-drift 3s ease-in-out -1.5s infinite}
}

/* ===== fig-situation ===== */
#fig-situation .fig-sit-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
@media (min-width:640px){#fig-situation .fig-sit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
#fig-situation .fig-sit-card{background:var(--paper);border:1px solid var(--line);border-top:4px solid var(--muted);border-radius:10px;padding:10px 12px 12px;min-width:0}
#fig-situation .fig-sit-card[data-b="profitable"]{border-top-color:var(--cash)}
#fig-situation .fig-sit-card[data-b="declining"]{border-top-color:var(--cost)}
#fig-situation .fig-sit-h{font:600 18px/1.2 var(--serif);margin:0 0 8px}
#fig-situation .fig-sit-items{list-style:none;margin:0;padding:0;display:grid;gap:6px}
#fig-situation .fig-sit-item{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:2px 10px;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:15px;line-height:1.3}
#fig-situation .fig-sit-stat{font-size:14px;color:var(--muted);font-variant-numeric:tabular-nums}
#fig-situation .fig-sit-hot{background:var(--wash);border:2px solid var(--ink);padding:7px 9px;font-weight:600}
#fig-situation .fig-sit-hot .fig-sit-stat{color:var(--ink)}
#fig-situation .fig-sit-go{text-align:center;margin-top:12px}
#fig-situation .fig-sit-arrow{display:block;width:24px;height:36px;margin:0 auto 2px}
#fig-situation .fig-sit-arrow path{fill:none;stroke:var(--ink);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
#fig-situation .fig-sit-go-t{font:600 22px/1.2 var(--serif);margin:0 0 4px}
#fig-situation .fig-sit-go-s{font-size:15px;line-height:1.45;color:var(--muted);margin:0 auto;max-width:44ch}

/* ===== fig-garage ===== */
#fig-garage .fig-garage-svg{max-width:440px;margin:0 auto}
#fig-garage .fig-garage-card{fill:var(--paper);stroke:var(--line);stroke-width:1}
#fig-garage .fig-garage-wall{fill:var(--buildings-wash);stroke:var(--buildings);stroke-width:2;stroke-linejoin:round}
#fig-garage .fig-garage-rack{fill:var(--compute-wash);stroke:var(--compute);stroke-width:1.5}
#fig-garage .fig-garage-led-off{fill:var(--line)}
#fig-garage .fig-garage-win{fill:var(--surface);stroke:var(--buildings);stroke-width:1.2}
#fig-garage .fig-garage-z{font-size:15px;font-style:italic;fill:var(--muted)}
#fig-garage .fig-garage-lab{font-size:15px;font-weight:600;text-anchor:middle}
#fig-garage .fig-garage-h{font-size:17px;font-weight:600}
#fig-garage .fig-garage-p{font-size:15px}
#fig-garage .fig-garage-m{font-size:15px;fill:var(--muted)}
#fig-garage .fig-garage-mid{text-anchor:middle}
#fig-garage .fig-garage-or{font-size:15px;font-weight:600;fill:var(--muted);text-anchor:middle}
#fig-garage .fig-garage-track{fill:var(--line)}
#fig-garage .fig-garage-used{fill:var(--compute)}
#fig-garage .fig-garage-arc-track{fill:none;stroke:var(--line);stroke-width:6;stroke-linecap:round}
#fig-garage .fig-garage-arc-on{fill:none;stroke:var(--compute);stroke-width:6;stroke-linecap:round}
#fig-garage .fig-garage-needle{stroke:var(--ink);stroke-width:3;stroke-linecap:round}
#fig-garage .fig-garage-hub{fill:var(--ink)}
#fig-garage .fig-garage-cell{fill:var(--line)}
#fig-garage .fig-garage-cell-on{fill:var(--compute)}
@media (prefers-reduced-motion:no-preference){
  @keyframes fig-garage-tick{0%,100%{opacity:1}50%{opacity:.35}}
  #fig-garage .fig-garage-cell-last{animation:fig-garage-tick 1.4s ease-in-out infinite}
}

/* ===== fig-stack ===== */
#fig-stack .fig-stack-layers{list-style:none;margin:0;padding:0;display:flex;flex-direction:column-reverse;gap:8px}
#fig-stack .fig-stack-layer{--c:var(--muted);--cw:var(--paper);background:var(--cw);border:1px solid var(--line);border-left:8px solid var(--c);border-radius:10px;overflow:hidden}
#fig-stack .fig-stack-power{--c:var(--power);--cw:var(--power-wash)}
#fig-stack .fig-stack-buildings{--c:var(--buildings);--cw:var(--buildings-wash)}
#fig-stack .fig-stack-chips{--c:var(--chips);--cw:var(--chips-wash)}
#fig-stack .fig-stack-compute{--c:var(--compute);--cw:var(--compute-wash)}
#fig-stack .fig-stack-cash{--c:var(--cash);--cw:var(--cash-wash)}
#fig-stack .fig-stack-btn{display:block;position:relative;width:100%;min-height:56px;margin:0;padding:10px 12px;border:0;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
#fig-stack .fig-stack-btn:focus-visible{outline-offset:-3px}
#fig-stack .fig-stack-n{display:block;font:600 17px/1.25 var(--serif)}
#fig-stack .fig-stack-who{display:block;margin-top:3px;font-size:15px;line-height:1.4;color:var(--muted)}
#fig-stack .fig-stack-k{font-weight:600;color:var(--ink)}
#fig-stack .fig-stack-detail{margin:0;padding:0 12px 12px;font-size:15px;line-height:1.5}
#fig-stack.fig-stack-js .fig-stack-btn{padding-right:44px}
#fig-stack.fig-stack-js .fig-stack-btn::after{content:"+";position:absolute;right:14px;top:50%;transform:translateY(-50%);font-size:24px;line-height:1;color:var(--muted)}
#fig-stack.fig-stack-js .fig-stack-btn[aria-expanded="true"]::after{content:"\2212"}
#fig-stack .fig-stack-detail[hidden]{display:none}
@media (prefers-reduced-motion:no-preference){
  @keyframes fig-stack-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
  #fig-stack.fig-stack-js .fig-stack-detail{animation:fig-stack-in .25s ease-out}
}

/* ===== fig-revenue-tree ===== */
#fig-revenue-tree .fig-rt-root{display:inline-block;margin:0 0 26px;padding:6px 16px;border-radius:10px;background:var(--ink);color:var(--paper);font:600 18px/1.2 var(--serif)}
#fig-revenue-tree .fig-rt-tree{position:relative;padding-left:28px}
#fig-revenue-tree .fig-rt-list{list-style:none;margin:0;padding:0}
#fig-revenue-tree .fig-rt-node{--draw:1;position:relative;margin:0 0 26px}
#fig-revenue-tree .fig-rt-node:last-child{margin-bottom:0}
#fig-revenue-tree .fig-rt-node::before,
#fig-revenue-tree .fig-rt-node::after{content:"";position:absolute;left:-19px;width:2px;background:var(--muted);transform:scaleY(var(--draw));transform-origin:top}
#fig-revenue-tree .fig-rt-node::before{top:-26px;height:50px}
#fig-revenue-tree .fig-rt-node::after{top:24px;bottom:0}
#fig-revenue-tree .fig-rt-last::after,
#fig-revenue-tree .fig-rt-side::before{background:none;width:0;border-left:2px dashed var(--muted)}
#fig-revenue-tree .fig-rt-side::after{display:none}
#fig-revenue-tree .fig-rt-card{position:relative;background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
#fig-revenue-tree .fig-rt-card::before{content:"";position:absolute;left:-19px;top:23px;width:19px;height:2px;background:var(--muted);transform:scaleX(var(--draw));transform-origin:left}
#fig-revenue-tree .fig-rt-side .fig-rt-card{background:var(--cash-wash);border-color:var(--cash)}
#fig-revenue-tree .fig-rt-card p{margin:0}
#fig-revenue-tree .fig-rt-name{font:600 17px/1.25 var(--serif);margin-bottom:3px}
#fig-revenue-tree .fig-rt-why{font-size:15px;line-height:1.45;color:var(--muted)}
#fig-revenue-tree .fig-rt-ex{font-size:15px;line-height:1.45;margin-top:6px}
#fig-revenue-tree .fig-rt-ex strong{font-weight:600}
#fig-revenue-tree .fig-rt-op{position:absolute;left:10px;top:-26px;height:26px;display:flex;align-items:center;font:600 20px/1 var(--serif);color:var(--muted)}
@media (min-width:720px){
  #fig-revenue-tree .fig-rt-list{max-width:560px}
}
