@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:400 700;font-display:swap;src:url(/assets/fonts/space-grotesk.woff2) format('woff2');}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400 600;font-display:swap;src:url(/assets/fonts/jetbrains-mono.woff2) format('woff2');}
@font-face{font-family:'Inter';font-style:normal;font-weight:400 600;font-display:swap;src:url(/assets/fonts/inter.woff2) format('woff2');}

/* WhatsAbove — "Night Ops" design system. Dark only, by identity. */

:root {
  --bg: #050607;
  --phosphor: #1E2B26;
  --air: #4ADE80;
  --space: #7DD3FC;
  --alert: #F87171;
  --ink: #E7E5E0;
  --ink-dim: #8b8e8a;
  --ink-faint: #55585a;
  --panel: rgba(13, 16, 18, 0.78);
  --panel-line: rgba(231, 229, 224, 0.08);
  --accent: var(--air);
  --accent-dim: rgba(74, 222, 128, 0.14);
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-body: 'Inter', system-ui, sans-serif;
}
[data-layer="space"] { --accent: var(--space); --accent-dim: rgba(125, 211, 252, 0.14); }

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: var(--bg); }

/* ---------- shell ---------- */
.site-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--panel-line);
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700; font-size: 20px; letter-spacing: 0.06em;
  color: var(--ink); text-transform: uppercase;
  display: flex; align-items: center; gap: 9px;
}
.wordmark:hover { text-decoration: none; }
.wordmark svg { display: block; }
.header-nav { margin-left: auto; display: flex; gap: 18px; font-size: 13.5px; }
.header-nav a { color: var(--ink-dim); }
.header-nav a:hover { color: var(--ink); text-decoration: none; }

main { display: block; }

.site-footer {
  border-top: 1px solid var(--panel-line);
  padding: 26px 20px 40px; margin-top: 48px;
  color: var(--ink-faint); font-size: 13px;
}
.site-footer .foot-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.site-footer a { color: var(--ink-dim); }

/* ---------- the app ---------- */
.app-wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

.hero-head { text-align: center; padding: 26px 10px 6px; }
.hero-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(24px, 4.4vw, 40px); line-height: 1.15;
  margin: 0 0 8px; letter-spacing: -0.01em;
}
.hero-head p { color: var(--ink-dim); margin: 0 auto; max-width: 620px; font-size: 15px; }

/* search */
.searchbar {
  display: flex; gap: 8px; max-width: 620px; margin: 18px auto 6px;
}
.searchbar input {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--panel-line);
  color: var(--ink);
  font-family: var(--font-body); font-size: 15px;
  padding: 12px 16px; border-radius: 10px;
  outline: none;
}
.searchbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.searchbar input::placeholder { color: var(--ink-faint); }
.searchbar button {
  background: var(--accent); color: var(--bg);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  border: 0; border-radius: 10px; padding: 0 22px; cursor: pointer;
  letter-spacing: 0.03em; transition: filter .15s;
}
.searchbar button:hover { filter: brightness(1.12); }
.geo-note { text-align: center; font-size: 12.5px; color: var(--ink-faint); min-height: 18px; margin: 4px 0 0; }
.geo-note.err { color: var(--alert); }

/* the counter — the brand */
.counter {
  text-align: center; margin: 14px 0 4px;
  font-family: var(--font-display); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.counter .counter-lead { display: block; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; margin-bottom: 2px; }
.counter .counter-line { font-size: clamp(34px, 6vw, 64px); line-height: 1.1; }
.counter .n-air { color: var(--air); }
.counter .n-space { color: var(--space); }
.counter .counter-unit { font-size: 0.42em; color: var(--ink-dim); font-weight: 500; letter-spacing: 0.02em; }
.counter .counter-dot { color: var(--ink-faint); margin: 0 0.18em; }
.locline { text-align: center; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-dim); margin: 2px 0 14px; }
.locline .loc-ctx { color: var(--ink-faint); }

