:root {
  --paper: oklch(0.977 0.006 84.566);
  --surface: oklch(0.944 0.007 80.721);
  --ink: oklch(0.264 0.004 106.647);
  --muted: oklch(0.503 0.008 88.693);
  --rule: oklch(0.892 0.009 84.575);
  --line: oklch(0.62 0.008 88.693);
  --current-step: oklch(0.87 0.008 84.575);
  --accent: oklch(0.583 0.223 27.927);
  --axis-red: oklch(0.53 0.147 29.082);
  --axis-brown: oklch(0.523 0.077 70.904);
  --axis-blue: oklch(0.503 0.07 233.181);
  color-scheme: light;
  font-family: Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
[hidden] {
  display: none !important;
}
* {
  box-sizing: border-box;
}
html {
  overflow: hidden;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
  min-height: 44px;
  border-radius: 4px;
  padding: 9px 14px;
  touch-action: manipulation;
}
button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button[aria-pressed='true'] {
  background: var(--surface);
  border-color: var(--muted);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.stage {
  position: relative;
  aspect-ratio: 16/9;
  min-height: 330px;
  overflow: hidden;
  background: var(--paper);
}
#annotations {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#annotations path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
#annotations circle {
  fill: var(--ink);
}
#annotations .part-name {
  fill: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
#annotations .part-detail {
  fill: var(--muted);
  font-size: 12px;
}
#press-info {
  position: absolute;
  left: 4%;
  top: 29%;
  pointer-events: none;
}
#phases {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 13px;
  font-size: 15px;
  color: var(--muted);
}
#phases .active {
  color: var(--ink);
}
#travel {
  font:
    clamp(22px, 3vw, 36px) ui-monospace,
    monospace;
  color: var(--ink);
}
#circuit {
  font-size: 12px;
  color: var(--muted);
}
#contact-info {
  position: absolute;
  right: 4%;
  top: 58%;
  max-width: 190px;
  pointer-events: none;
}
#contact-info strong {
  color: var(--axis-brown);
  font-size: 15px;
  font-weight: 500;
}
#contact-info p {
  margin: 7px 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
