:root {
  --navy: #020e4a;
  --red: #e7000b;
  --ink: #1d2433;
  --mute: #5b6475;
  --line: #e3e5ea;
  --font: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #f3f3f3; }
body { color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; background: #f3f3f3 url("../assets/images/background-image.webp") center top / cover no-repeat; }
body { overflow: hidden; }
button { font-family: inherit; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3D canvas fills the frame, the UI flows on top of it */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; outline: none; mix-blend-mode: multiply; }
#annsvg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 8; pointer-events: none; overflow: visible; }
#ann { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.ann { position: absolute; left: 0; top: 0; white-space: nowrap; max-width: 180px; font-size: 10px; font-weight: 600; letter-spacing: .02em; color: var(--navy); opacity: 0; padding: 5px 8px; background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(2,14,74,.08); contain: layout style; will-change: transform; pointer-events: none; }
.ann small { display: block; margin-top: 2px; font-size: 10px; font-weight: 400; color: var(--mute); }
.ann small:empty { display: none; }
.ann.r { text-align: right; }
.dim { position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 12px; color: #fff; opacity: 0; padding: 4px 8px; background: var(--navy); border-radius: 6px; white-space: nowrap; }
.dim b { color: #b8d45c; font-weight: 500; }
.open-type .ann { display: none; }

/* loader */
#loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: 22vh; background: rgba(243,243,243,.92); transition: opacity .8s .2s, visibility 0s 1s; }
#loader.done { opacity: 0; visibility: hidden; }
.ld { width: min(460px, 84vw); position: sticky; top: 40%; }
.ld-top, .ld-bot { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.ld-num { font-weight: 800; font-size: clamp(64px, 12vw, 120px); line-height: .9; color: var(--navy); margin: 14px 0 18px; font-variant-numeric: tabular-nums; }
.ld-num sup { font-size: .25em; color: var(--red); vertical-align: top; margin-left: .1em; }
.ld-bar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; position: relative; }
.ld-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--red); }
.ld-bot { margin-top: 12px; }

/* page */
.gp-wrap { position: relative; z-index: 10; width: min(1180px, 100%); margin: 0 auto; padding: 24px 20px 32px; display: flex; flex-direction: column; pointer-events: none; }
.gp-wrap > * { pointer-events: auto; }

.rail { display: flex; justify-content: space-between; gap: 4px; padding: 14px 18px; background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(2,14,74,.06); }
.rail button { all: unset; flex: 1; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; position: relative; color: var(--ink); transition: color .3s; }
.rail button + button::before { content: ''; position: absolute; left: -2px; top: 18%; bottom: 18%; width: 1px; background: var(--line); }
.rail button small { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.rail button em { font-style: normal; font-size: 15px; font-weight: 600; }
.rail button:hover, .rail button.on, .rail button.on small { color: var(--red); }
.rail button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 8px; }

.gp-head { position: relative; margin-top: 34px; text-align: center; pointer-events: none; }
.gp-head .ch { position: absolute; inset: 0 0 auto; opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .7s cubic-bezier(.2,.7,.1,1); }
.gp-head .ch.on { position: relative; opacity: 1; transform: none; }
.idx { display: inline-flex; padding: 7px 14px; border-radius: 99px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; }
.ch h2 { margin: 20px auto 16px; max-width: 760px; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; font-weight: 600; text-transform: uppercase; color: var(--navy); letter-spacing: -.01em; }
.lead { max-width: 560px; margin: 0 auto; font-size: 15px; line-height: 1.6; color: var(--ink); font-weight: 500; }
.lead strong { font-weight: 700; }

/* stage: transparent window onto the canvas */
.gp-stage { position: relative; height: clamp(320px, 46vw, 520px); margin-top: 8px; pointer-events: none; }
.gp-stage > * { pointer-events: auto; }
.stage-l { position: absolute; left: 0; top: 12px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.start { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.start .k { width: 46px; height: 26px; border-radius: 99px; background: #cfd3db; position: relative; transition: background .3s; }
.start .k::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s; }
.start.run .k { background: #2bb24c; }
.start.run .k::after { transform: translateX(20px); }
.start-t { display: flex; flex-direction: column; font-size: 11px; line-height: 1.3; color: var(--ink); }
.start-t small { font-size: 10px; color: var(--mute); }
#startl { font-weight: 700; }
#start:disabled { opacity: .5; cursor: not-allowed; }
.snd { all: unset; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--mute); border: 1px solid var(--line); transition: .3s; }
.snd svg { width: 16px; height: 16px; }
.snd.on { background: #2bb24c; border-color: #2bb24c; color: #fff; }
.ctrl { position: absolute; right: 0; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.modes { display: flex; padding: 3px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.modes button { all: unset; cursor: pointer; padding: 7px 11px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink); transition: .25s; }
.modes button.on { background: var(--navy); color: #fff; }
#modes button { font-size: 9.5px; padding: 6px 9px; color: var(--mute); }
#modes button.on { background: #eef0f4; color: var(--navy); }
.cad { display: none; }

/* step details under the model */
.gp-extras { position: relative; margin-top: 8px; }
.chx { position: absolute; inset: 0 0 auto; opacity: 0; visibility: hidden; transition: opacity .45s ease; }
.chx.on { position: relative; opacity: 1; visibility: visible; }
.card { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 20px 28px; background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(2,14,74,.06); }
.stats { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.stat { padding: 0 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-size: 22px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat b sup { font-size: .55em; margin-left: 3px; color: var(--mute); vertical-align: baseline; }
.stat span { display: block; margin-top: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.steps { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 22px; counter-reset: s; }
.steps li { list-style: none; display: flex; gap: 8px; font-size: 12px; color: var(--mute); transition: color .3s; }
.steps li::before { counter-increment: s; content: counter(s, decimal-leading-zero); color: #b7bcc6; font-variant-numeric: tabular-nums; }
.steps li.on { color: var(--navy); font-weight: 600; }
.steps li.on::before { color: var(--red); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; }
.chip { all: unset; cursor: pointer; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 600; color: var(--navy); transition: .25s; }
.chip.act { border-color: rgba(231,0,11,.35); color: var(--red); }
.chip:hover { border-color: var(--red); background: #fff5f5; }
.note { font-size: 12px; color: var(--mute); }
.btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 8px; background: var(--red); border: 2px solid var(--red); color: #fff; font-size: 14px; font-weight: 600; transition: transform .3s; }
.btn:hover { transform: scale(.96); }
.btn-o { background: #fff; color: var(--red); }
.wave { padding: 16px 20px 12px; border-radius: 16px; background: var(--navy); }
.wave canvas { width: 100%; height: 70px; display: block; }
.wave-l { display: flex; gap: 18px; margin-top: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: rgba(255,255,255,.7); }
.wave-l i { display: inline-block; width: 14px; height: 2px; margin-right: 6px; vertical-align: middle; }
.fuel-controls { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 14px; min-width: min(460px, 100%); font-size: 12px; color: var(--mute); }
.fuel-controls .chip { grid-column: 1 / -1; justify-self: start; }
.fuel-controls input { accent-color: var(--red); width: 100%; }
.fuel-controls output { font-weight: 700; color: var(--navy); }
.card-dark { background: var(--navy); }
.test { width: 100%; display: grid; gap: 9px; }
.trow { display: grid; grid-template-columns: 44px 1fr 170px; gap: 12px; white-space: nowrap; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: rgba(255,255,255,.55); }
.trow .tb { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); position: relative; overflow: hidden; }
.trow .tb i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--red), #ff7a1a); }
.trow.live { color: #fff; }
.trow span:last-child { text-align: right; }
.card-final { align-items: stretch; }
.spec { flex: 1 1 380px; }
.spec div { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.spec div span { color: var(--mute); }
.spec div b { font-weight: 600; color: var(--navy); text-align: right; }
.profile-box { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--mute); }
.profile-box select { padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: 600 13px var(--font); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

/* live monitoring panel */
.hud { margin-top: 18px; padding: 18px 20px 20px; border-radius: 16px; background: var(--navy); color: #fff; }
.hud-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.hud-h strong { font-size: 16px; font-weight: 700; }
.hud-h p { margin-top: 4px; font-size: 12px; color: rgba(255,255,255,.6); }
.hud-st { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.1); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.led { width: 7px; height: 7px; border-radius: 50%; background: #e8a400; box-shadow: 0 0 8px #e8a400; }
.hud.run .led { background: #2bdc6a; box-shadow: 0 0 10px #2bdc6a; }
.hud-g { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 16px; }
.hud-g div { padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,.07); }
.hud-g label { display: block; font-size: 11px; color: rgba(255,255,255,.6); }
.hud-g b { display: block; margin-top: 6px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-g b small { font-size: 12px; font-weight: 500; margin-left: 3px; color: rgba(255,255,255,.7); }
#scope { display: none; }

.fallback { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; padding: 30px; text-align: center; background: #f3f3f3; color: var(--mute); }

@media (max-width: 820px) {
  .gp-wrap { padding: 12px 12px 24px; }
  .rail { overflow-x: auto; justify-content: flex-start; padding: 8px; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail button { flex: 0 0 auto; padding: 6px 10px; }
  .rail button em { font-size: 13px; }
  .gp-head { margin-top: 22px; }
  .ch h2 { font-size: 28px; }
  .lead { font-size: 14px; }
  .gp-stage { height: 330px; }
  .stage-l, .ctrl { top: 4px; }
  #modes { display: none; }
  .ann { display: none; }
  .card { padding: 16px; gap: 16px; }
  .stats { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
  .stat, .stat:first-child { border: 0; padding: 0; }
  .steps { grid-template-columns: 1fr; }
  .hud-g { grid-template-columns: repeat(2, 1fr); }
  .hud-g div:last-child { grid-column: 1 / -1; }
  .trow { grid-template-columns: 36px 1fr 120px; font-size: 10px; }
}

/* part inspector (from the original page) */
#cadInspector{position:fixed;inset:0;width:min(1480px,calc(100vw - 32px));height:min(950px,calc(100dvh - 32px));max-width:none;max-height:none;margin:auto;padding:0;border:1px solid #394554;border-radius:18px;background:#10151d;color:#eef3f7;overflow:hidden;box-shadow:0 24px 100px #000a}
#cadInspector::backdrop{background:#020509d9;backdrop-filter:blur(12px)}
.inspect-top{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid #ffffff12}.inspect-eyebrow{font:10px ui-monospace,monospace;letter-spacing:.15em;color:#a8d351}.inspect-top h2{font:600 22px Arial,sans-serif;text-transform:none;letter-spacing:-.02em;margin:7px 0 0}.inspect-top button,.inspect-controls button{cursor:pointer;background:#1b2632;border:1px solid #415064;color:#e9eff5;border-radius:7px;padding:10px 13px}.inspect-tabs{display:flex;gap:8px;padding:12px 24px;background:#0c1118}.inspect-tabs button{cursor:pointer;border:1px solid transparent;border-radius:6px;padding:10px 20px;background:transparent;color:#9baaba;font-size:13px}.inspect-tabs button.selected{color:#e1f1bd;background:#8bc13417;border-color:#94bd455e}.inspect-main{height:calc(100% - 147px);display:grid;grid-template-columns:minmax(0,1fr) 300px}.inspect-stage{position:relative;min-height:0;overflow:hidden;background:radial-gradient(ellipse at 50% 40%,#263649,#101820 75%)}#inspectCanvas{display:block;width:100%;height:100%;touch-action:none}.inspect-hint{position:absolute;bottom:18px;left:18px;color:#8394a7;font-size:11px;pointer-events:none}#inspectLoading{position:absolute;inset:0;display:grid;place-items:center;background:#111923e8;color:#b6d17d;font:13px ui-monospace}#inspectMeasureResult{position:absolute;top:18px;left:18px;padding:8px 12px;background:#14212de8;color:#ffd17b;border-radius:7px;font:12px ui-monospace;pointer-events:none}#inspectMeasureResult:empty{display:none}.inspect-controls{overflow:auto;padding:22px;background:#141c26;border-left:1px solid #ffffff12}.inspect-controls h3{font-size:19px;margin:10px 0}.inspect-controls p{font-size:12px;line-height:1.6;color:#adbdcc}.inspect-controls label{display:flex;align-items:center;justify-content:space-between;font-size:12px;margin-top:18px;gap:10px}.inspect-controls output{font:11px ui-monospace;color:#c7daaa}.inspect-controls input[type=range]{width:100%;margin:12px 0;accent-color:#a9ce5c}.inspect-readout{display:flex;justify-content:space-between;align-items:center;background:#223040;border-radius:8px;padding:14px;margin-top:18px;font-size:12px}.inspect-readout strong{color:#d4e9ac;font:600 19px ui-monospace}.inspect-segment{display:flex;gap:4px;padding:4px;background:#0e151e;border-radius:8px;margin:18px 0}.inspect-segment button{flex:1;background:none;border-color:transparent;font-size:12px}.inspect-segment button.selected{background:#344358;color:#fff}.inspect-controls .inspect-small{font-size:10px;color:#8093a7}.inspect-legend{display:flex;gap:18px;font-size:11px;color:#a9b9c9}.inspect-legend i{display:inline-block;width:9px;height:9px;margin-right:6px;border-radius:2px}.inspect-legend .metal{background:#3b74ae}.inspect-legend .foam{background:#5d6166}.inspect-divider{height:1px;background:#ffffff13;margin-top:22px}.inspect-toggle{justify-content:flex-start!important}.inspect-row{display:flex;align-items:center;gap:8px;margin-top:12px}.inspect-row label{margin:0}.inspect-row select{background:#233144;color:white;border:1px solid #415064;border-radius:6px;padding:8px}.inspect-row button{padding:8px 12px}.inspect-wide{width:100%;margin-top:12px}#measureBtn[aria-pressed=true]{border-color:#e8bc65;color:#ffd890}
@media(max-width:820px){#cadInspector{inset:0;width:100vw;height:100dvh;border:0;border-radius:0}.inspect-top{padding:12px 16px}.inspect-top h2{font-size:18px}.inspect-tabs{gap:0;padding:8px}.inspect-tabs button{flex:1;padding:10px 5px;font-size:11px}.inspect-main{height:calc(100% - 126px);grid-template-columns:1fr;grid-template-rows:52% 48%}.inspect-controls{border-left:0;border-top:1px solid #ffffff12;padding:16px}.inspect-controls h3{margin:7px 0}.inspect-hint{font-size:10px;bottom:10px}.inspect-controls input[type=range]{margin:10px 0}}
