:root {
  color-scheme: light;
  --page: #f7f5ef;
  --ink: #142229;
  --muted: #526168;
  --rule: #d5d6cd;
  --blue: #2f5f7f;
  --panel: #101d26;
  --panel-rule: #2d4048;
  --mint: #bdebcb;
  --amber: #ffd39a;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15px/1.45 system-ui, sans-serif; }
main { width: min(1260px, calc(100% - 88px)); margin: 0 auto; }
button { color: inherit; font: inherit; border-radius: 0; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid #337eaa; outline-offset: 3px; }
.masthead, .heading, footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.masthead { min-height: 76px; border-bottom: 1px solid var(--rule); }
.brand, .heading-detail, .eyebrow, .map-label, .dispatch {
  font: 600 11px/1.3 var(--mono);
  letter-spacing: .13em;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--ink); color: var(--mint); font: 20px/1 system-ui; }
.toolbar { display: flex; gap: 8px; }
.tool { min-height: 36px; padding: 0 13px; border: 1px solid var(--rule); background: transparent; font-size: 13px; font-weight: 500; }
.tool:not(:disabled):hover { border-color: var(--ink); }
.heading { align-items: end; margin: 33px 0 25px; }
.heading h1 { margin: 0; font-size: clamp(45px, 6.4vw, 85px); font-weight: 760; line-height: .96; letter-spacing: -.065em; }
.heading h1 span { color: #367567; }
.heading p { margin: 12px 0 0; color: var(--muted); }
.heading-detail { color: var(--muted); margin-bottom: 3px; padding-left: 11px; border-left: 3px solid #70a386; white-space: nowrap; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 262px; gap: 28px; align-items: start; }
.console { background: var(--panel); color: #dce7e8; border: 1px solid #253a43; }
.telemetry { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.telemetry div { padding: 13px 18px 12px; border-right: 1px solid var(--panel-rule); }
.telemetry div:last-child { border: 0; }
.telemetry dt { font: 600 10px/1.2 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: #a9bbc1; }
.telemetry dd { margin: 5px 0 0; font: 600 25px/1 var(--mono); color: var(--mint); white-space: nowrap; }
.telemetry small { color: #a9bbc1; font-size: 11px; }
#waiting { color: var(--amber); }
#airframes { font-size: 15px; letter-spacing: .18em; margin-top: 10px; }
.viewport { position: relative; aspect-ratio: 2 / 1; background: #162938; isolation: isolate; overflow: hidden; border-block: 1px solid var(--panel-rule); }
#screen { position: absolute; inset: 0; }
#screen canvas { display: block; image-rendering: pixelated; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 6%; background: linear-gradient(90deg, #0a171fee 1%, #0a171fb5 29%, #0a171f40 58%, transparent 81%); }
.overlay-inner { position: relative; }
.eyebrow { margin: 0 0 11px; color: var(--amber); text-transform: uppercase; }
.overlay h2 { color: #f3f2e7; margin: 0; font-size: clamp(26px, 4.45vw, 68px); line-height: .96; font-weight: 740; letter-spacing: -.055em; }
#overlay-copy { margin: 13px 0 18px; color: #e3ebea; font-size: 14px; line-height: 1.4; }
.launch-row { display: flex; align-items: center; gap: 10px; }
#launch, #restart { min-height: 42px; padding: 0 14px; border: 1px solid var(--mint); background: var(--mint); color: #10231e; font: 700 12px/1 var(--mono); }
#launch span { margin-left: 14px; }
#launch:hover { background: #e0f8e8; }
#restart { color: #e7f3ef; background: #172c35; border-color: #849e9b; }
kbd { display: inline-block; border: 1px solid var(--rule); background: #efeee8; padding: 4px 6px; font: 600 10px/1 var(--mono); white-space: nowrap; }
.overlay kbd { background: #142632; color: #dfebea; border-color: #536c73; }
.navigation { display: flex; align-items: center; gap: 17px; padding: 9px 18px; border-bottom: 1px solid var(--panel-rule); }
.map-label { color: #a9bbc1; white-space: nowrap; }
.map { height: 26px; flex: 1; position: relative; }
.map-track { position: absolute; left: 0; right: 0; height: 1px; top: 12px; background: #4a6068; }
.map-base, .map-stop { position: absolute; top: 12px; left: var(--x); transform: translate(-50%, -50%); width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid #536e74; background: var(--panel); font: 600 10px/1 var(--mono); color: #d5e5e6; }
.map-base, .map-stop.clear { color: var(--mint); border-color: #88aa99; }
#map-heli { position: absolute; top: 0; left: var(--x); width: 9px; height: 6px; transform: translateX(-50%); clip-path: polygon(0 0, 100% 0, 50% 100%); background: var(--amber); }
.dispatch { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 7px 17px; color: #c5d6d8; letter-spacing: .025em; }
.signal { width: 6px; height: 6px; background: var(--mint); flex: none; }
#hull { margin-left: auto; white-space: nowrap; font-size: 10px; }
#hull b { color: var(--mint); margin-left: 4px; letter-spacing: .14em; }
#hull.damaged b { color: var(--amber); }
aside { border-top: 2px solid var(--ink); }
aside section { padding-top: 14px; }
aside h2 { font-size: 17px; margin: 0 0 13px; }
aside ol, aside dl { padding: 0; margin: 0; list-style: none; }
aside li { display: grid; grid-template-columns: 27px 1fr; gap: 6px; padding: 11px 0; border-top: 1px solid var(--rule); }
aside li:first-child { padding-top: 0; border: 0; }
.step { color: #3a7162; font: 600 11px/1.8 var(--mono); }
aside strong { font-size: 13px; }
aside p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.controls { border-top: 1px solid var(--rule); margin-top: 7px; }
.controls dl > div { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.controls dt { font-size: 12px; }
.controls dd { white-space: nowrap; margin: 0; }
.controls p { margin-top: 12px; }
footer { border-top: 1px solid var(--rule); margin: 22px 0 16px; padding-top: 12px; font-size: 12px; color: var(--muted); }
footer a { color: var(--blue); }
.touch { display: none; }

@media (max-width: 1050px) {
  main { width: calc(100% - 44px); }
  .layout { grid-template-columns: minmax(0, 1fr) 222px; gap: 20px; }
}
@media (max-width: 760px) {
  main { width: calc(100% - 28px); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .heading { margin: 24px 0 17px; }
  .heading-detail { display: none; }
  .masthead { min-height: 60px; }
  aside { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .controls { border: 0; margin: 0; }
}
@media (max-width: 490px) {
  .brand { letter-spacing: .03em; font-size: 10px; gap: 7px; }
  .tool { padding: 0 9px; }
  .toolbar { gap: 5px; }
  .telemetry div { padding: 9px 7px; }
  .telemetry dt { font-size: 9px; letter-spacing: .04em; }
  .telemetry dd { font-size: 20px; }
  .telemetry small { font-size: 9px; }
  #airframes { font-size: 13px; margin-top: 8px; }
  .overlay { padding: 0 5%; }
  .eyebrow { margin-bottom: 6px; font-size: 9px; }
  #overlay-copy { font-size: 12px; margin: 6px 0 8px; }
  #launch, #restart { min-height: 34px; }
  .navigation { padding: 5px 9px; gap: 9px; }
  .map-label { font-size: 9px; }
  .dispatch { padding: 6px 9px; min-height: 35px; font-size: 10px; }
  aside { grid-template-columns: 1fr; gap: 0; }
  .controls { border-top: 1px solid var(--rule); }
}
@media (pointer: coarse), (max-width: 760px) {
  .touch { display: flex; justify-content: space-between; gap: 4px; padding: 7px; border-top: 1px solid var(--panel-rule); }
  .touch-group { display: flex; gap: 4px; }
  .touch button { touch-action: none; min-width: 42px; min-height: 42px; padding: 0 5px; border: 1px solid #557078; background: #1b303a; font: 600 13px/1 var(--mono); }
  .touch button:active { background: var(--mint); color: var(--panel); }
  .touch[inert] { opacity: .65; }
}
@media (max-width: 345px) {
  .viewport { aspect-ratio: 1.8; }
  .touch button { min-width: 38px; }
  footer { flex-wrap: wrap; gap: 5px; }
}
