/* SR-71 viewer shell.
   The control panel markup is generated by src/app/ui.js; the class names
   below are the contract between that module and this stylesheet. */

:root {
  --bg: #07080a;
  --ink: #cfd6dd;
  --ink-dim: #7c8792;
  --ink-faint: #4b535c;
  --line: #1c2127;
  --line-soft: #14181d;
  --accent: #d8562f;
  --accent-dim: #7d3620;
  --panel: rgba(9, 11, 14, 0.86);
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

#viewport {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* ---------------------------------------------------------------- titlebar */

#titlebar {
  position: fixed;
  top: 22px;
  left: 26px;
  z-index: 10;
  pointer-events: none;
  user-select: none;
}

.mark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.mark-primary {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #eef2f6;
}

.mark-secondary {
  font-size: 13px;
  letter-spacing: 0.42em;
  color: var(--accent);
}

.mark-sub {
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------------- panel */

#panel {
  position: fixed;
  top: 22px;
  right: 22px;
  bottom: 22px;
  width: 292px;
  z-index: 10;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 14px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
  scrollbar-color: #2a3037 transparent;
}

#panel::-webkit-scrollbar {
  width: 7px;
}
#panel::-webkit-scrollbar-thumb {
  background: #262c33;
}

.section {
  padding: 14px 0 4px;
  border-bottom: 1px solid var(--line-soft);
}
.section:last-child {
  border-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.ctl {
  margin-bottom: 11px;
}

.ctl-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
}
.ctl-label b {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: ew-resize;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: #262c33;
}
input[type="range"]::-moz-range-track {
  height: 2px;
  background: #262c33;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4.5px;
  background: var(--accent);
  border: 0;
  border-radius: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  background: var(--accent);
  border: 0;
  border-radius: 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.btn {
  flex: 1 1 auto;
  min-width: 62px;
  padding: 7px 9px;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: #10141a;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.btn:hover {
  color: var(--ink);
  border-color: #333c45;
  background: #161b22;
}
.btn.is-active {
  color: #fff;
  border-color: var(--accent-dim);
  background: #23140e;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  cursor: pointer;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
}
.toggle:hover {
  color: var(--ink);
}
.toggle input {
  display: none;
}
.toggle .sw {
  position: relative;
  width: 30px;
  height: 14px;
  background: #171c22;
  border: 1px solid var(--line);
  flex: none;
}
.toggle .sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  background: #3d454e;
  transition: transform 0.14s, background 0.14s;
}
.toggle input:checked + .sw::after {
  transform: translateX(16px);
  background: var(--accent);
}

/* part list */

.part-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 5px;
  cursor: pointer;
  color: var(--ink-dim);
  border-left: 2px solid transparent;
}
.part-item:hover {
  color: var(--ink);
  background: #10141a;
}
.part-item.is-hidden {
  color: var(--ink-faint);
  text-decoration: line-through;
}
.part-item.is-isolated {
  border-left-color: var(--accent);
  color: #fff;
  background: #14181f;
}
.part-name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.part-tris {
  font-size: 9px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.part-group {
  margin: 9px 0 3px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.note {
  color: var(--ink-faint);
  line-height: 1.55;
  font-size: 10px;
}
.warn {
  color: #c98b4a;
  line-height: 1.55;
  font-size: 10px;
}

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

#readout {
  position: fixed;
  left: 26px;
  bottom: 22px;
  z-index: 10;
  padding: 10px 14px;
  min-width: 158px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.readout-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 0;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.readout-row b {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- hotspots */

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.2s;
}
.hotspot.is-visible {
  opacity: 1;
}
.hotspot .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  background: var(--accent);
  vertical-align: middle;
}
.hotspot .txt {
  padding: 3px 7px;
  background: rgba(7, 8, 10, 0.8);
  border: 1px solid var(--line);
}

/* -------------------------------------------------------------------- boot */

#boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.5s;
}
#boot.is-done {
  opacity: 0;
  pointer-events: none;
}

.boot-inner {
  text-align: center;
}
.boot-title {
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.boot-bar {
  width: 240px;
  height: 1px;
  background: #1b2027;
  overflow: hidden;
}
.boot-bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: sweep 1.1s ease-in-out infinite;
}
@keyframes sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}
.boot-note {
  margin-top: 13px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  min-height: 14px;
}

/* ------------------------------------------------------------ light theme */
/* The aircraft is near-black, so the default backdrop is a white studio. Only
   the elements that sit directly on the backdrop need re-colouring: the panel,
   readout and hotspot labels are dark cards and read correctly on white. */

body.theme-light {
  background: #eef1f4;
}

body.theme-light .mark-primary {
  color: #0d1116;
}

body.theme-light .mark-sub {
  color: #6b747d;
}

body.theme-light #boot {
  background: #eef1f4;
}

body.theme-light .boot-title {
  color: #4a535c;
}

body.theme-light .boot-note {
  color: #7b848d;
}

body.theme-light .boot-bar {
  background: #cdd4db;
}

body.theme-light #titlebar {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

@media (max-width: 900px) {
  #panel {
    width: 240px;
  }
  #titlebar {
    top: 14px;
    left: 16px;
  }
  .mark-primary {
    font-size: 22px;
  }
}
