/* ==========================================================================
   Eagle Dynamix — shared stylesheet
   ========================================================================== */

:root {
  --void:        #05070f;
  --deep:        #0a0f1f;
  --panel:       #111829;
  --panel-2:     #161f34;
  --line:        #223050;
  --ink:         #eef2fb;
  --ink-dim:     #a3b0cc;
  --ink-faint:   #6f7d9c;
  --gold:        #e8b44a;
  --gold-soft:   #f5d089;
  --cyan:        #4fd1e0;
  --ember:       #ff6b4a;
  --shadow:      0 18px 50px rgba(0, 0, 0, .55);
  --radius:      14px;
  --wrap:        1180px;
  --ease:        cubic-bezier(.22, .8, .3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font: 400 17px/1.65 "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5.5vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--gold); }

img { max-width: 100%; display: block; }

.wrap {
  width: min(var(--wrap), 100% - 3rem);
  margin-inline: auto;
}

.eyebrow {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.lede {
  font-size: 1.18rem;
  color: var(--ink-dim);
  max-width: 62ch;
}

.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* ---------- Starfield ---------------------------------------------------- */

#starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
}

.nebula {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 78% -8%, rgba(79, 209, 224, .13), transparent 65%),
    radial-gradient(50rem 38rem at 12% 8%, rgba(232, 180, 74, .10), transparent 62%),
    radial-gradient(70rem 50rem at 50% 108%, rgba(96, 84, 220, .16), transparent 68%);
}

/* ---------- Header ------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 7, 15, .72);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: 1.12rem;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand span small {
  display: block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: .5rem .8rem;
  border-radius: 8px;
  color: var(--ink-dim);
  font-size: .95rem;
  font-weight: 500;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.nav-links a[aria-current="page"] { color: var(--gold); }

/* The button in the nav must keep its own ink — .nav-links a would otherwise
   win on specificity and wash the label out against the gold fill. */
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover,
.nav-links a.btn-primary[aria-current="page"] {
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), #d99b2e);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .45rem .6rem;
  color: var(--ink);
  cursor: pointer;
}

/* ---------- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .97rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              background .18s var(--ease), border-color .18s var(--ease);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #d99b2e);
  color: #1a1204;
  box-shadow: 0 10px 30px rgba(232, 180, 74, .22);
}
.btn-primary:hover {
  color: #1a1204;
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(232, 180, 74, .32);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, .03);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2rem;
}

/* ---------- Sections ----------------------------------------------------- */

section { padding: 5.5rem 0; }

.section-head { max-width: 65ch; margin-bottom: 3rem; }

.hero {
  padding: 7rem 0 6rem;
  min-height: 82vh;
  display: flex;
  align-items: center;
}

.hero h1 span {
  background: linear-gradient(100deg, var(--gold-soft), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede { font-size: 1.28rem; }

/* ---------- Cards / grids ------------------------------------------------ */

.grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--deep));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.9rem;
  transition: transform .25s var(--ease), border-color .25s var(--ease),
              box-shadow .25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 209, 224, .45);
  box-shadow: var(--shadow);
}

.card .icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(232, 180, 74, .12);
  border: 1px solid rgba(232, 180, 74, .28);
  margin-bottom: 1.1rem;
  font-size: 1.35rem;
}

.card p:last-child { margin-bottom: 0; color: var(--ink-dim); font-size: .97rem; }

/* ---------- Stats -------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat { background: var(--deep); padding: 1.8rem 1.4rem; text-align: center; }
.stat b {
  display: block;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--gold);
}
.stat span {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Page banner -------------------------------------------------- */

.page-banner {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--line);
}

/* ---------- Fun facts ---------------------------------------------------- */

.fact-hero {
  background: linear-gradient(150deg, rgba(79, 209, 224, .1), rgba(232, 180, 74, .07));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  text-align: center;
}

#fact-text {
  font-size: clamp(1.2rem, 2.6vw, 1.75rem);
  font-weight: 600;
  line-height: 1.45;
  min-height: 4.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 46ch;
  margin: 0 auto 1.6rem;
  transition: opacity .25s var(--ease);
}
#fact-text.fading { opacity: 0; }

.fact-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}

