/* Hero sequence (preview). Loaded only on the page that uses it. */
.seq .seq-stage{position:relative;aspect-ratio:990/760;overflow:hidden;background:#fff}
.seq .seq-stage>*{position:absolute;inset:0;width:100%;height:100%;transition:opacity .7s ease}
.seq svg{display:block;touch-action:manipulation}
.seq .bx{fill:none;stroke:var(--ink);stroke-width:1.2;stroke-linejoin:round}.seq .bx.top{fill:rgba(255,255,255,.9)}
.seq .frame{fill:none;stroke:#9aa0ab;stroke-width:1;stroke-dasharray:5 4;transition:opacity .6s}
.seq .dl,.seq .ldr{fill:none;stroke:var(--ink);stroke-width:1}
.seq .dt{font:500 15.5px 'IBM Plex Mono',monospace;fill:var(--ink)}
.seq .ln{stroke-linecap:round;transition:stroke-width .6s}
.seq .ln.drop{stroke-linecap:round}
.seq .valve{fill:#fff;stroke:var(--blue);stroke-width:1.3}
.seq .hit{fill:none;stroke:transparent;stroke-width:18;pointer-events:stroke;cursor:pointer}
.seq .wf{opacity:0}
.seq .an,.seq .dim,.seq .fl text{transition:opacity .5s}

/* stage visibility */
.seq .seq-spec,.seq .seq-photo{opacity:0;pointer-events:none}
.seq[data-stage="1"] svg,.seq[data-stage="5"] svg{opacity:0;pointer-events:none}
.seq[data-stage="1"] .seq-spec{opacity:1}
.seq[data-stage="5"] .seq-photo{opacity:1}

/* 1 brief */
.seq-spec{display:flex;flex-direction:column;justify-content:center;padding:6% 8%;background:#fff}
.seq-spec>.mono{color:var(--ink3);margin-bottom:14px}
.seq-spec dl{border-top:1.5px solid var(--ink)}
.seq-spec dl div{display:grid;grid-template-columns:minmax(110px,.42fr) 1fr;gap:14px;padding:clamp(7px,1.05vw,13px) 0;border-bottom:1px solid var(--line);opacity:0;transform:translateY(6px)}
.seq[data-stage="1"] .seq-spec dl div{opacity:1;transform:none;transition:opacity .45s ease,transform .45s ease;transition-delay:calc(var(--i)*.38s + .2s)}
.seq-spec dt{font:500 11px 'IBM Plex Mono',monospace;letter-spacing:.1em;text-transform:uppercase;color:var(--ink3);padding-top:4px}
.seq-spec dd{font-weight:600;font-size:clamp(14.5px,1.25vw,18px);line-height:1.3}

/* 2 sketch: pencil strokes on squared paper, drawn in one after another */
@font-face{font-family:Caveat;src:url(../fonts/caveat-500.woff2) format('woff2');font-weight:500;font-display:swap}
.seq[data-stage="2"] .seq-stage{background:linear-gradient(#e3e9f1 1px,transparent 1px) 0 0/100% 4.4%,linear-gradient(90deg,#e3e9f1 1px,transparent 1px) 0 0/3.4% 100%,#fdfdfb}
.seq .all{transition:opacity .7s ease}
.seq[data-stage="2"] .all{opacity:0;pointer-events:none}
.seq .sk{opacity:0;transition:opacity .6s ease;pointer-events:none}
.seq[data-stage="2"] .sk{opacity:1}
.sk .sp{fill:none;stroke:#3d4350;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;opacity:.88;stroke-dasharray:1.02;stroke-dashoffset:1.02;transition:stroke-dashoffset 0s .7s}
.sk .sp.faint{stroke:#a3a9b4;stroke-width:1}
.sk .sp.col{stroke-width:2.8;opacity:.82}.sk .sp.col.old{stroke-width:1.5;opacity:.55}
.sk .sp.r{stroke:var(--red)}.sk .sp.g{stroke:var(--green)}.sk .sp.b{stroke:var(--blue)}
.seq[data-stage="2"] .sk .sp{stroke-dashoffset:0;transition:stroke-dashoffset var(--t) cubic-bezier(.4,0,.3,1) var(--d)}
.seq.sk-done .sk .sp{stroke-dasharray:none;stroke-dashoffset:0;transition:none}
.sk .sh{font:500 25px Caveat,'Segoe Print','Bradley Hand',cursive;fill:#3d4350;opacity:0;transition:opacity 0s .7s}
.sk .sh.ttl{font-size:31px}.sk .sh.sm2{font-size:22px;fill:#6a7180}
.sk .sh.r{fill:var(--red)}.sk .sh.g{fill:var(--green)}.sk .sh.b{fill:var(--blue)}
.seq[data-stage="2"] .sk .sh{opacity:1;transition:opacity .45s ease var(--d)}
.seq.sk-done .sk .sh{opacity:1;transition:none}

/* 4 isometric */
.seq[data-stage="4"] .wf{opacity:1}
.seq[data-stage="4"] .an .t.sm,.seq[data-stage="4"] .fl text,.seq[data-stage="4"] .dim,.seq[data-stage="4"] .ex text{opacity:0}
.seq .ex text{transition:opacity .5s}.seq .fl .wall{transition:fill .6s}.seq[data-stage="4"] .fl .wall:not(.thin){fill:#f3f3ef}
.seq[data-stage="4"] .ln{stroke-width:4.4}.seq[data-stage="4"] .ln.drop{stroke-width:2}

/* 5 installed */
.seq-photo{display:grid;grid-template-columns:1.15fr 1fr;gap:3px;background:#fff}
.seq-photo img{width:100%;height:100%;object-fit:cover;min-height:0;background:#e9eaec}
.seq-photo span{position:absolute;left:0;bottom:0;background:var(--ink);color:#fff;padding:8px 12px;font-size:11px}

/* caption and stepper */
.seq-cap b{font-size:17px;display:block}.seq-cap p{color:var(--ink2);font-size:14.5px;line-height:1.45;margin-top:4px;max-width:44em}
.seq-bar{grid-column:2/7;grid-row:1;height:4px;background:var(--line);overflow:hidden}
.seq-bar i{display:block;height:100%;width:0;background:var(--red);will-change:width}
.seq-steps{display:grid;grid-template-columns:auto repeat(5,1fr);border-top:1px solid var(--line)}
.seq-steps>button:not(.seq-pp){grid-row:2}
.seq-steps .seq-pp{grid-row:1/3;grid-column:1}
.seq-steps .seq-pp{flex-direction:row;align-items:center;gap:8px;padding:10px 14px;color:var(--ink);border-right:1px solid var(--line)}
.seq-pp svg{width:12px;height:12px;fill:var(--red);flex:none}.seq-pp b{font-size:13.5px;font-weight:700;min-width:2.9em}
.seq-steps button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 12px 12px;text-align:left;transition:background .15s,color .2s;min-width:0;color:var(--ink3)}
.seq-steps button .mono{font-size:10.5px;color:inherit}
.seq-steps button b{font-size:14.5px;font-weight:600;white-space:nowrap}
.seq-steps button:hover{background:var(--paper);color:var(--ink)}
.seq-steps button.done{color:var(--ink2)}
.seq-steps button[aria-current=step]{color:var(--ink)}.seq-steps button[aria-current=step] b{font-weight:800}
.seq-steps button[aria-current=step] .mono{color:var(--red)}
.seq .readout{min-height:96px}
@media(max-width:760px){
 .seq-steps button{padding:8px 5px 10px}.seq-steps .seq-pp{padding:8px 9px}.seq-pp b{display:none}.seq-steps button b{font-size:11.5px}.seq-steps button .mono{font-size:9.5px}
 .seq .seq-stage{aspect-ratio:990/860}.seq-spec>.mono{display:none}
 .seq-spec{padding:3% 5%}.seq-spec dl div{grid-template-columns:96px 1fr;gap:8px;padding:6px 0}.seq-spec dd{font-size:13.5px}.seq-spec dt{font-size:9.5px}
 .seq .readout{min-height:128px}
}
@media(prefers-reduced-motion:reduce){.seq .seq-stage>*,.seq .ln{transition:none}.seq .sk .sp{stroke-dasharray:none!important;transition:none!important}.seq .sk .sh{transition:none!important}}

/* ---------- dark theme (the sketch stage stays on light paper) ---------- */
[data-theme=dark] .seq:not([data-stage="2"]) .seq-stage,[data-theme=dark] .seq-spec{background:var(--sheet)}
[data-theme=dark] .seq .bx.top{fill:rgba(22,25,32,.92)}
[data-theme=dark] .seq .valve{fill:var(--sheet)}
[data-theme=dark] .seq[data-stage="4"] .fl .wall:not(.thin){fill:#1c2029}
[data-theme=dark] .seq-photo{background:var(--sheet)}
[data-theme=dark] .seq-photo span{background:#07080a;color:#fff}
