sim-web-shell 0.1.0

sim-web-shell: the binary that serves the SIM WebUI shell.
Documentation
/* SIM Web-UI theme tokens.
 *
 * Theme tokens only -- no layout logic and no domain logic. The Scene
 * interpreter owns layout; lenses never ship their own CSS.
 */

:root {
  /* Color tokens. Foreground/background contrast is checked to meet WCAG AA
   * (>= 4.5:1) for body text; status colors are paired with text tokens and
   * shapes so status never relies on color alone. */
  --bg: #11151a;
  --fg: #e6edf3;
  --muted: #9aa7b4;
  --accent: #4aa3ff;
  --ok: #2ea043;
  --warn: #b0883a;
  --error: #d1453b;
  --info: #4aa3ff;
  --pending: #b0883a;
  --focus-ring: #ffd24a;
  --radius: 8px;
  --gap: 16px;

  /* Motion tokens. The interpreter (not each lens) owns motion; reduced-motion
   * mode below disables it globally. */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);

  /* Icon set: named glyphs the theme owns, referenced by scene/icon. */
  --icon-play: "\25B6";
  --icon-stop: "\25A0";
  --icon-add: "+";
  --icon-remove: "\2212";
  --icon-warn: "\26A0";
}

/* Reduced-motion mode: disable animation in the interpreter, not per lens.
 * Honored both via the OS setting and an explicit body[data-reduced-motion]. */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body[data-reduced-motion="true"] * {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

/* Visible focus on every interactive surface, including canvas/graph nodes that
 * are not native DOM controls. */
:focus-visible,
[tabindex]:focus-visible,
.scene-node:focus-visible,
.scene-button:focus-visible,
.scene-field:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
}

.top-nav {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 16px 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.top-nav a {
  min-height: 34px;
  border: 1px solid #2c3640;
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
  padding: 6px 10px;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  border-color: var(--accent);
  background: #17212c;
}

#shell {
  max-width: 820px;
  margin: 0 auto;
  padding: calc(var(--gap) * 2) var(--gap);
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap) * 1.5);
}

.shell-header h1 { margin: 0; font-size: 2rem; }
.tagline { color: var(--muted); margin: 4px 0 0; }
.shell-body code { color: var(--accent); }

.status-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.badge {
  display: inline-block;
  min-width: 64px;
  text-align: center;
  border-radius: var(--radius);
  padding: 2px 8px;
  font-size: 0.8rem;
  margin-right: 8px;
}

/* Status badges pair color with a leading shape glyph so they are legible
 * without color (color-blind and monochrome safe). */
.badge.ok { background: var(--ok); color: #fff; }
.badge.ok::before { content: "\2714 "; }
.badge.warn { background: var(--warn); color: #fff; }
.badge.warn::before { content: "\26A0 "; }
.badge.error { background: var(--error); color: #fff; }
.badge.error::before { content: "\2715 "; }
.badge.info { background: var(--info); color: #08121f; }
.badge.info::before { content: "\2139 "; }
.badge.pending { background: var(--pending); color: #fff; }

/* Named theme glyphs for scene/icon. */
.scene-icon[data-icon="play"]::before { content: var(--icon-play); }
.scene-icon[data-icon="stop"]::before { content: var(--icon-stop); }
.scene-icon[data-icon="add"]::before { content: var(--icon-add); }
.scene-icon[data-icon="remove"]::before { content: var(--icon-remove); }
.scene-icon[data-icon="warn"]::before { content: var(--icon-warn); }

.scene-keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 760px);
}

.scene-keyboard-keys,
.scene-keyboard-controls {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.scene-keyboard-key,
.scene-keyboard-sustain,
.scene-keyboard-octave {
  min-height: 42px;
  border: 1px solid #2c3640;
  border-radius: 4px;
  background: #f2f5f8;
  color: #11151a;
}

.scene-keyboard-key[data-white="false"] {
  background: #1d2630;
  color: var(--fg);
}

.scene-keyboard-key[data-scale="true"] {
  border-color: var(--accent);
}

.scene-keyboard-key[data-held="true"],
.scene-keyboard-key[data-generated="true"] {
  box-shadow: inset 0 -4px 0 var(--focus-ring);
}

.scene-keyboard-bend {
  min-height: 20px;
  border: 1px solid #2c3640;
  border-radius: 4px;
  background: #17212c;
}

.scene-piano-roll,
.scene-player-rack,
.scene-object-roll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 760px);
}

.scene-piano-roll-actions,
.scene-player-rack-actions,
.scene-player-rack-device-actions,
.scene-object-roll-actions,
.scene-object-roll-placement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.scene-piano-roll-action,
.scene-player-rack-action,
.scene-player-rack-device-action,
.scene-object-roll-action,
.scene-object-roll-placement-action {
  min-height: 30px;
  border: 1px solid #2c3640;
  border-radius: 4px;
  background: #17212c;
  color: var(--fg);
}

.scene-piano-roll-lanes,
.scene-player-rack-devices,
.scene-object-roll-lanes {
  display: grid;
  gap: 6px;
}

.scene-piano-roll-lane,
.scene-player-rack-device,
.scene-object-roll-lane,
.scene-object-roll-placement {
  display: grid;
  grid-template-columns: minmax(92px, 140px) 1fr;
  gap: 6px;
  align-items: center;
  border: 1px solid #2c3640;
  border-radius: 4px;
  padding: 6px;
  background: #151c24;
}

.scene-piano-roll-lane-label,
.scene-player-rack-device-title,
.scene-object-roll-lane-label,
.scene-object-roll-placement-title {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.scene-piano-roll-events,
.scene-piano-roll-live,
.scene-piano-roll-generated {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.scene-piano-roll-event {
  min-width: 44px;
  min-height: 24px;
  border: 1px solid #2c3640;
  border-radius: 4px;
  background: #223144;
  color: var(--fg);
}

.scene-piano-roll-event[data-live="true"] {
  border-color: var(--focus-ring);
}

.scene-piano-roll-event[data-generated="true"] {
  border-color: var(--accent);
}

.scene-object-roll-placements,
.scene-object-roll-diagnostics {
  display: grid;
  gap: 4px;
}

.scene-object-roll-diagnostic {
  border-left: 3px solid var(--warn);
  padding-left: 6px;
  color: var(--muted);
}

.shell-footer { color: var(--muted); border-top: 1px solid #222b34; padding-top: var(--gap); }