.fact-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  font-size: .98rem;
  color: var(--ink-dim);
}
.fact-list li b { color: var(--ink); display: block; margin-bottom: .3rem; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.chip {
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--cyan); }
.chip.active { background: var(--gold); border-color: var(--gold); color: #1a1204; font-weight: 600; }

/* ---------- Weather ------------------------------------------------------ */

.wx-now {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 1.4fr;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(140deg, var(--panel-2), var(--deep));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.4rem;
}

.wx-temp {
  font-size: clamp(3.6rem, 10vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--gold);
}
.wx-icon { font-size: 3.4rem; line-height: 1; margin-bottom: .5rem; }
.wx-cond { font-size: 1.15rem; color: var(--ink); font-weight: 600; }
.wx-place { color: var(--ink-faint); font-size: .9rem; }

/* Cell separators are drawn as borders rather than grid gaps, so a partly
   filled last row does not leave a slab of the gap colour showing. */
.wx-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.wx-metrics div {
  padding: .9rem 1rem;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.wx-metrics dt {
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .3rem;
}
.wx-metrics dd { margin: 0; font-size: 1.2rem; font-weight: 600; line-height: 1.2; }

.wx-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}
.wx-day {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem .8rem;
  text-align: center;
}
.wx-day b { display: block; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.wx-day .g { font-size: 2rem; margin: .5rem 0; }
.wx-day .hi { font-weight: 700; }
.wx-day .lo { color: var(--ink-faint); }

.wx-sky {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.4rem;
}

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--ember);
  background: var(--panel);
  border-radius: 10px;
  padding: 1rem 1.3rem;
  color: var(--ink-dim);
  font-size: .95rem;
}

.skeleton { color: var(--ink-faint); }

/* ---------- Table -------------------------------------------------------- */

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: .96rem;
}
th, td {
  text-align: left;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
td { color: var(--ink-dim); }
td:first-child { color: var(--ink); font-weight: 600; }

/* ---------- CTA / footer ------------------------------------------------- */

.cta {
  background: linear-gradient(140deg, rgba(232, 180, 74, .12), rgba(79, 209, 224, .08));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3.5rem 2.5rem;
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--deep);
  padding: 3.5rem 0 2rem;
  font-size: .93rem;
  color: var(--ink-faint);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-grid h4 {
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid a { color: var(--ink-faint); }
.footer-grid a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

/* ---------- Trackers (flights / orbit) ----------------------------------- */

.tracker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.4rem;
  align-items: start;
}

.map-shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #070c1a;
}

canvas.map {
  display: block;
  width: 100%;
  height: clamp(380px, 60vh, 660px);
  touch-action: none;
}

.map-legend {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  padding: .6rem .9rem;
  border-radius: 10px;
  background: rgba(5, 7, 15, .78);
  border: 1px solid var(--line);
  font-size: .78rem;
  color: var(--ink-dim);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.map-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: .35rem;
  vertical-align: -1px;
}

.map-hint {
  position: absolute;
  right: 1rem;
  top: 1rem;
  padding: .4rem .75rem;
  border-radius: 8px;
  background: rgba(5, 7, 15, .78);
  border: 1px solid var(--line);
  font-size: .75rem;
  color: var(--ink-faint);
  pointer-events: none;
}

.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.search-input {
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .55rem 1.1rem;
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  min-width: 220px;
}
.search-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(79, 209, 224, .15);
}

.side-stack { display: grid; gap: 1.2rem; }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.mini-stats div { background: var(--deep); padding: .9rem .6rem; text-align: center; }
.mini-stats b { display: block; font-size: 1.35rem; font-weight: 700; color: var(--gold); letter-spacing: -.02em; }
.mini-stats span { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }

.data-table tbody tr { cursor: pointer; transition: background .15s var(--ease); }
.data-table tbody tr:hover { background: rgba(79, 209, 224, .07); }

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

/* ---------- Reveal animation --------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive --------------------------------------------------- */

/* Nine nav items need real room; collapse to the menu button well before the
   bar would start colliding with the wordmark. */
@media (max-width: 1120px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--deep);
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.5rem 1.2rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .8rem .4rem; }
  .nav-links a.btn-primary { text-align: center; margin-top: .4rem; }
}

@media (max-width: 860px) {
  .wx-now { grid-template-columns: 1fr; text-align: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  section { padding: 4rem 0; }
  .hero { padding: 4.5rem 0; min-height: 0; }
  .fact-hero, .cta { padding: 2.2rem 1.4rem; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .wrap { width: min(var(--wrap), 100% - 2rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
