:root {
  color-scheme: dark;
  --body: #141513;
  --case: #333431;
  --lip: #6a6960;
  --ink: #e8e4d7;
  --muted: #bbb7aa;
  --face: #12130f;
  --amber: #ffba68;
  --unlit: #38291b;
  --orange: #e97c31;
  --green: #a4ca85;
  --mono: 'Lucida Console', 'Courier New', monospace;
}
:root[data-night] {
  --body: #0c0d0a;
  --case: #22231f;
  --lip: #4a4941;
  --ink: #c3bca9;
  --muted: #a6a091;
  --face: #0e0e0b;
  --amber: #d58348;
  --unlit: #291d14;
  --orange: #b86435;
  --green: #809d69;
}
* { box-sizing: border-box; }
::selection { color: var(--face); background: var(--amber); }
body { margin: 0; min-height: 100dvh; display: grid; padding: clamp(8px,2.4vmin,30px); background: var(--body); color: var(--ink); font-family: Arial, sans-serif; }
.console { display: grid; grid-template-rows: auto 1fr auto; gap: clamp(9px, 1.8vmin, 22px); padding: clamp(10px,2.4vmin,30px); border: 1px solid var(--lip); border-radius: 12px; background: var(--case); box-shadow: inset 0 1px 0 #ffffff17, 0 8px 18px #0006; min-width: 0; }
.faceplate { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(12px,2vw,30px); border-bottom: 3px solid var(--orange); padding: 2px 2px clamp(8px,2vmin,22px); }
.diamond { color: var(--ink); }
.identity p, .model, .status, button { font: bold .76rem/1.35 var(--mono); letter-spacing: .10em; }
.identity p { margin: 0; }
.identity p span { color: var(--orange); }
.identity .subtitle { color: var(--muted); }
h1 { margin: .10em 0; font-size: clamp(1.65rem,6.1vmin,4.7rem); font-stretch: condensed; letter-spacing: -.025em; line-height: .96; }
.model { border-left: 1px solid var(--lip); padding-left: clamp(10px,2vw,24px); display: grid; gap: .18rem; color: var(--muted); }
.model strong { letter-spacing: -.025em; font: bold clamp(1.1rem,3vmin,2.5rem)/1 Arial,sans-serif; color: var(--ink); }
.instruments { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(0,1fr); gap: clamp(8px,1.2vmin,16px); min-width: 0; }
.instrument { position: relative; min-width: 0; display: grid; align-content: center; gap: clamp(6px,1.3vmin,16px); padding: clamp(12px,3vmin,38px); border: 1px solid #6c6352; border-radius: 4px; background: var(--face); box-shadow: inset 0 3px 8px #000a; color: var(--amber); }
h2 { margin: 0; color: var(--ink); text-transform: uppercase; font: bold clamp(.83rem,2.1vmin,1.35rem)/1.1 var(--mono); letter-spacing: .15em; }
.readout { display: flex; margin: 0; gap: clamp(8px,2vmin,24px); align-items: baseline; font: bold clamp(1.8rem,8vmin,5.75rem)/.95 var(--mono); }
.digits { display: inline-flex; align-items: end; }
.digits svg { display: block; height: .90em; width: auto; overflow: visible; }
.segment-off { fill: var(--unlit); }
.segment-on { fill: currentColor; }
.unit { color: var(--amber); font: bold clamp(.76rem,1.8vmin,1.15rem)/1.1 var(--mono); letter-spacing: .08em; white-space: nowrap; }
.speed { align-content: center; gap: clamp(13px,3.8vmin,44px); }
.speed .readout { font-size: clamp(4.3rem,27vmin,18rem); flex-wrap: wrap; align-items: end; }
.speed .unit { font-size: clamp(1rem,2.8vmin,1.8rem); padding-bottom: .14em; }
.track { height: clamp(10px,2.5vmin,27px); background: var(--unlit); }
.track-fill { width: var(--position); height: 100%; background: var(--amber); }
.track, .track-fill { mask-image: repeating-linear-gradient(to right,#000 0 calc(100% / 36 - 2px),transparent calc(100% / 36 - 2px) calc(100% / 36)); }
.track-fill { mask-image: none; }
.ticks { position: relative; height: 1em; color: var(--muted); margin-top: 8px; font: .78rem/1 var(--mono); }
.ticks span { position: absolute; left: var(--at, 0%); }
.ticks span:not(:first-child):not(:last-child) { translate: -50% 0; }
.ticks span:last-child { right: 0; left: auto; }
.auxiliary { display: grid; grid-template-rows: repeat(3,minmax(0,1fr)); gap: clamp(8px,1.2vmin,16px); min-width: 0; }
.heading .readout { padding-right: min(12%,30px); }
.compass { position: absolute; width: clamp(36px,8vmin,82px); height: auto; top: 50%; right: clamp(10px,3vmin,38px); transform: translateY(-50%); }
.g-scale { display: flex; align-items: center; gap: 7px; color: var(--muted); font: .72rem/1 var(--mono); max-width: 19rem; }
.g-axis { position: relative; flex: 1; background: var(--unlit); height: 4px; }
.g-axis::before, .g-axis i { position: absolute; content: ''; width: 2px; height: 9px; top: -2px; left: 50%; background: var(--muted); }
.g-axis i { left: 66%; background: var(--amber); width: 4px; }
.status { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.system { display: flex; gap: 9px; align-items: center; }
.lamp { flex: 0 0 9px; height: 9px; background: var(--green); border-radius: 2px; }
.demo { color: var(--amber); border: 1px solid var(--lip); background: var(--face); padding: 4px 7px; }
.controls { margin-left: auto; display: flex; gap: 7px; }
button { color: var(--ink); background: var(--face); border: 1px solid var(--lip); border-radius: 3px; min-height: 44px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; letter-spacing: 0; }
button:hover, button[aria-pressed='true'] { color: var(--amber); border-color: var(--orange); }
button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.notice { margin: 0; color: var(--amber); font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 790px) and (orientation: landscape) {
  .instrument { padding: clamp(9px,2.2vmin,17px); }
  .readout { font-size: clamp(1.48rem,6.4vmin,3rem); }
  .heading .readout { gap: 6px; }
}
@media (orientation: portrait), (max-width: 550px) {
  .instruments { grid-template-columns: 1fr; }
  .auxiliary { grid-template-rows: none; }
  .instrument { padding: 12px; }
  .speed .readout { font-size: clamp(4.25rem,23vmin,9rem); }
  .speed { gap: 11px; }
  .heading .readout { padding: 0; }
  .faceplate { grid-template-columns: auto 1fr; }
  .model { grid-column: 2; padding: 0; border: 0; display: flex; align-items: baseline; gap: 9px; }
  .model span:first-child { display: none; }
  .model strong { font-size: .96rem; }
  .diamond { grid-row: span 2; width: 27px; }
  .identity p, .model { font-size: .65rem; }
  .status { column-gap: 9px; }
  .controls { margin-left: 0; }
}
@media (max-height: 520px) and (min-width: 551px) and (orientation: landscape) {
  body { padding: 6px; }
  .console { padding: 7px; gap: 6px; }
  .faceplate { padding-bottom: 4px; }
  .auxiliary { grid-template-rows: minmax(0,1.15fr) repeat(2,minmax(0,1fr)); gap: 6px; }
  .identity p, .model, .status { font-size: .66rem; }
  .status { column-gap: 9px; }
  .diamond { height: 30px; }
  .instrument { padding: 4px 12px; gap: 3px; }
  .instrument h2 { font-size: .76rem; }
  .readout { font-size: clamp(1.4rem,6.2vmin,2.25rem); }
  .speed { gap: 9px; }
  .ticks { margin-top: 5px; }
}
