:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07111f;
  color: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, .22), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(45, 212, 191, .12), transparent 30rem),
    linear-gradient(135deg, #07111f 0%, #0f172a 100%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 32px;
  background: rgba(15, 23, 42, .72);
  box-shadow: 0 32px 100px rgba(0, 0, 0, .36);
  backdrop-filter: blur(12px);
}

.eyebrow,
.card-kicker {
  margin: 0;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 14px 0 0;
  font-size: clamp(52px, 10vw, 104px);
  line-height: .9;
  letter-spacing: -.075em;
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: #cbd5e1;
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1.35;
}

.status {
  display: inline-flex;
  margin: 32px 0 0;
  padding: 10px 14px;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 999px;
  color: #94a3b8;
  background: rgba(15, 23, 42, .9);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.card {
  min-height: 320px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 28px;
  background: rgba(15, 23, 42, .68);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
}

.muted-card {
  opacity: .72;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  padding: 6px 10px;
  border: 1px solid rgba(56, 189, 248, .26);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(14, 165, 233, .1);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h2 {
  margin: 28px 0 0;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -.05em;
}

.muted {
  margin: 14px 0 0;
  color: #94a3b8;
  line-height: 1.5;
}

.stats {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.stats > div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .045);
}

.label {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

strong {
  color: #f8fafc;
}

.countries {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.country-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, .16);
  color: #cbd5e1;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .card {
    padding: 24px;
  }
}

.pill-fresh {
  border-color: rgba(34, 197, 94, .32);
  color: #bbf7d0;
  background: rgba(22, 163, 74, .12);
}

.pill-recent {
  border-color: rgba(56, 189, 248, .32);
  color: #bae6fd;
  background: rgba(14, 165, 233, .12);
}

.pill-stale {
  border-color: rgba(251, 191, 36, .32);
  color: #fde68a;
  background: rgba(217, 119, 6, .12);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 0 8px;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 720px) {
  .footer {
    flex-direction: column;
  }
}

.map-card {
  grid-column: 1 / -1;
  min-height: 520px;
}

.aircraft-map {
  width: 100%;
  height: 440px;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 22px;
  background: rgba(15, 23, 42, .85);
}

.leaflet-container {
  font-family: inherit;
  background: #0f172a;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, .22);
}

.leaflet-popup-content {
  margin: 12px 14px;
  line-height: 1.45;
}

.leaflet-control-attribution {
  background: rgba(15, 23, 42, .82) !important;
  color: #94a3b8 !important;
}

.leaflet-control-attribution a {
  color: #38bdf8 !important;
}

.map-summary {
  margin-top: 16px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  color: #94a3b8;
  font-size: 13px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}

.legend-airborne {
  background: #38bdf8;
}

.legend-ground {
  background: #facc15;
}

.legend-unknown {
  background: #94a3b8;
}

.popup-title {
  display: block;
  margin-bottom: 4px;
  color: #f8fafc;
  font-size: 14px;
}

.popup-meta {
  color: #94a3b8;
}

/* Night mode for Leaflet map tiles */
.aircraft-map .leaflet-tile {
  filter: brightness(0.72) contrast(1.12) saturate(0.65) hue-rotate(180deg) invert(1);
}

.aircraft-map .leaflet-container {
  background: #07111f;
}

.aircraft-map .leaflet-control-zoom a {
  background: #0f172a;
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, .35);
}

.aircraft-map .leaflet-control-zoom a:hover {
  background: #1e293b;
  color: #ffffff;
}

.aircraft-map .leaflet-control-attribution {
  border-radius: 8px 0 0 0;
}
