/* Instrument, not toy: one accent, a lot of dark, nothing that blinks for effect. */

:root {
  --bg:        #0b0d0f;
  --panel:     #12161a;
  --rule:      #232a30;
  --ink:       #e6edf2;
  --ink-soft:  #8d9aa5;
  --ink-faint: #5c6871;
  --accent:    #e0a066;
  --warn:      #d4694a;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* The panels get a column of their own. Overlaying them on the scope hid
   aircraft behind the chrome, which on a display is not a cosmetic problem. */
.layout {
  display: grid;
  grid-template-columns: 21rem 1fr;
  height: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  background: var(--panel);
}

.scope-wrap { position: relative; min-width: 0; }

#scope { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------------- hud -- */

.hud {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.125rem;
  background: color-mix(in srgb, var(--bg) 40%, var(--panel));
}

.sidebar > :last-child { margin-top: auto; }

.hud h1 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hud h2 {
  margin: 0 0 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hud__sub {
  margin: 0.125rem 0 0.875rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- readout -- */

.readout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.375rem 1rem;
  margin: 0;
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
}

.readout > div { display: contents; }

.readout dt {
  color: var(--ink-faint);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: center;
}

.readout dd {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-block;
  padding: 0.0625rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill--live     { color: #7fc9a0; }
.pill--degraded { color: var(--warn); }
.pill--mock     { color: var(--accent); }

/* ---------------------------------------------------------------- legend -- */

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4375rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.legend li { display: flex; align-items: center; gap: 0.625rem; }

.swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.swatch--live   { background: var(--ink); }
.swatch--aging  { background: var(--ink-soft); }
.swatch--stale  { border: 1px solid var(--ink-faint); }
.swatch--frozen { border: 1px dashed var(--accent); }
.swatch--mlat   { border: 1px dashed #7fb0c8; border-radius: 50%; }
.swatch--ground { background: var(--ink-faint); border-radius: 0; transform: scale(0.7); }

.legend__note {
  margin: 0.875rem 0 0;
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------- tooltip -- */

.tooltip {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.5rem 0.625rem;
  font: 0.75rem/1.5 var(--mono);
  white-space: pre;
  color: var(--ink);
}

.tooltip[hidden] { display: none; }

/* ------------------------------------------------------------------- a11y -- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 52rem) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--rule); }
  .sidebar > :last-child { margin-top: 0; }
}

.legend__note a { color: var(--ink-soft); }
.legend__note a:hover { color: var(--ink); }
