:root {
  --ink: #171816;
  --paper: #e8e6df;
  --paper-deep: #d9d7cf;
  --line: rgba(23, 24, 22, 0.2);
  --muted: #696c66;
  --orange: #e96535;
  --blue: #7ea9ad;
  --yellow: #d8a837;
  --stage: #c9cbc5;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.01em;
}
button, input { font: inherit; }
button { color: inherit; }
.topbar {
  height: 66px;
  border-bottom: 1px solid var(--line);
  padding: 0 4.2vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.brand-mark {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  font-size: 12px;
  letter-spacing: 0;
}
.topbar-meta, .live-status, .eyebrow, .model-kicker, .assembly-count, .stage-readout, .stage-caption, .footer, .part-index {
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.topbar-meta { color: var(--muted); display: flex; align-items: center; gap: 12px; }
.meta-dot { width: 3px; height: 3px; border-radius: 100%; background: var(--orange); }
.live-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.live-status i { width: 6px; height: 6px; border-radius: 100%; background: var(--orange); box-shadow: 0 0 0 3px rgba(233, 101, 53, 0.16); }
main { width: min(1400px, 91.6vw); margin: 0 auto; }
.intro { padding: clamp(64px, 8.2vw, 124px) 0 62px; position: relative; }
.eyebrow { margin: 0; color: var(--muted); font-weight: 700; }
.intro h1 {
  margin: 14px 0 20px;
  font-family: var(--display);
  font-size: clamp(54px, 8.15vw, 124px);
  line-height: 0.81;
  font-weight: 800;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}
h1 em, h2 em { color: var(--orange); font-style: normal; }
.intro-copy { width: min(420px, 100%); margin: 0 0 0 31%; color: var(--muted); line-height: 1.65; font-size: 13px; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 342px; min-height: 720px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.model-column { min-width: 0; padding-right: 28px; }
.model-header { height: 69px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 20px; }
.model-header > div:first-child { display: flex; align-items: baseline; gap: 20px; }
.model-kicker { color: var(--orange); font-weight: 800; }
.model-title { font-size: 12px; font-weight: 600; }
.drag-hint { color: var(--muted); font-size: 9px; letter-spacing: 0.14em; font-weight: 700; }
.mouse-icon { display: inline-block; width: 10px; height: 14px; margin-right: 5px; border: 1px solid currentColor; border-radius: 6px; vertical-align: -3px; position: relative; }
.mouse-icon::before { content: ""; position: absolute; left: 4px; top: 2px; height: 3px; border-left: 1px solid currentColor; }
.stage-wrap { height: 568px; position: relative; background: var(--stage); overflow: hidden; cursor: grab; }
.stage-wrap:active { cursor: grabbing; }
.stage-wrap::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(255,255,255,.2), transparent 42%), repeating-linear-gradient(0deg, transparent 0 47px, rgba(23,24,22,.038) 48px), repeating-linear-gradient(90deg, transparent 0 47px, rgba(23,24,22,.038) 48px); }
.stage-wrap::after { content: ""; position: absolute; left: 0; right: 0; bottom: 55px; height: 1px; background: rgba(23,24,22,.25); pointer-events: none; }
canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; touch-action: none; }
.model-loading { position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--ink); background: rgba(201, 203, 197, .8); pointer-events: none; transition: opacity .35s, visibility .35s; }
.model-loading.ready { opacity: 0; visibility: hidden; }
.model-loading.error { color: var(--orange); }
.model-loading b { font-size: 10px; letter-spacing: .16em; }
.model-loading small { color: var(--muted); font-size: 10px; }
.loading-spinner { width: 22px; height: 22px; border: 2px solid rgba(23, 24, 22, .2); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-readout { position: absolute; z-index: 2; top: 17px; left: 18px; display: flex; gap: 18px; color: var(--muted); pointer-events: none; }
.stage-readout span:last-child { color: var(--orange); }
.stage-caption { position: absolute; z-index: 2; bottom: 17px; left: 18px; display: flex; gap: 18px; color: var(--muted); pointer-events: none; }
.legend-swatch { width: 7px; height: 7px; display: inline-block; margin-right: 5px; background: var(--ink); }
.legend-swatch.system { background: var(--blue); }
.legend-swatch.cut { background: var(--orange); }
.canvas-note { position: absolute; z-index: 2; right: 18px; bottom: 15px; color: var(--muted); font-size: 8px; line-height: 1.6; letter-spacing: .14em; text-align: right; pointer-events: none; }
.model-footer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 18px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.model-footer b { color: var(--ink); margin-right: 7px; font-size: 9px; }
.inspector { border-left: 1px solid var(--ink); padding: 31px 0 0 28px; display: flex; flex-direction: column; }
.inspector-head, .assembly-head, .control-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.part-index, .assembly-count { color: var(--muted); white-space: nowrap; }
.selected-line { width: 39px; border-top: 3px solid var(--orange); margin: 20px 0 15px; }
.inspector h2 { margin: 0 0 11px; font-family: var(--display); font-size: 33px; line-height: .94; letter-spacing: -.05em; text-transform: uppercase; }
.part-intro { margin: 0; min-height: 63px; color: var(--muted); line-height: 1.55; font-size: 11px; }
.spec-list { margin: 23px 0 27px; border-top: 1px solid var(--line); }
.spec-list div { display: grid; grid-template-columns: 1fr 1.3fr; padding: 10px 0 9px; border-bottom: 1px solid var(--line); }
dl dt { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
dl dd { margin: 0; font-size: 10px; font-weight: 600; }
.assembly-head { padding-bottom: 11px; border-bottom: 1px solid var(--ink); }
.part-list { overflow: auto; max-height: 245px; }
.part-button { width: 100%; display: grid; grid-template-columns: 26px 1fr 12px; align-items: center; gap: 7px; padding: 11px 8px 11px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; transition: padding .2s, color .2s; }
.part-button:hover, .part-button.active, .part-button.hovered { padding-left: 8px; color: var(--orange); }
.part-button.absent .part-button-name { color: var(--muted); }
.part-button.absent .part-button-arrow { opacity: .25; }
.part-button-number { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.part-button.active .part-button-number { color: var(--orange); }
.part-button-name { font-size: 11px; font-weight: 650; }
.part-button-detail { color: var(--muted); font-size: 9px; line-height: 1.2; }
.part-button-arrow { font-size: 14px; opacity: .45; }
.controls { margin-top: auto; padding: 25px 0 4px; }
.text-button { border: 0; padding: 0; background: none; color: var(--orange); cursor: pointer; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.range-control { display: block; margin-top: 20px; }
.cut-range-control { margin-top: 17px; }
.range-control.disabled { opacity: .4; }
.range-control.disabled input[type="range"] { cursor: default; }
.range-control > span { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 9px; letter-spacing: .1em; }
.range-control output { color: var(--orange); font-weight: 700; }
input[type="range"] { width: 100%; height: 14px; display: block; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -6px; border: 2px solid var(--paper); border-radius: 50%; appearance: none; background: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--ink); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--paper); border-radius: 50%; background: var(--orange); }
.cut-range-control input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--muted) 0 49.5%, var(--orange) 49.5% 50.5%, var(--muted) 50.5%); }
.cut-range-control input[type="range"]::-moz-range-track { background: linear-gradient(90deg, var(--muted) 0 49.5%, var(--orange) 49.5% 50.5%, var(--muted) 50.5%); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 17px 0 15px; border-bottom: 1px solid var(--line); }
.toggle-row b, .toggle-row small { display: block; }
.toggle-row b { font-size: 9px; letter-spacing: .1em; }
.toggle-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.switch { flex: 0 0 auto; display: block; width: 34px; height: 18px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { display: block; width: 34px; height: 18px; padding: 3px; border: 1px solid var(--ink); border-radius: 20px; transition: background .2s; }
.switch span::after { content: ""; display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--orange); border-color: var(--orange); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--paper); }
.view-actions { display: flex; gap: 5px; padding-top: 15px; }
.view-button { border: 1px solid var(--line); padding: 8px 8px 7px; background: transparent; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .1em; cursor: pointer; }
.view-button:hover, .view-button.active { border-color: var(--ink); color: var(--ink); background: rgba(23,24,22,.06); }
.principle { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 30px; padding: 104px 5.5vw 115px 0; align-items: start; }
.principle-number { font-family: var(--display); font-size: 70px; line-height: .8; color: var(--orange); letter-spacing: -.08em; }
.principle h2 { margin: 14px 0 0; font-family: var(--display); font-size: clamp(32px, 4vw, 56px); line-height: .92; letter-spacing: -.06em; text-transform: uppercase; }
.principle-copy { max-width: 360px; margin: 40px 0 0 auto; color: var(--muted); font-size: 12px; line-height: 1.7; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 21px 4.2vw; border-top: 1px solid var(--line); color: var(--muted); }
.footer span:first-child { color: var(--ink); font-weight: 800; }
@media (max-width: 900px) {
  .topbar-meta { display: none; }
  .workbench { grid-template-columns: 1fr; }
  .model-column { padding-right: 0; }
  .inspector { border-top: 1px solid var(--ink); border-left: 0; padding: 30px 0; }
  .part-list { max-height: none; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 20px; }
  .controls { margin-top: 25px; }
  .principle { padding-right: 0; grid-template-columns: 60px 1fr; }
  .principle-copy { grid-column: 2; margin: 20px 0 0; }
}
@media (max-width: 560px) {
  main { width: 88vw; }
  .topbar { padding: 0 6vw; }
  .intro { padding-top: 65px; padding-bottom: 45px; }
  .intro h1 { font-size: 18vw; }
  .intro-copy { margin-left: 0; }
  .model-header { height: auto; padding: 17px 0; align-items: flex-start; }
  .model-header > div:first-child { display: block; }
  .model-title { display: block; margin-top: 8px; }
  .drag-hint { display: none; }
  .stage-wrap { height: 420px; }
  .model-footer { display: block; padding-bottom: 18px; }
  .model-footer span { display: block; margin-top: 10px; }
  .part-list { grid-template-columns: 1fr; }
  .principle { padding: 70px 0; grid-template-columns: 42px 1fr; gap: 14px; }
  .principle-number { font-size: 42px; }
  .principle h2 { font-size: 37px; }
  .principle-copy { grid-column: 2; }
  .footer { display: block; line-height: 2.1; padding-left: 6vw; padding-right: 6vw; }
  .footer span { display: block; }
}
