:root {
  color-scheme: light dark;
  --bg: #eef2f7;
  --bg-gradient-top: rgba(243, 184, 100, 0.16);
  --bg-gradient-mid: rgba(89, 144, 229, 0.14);
  --bg-gradient-bottom: #e9eef6;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --hero-surface: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(243, 247, 252, 0.96));
  --text: #132033;
  --muted: #607187;
  --line: rgba(18, 32, 51, 0.1);
  --accent: #f3b864;
  --accent-deep: #d98d2b;
  --success: #169b62;
  --shadow: 0 24px 80px rgba(33, 51, 74, 0.12);
  --map-grid: rgba(19, 32, 51, 0.08);
  --map-surface: linear-gradient(180deg, rgba(240, 245, 251, 0.92), rgba(230, 238, 248, 0.8));
  --map-stroke-start: rgba(22, 155, 98, 0.25);
  --map-stroke-mid: rgba(22, 155, 98, 0.95);
  --map-stroke-end: rgba(243, 184, 100, 0.95);
  --map-node: #0d213d;
  --plane-core: #f3b864;
  --plane-glow: rgba(243, 184, 100, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08111f;
    --bg-gradient-top: rgba(243, 184, 100, 0.16);
    --bg-gradient-mid: rgba(70, 115, 196, 0.2);
    --bg-gradient-bottom: #09111d;
    --panel: rgba(8, 17, 31, 0.7);
    --panel-strong: rgba(10, 18, 31, 0.9);
    --hero-surface: linear-gradient(160deg, rgba(7, 17, 31, 0.8), rgba(10, 18, 31, 0.96));
    --text: #f5f7fb;
    --muted: #9daac0;
    --line: rgba(255, 255, 255, 0.1);
    --success: #74d6a5;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    --map-grid: rgba(255, 255, 255, 0.08);
    --map-surface: linear-gradient(180deg, rgba(13, 25, 42, 0.92), rgba(8, 17, 31, 0.88));
    --map-stroke-start: rgba(116, 214, 165, 0.15);
    --map-stroke-mid: rgba(116, 214, 165, 0.92);
    --map-stroke-end: rgba(243, 184, 100, 0.8);
    --map-node: #f4f7fb;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, var(--bg-gradient-top), transparent 28%),
    radial-gradient(circle at 85% 18%, var(--bg-gradient-mid), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-gradient-bottom) 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.page-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.app-nav-wrap { padding-bottom: 12px; }
.app-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-decoration: none;
}
.hero, .flight-board, .insight-panel, .sources-panel { border: 1px solid var(--line); border-radius: 28px; background: var(--panel); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.hero { overflow: hidden; background: linear-gradient(135deg, rgba(255,255,255,0.04), transparent 45%), var(--hero-surface); }
.topbar, .hero-content, .flight-board, .insight-panel, .sources-panel, .tracker-panel, .analysis-panel { padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 0; }
.brand-lockup, .topbar-actions, .hero-actions, .route-switcher { display: flex; align-items: center; gap: 12px; }
.hero-actions, .route-switcher { flex-wrap: wrap; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #1a1208; font-family: "Space Grotesk", sans-serif; font-weight: 700; }
.eyebrow, .kicker { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.72rem; }
h1, h2, h3, strong, .map-label { font-family: "Space Grotesk", sans-serif; }
.hero-copy h2 { font-size: clamp(2.8rem, 7vw, 5.2rem); line-height: 0.95; margin: 14px 0 0; letter-spacing: -0.05em; }
.lead, .tracker-description, .analysis-intro, .analysis-footnote, .tracker-footnote, .insight-panel p, .sources-panel li { line-height: 1.7; color: color-mix(in srgb, var(--text) 84%, var(--muted) 16%); }
.ghost-link, .mode-chip, .route-tab, .secondary-button { padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); background: rgba(255,255,255,0.03); }
.mode-chip { color: #7d4c06; border-color: rgba(243, 184, 100, 0.45); background: rgba(243,184,100,0.14); }
.primary-button { border: 0; border-radius: 999px; padding: 13px 18px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #190f04; font-weight: 800; }
.secondary-button, .route-tab { color: var(--text); }
.hero-content, .content-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 20px; }
.hero-stats, .flight-times, .tracker-stats, .analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-stats div, .time-box, .tracker-stat, .analysis-card { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.03); }
.hero-visual { position: relative; min-height: 360px; }
.orb { position: absolute; border-radius: 999px; }
.orb-sun { top: 12px; right: 34px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(243,184,100,0.96) 0%, rgba(243,184,100,0.2) 58%, transparent 72%); }
.orb-earth { right: 40px; bottom: 4px; width: 300px; height: 300px; border: 1px solid var(--line); background: radial-gradient(circle at 30% 30%, rgba(143,201,255,0.24), transparent 26%), radial-gradient(circle at 60% 48%, rgba(59,123,224,0.32), transparent 22%), radial-gradient(circle at center, rgba(15,39,74,0.82), rgba(4,12,22,0.98)); }
.route-card { position: absolute; left: 20px; bottom: 24px; width: min(320px, 100%); padding: 22px; border: 1px solid var(--line); border-radius: 28px; background: var(--panel-strong); }
.route-line { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 14px 0; }
.route-line span:nth-child(2) { height: 1px; background: linear-gradient(90deg, var(--map-stroke-start), var(--map-stroke-mid), var(--map-stroke-end)); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.flight-list, .sidebar { display: grid; gap: 14px; }
.flight-item { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); }
.flight-top { display: flex; justify-content: space-between; gap: 16px; }
.flight-code { display: inline-flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.flight-code::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--success); }
.flight-meta, .time-box span, .tracker-stat span, .analysis-card span { color: var(--muted); font-size: 0.82rem; }
.flight-status-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: center; }
.flight-status-badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.flight-status-badge.live { background: rgba(22, 155, 98, 0.14); color: var(--success); border: 1px solid rgba(22, 155, 98, 0.24); }
.flight-status-badge.next { background: rgba(243, 184, 100, 0.16); color: #8b5607; border: 1px solid rgba(243, 184, 100, 0.28); }
.flight-status-badge.later { background: rgba(89, 144, 229, 0.12); color: #3561a8; border: 1px solid rgba(89, 144, 229, 0.22); }
.flight-status-detail { color: var(--muted); font-size: 0.9rem; }
.map-shell { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 24px; background: var(--map-surface); }
.route-map { width: 100%; display: block; }
.map-grid path { fill: none; stroke: var(--map-grid); stroke-width: 1; }
.route-path { fill: none; stroke: url(#routeStroke); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 8 10; }
.airport-node { fill: var(--map-node); }
.plane-glow { fill: var(--plane-glow); }
.plane-core { fill: var(--plane-core); }
.plane-icon { fill: #221304; font-size: 17px; }
.progress-track { width: 100%; height: 12px; margin-top: 18px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.progress-bar { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--map-stroke-mid), var(--map-stroke-end)); transition: width 700ms ease; }
.tracker-panel, .analysis-panel { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 28px; background: var(--panel-strong); }
.analysis-card strong, .tracker-stat strong, .time-box strong { display: block; margin-top: 8px; font-size: 1.2rem; }
.analysis-card p { margin: 10px 0 0; line-height: 1.6; }
.sources-panel ul { margin: 14px 0 0; padding-left: 18px; }
@media (max-width: 980px) { .hero-content, .content-grid { grid-template-columns: 1fr; } .hero-visual { min-height: 280px; } }
@media (max-width: 720px) {
  .page-shell { width: min(100% - 20px, 1240px); padding-top: 10px; }
  .topbar, .topbar-actions, .section-head, .flight-top { flex-direction: column; align-items: start; }
  .hero-stats, .flight-times, .tracker-stats, .analysis-grid { grid-template-columns: 1fr; }
  .route-switcher { width: 100%; }
  .route-tab { flex: 1; }
}
