/* SPDX-License-Identifier: MIT */
/* Wisp concept 1, "Sectional": the aviation sectional chart. Restrained light screens for bright sun:
   chart tints for the ground, airspace blue for limits and sensors, chart magenta only for Wisp and its path. */
@font-face { font-family: "Overpass"; src: url("../fonts/overpass-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("../fonts/overpass-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("../fonts/overpass-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --paper: #fafbf6; --land: #eceee2; --land-2: #e1e5d3; --water: #cfe2ea; --shore: #6b8792;
  --ink: #16222a; --muted: #47555e; --line: #d3d8c8;
  --air: #1d5aa3; --wisp: #9f166c; --warn: #8a5a00; --stop: #16222a;
  --r: 6px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--land-2); color: var(--ink); font: 400 15px/1.45 "Overpass", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
::selection { background: var(--wisp); color: var(--paper); }
:focus-visible { outline: 3px solid var(--air); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:active { transform: scale(0.97); }
button { transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms ease; }
@media (prefers-reduced-motion: reduce) { button, button:active { transition: none; transform: none; } }

/* ---------- phone ---------- */
.phone-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 0; }
.phone { width: 390px; height: 844px; background: var(--paper); overflow: hidden; display: flex; flex-direction: column; border-radius: 0; }
.status { padding: 18px 20px 12px; }
.status-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.status h1 { margin: 0; font-size: 28px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
.latency { margin: 0; color: var(--muted); font-size: 14px; }
.latency b { color: var(--ink); font-weight: 600; font-size: 17px; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.35; }
.map { margin: 0; position: relative; height: 392px; }
.map svg { display: block; width: 390px; height: 392px; }
.map .ceil { font: 800 22px "Overpass"; letter-spacing: -0.01em; }
.map .lbl { font: 600 13px "Overpass"; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; }
.map .scale { font: 600 11px "Overpass"; }
.map .obs { font: 400 12px "Overpass"; paint-order: stroke; stroke: var(--land); stroke-width: 3px; }
.air { position: absolute; right: 12px; bottom: 10px; background: var(--paper); padding: 4px 9px; border-radius: var(--r); font-size: 12.5px; color: var(--muted); }
.air-num { color: var(--air); font-weight: 800; }
.readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; padding: 12px 20px 4px; }
.readouts p { margin: 0; }
.big { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.big small { font-size: 15px; font-weight: 600; margin-left: 2px; color: var(--muted); }
.big.near { color: var(--air); }
.cap { color: var(--muted); font-size: 12.5px; margin-top: 4px !important; }
.controls { padding: 10px 20px 0; display: grid; gap: 10px; }
.modes { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--land); border-radius: var(--r); padding: 3px; }
.modes button { border: 0; background: none; padding: 8px 0; border-radius: 4px; font-weight: 600; font-size: 14px; color: var(--muted); }
.modes button[aria-checked="true"] { background: var(--paper); color: var(--wisp); }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stepper { display: grid; grid-template-columns: 1fr 34px auto 34px; align-items: center; gap: 4px; }
.stepper span { font-size: 13px; color: var(--muted); }
.stepper button { height: 34px; border: 0; background: var(--land); border-radius: var(--r); font-size: 18px; font-weight: 600; }
.stepper output { min-width: 46px; text-align: center; font-weight: 600; }
.stop { height: 56px; border: 0; border-radius: var(--r); background: var(--stop); color: var(--paper); font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.secondary button { height: 40px; border: 0; background: var(--land); border-radius: var(--r); font-weight: 600; }
.foot { margin-top: auto; display: flex; justify-content: space-between; padding: 10px 20px 16px; font-size: 12.5px; color: var(--muted); }
.rec i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wisp); margin-right: 6px; vertical-align: 1px; }

/* ---------- Control Lab ---------- */
.lab { width: 1440px; height: 900px; display: grid; grid-template-columns: 232px 1fr; background: var(--paper); }
.side { background: var(--land); padding: 22px 18px; display: flex; flex-direction: column; gap: 18px; }
.mark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.mark svg { width: 28px; height: 28px; }
.side h2 { margin: 6px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.loops { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.loops a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: var(--r); color: var(--ink); text-decoration: none; font-size: 14.5px; }
.loops a[aria-current="page"] { background: var(--paper); font-weight: 600; }
.loops a span { color: var(--muted); font-size: 12.5px; }
.sitl { margin-top: auto; font-size: 13px; color: var(--muted); line-height: 1.5; }
.sitl b { color: var(--ink); font-weight: 600; }
.main { padding: 22px 30px 24px; display: grid; grid-template-rows: auto auto 1fr; gap: 16px; min-width: 0; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.title-row h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.title-row p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.apply { height: 40px; padding: 0 18px; border: 0; border-radius: var(--r); background: var(--ink); color: var(--paper); font-weight: 600; }
.diagram { background: var(--land); border-radius: var(--r); padding: 6px 10px 2px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram text { font-family: "Overpass"; }
.eq { font-size: 21px; line-height: 1.4; padding: 10px 14px 12px; }
.eq .term { color: var(--muted); }
.eq b { color: var(--wisp); font-weight: 800; }
.grid { display: grid; grid-template-columns: 1fr 1fr 300px; gap: 22px; min-height: 0; }
.card h3 { margin: 0 0 2px; font-size: 15px; font-weight: 800; }
.card p.note { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.card svg { display: block; width: 100%; }
.card svg text { font: 400 12px "Overpass"; fill: var(--muted); }
.card svg text.mk { font-weight: 600; font-size: 13px; }
.gains { display: grid; gap: 14px; align-content: start; }
.gain label { display: flex; justify-content: space-between; font-size: 14px; }
.gain output { font-weight: 600; }
.gain input { width: 100%; accent-color: var(--wisp); }
.margins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 4px; }
.margins p { margin: 0; }
.margins .big { font-size: 26px; }