/* tabs */
.layer-tabs { display: flex; justify-content: center; gap: 10px; margin: 10px 0 14px; }
.layer-tab {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: 0.05em;
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--panel-line); border-radius: 999px;
  padding: 9px 26px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.layer-tab[aria-selected="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.layer-tab:hover { color: var(--ink); }
[data-layer="air"] .layer-tab[data-tab="air"],
[data-layer="space"] .layer-tab[data-tab="space"] { color: var(--accent); }

/* scope + side panel layout */
.scope-row { display: flex; gap: 18px; align-items: stretch; }
.scope-stage { position: relative; flex: 1 1 auto; min-width: 0; }
#scope {
  display: block; width: 100%;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--panel-line);
  touch-action: none;
  cursor: crosshair;
  transition: opacity .2s ease; /* 200ms tab crossfade */
}
#scope.fading { opacity: 0.15; }

.scope-hud {
  position: absolute; top: 12px; left: 12px;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.hud-chip {
  pointer-events: auto;
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-dim);
  background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-line); border-radius: 7px;
  padding: 4px 9px;
}
.range-ctl { position: absolute; top: 12px; right: 12px; display: flex; gap: 5px; }
[data-layer="space"] .range-ctl { display: none; } /* az/el projection has no range */
.range-btn {
  font-family: var(--font-mono); font-size: 11.5px;
  background: var(--panel); color: var(--ink-dim);
  border: 1px solid var(--panel-line); border-radius: 7px;
  padding: 4px 9px; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.range-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

.overhead-chip {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 13px; color: var(--bg);
  background: var(--accent); border-radius: 999px; padding: 6px 15px;
  animation: chip-in .35s ease;
  white-space: nowrap; font-weight: 600;
}
@keyframes chip-in { from { transform: translate(-50%, 14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.emg-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  color: #fff; background: rgba(153, 27, 27, 0.92);
  border: 1px solid var(--alert); border-radius: 8px;
  padding: 6px 14px; white-space: nowrap;
  animation: emg-pulse 1.2s ease-in-out infinite;
}
@keyframes emg-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(248,113,113,.5); } 50% { box-shadow: 0 0 0 8px rgba(248,113,113,0); } }

.empty-note {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  max-width: 320px; text-align: center;
  font-size: 13.5px; color: var(--ink-dim);
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px;
  padding: 14px 18px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

/* filter chips (SPACE) */
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 12px 0 2px; }
.filter-chip {
  font-family: var(--font-mono); font-size: 12px;
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--panel-line); border-radius: 999px;
  padding: 5px 13px; cursor: pointer; transition: color .15s, border-color .15s;
}
.filter-chip[aria-pressed="true"] { color: var(--space); border-color: var(--space); background: rgba(125,211,252,0.1); }
.filter-chip:hover { color: var(--ink); }

