.mechanics-page{--mech-viewport-space:120px}
.mech-lab{--mech-bg:#17201f;--mech-ink:#f1f4e8;--mech-lime:#d5ed74;--mech-muted:#bac5bb;--mech-line:#3c4a43;--mech-weight:#efb078;margin:0 0 64px;isolation:isolate}
.mech-lab *{box-sizing:border-box}
/* Keep the interactive frame in one viewport; the reading content follows below. */
.mech-frame{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;height:min(740px,calc(100svh - var(--mech-viewport-space)));background:var(--mech-bg);color:var(--mech-ink);border:1px solid #35443b;overflow:hidden;scroll-margin-top:12px}
.mech-frame>.mech-panel{min-width:0;min-height:0}
.mech-heading{display:flex;align-items:end;justify-content:space-between;gap:32px;padding:24px 32px 18px}
.mech-heading h1{font-family:var(--display,Impact,sans-serif);font-size:clamp(2rem,3.6vw,3.5rem);line-height:1;margin:0;color:var(--mech-ink)}
.mech-eyebrow{font-size:11px;font-weight:700;line-height:1.4;letter-spacing:.14em;text-transform:uppercase;color:var(--mech-lime);margin:0 0 12px}

.mech-types{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:0 32px 20px;border-bottom:1px solid var(--mech-line)}
.mech-type{border:1px solid #7b8b70;border-radius:3px;background:#202d25;color:var(--mech-ink);padding:12px 16px;display:flex;align-items:center;justify-content:center;gap:10px;text-align:center;font:600 15px/1.3 var(--body,Arial,sans-serif);min-height:48px;cursor:pointer;transition:background-color .15s,border-color .15s}
.mech-type-icon{width:16px;height:16px;flex-shrink:0;fill:currentColor}
.mech-type[aria-pressed=true]{background:var(--mech-lime);border-color:var(--mech-lime);color:#17201f}
.mech-type:hover:not([aria-pressed=true]){background:#354832;border-color:var(--mech-lime)}
.mech-type:active{background:#43573a}
.mech-lab button:focus-visible,.mech-lab input:focus-visible,.mech-lab a:focus-visible{outline:3px solid var(--mech-weight);outline-offset:-5px}
.mech-panel[hidden],.mech-motion-note[hidden]{display:none}
.mech-stage{position:relative;display:flex;flex-direction:column;min-height:0;height:100%;padding:14px 24px 0;background-color:#1c2722;background-image:linear-gradient(#a8c39d09 1px,transparent 1px),linear-gradient(90deg,#a8c39d09 1px,transparent 1px);background-size:36px 36px;overflow:hidden}
.mech-stage-meta{display:flex;flex-shrink:0;justify-content:space-between;gap:16px;color:#c4cebf;text-transform:uppercase;font-size:10px;font-weight:600;line-height:1.4;letter-spacing:.12em;padding:0 4px;position:relative;z-index:1}
.mech-svg{display:block;flex:1;min-height:0;width:100%;height:100%;overflow:hidden}
.mech-svg path,.mech-svg circle,.mech-svg rect{vector-effect:non-scaling-stroke}
.mech-steel{stroke:var(--mech-lime);stroke-width:2.5;fill:none;stroke-linejoin:round}
.mech-deck{fill:var(--mech-lime);stroke:var(--mech-lime);stroke-width:1}
.mech-counterweight{fill:var(--mech-weight);stroke:#f9d8ac;stroke-width:1}
.mech-weight-arm{stroke:var(--mech-lime);stroke-width:6;fill:none}
.mech-bank{fill:#364238;stroke:none}
.mech-groundline{fill:none;stroke:#85927d;stroke-width:2}
.mech-ghost{fill:none;stroke:#a4b29755;stroke-width:1;stroke-dasharray:5 6}
.mech-bearing{fill:#829476;stroke:#b4c4a3;stroke-width:1.5}
.mech-pivot{fill:#f7faec;stroke:var(--mech-bg);stroke-width:2}
.mech-waterline{fill:none;stroke:#6eafa75c;stroke-width:1}
.mech-water-label{fill:#a3c9c1;font-family:var(--body,Arial,sans-serif);font-size:15px;letter-spacing:5px}
.mech-label{fill:#d4dfc9;font-family:var(--body,Arial,sans-serif);font-size:20px;line-height:1.4;font-weight:500}
.mech-leader{fill:none;stroke:#91a382;stroke-width:1}
.mech-diagram-number{fill:#c5d7ac21;font-family:var(--display,Impact,sans-serif);font-size:70px}
.mech-track{stroke:#b2c4a2;stroke-width:3;fill:none}
.mech-track-teeth{stroke:#748767;stroke-width:1;fill:none}
.mech-heel{stroke:var(--mech-lime);stroke-width:6;fill:none}
.mech-contact{fill:#f3f8df;stroke:var(--mech-bg);stroke-width:1}
.mech-tower{stroke:#94a787;stroke-width:3;fill:none;stroke-linejoin:round}
.mech-sheave{stroke:var(--mech-weight);stroke-width:3;fill:var(--mech-bg)}
.mech-sheave-hub{fill:var(--mech-weight)}
.mech-rope{stroke:var(--mech-weight);stroke-width:1.5;fill:none}
.mech-plan-water{fill:#26423b}
.mech-plan-bank{fill:#2e382f}
.mech-bank-edge{stroke:#9bb392;stroke-width:2;fill:none}
.mech-road{fill:#4a5643;stroke:#839476;stroke-width:1}
.mech-road-center{fill:none;stroke:#c3cfb46b;stroke-width:1;stroke-dasharray:9 12}
.mech-flow{fill:none;stroke:#7eb3a9;stroke-width:1.5}
.mech-swing-guide{fill:none;stroke:#aec79a40;stroke-width:1;stroke-dasharray:4 8}
.mech-pier{fill:#7b8970;stroke:#aebea2;stroke-width:2}
.mech-swing-brace{fill:none;stroke:#4d612c;stroke-width:2}
.mech-plan-river{fill:#9ec4b9;font-family:var(--body,Arial,sans-serif);font-size:15px;letter-spacing:5px}
.mech-explanation{display:grid;grid-template-columns:1.2fr 1fr;gap:48px;padding:28px 0 0;color:var(--ink)}
.mech-principle{font-size:10px!important;letter-spacing:.11em;text-transform:uppercase;color:#52633b!important;margin:0 0 10px!important;font-weight:600}
.mech-explanation h3{font-family:var(--display,Impact,sans-serif);font-size:30px;line-height:1.05;margin:0 0 12px;color:var(--ink)}
.mech-explanation p{font-size:14px;line-height:1.7;color:#4b564c;margin:0}
.mech-example{border-left:1px solid #cbd0c3;padding-left:32px;align-self:center}
.mech-example a{font-size:14px;font-weight:600;color:#42572e;text-decoration:underline;text-underline-offset:4px;text-decoration-color:#87977a}
.mech-example a:hover{text-decoration-color:currentColor}
.mech-example p{font-size:12px;margin:9px 0 0}
.mech-controls{display:grid;grid-template-columns:112px 1fr;align-items:center;gap:28px;padding:16px 32px 18px;border-top:1px solid var(--mech-line);background:#121a17}
.mech-play{background:var(--mech-lime);color:#17201f;border:0;border-radius:0;display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:12px 16px;font:600 14px var(--body,Arial,sans-serif);cursor:pointer}
.mech-play:hover{background:#e4f69e}
.mech-play:disabled{background:#536044;color:#d1d9c8;cursor:default}
.mech-play svg{height:18px;width:18px;fill:currentColor}
.mech-pause-symbol{display:none}
.mech-play[data-playing=true] .mech-play-symbol{display:none}
.mech-play[data-playing=true] .mech-pause-symbol{display:block}
.mech-range-wrap{min-width:0}
.mech-range-label{display:flex;justify-content:space-between;gap:16px;align-items:center;font-size:12px;line-height:1.5;font-weight:600;margin-bottom:2px}
.mech-range-label output{font-weight:400;color:var(--mech-lime);font-variant-numeric:tabular-nums}
.mech-range-wrap input{--mech-progress:35%;appearance:none;-webkit-appearance:none;display:block;border:0;width:100%;height:28px;margin:0;background:transparent;cursor:ew-resize;touch-action:pan-y;accent-color:var(--mech-lime)}
.mech-range-wrap input::-webkit-slider-runnable-track{height:4px;background:linear-gradient(to right,var(--mech-lime) 0 var(--mech-progress),#53604d var(--mech-progress) 100%);border-radius:0}
.mech-range-wrap input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;height:18px;width:18px;background:var(--mech-lime);border:3px solid #18221b;border-radius:50%;box-shadow:0 0 0 1px var(--mech-lime);margin-top:-7px}
.mech-range-wrap input::-moz-range-track{height:4px;background:#53604d;border-radius:0}
.mech-range-wrap input::-moz-range-progress{height:4px;background:var(--mech-lime)}
.mech-range-wrap input::-moz-range-thumb{height:14px;width:14px;background:var(--mech-lime);border:3px solid #18221b;border-radius:50%;box-shadow:0 0 0 1px var(--mech-lime)}
.mech-range-endpoints{display:flex;justify-content:space-between;font-size:10px;color:var(--mech-muted);line-height:1.5}
.mech-motion-note{font-size:12px;line-height:1.6;color:var(--mech-muted);margin:0;padding:0 32px 14px;background:#121a17}
@media(min-width:1200px){.mech-stage{padding-left:50px;padding-right:50px}.mech-heading,.mech-types{padding-left:40px;padding-right:40px}}
@media(max-width:760px){.mechanics-page{--mech-viewport-space:96px}}
@media(max-width:680px){.mech-lab{margin:0 0 48px}.mech-frame{height:min(560px,calc(100svh - var(--mech-viewport-space)))}.mech-heading{display:block;padding:20px 20px 16px}.mech-types{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0 20px 16px}.mech-type{padding:12px;min-height:46px;font-size:13px;gap:8px}.mech-type-icon{width:13px;height:13px}.mech-stage{padding:12px 8px 0;background-size:26px 26px}.mech-stage-meta{font-size:8px;letter-spacing:.07em;padding:0 10px 7px;gap:8px}.mech-label{font-size:24px}.mech-water-label,.mech-plan-river{font-size:20px;letter-spacing:3px}.mech-explanation{display:block;padding:24px 0 0;gap:0}.mech-explanation h3{font-size:28px}.mech-explanation p{font-size:13px}.mech-example{border-left:0;border-top:1px solid #cbd0c3;padding:17px 0 0;margin-top:20px}.mech-example a{font-size:13px}.mech-example p{font-size:11px;line-height:1.7}.mech-controls{grid-template-columns:88px 1fr;gap:18px;padding:14px 20px 16px}.mech-play{font-size:12px;min-height:46px;padding:10px;gap:8px}.mech-play svg{width:15px;height:15px}.mech-range-label{font-size:10px;gap:6px}.mech-range-endpoints{font-size:9px}.mech-motion-note{padding:0 20px 12px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.mech-lab *{scroll-behavior:auto;animation:none!important;transition:none!important}}

@media(max-height:500px) and (min-width:681px){
 .mech-frame{grid-template-columns:220px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto}
 .mech-heading{grid-column:1;grid-row:1;display:block;padding:16px 18px 12px}
 .mech-heading h1{font-size:28px}
 .mech-types{grid-column:1;grid-row:2;grid-template-columns:1fr 1fr;align-content:start;gap:8px;padding:0 18px 12px;border:0}
 .mech-type{font-size:12px;gap:5px;min-height:44px;padding:8px 5px}.mech-type-icon{width:12px;height:12px}
 .mech-frame>.mech-panel{grid-column:2;grid-row:1/span 2}
 .mech-stage{padding:12px 8px 0}.mech-stage-meta{font-size:8px;letter-spacing:.04em}
 .mech-controls{grid-column:1/-1;grid-row:3;padding:10px 18px 12px;gap:20px}
 .mech-frame>.mech-motion-note{grid-column:1/-1;grid-row:4;padding:0 18px 10px;font-size:11px}
}