#curves {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0 0;
}
#curves figure {
  margin: 0;
  min-width: 0;
}
#curves figcaption {
  font-size: 13px;
  color: var(--axis-color);
}
#curves figcaption span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
#curves svg {
  display: block;
  width: 100%;
  margin-top: 8px;
}
#curves text {
  fill: var(--muted);
  font:
    10px ui-monospace,
    monospace;
}
.chart-axis {
  stroke: var(--line);
  stroke-width: 1;
  fill: none;
}
.force-line {
  stroke: var(--axis-color);
  stroke-width: 2;
  fill: none;
}
#curves circle {
  fill: var(--ink);
}
#sequencer {
  margin-top: 24px;
}
.sequence-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font:
    10px/1.7 ui-monospace,
    monospace;
  color: var(--muted);
  margin-bottom: 10px;
}
.sequence-scroll {
  overflow-x: auto;
  padding-bottom: 5px;
}
#steps {
  display: grid;
  grid-template-columns: 48px repeat(16, minmax(16px, 1fr));
  gap: 6px;
  min-width: 470px;
  align-items: center;
}
.step-number {
  font:
    10px/1.7 ui-monospace,
    monospace;
  color: var(--muted);
  text-align: center;
}
.step-label {
  font-size: 12px;
}
.step-cell {
  position: relative;
  display: block;
  height: 25px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 2px;
}
.step-cell.hit:after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--axis-color);
}
.step-cell.on {
  background: var(--current-step);
  border-color: var(--line);
}
@media (max-width: 600px) {
  body[data-scene='1'] .stage {
    aspect-ratio: 0.77;
  }
  body[data-scene='2'] .stage {
    aspect-ratio: 0.8;
  }
  #annotations .part-name {
    font-size: 27px;
  }
  #annotations .part-detail {
    font-size: 21px;
  }
  #press-info {
    top: 32%;
    left: 4%;
  }
  #phases {
    font-size: 12px;
    gap: 13px;
    margin-bottom: 16px;
  }
  #circuit {
    font-size: 10px;
    max-width: 100px;
    line-height: 1.7;
  }
  #contact-info {
    right: 4%;
    top: auto;
    bottom: 12%;
    max-width: 170px;
  }
  #contact-info strong {
    font-size: 12px;
  }
  #contact-info p {
    font-size: 10px;
  }
  #curves {
    gap: 10px;
  }
  #curves svg {
    margin-top: 12px;
  }
  #curves text {
    font-size: 15px;
  }
  #curves figcaption {
    font-size: 12px;
  }
  #curves figcaption span {
    font-size: 9px;
  }
  .sequence-header {
    font-size: 9px;
  }
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.caption {
  position: absolute;
  left: 28px;
  top: 26px;
  pointer-events: none;
  z-index: 1;
  max-width: 80%;
}
.step-cell.manual-hit {
  border-color: var(--axis-color);
  background: color-mix(in srgb, var(--axis-color) 20%, var(--surface));
}
.step-cell.manual-hit:after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--axis-color);
}
.step-cell.struck {
  background: color-mix(in srgb, var(--axis-color) 55%, var(--surface));
}
.caption > span,
.stage-footer {
  font:
    10px/1.6 ui-monospace,
    monospace;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.caption h2 {
  font-size: clamp(18px, 2.7vw, 28px);
  font-weight: 500;
  margin: 8px 0;
}
.caption p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.stage-footer {
  position: absolute;
  bottom: 18px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.controls {
  padding: 0 24px 20px;
  border-top: 1px solid var(--rule);
}
.timeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 18px 0 22px;
}
.timeline button {
  position: relative;
  border: 0;
  border-radius: 0;
  text-align: left;
  font-size: 12px;
  padding: 16px 6px 4px;
  color: var(--muted);
}
.timeline button:before {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 2px;
  background: var(--rule);
}
.timeline button[aria-current='step'] {
  color: var(--ink);
}
.timeline button[aria-current='step']:before {
  background: var(--accent);
}
.timeline small {
  display: block;
  font:
    10px ui-monospace,
    monospace;
  margin-bottom: 6px;
}
.actions,
.switches,
.toggles {
  display: flex;
  gap: 8px;
  align-items: center;
}
.actions {
  justify-content: space-between;
  flex-wrap: wrap;
}
.switches button {
  display: grid;
  grid-template-columns: 10px auto;
  column-gap: 8px;
  text-align: left;
  min-width: 104px;
}
.switches span {
  grid-column: 2;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.switches i {
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 50%;
}
.red {
  background: var(--axis-red);
}
.brown {
  background: var(--axis-brown);
}
.blue {
  background: var(--axis-blue);
}
.toggles button,
.separation button {
  font-size: 12px;
}
.separation {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  font-size: 12px;
}
.separation input {
  flex: 1;
  min-width: 30px;
  height: 44px;
  accent-color: var(--accent);
  cursor: pointer;
}
.separation output {
  width: 35px;
  text-align: right;
  font:
    12px ui-monospace,
    monospace;
}
.separation button {
  min-width: 72px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#loading {
  position: absolute;
  inset: 45% 20px auto;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
#loading.error {
  z-index: 2;
  padding: 20px;
  background: var(--surface);
}
@media (hover: hover) and (pointer: fine) {
  button:hover {
    background: var(--surface);
  }
  .timeline button:hover {
    color: var(--ink);
  }
}
@media (max-width: 600px) {
  .stage {
    aspect-ratio: 1/1;
    min-height: 320px;
  }
  .caption {
    left: 18px;
    top: 18px;
  }
  .caption p {
    max-width: 260px;
    line-height: 1.6;
  }
  .stage-footer {
    left: 18px;
    right: 18px;
    font-size: 8px;
  }
  .controls {
    padding: 0 14px 16px;
  }
  .timeline {
    gap: 0;
    padding-bottom: 16px;
  }
  .timeline button {
    font-size: 10px;
    padding-left: 2px;
    padding-right: 2px;
  }
  .timeline button:before {
    left: 2px;
    right: 2px;
  }
  .switches {
    width: 100%;
    gap: 6px;
  }
  .switches button {
    flex: 1;
    min-width: 0;
    padding: 9px;
  }
  .toggles {
    margin-top: 4px;
  }
  .separation {
    gap: 8px;
  }
}
