/* Match the site's typeface (Routed Gothic; single weight, bold synthesised). */
@font-face {
  font-family: 'Routed Gothic';
  src: url('/assets/fonts/RoutedGothic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Mirror the site's palette under the demo short names. Black and white only:
   the pressure maps, the point clouds and the response are drawn from these four values. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #000000;
  --line: #d6d6d6;
  --muted: #6f6f6f;
}
html.theme-dark {
  color-scheme: dark;
  --bg: #0d0d0d;
  --fg: #f0f0f0;
  --line: #2a2a2a;
  --muted: #8b8b8b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Routed Gothic', 'iA Writer Quattro', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

room-view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* The response sits under the views, clear of the panel when there is room for both. */
room-response {
  position: fixed;
  left: 256px;
  right: 12px;
  bottom: 10px;
  height: 136px;
  z-index: 1;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
html.panel-collapsed room-response { left: 12px; }
@media (max-width: 639px) { room-response { left: 12px; height: 120px; } }

#panel {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 220px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.3;
  user-select: none;
  scrollbar-width: thin;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
#panel-body { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
#panel.collapsed #panel-body { display: none; }

.title { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Chrome labels are uppercase + tracked (House Style: no lowercase tier). */
.lab > span:first-child, .h, button, text-switch { text-transform: uppercase; letter-spacing: 0.06em; }

.control { display: block; margin-bottom: 9px; }
.lab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.lab .val { font-weight: 700; font-variant-numeric: tabular-nums; }

.section { padding-top: 9px; border-top: 1px solid var(--line); margin-top: 2px; }
.section + .section, .meta { margin-top: 2px; }

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 12px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--line); }
input[type=range]::-moz-range-track { height: 1px; background: var(--line); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -5px;
  background: var(--fg);
  border-radius: 50%;
}
input[type=range]::-moz-range-thumb { width: 11px; height: 11px; background: var(--fg); border: none; border-radius: 50%; }

select, input[type=number] {
  font: inherit;
  font-size: 12px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 3px 5px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s linear;
}
select { cursor: pointer; margin-top: 2px; }
select:focus, input[type=number]:focus { border-color: var(--fg); }

.btn-group { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 9px; }

button {
  font: inherit;
  font-size: 11px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 4px 6px;
  cursor: pointer;
  line-height: 1.2;
  transition: border-color 0.15s linear;
}
button:hover, button:focus-visible { border-color: var(--fg); outline: none; }
button[aria-pressed="true"] { border-color: var(--fg); font-weight: 700; }
#collapse { border: 0; padding: 0; color: var(--muted); transition: color 0.15s linear; }
#panel .btn-group button[hidden] + button { grid-column: 1 / -1; }
#collapse:hover, #collapse:focus-visible { color: var(--fg); }

mode-list { margin-top: 2px; }

.dims { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 3px 5px; align-items: center; margin-bottom: 9px; }
.dims .h { color: var(--muted); font-size: 11px; }

.meta {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-bottom: 9px;
}
.readout { font-variant-numeric: tabular-nums; line-height: 1.45; }
.readout b { font-weight: 700; }
.hint { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.35; }

.theme { padding-top: 8px; border-top: 1px solid var(--line); margin-bottom: 0; }
