/* Aviascan — palette borrowed from aeronautical charts: chart paper, navy ink,
   airspace magenta for warnings, chart blue for traffic, terrain tan for aircraft on the ground. */
:root {
  --paper: #e8eeed;
  --panel: #f4f7f6;
  --ink: #14233f;
  --muted: #56667a;
  --rule: #c5d0d0;
  --blue: #2c6aa0;
  --blue-ghost: rgba(44, 106, 160, 0.22);
  --magenta: #a3176a;
  --tan: #b39a5c;
  --focus: #a3176a;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Golos Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a2b;
    --panel: #16243a;
    --ink: #e4ebf2;
    --muted: #93a3b6;
    --rule: #2a3b55;
    --blue: #6fa8dc;
    --blue-ghost: rgba(111, 168, 220, 0.22);
    --magenta: #e0559f;
    --tan: #c4ad78;
    --focus: #e0559f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wrap { max-width: 70rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h2 { font: 600 1.05rem/1.3 var(--body); margin: 0 0 0.75rem; }
.hint { color: var(--muted); font-size: 0.875rem; margin: 0.5rem 0 0; max-width: 60ch; }

/* header */
header.site { padding: calc(2rem + env(safe-area-inset-top, 0px)) 0 1.5rem; }
.wordmark {
  font: 700 1.6rem/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.lede { margin: 0.6rem 0 0; color: var(--muted); max-width: 52ch; }

.draft {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--magenta);
  background: var(--panel);
  color: var(--ink);
  max-width: 62ch;
}

/* switcher */
.switcher { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; margin-bottom: 2rem; }
.group { display: flex; flex-direction: column; gap: 0.4rem; }
.group-name { color: var(--muted); font-size: 0.8125rem; }
.group-items { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.switcher button {
  font: 500 0.9375rem/1 var(--body);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}
.switcher button:hover { border-color: var(--blue); }
.switcher button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.switcher button .soon { color: var(--muted); font-weight: 400; }
.switcher button[aria-pressed="true"] .soon { color: inherit; opacity: 0.7; }

/* hero: the airport identifier is the memorable element */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 2rem;
  align-items: end;
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.icao {
  font: 700 clamp(4rem, 15vw, 9.5rem)/0.85 var(--display);
  letter-spacing: -0.04em;
  margin: 0;
}
.hero-text { padding-bottom: 0.6rem; }
.hero-name { font: 600 1.6rem/1.2 var(--body); margin: 0; }
.hero-city { color: var(--muted); margin: 0.15rem 0 0.6rem; }
.status { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; }
.status::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--blue); }
.status.planned::before { background: var(--muted); }
.hero-note { color: var(--muted); font-size: 0.9375rem; margin: 0.6rem 0 0; max-width: 56ch; }
@media (max-width: 40rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-text { padding-bottom: 0; margin-top: 0.75rem; }
}

/* runway strip */
.runway { padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.runway-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 2rem; }
.runway-head .hint { margin: 0 0 0.75rem; }
.runway-chart, .trend { width: 100%; overflow-x: auto; }
.runway-chart svg, .trend svg { display: block; width: 100%; height: auto; }
.axis { fill: var(--muted); font: 400 12px var(--body); }
.gridline { stroke: var(--rule); stroke-width: 1; }
.centerline { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 10 8; }
.bar-now { fill: var(--blue); }
.bar-low { fill: var(--magenta); }
.bar-ghost { fill: var(--blue-ghost); }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; color: var(--muted); font-size: 0.8125rem; margin-top: 0.6rem; }
.legend span::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.4rem; vertical-align: -1px; border-radius: 2px; }
.legend .k-now::before { background: var(--blue); }
.legend .k-ghost::before { background: var(--blue-ghost); }
.legend .k-low::before { background: var(--magenta); }
.legend .k-ok::before { background: var(--blue); }
.legend .k-canc::before { background: var(--magenta); }
.legend .k-mil::before { background: var(--magenta); border-radius: 50%; }

/* numbers */
.numbers {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) 2fr;
  gap: 2rem 3rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 48rem) { .numbers { grid-template-columns: 1fr; } }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1.25rem; align-items: baseline; }
.facts dt { font: 600 1.75rem/1 var(--body); font-variant-numeric: tabular-nums; text-align: right; }
.facts dd { margin: 0; color: var(--muted); }
.facts dt.warn { color: var(--magenta); }
.line { fill: none; stroke: var(--blue); stroke-width: 2.25; }
.dot-mil { fill: var(--magenta); }
.bar-ok { fill: var(--blue); }
.bar-canc { fill: var(--magenta); }

.empty { padding: 1.5rem 0; color: var(--muted); max-width: 56ch; }

/* about, sources */
.about, .sources { padding: 2rem 0; }
.about { border-bottom: 1px solid var(--rule); }
.about p { max-width: 68ch; margin: 0 0 0.9rem; }
.sources ul { margin: 0; padding-left: 1.1rem; }
.sources li { margin-bottom: 0.35rem; }
.sources { padding-bottom: 3rem; }

.tip {
  position: fixed; pointer-events: none; z-index: 10;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.4rem 0.6rem; font-size: 0.8125rem; line-height: 1.4;
  box-shadow: 0 4px 16px rgba(10, 20, 40, 0.18);
}

@media (prefers-reduced-motion: no-preference) {
  .runway-chart rect { transition: height 0.4s ease, y 0.4s ease; }
}