/* side telemetry card */
.side-card {
  width: 320px; flex: 0 0 320px;
  background: var(--panel);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--panel-line); border-radius: 14px;
  padding: 18px; align-self: flex-start;
  font-family: var(--font-mono); font-size: 13px;
  max-height: 720px; overflow-y: auto;
}
.side-card h3 {
  font-family: var(--font-display); font-size: 21px; margin: 0 0 2px;
  color: var(--accent); letter-spacing: 0.02em;
}
.side-card .card-sub { color: var(--ink-dim); font-size: 12px; margin: 0 0 12px; }
.card-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--ink-faint); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px; }
.card-close:hover { color: var(--ink); }
.side-card { position: relative; }
.routeline {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  margin: 10px 0 14px; color: var(--ink);
}
.routeline .route-bar { flex: 1; height: 2px; background: var(--panel-line); position: relative; min-width: 40px; }
.routeline .route-bar::after { content: '✈'; position: absolute; top: -9px; left: var(--prog, 50%); transform: translateX(-50%); font-size: 11px; color: var(--accent); }
.trow { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(231,229,224,0.05); }
.trow .tk { color: var(--ink-faint); font-size: 11.5px; letter-spacing: 0.04em; }
.trow .tv { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.trow .tv.up { color: var(--air); } .trow .tv.dn { color: #fbbf24; }
.trow .tv.emg { color: var(--alert); font-weight: 600; }
.follow-btn {
  display: block; width: 100%; margin-top: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.06em;
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 9px; padding: 9px; cursor: pointer;
}
.follow-btn[aria-pressed="true"] { background: var(--accent); color: var(--bg); }

/* tonight panel */
.tonight {
  margin: 22px auto 0; max-width: 900px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px;
  padding: 18px 20px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tonight h2 { font-family: var(--font-display); font-size: 17px; margin: 0 0 4px; color: var(--space); letter-spacing: 0.03em; }
.tonight .tonight-sub { color: var(--ink-faint); font-size: 12.5px; margin: 0 0 14px; font-family: var(--font-mono); }
.night-timeline { position: relative; height: 74px; }
.night-timeline canvas { display: block; width: 100%; height: 74px; }
.pass-list { margin: 12px 0 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: 13px; }
.pass-list li { padding: 7px 0; border-top: 1px solid rgba(231,229,224,0.05); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pass-list .p-name { color: var(--space); font-weight: 600; min-width: 90px; }
.pass-list .p-meta { color: var(--ink-dim); }
.pass-none { color: var(--ink-faint); font-size: 13px; font-family: var(--font-mono); }

/* share */
.share-row { display: flex; justify-content: center; gap: 10px; margin: 20px 0 8px; flex-wrap: wrap; }
.share-btn {
  font-family: var(--font-mono); font-size: 12.5px;
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--panel-line); border-radius: 9px;
  padding: 8px 16px; cursor: pointer;
}
.share-btn:hover { color: var(--accent); border-color: var(--accent); }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--accent); color: var(--ink);
  border-radius: 10px; padding: 10px 18px; font-size: 13.5px; font-family: var(--font-mono);
  z-index: 60; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: chip-in .3s ease;
}

/* ---------- article / guide pages ---------- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 34px 18px 10px; }
.article-wrap h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 38px); line-height: 1.18; margin: 0 0 10px; letter-spacing: -0.01em; }
.article-wrap h2 { font-family: var(--font-display); font-size: 23px; margin: 36px 0 12px; }
.article-wrap h3 { font-family: var(--font-display); font-size: 18px; margin: 26px 0 8px; }
.article-wrap p, .article-wrap li { color: #c9c7c2; font-size: 16px; }
.article-wrap .lede { color: var(--ink-dim); font-size: 18px; }
.byline { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); margin: 0 0 26px; }
.article-wrap table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14.5px; }
.article-wrap th, .article-wrap td { text-align: left; padding: 8px 12px; border: 1px solid var(--panel-line); }
.article-wrap th { font-family: var(--font-display); color: var(--ink); background: rgba(255,255,255,0.03); }
.article-wrap td { color: #c9c7c2; font-family: var(--font-mono); font-size: 13.5px; }
.article-wrap code { font-family: var(--font-mono); background: rgba(255,255,255,0.06); border-radius: 4px; padding: 1px 6px; font-size: 0.9em; }
.article-wrap blockquote { border-left: 3px solid var(--accent); margin: 18px 0; padding: 4px 0 4px 16px; color: var(--ink-dim); }
.cta-box {
  background: var(--accent-dim); border: 1px solid var(--accent); border-radius: 12px;
  padding: 16px 20px; margin: 26px 0; font-size: 15px;
}
.cta-box a { font-weight: 600; }

/* guide/city index grids */
.index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 24px 0; padding: 0; list-style: none; }
.index-grid li a {
  display: block; padding: 14px 16px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--panel-line); border-radius: 11px;
  color: var(--ink); font-size: 14.5px; line-height: 1.4;
}
.index-grid li a:hover { border-color: var(--accent); text-decoration: none; }
.index-grid li a .gi-sub { display: block; color: var(--ink-faint); font-size: 12px; font-family: var(--font-mono); margin-top: 3px; }

/* city page facts */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.fact { background: rgba(255,255,255,0.025); border: 1px solid var(--panel-line); border-radius: 11px; padding: 14px 16px; }
.fact .f-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.fact .f-v { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-top: 3px; }
.fact .f-sub { font-size: 12.5px; color: var(--ink-dim); font-family: var(--font-mono); margin-top: 2px; }

.crumbs { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); margin-bottom: 14px; }
.crumbs a { color: var(--ink-dim); }

/* ad slots — inert hooks, never over the scope */
.ad-slot { min-height: 0; margin: 26px auto; max-width: 760px; text-align: center; }
.ad-slot:empty { display: none; }

/* mobile */
@media (max-width: 900px) {
  .scope-row { flex-direction: column; }
  .side-card {
    width: auto; flex: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    border-radius: 16px 16px 0 0; max-height: 55vh;
    animation: sheet-in .25s ease;
  }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
  .header-nav { gap: 12px; font-size: 12.5px; }
  .counter .counter-line { font-size: clamp(30px, 9vw, 46px); }
}
