:root {
  --bg: #05080f;
  --ink: #eef3fa;
  --muted: #a4b3c7;
  --yellow: #f2b705;
  --blue: #1967d2;
  --cyan: #4fc3ff;
  --violet: #8b6cff;
  --line: rgba(255, 255, 255, .14);
  --sans: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --pad: clamp(20px, 4.5vw, 72px);
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--yellow); color: #05080f; font: 500 .8rem var(--mono); }
.skip:focus { top: 12px; }

/* ---------- stage ---------- */
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.scrim {
  position: fixed; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 8, 15, .9) 0%, rgba(5, 8, 15, .62) 32%, rgba(5, 8, 15, 0) 60%),
    linear-gradient(0deg, rgba(5, 8, 15, .55) 0%, rgba(5, 8, 15, 0) 30%);
}

/* ---------- loader ---------- */
#loader { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: var(--bg); transition: opacity .9s ease, visibility .9s; }
#loader.done { opacity: 0; visibility: hidden; }
.loader-inner { width: min(320px, 70vw); text-align: left; }
.loader-mark, .brand { font: 600 1.9rem/1 var(--sans); letter-spacing: -.02em; margin: 0 0 18px; }
.loader-mark i, .brand i { font-style: normal; color: var(--yellow); }
.loader-bar { height: 8px; border: 1px solid var(--line); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, #05080f 8px 16px); }
.loader-text { margin: 12px 0 0; font: 400 .7rem var(--mono); letter-spacing: .14em; color: var(--muted); }

/* ---------- top bar ---------- */
.top { position: fixed; z-index: 20; inset: 0 0 auto 0; display: flex; align-items: flex-start; justify-content: space-between; padding: clamp(16px, 2.6vw, 30px) var(--pad); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { margin: 0; text-decoration: none; font-size: 1.7rem; display: grid; gap: 6px; }
.brand small { font: 400 .58rem var(--mono); letter-spacing: .2em; color: var(--muted); }
.top nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); font: 500 .72rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.top nav a { text-decoration: none; padding: 8px 0; border-bottom: 1px solid transparent; }
.top nav a:hover { border-bottom-color: var(--yellow); }
.top nav .nav-cta { padding: 9px 14px; border: 1px solid var(--yellow); color: var(--yellow); }
.top nav .nav-cta:hover { background: var(--yellow); color: #05080f; }

/* ---------- rail ---------- */
.rail { position: fixed; z-index: 20; right: var(--pad); top: 50%; transform: translateY(-50%); display: grid; gap: 4px; font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 7px 0; text-decoration: none; color: var(--muted); }
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s; }
.rail a b { font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.rail a b::after { content: ""; width: 14px; height: 2px; background: currentColor; transition: width .25s, background .25s; }
.rail a:hover span, .rail a[aria-current] span, .rail a:focus-visible span { opacity: 1; transform: none; }
.rail a { flex-direction: row-reverse; }
.rail a[aria-current] { color: var(--ink); }
.rail a[aria-current] b::after { width: 30px; background: var(--yellow); }

/* ---------- hud ---------- */
.hud { position: fixed; z-index: 20; left: var(--pad); right: var(--pad); bottom: clamp(14px, 2.4vw, 26px); display: flex; justify-content: space-between; gap: 16px; font: 400 .64rem var(--mono); letter-spacing: .16em; color: var(--muted); pointer-events: none; }
.hud-bar { position: absolute; left: 0; right: 0; bottom: -10px; height: 2px; background: var(--line); }
.hud-bar i { display: block; height: 100%; background: var(--yellow); transform: scaleX(0); transform-origin: left; }
.hud-hint { transition: opacity .6s; }
body.moved .hud-hint { opacity: 0; }

/* ---------- chapters ---------- */
.chapter {
  position: fixed; z-index: 10; left: var(--pad); bottom: clamp(64px, 11vh, 120px);
  width: min(34rem, 42vw);
  opacity: 0; visibility: hidden; will-change: opacity, transform;
}
.chapter.is-active { pointer-events: auto; }
.chapter, .rail, .hud, .top nav { text-shadow: 0 1px 14px rgba(5, 8, 15, .85); }
.eyebrow { margin: 0 0 14px; font: 500 .7rem var(--mono); letter-spacing: .18em; color: var(--yellow); text-transform: none; }
h1, h2 { margin: 0 0 18px; font: 500 clamp(2.3rem, 4.9vw, 4.4rem)/1.02 var(--sans); letter-spacing: -.035em; text-wrap: balance; }
h1 .line, h2 .line { display: block; white-space: nowrap; }
.lede { margin: 0 0 20px; max-width: 30rem; color: #d3dceb; font-size: clamp(.98rem, 1.15vw, 1.1rem); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; }
.chips li { padding: 6px 10px; border-left: 2px solid var(--cyan); background: rgba(79, 195, 255, .08); font: 500 .64rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px;
  border: 1px solid var(--yellow); border-radius: 2px; background: var(--yellow); color: #05080f;
  font: 500 .74rem var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: transform .2s, background .2s, color .2s;
}
.btn::after { content: "→"; transition: transform .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:hover::after { transform: translateX(4px); }
.btn.ghost { background: rgba(5, 8, 15, .5); color: var(--ink); border-color: var(--line); backdrop-filter: blur(6px); }
.btn.ghost:hover { border-color: var(--yellow); color: var(--yellow); }
.btn.small { min-height: 34px; padding: 0 12px; }
.btn.small::after { content: none; }
#contact .btn { text-transform: none; letter-spacing: .04em; font-size: .85rem; }
.note { margin: 0; font: 400 .64rem/1.6 var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.still { display: none; margin: 0 0 22px; }
.still img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }

/* ---------- hotspots (clickable markers pinned to 3D objects) ---------- */
.hotspots { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.hotspot {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: var(--ink);
  font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; pointer-events: auto; opacity: 0; visibility: hidden;
  will-change: transform, opacity; text-shadow: 0 1px 12px rgba(5, 8, 15, .9);
}
.hotspot i { position: relative; width: 34px; height: 34px; margin: -17px 0 -17px -17px; border: 1px solid var(--cyan); border-radius: 50%; background: rgba(5, 8, 15, .55); backdrop-filter: blur(4px); flex: none; transition: background .2s; }
.hotspot i::before, .hotspot i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: var(--cyan); transform: translate(-50%, -50%); }
.hotspot i::after { transform: translate(-50%, -50%) rotate(90deg); }
.hotspot::before { content: ""; position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--cyan); animation: ping 2.2s ease-out infinite; }
.hotspot span { padding: 6px 10px; background: rgba(5, 8, 15, .7); border-left: 2px solid var(--cyan); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; white-space: nowrap; }
.hotspot:hover span, .hotspot:focus-visible span { opacity: 1; transform: none; }
.hotspot:hover i, .hotspot.hot i { background: var(--cyan); }
.hotspot:hover i::before, .hotspot:hover i::after, .hotspot.hot i::before, .hotspot.hot i::after { background: #05080f; }
@keyframes ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.3); opacity: 0; } }
.pick-label { position: fixed; z-index: 13; left: 0; top: 0; padding: 6px 10px; background: rgba(5, 8, 15, .82); border-left: 2px solid var(--yellow); font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; pointer-events: none; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.pick-label.show { opacity: 1; }
body.can-pick #stage { cursor: pointer; }

/* ---------- product detail panel ---------- */
.detail {
  position: fixed; z-index: 15; left: var(--pad); top: clamp(84px, 13vh, 112px); bottom: clamp(48px, 8vh, 72px);
  width: min(40rem, 46vw); padding: clamp(20px, 2.4vw, 34px); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(7, 11, 19, .78); backdrop-filter: blur(16px) saturate(1.2); border: 1px solid var(--line); border-top: 2px solid var(--yellow);
  opacity: 0; visibility: hidden; transform: translate3d(-28px, 0, 0); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .7, .2, 1), visibility .45s;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.detail.open { opacity: 1; visibility: visible; transform: none; }
.detail-close { position: sticky; top: 0; float: right; margin: 0 0 8px 12px; z-index: 2; }
.detail-title { margin: 0 0 14px; font: 500 clamp(1.7rem, 2.9vw, 2.6rem)/1.05 var(--sans); letter-spacing: -.03em; }
.detail-sub { margin: 26px 0 10px; font: 500 .7rem var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
.detail p { color: #d3dceb; }
.detail p.eyebrow { color: var(--yellow); }
.detail p.note { color: var(--muted); margin: 6px 0 0; }
.steps { list-style: none; counter-reset: step; margin: 18px 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 58px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 16px; top: 14px; font: 500 .9rem var(--mono); color: var(--yellow); }
.steps h4 { margin: 0 0 4px; font: 500 1.05rem/1.3 var(--sans); }
.steps p { margin: 0; font-size: .95rem; }
.steps p.note { margin-top: 6px; font-size: .62rem; }
.steps.compact { gap: 6px; }
.steps.compact li { padding-block: 10px; }
.steps.compact h4 { margin: 0; }
.facts { list-style: none; margin: 14px 0 22px; padding: 0; display: grid; gap: 8px; }
.facts li { padding: 10px 14px; border-left: 2px solid var(--cyan); background: rgba(79, 195, 255, .07); color: #d3dceb; font-size: .95rem; }
.facts b { display: block; font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-bottom: 2px; }
.detail .actions { margin-top: 22px; }
.detail figure.info { margin: 18px 0 22px; }
.info-open { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: none; cursor: zoom-in; }
.info-open img { display: block; width: 100%; height: auto; }
.info-open:hover, .info-open:focus-visible { border-color: var(--yellow); }
.detail figcaption { margin-top: 6px; font: 500 .62rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
body.in-detail .rail, body.in-detail .hud-hint { opacity: 0; pointer-events: none; }
body.in-detail .hotspots { display: none; }

/* ---------- dialog ---------- */
dialog { width: min(960px, 92vw); padding: 18px; border: 1px solid var(--line); border-radius: 4px; background: #0a0f1a; color: var(--ink); }
dialog::backdrop { background: rgba(3, 5, 10, .82); backdrop-filter: blur(6px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dialog-head .eyebrow { margin: 0; }
dialog video { display: block; width: 100%; max-height: 74vh; background: #000; }
dialog.image { width: min(1500px, 96vw); }
dialog img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; }
dialog [hidden] { display: none; }

/* ---------- contact form ---------- */
#contact-dialog { width: min(640px, 92vw); }
#contact-form { display: grid; gap: 14px; }
#contact-form label { display: grid; gap: 6px; font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
#contact-form input, #contact-form select, #contact-form textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 2px; background: rgba(255, 255, 255, .05);
  color: var(--ink); font: 400 1rem/1.4 var(--sans); letter-spacing: 0; text-transform: none;
}
#contact-form select option { background: #0a0f1a; color: var(--ink); }
#contact-form textarea { min-height: 130px; resize: vertical; }
#contact-form input:focus-visible, #contact-form select:focus-visible, #contact-form textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--cyan); }
#contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#contact-form .actions { margin: 0; }
#contact-form .note a { text-transform: none; letter-spacing: .04em; color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-status { margin: 0; font-size: .92rem; color: var(--muted); }
.form-status:empty { display: none; }
.form-status.ok { color: #7dffb0; }
.form-status.err { color: #ff9a9a; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .detail { left: 0; right: 0; width: auto; top: 34vh; bottom: 0; border-left: 0; border-right: 0; transform: translate3d(0, 28px, 0); }
  .hotspot span { display: none; }
  body.in-detail .hud { opacity: 0; }
  .top nav a:not(.nav-cta) { display: none; }
  .rail { display: none; }
  .chapter { left: 20px; right: 20px; width: auto; bottom: 58px; }
  h1, h2 { font-size: clamp(2rem, 9.4vw, 3rem); }
  .lede { font-size: .95rem; margin-bottom: 14px; }
  .chips { margin-bottom: 14px; }
  .scrim { background: linear-gradient(0deg, rgba(5, 8, 15, .97) 0%, rgba(5, 8, 15, .93) 52%, rgba(5, 8, 15, .6) 66%, rgba(5, 8, 15, 0) 82%); }
  .hud-hint { display: none; }
}
@media (max-height: 620px) and (min-width: 821px) {
  h1, h2 { font-size: clamp(2rem, 4vw, 3rem); }
  .lede { margin-bottom: 12px; }
}

/* ---------- static page (no WebGL / reduced motion) ---------- */
html.static body { overflow: auto; }
html.static #stage, html.static #loader, html.static .rail, html.static .hud, html.static .scrim, html.static .hotspots, html.static .pick-label, html.static .detail-close { display: none; }
html.static .detail { position: static; width: auto; max-width: 46rem; margin: 0 auto; padding: clamp(40px, 8vh, 80px) var(--pad); opacity: 1; visibility: visible; transform: none; overflow: visible; background: none; backdrop-filter: none; border: 0; border-bottom: 1px solid var(--line); }
html.static .top { position: sticky; top: 0; background: rgba(5, 8, 15, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
html.static .chapter {
  position: static; width: auto; max-width: 46rem; margin: 0 auto; padding: clamp(64px, 12vh, 120px) var(--pad);
  opacity: 1 !important; visibility: visible !important; transform: none !important; pointer-events: auto;
  border-bottom: 1px solid var(--line);
}
html.static .still { display: block; }
html.static #keyboard .still img, html.static #workorders .still img { max-width: 260px; }
html.static h1 .line, html.static h2 .line { white-space: normal; }
