/* A full-page circuit drawing, with a compact scroll-synchronised caption. */
body.qr-page{--bg:#f7f7f3;--ink:#20272c;--muted:#58646b;background:var(--bg)}
.qr-page header{position:fixed;top:0;left:0;right:0;height:54px;max-width:none;padding:10px 24px;border-bottom:1px solid #dce1e1;background:var(--bg);z-index:8}.qr-page .brand-note{display:none}.qr-page main{max-width:none;padding:54px 0 0}.qr-page footer{max-width:none;padding:24px}.qr-page section{padding:0}.qr-experience{position:relative;width:100%;margin:0}.qr-visual{position:sticky;top:54px;height:calc(100svh - 54px);padding:10px 20px 8px;display:flex;flex-direction:column;background:var(--bg);z-index:3;overflow:hidden}.qr-caption{display:grid;grid-template-columns:minmax(220px,25%) 1fr;gap:32px;align-items:start;padding:0 8px 8px;flex:none}.qr-caption h1{font-size:23px;font-weight:600;letter-spacing:-.6px;line-height:1.2;margin:2px 0}.qr-kicker{font:9px var(--mono);letter-spacing:1px;color:#6f7b84;text-transform:uppercase}.qr-caption h2{font-size:16px;font-weight:600;letter-spacing:0;line-height:1.25;margin:0 0 4px}.qr-caption p{font-size:13px;line-height:1.4;color:var(--muted);margin:0;max-width:780px}.qr-scene-label{display:flex;justify-content:space-between;align-items:center;font:9px var(--mono);color:#6a7882;text-transform:uppercase;letter-spacing:.8px;padding:2px 8px}.qr-canvas{position:relative;flex:1;min-height:0;width:100%}#qr-array{display:block;width:100%;height:100%;opacity:1;transition:opacity .35s}#qr-array.muted{opacity:0;pointer-events:none}.qr-page svg text{font:20px Arial,Helvetica,sans-serif;text-anchor:middle;fill:#20282e}.qr-page svg .qr-port{font:18px Georgia,serif;fill:#556571}.qr-page svg .qr-output{font:16px var(--mono);fill:#47788a}.qr-section-label{font:600 22px Arial,sans-serif!important;letter-spacing:1.4px;fill:#263746!important}.qr-wire{fill:none;stroke:#465968;stroke-width:2.4;color:#465968;stroke-linejoin:miter;transition:stroke .25s}.qr-wire.flowing{stroke:#0879b4;color:#0879b4;stroke-width:3}.qr-unit rect{fill:#efefeb;stroke:#24303a;stroke-width:3;transition:fill .25s,stroke .25s}.qr-unit.active rect{fill:#e0eef4;stroke:#0879b4}.qr-unit.active text{fill:#075d8b}.qr-pe text{font-weight:600;font-size:23px}.qr-register rect{fill:#fff;stroke:#27323a;stroke-width:2.5}.qr-register text{font:bold 11px Arial,sans-serif}.qr-clock-symbol{fill:none;stroke:#27323a;stroke-width:2}.qr-junction{fill:#465968}.qr-term{font:16px var(--mono)!important;fill:#627581!important}#qr-back #qr-mul0 text,#qr-back #qr-mul1 text,#qr-back #qr-mul2 text{font-size:35px}#qr-back #qr-div text{font-size:26px}#qr-back #qr-sol text{font:18px var(--mono)}
.qr-packet{pointer-events:none;will-change:transform}.qr-packet circle{r:5px;fill:#0879b4;stroke:var(--bg);stroke-width:2}.qr-packet .qr-number{font:19px var(--mono);fill:#076792;paint-order:stroke;stroke:var(--bg);stroke-width:6px;stroke-linejoin:round}.qr-packet.qr-lower circle{fill:#8b7350}.qr-packet.qr-lower .qr-number{fill:#7e6137}.qr-packet.qr-result circle{fill:#267b63}.qr-packet.qr-result .qr-number{fill:#267b63}.qr-core-dot{fill:#0879b4;stroke:var(--bg);stroke-width:1.5}.qr-core-dot.lower{fill:#8b7350}
.qr-scene-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;flex:none;min-height:43px;padding:0 8px}.qr-scene-footer math{font-size:17px;color:#304c60}.qr-transport{display:flex;gap:12px;align-items:center;margin-left:auto}.qr-transport[hidden]{display:none}.qr-transport button{font:11px var(--mono);color:#405e70;border:0;border-radius:0;background:transparent;padding:6px;gap:6px}.qr-transport button:hover{background:#e4ebee}.qr-chapter-nav{display:flex;gap:14px;flex-wrap:wrap;font:10px var(--mono)}.qr-chapter-nav a{text-decoration:none;color:#71818b;padding:5px 0}.qr-chapter-nav a[aria-current=step]{color:#086a9f;border-bottom:2px solid #0879b4}
/* Narrative nodes provide scroll distances; only the current caption is shown. */
.qr-copy{position:relative;z-index:0;margin-top:calc(-100svh + 54px);pointer-events:none}.qr-chapter{min-height:125svh;position:relative}.qr-opening{min-height:100svh}.qr-ending{min-height:100svh}.qr-chapter>*{visibility:hidden;pointer-events:none}.qr-page details{font-size:11px;color:#60727d}.qr-caption details{position:absolute;right:28px;top:70px;max-width:450px;z-index:5;background:var(--bg)}.qr-caption details[open]{padding:14px;border:1px solid #bac8d0}.qr-caption details p{font-size:12px;margin-top:10px}.qr-page summary{cursor:pointer}
#qr-rotation{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .35s,transform .4s}#qr-rotation.visible{opacity:1;transform:none;pointer-events:auto}#qr-core{width:100%;flex:1;min-height:0}#qr-givens math{font-size:21px;color:#304c60}#qr-rotation-value math{font-size:18px;color:#304c60}.qr-control{fill:none;stroke:#806f4e;stroke-width:2;stroke-dasharray:5 4}.qr-direction{font-size:17px!important;fill:#806f4e!important}#core-addx text,#core-addy text{font-size:38px}.qr-page #qr-core .qr-port{font-size:17px}#qr-turns rect{fill:#d9dfe0;transition:fill .2s}#qr-turns rect.active{fill:#4782a0}.qr-registers{position:relative;margin:5px 0 0;font-size:10px;text-align:center}.qr-registers summary{color:#71818b}.qr-registers span{display:inline-block;width:24px;text-align:left}.qr-registers code{font:10px var(--mono);letter-spacing:.5px;background:none;color:#365d73}#qr-register-words{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);width:280px;padding:8px;background:var(--bg);border:1px solid #c4cdd2;z-index:4}.qr-fallback{padding:12vh 6vw!important}.qr-page .skip{z-index:10}
@media(min-width:1700px){.qr-visual{padding-left:2vw;padding-right:2vw}.qr-caption p{max-width:1000px;font-size:14px}.qr-caption h1{font-size:26px}}
@media(max-width:800px){.qr-page header{padding:10px 16px}.qr-page nav{gap:12px}.qr-page .brand{font-size:13px}.qr-caption{gap:12px;grid-template-columns:180px 1fr;padding:0 2px 5px}.qr-caption h1{font-size:19px}.qr-caption h2{font-size:14px}.qr-caption p{font-size:12px}.qr-visual{padding:8px}.qr-scene-footer{flex-wrap:wrap;gap:5px;min-height:60px}.qr-chapter-nav{gap:12px}.qr-scene-footer math{font-size:14px}.qr-chapter-nav{margin-left:auto}}
@media(max-width:520px){.qr-page header{height:48px}.qr-page header .monogram{display:none}.qr-page header nav{gap:9px;font-size:10px}.qr-page main{padding-top:48px}.qr-visual{top:48px;height:calc(100svh - 48px)}.qr-caption{grid-template-columns:1fr;gap:6px}.qr-caption>div:first-child{display:flex;align-items:center;justify-content:space-between}.qr-caption h1{font-size:17px}.qr-caption .qr-kicker{font-size:8px}.qr-caption p{font-size:12px;line-height:1.35}.qr-scene-label{font-size:8px}.qr-canvas{overflow-x:auto;overflow-y:hidden;display:flex;align-items:center}#qr-array{min-width:860px;height:100%;flex-shrink:0}#qr-rotation{min-width:0}#qr-core{width:100%;min-width:0}.qr-copy{margin-top:calc(-100svh + 48px)}.qr-chapter-nav{gap:12px;font-size:9px;width:100%;justify-content:center}.qr-caption details{right:8px;top:118px;max-width:95vw}#qr-givens math{font-size:16px}.qr-scene-footer math{font-size:12px}#qr-rotation-value math{font-size:15px}}
@media(prefers-reduced-motion:reduce){.qr-page *{transition:none!important;scroll-behavior:auto!important}}
/* Conventional circuit vocabulary: blocks, operators, muxes and clocked storage. */
.qr-page svg .qr-section-label{font-size:20px!important;paint-order:stroke;stroke:var(--bg);stroke-width:8px}.qr-boundary{fill:none;stroke:#a3aeb7;stroke-width:1.5;stroke-dasharray:8 6}.qr-bus{fill:none;stroke:#263c4c;stroke-width:5}.qr-unit.qr-pe rect{fill:#e4eaf0;stroke:#172d3e;stroke-width:3.5}.qr-unit.qr-pe text{font-size:24px;fill:#1c3548}.qr-unit.qr-register rect{fill:#fff7dd;stroke:#443f2d;stroke-width:3}.qr-unit.qr-register text{font:bold 14px Arial,sans-serif;fill:#443f2d}.qr-unit.qr-storage>rect{fill:#e7f1ec;stroke:#244c3e;stroke-width:3.5}.qr-storage>path{fill:none;stroke:#244c3e;stroke-width:2}.qr-storage>text:first-of-type{font-size:22px;font-weight:700;fill:#244c3e}.qr-storage text{font:18px Arial,sans-serif}.qr-operator circle{fill:#eef0f3;stroke:#253746;stroke-width:3.5}.qr-operator text{font-size:38px;font-weight:500}.qr-mux>path{fill:#f2e9d9;stroke:#635238;stroke-width:3}.qr-mux text{fill:#57472e;font-size:19px}.qr-controller rect{fill:#ede6f2;stroke:#665674;stroke-width:2.5}.qr-controller text{font:18px var(--mono)}.qr-control{stroke:#8a698e;stroke-width:2;stroke-dasharray:7 5}.qr-unit.active>rect,.qr-unit.active>circle,.qr-unit.active>path,#qr-sub.active circle{fill:#d4e7f4;stroke:#057ab9}.qr-solution-storage text{font:18px var(--mono)}.qr-clock-symbol{stroke:#443f2d;stroke-width:2.5}.qr-wire{stroke-width:2.6}.qr-caption{grid-template-columns:minmax(200px,22%) 1fr}.qr-caption h1{font-size:21px}.qr-caption p{max-width:1100px;font-size:12px}.qr-caption h2{font-size:15px}.qr-scene-label{padding-top:0}.qr-visual{padding-top:7px}.qr-canvas{min-height:0}.qr-section-label{letter-spacing:1px}#qr-back #qr-sol text{font:18px var(--mono)}

#core-gain.active rect{fill:#d4e7f4;stroke:#057ab9}.qr-processing rect{fill:#e4eaf0}.qr-page #qr-core .qr-register text{font-size:14px}@media(max-width:520px){.qr-caption{grid-template-columns:1fr}.qr-caption h1{font-size:17px}}

.qr-matrices{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;padding:4px 8px;flex:none;border-top:1px solid #d7dfdc}.qr-matrices[hidden]{display:none}.qr-matrices>div{text-align:center;min-width:0}.qr-matrices span{font:10px var(--mono);color:#4e645c}.qr-matrices math{font-size:13px;margin:3px 0}.qr-matrices small{font:9px var(--mono);color:#4e645c}.qr-bank-matrix.loading{background:#fff6df}.qr-bank-matrix.solving{background:#e6f2f8}.qr-storage.loading>rect{fill:#fff4d8;stroke:#a07b35}.qr-storage>text:first-of-type{font-size:17px}.qr-storage text,#qr-back #qr-sol text,.qr-solution-storage text{font:15px var(--mono)}#qr-time{width:120px;accent-color:#287e9e}#qr-time-value{font:10px var(--mono);width:28px}.qr-chapter:nth-child(2){min-height:320svh}.qr-packet.system-2 circle,.qr-packet.system-4 circle{fill:#aa7130}.qr-packet.system-2 .qr-number,.qr-packet.system-4 .qr-number{fill:#956122}@media(max-width:800px){.qr-matrices math{font-size:10px}.qr-matrices{gap:5px}.qr-matrices small{font-size:8px}.qr-scene-footer{gap:4px}#qr-time{width:85px}}@media(max-width:520px){.qr-matrices{overflow-x:auto;grid-template-columns:repeat(3,210px)}.qr-matrices math{font-size:12px}.qr-register text{font-size:12px}}
/* The simulation supplies its own easing; anchor scrolling must settle immediately. */
html:has(body.qr-page){scroll-behavior:auto!important}

.qr-core-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(230px,1fr);gap:18px;flex:1;min-height:0;width:100%;padding:8px}.qr-core-enclosure{display:flex;flex-direction:column;min-height:0;border:2px solid #31566c;background:#edf2f333;padding:8px}.qr-core-title{font:11px var(--mono);text-align:center;color:#31566c;padding:4px}.qr-plane-panel{display:flex;flex-direction:column;min-height:0}#qr-plane{width:100%;flex:1;min-height:0}#qr-plane-caption{font:11px var(--mono);text-align:center;color:#526d7c;min-height:30px}:is(#qr-plane,.design-vector-plane) .plane-axes{stroke:#a5b1b8;stroke-width:1.5;fill:none}:is(#qr-plane,.design-vector-plane) .plane-circle{stroke:#ccd6d9;stroke-dasharray:5 5}:is(#qr-plane,.design-vector-plane) .plane-initial{stroke:#9caab1;stroke-width:2;fill:none}:is(#qr-plane,.design-vector-plane) .plane-vector{stroke:#0879b4;stroke-width:4;fill:none}:is(#qr-plane,.design-vector-plane) .plane-next{stroke:#5c936e;stroke-width:2;stroke-dasharray:5 4;fill:none}:is(#qr-plane,.design-vector-plane) .plane-trail{stroke:#9ab3c2;stroke-width:1;fill:none}:is(#qr-plane,.design-vector-plane) .plane-projection{stroke:#91a7b1;stroke-width:1;stroke-dasharray:4 4;fill:none}:is(#qr-plane,.design-vector-plane) .plane-arc{stroke:#bf8841;stroke-width:3;fill:none}:is(#qr-plane,.design-vector-plane) text{font:17px var(--mono)}@media(max-width:620px){.qr-core-layout{grid-template-columns:1fr;overflow:auto;gap:8px}.qr-core-enclosure{min-height:240px}.qr-plane-panel{min-height:220px}.qr-core-title{font-size:9px}}
