/* ============================================================
   AstroLAB design system
   Clean cosmic foundation for all new pages.
   ============================================================ */

:root {
  --bg:        #0a0f1a;
  --bg-2:      #0d1521;
  --panel:     rgba(255,255,255,.045);
  --panel-2:   rgba(255,255,255,.07);
  --border:    rgba(255,255,255,.11);
  --border-2:  rgba(255,255,255,.18);
  --text:      rgba(255,255,255,.95);
  --muted:     rgba(255,255,255,.60);
  --faint:     rgba(255,255,255,.38);
  --accent:    #8b5cf6;
  --accent-2:  #a78bfa;
  --brand:     #ff6030;   /* logo nebula orange — secondary accent */
  --brand-2:   #e6237a;   /* logo nebula pink */
  --cool:      #38bdf8;
  --warm:      #fb923c;
  --good:      #34d399;
  --radius:    16px;
  --radius-sm: 10px;
  --maxw:      1180px;
  --shadow:    0 10px 40px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ---- Native dropdowns ----
   These pages are dark-only, so tell the UA to render <select> controls and
   their popup lists dark. color-scheme handles the closed control + popup;
   the explicit option/optgroup colors cover browsers that don't fully honor
   color-scheme on the popup. Applies to every <select> (telescope star/target,
   observatory & messier sort, eyepiece tool, admin/capture) — no class needed. */
select { color-scheme: dark; }
select option,
select optgroup {
  background-color: var(--bg-2);
  color: var(--text);
}

/* ---- Starfield backdrop ---- */
body {
  background:
    radial-gradient(1200px 700px at 75% -10%, rgba(139,92,246,.18), transparent 60%),
    radial-gradient(900px 600px at 10% 0%, rgba(56,189,248,.10), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
  min-height: 100vh;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,.9), transparent),
    radial-gradient(1.5px 1.5px at 130px 80px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 220px 160px, rgba(255,255,255,.8), transparent),
    radial-gradient(1.5px 1.5px at 320px 40px, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 400px 220px, rgba(255,255,255,.75), transparent),
    radial-gradient(1px 1px at 90px 250px, rgba(255,255,255,.6), transparent);
  background-repeat: repeat;
  background-size: 450px 300px;
  opacity: .5;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* ============================================================
   Topbar
   ============================================================ */
/* Skip link — positioned off-screen until focused, then a normal visible
   control. Moved rather than hidden with `display:none`, which would take it
   out of the tab order and defeat the point. */
.astro-skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  text-decoration: none;
}
.astro-skip:focus { left: 0; outline: 2px solid #fff; outline-offset: -4px; }
/* The jump target must not draw a focus ring of its own — it isn't a control. */
#main:focus { outline: none; }

.astro-topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,15,26,.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
/* Brand pinned left (col 1), nav centered (col 2), right column balances it. */
.astro-topbar .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; min-height: 60px; padding: 7px 0; }
.astro-brand { justify-self: start; }

.astro-brand { display: flex; align-items: center; }
.astro-brand img { height: 40px; width: auto; display: block; transition: filter .2s, transform .2s; }
.astro-brand:hover img { filter: drop-shadow(0 0 10px rgba(155,53,232,.55)); transform: translateY(-1px); }

.astro-nav { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.astro-nav-row { display: flex; gap: 5px; }
.astro-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--muted); transition: .15s; white-space: nowrap; border: 1px solid transparent;
}
.astro-nav a .ico { font-size: 14px; }
.astro-nav a:hover { color: var(--text); background: var(--panel-2); border-color: var(--border); }
.astro-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(139,92,246,.30), rgba(56,189,248,.18)); border-color: var(--border-2); }
.astro-nav a .soon { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent-2); border: 1px solid var(--border-2); border-radius: 6px; padding: 1px 4px; }

/* Opt-in global mount-status badge (injected by astro-shell.js, hidden until a
   reachable bridge is detected). Mirrors the Telescope page's badge palette. */
.astro-bridge-badge { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; margin-left: 10px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); background: var(--panel); color: var(--muted); white-space: nowrap; transition: .2s; }
.astro-bridge-badge .abb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.astro-bridge-badge.ok   { color: #d1fae5; border-color: rgba(52,211,153,.5); background: rgba(52,211,153,.12); }
.astro-bridge-badge.ok   .abb-dot { background: var(--good); box-shadow: 0 0 9px rgba(52,211,153,.8); }
.astro-bridge-badge.sim  { color: #cffafe; border-color: rgba(56,189,248,.5); background: rgba(56,189,248,.12); }
.astro-bridge-badge.sim  .abb-dot { background: var(--cool); box-shadow: 0 0 9px rgba(56,189,248,.8); }
.astro-bridge-badge.warn { color: #fde68a; border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.12); }
.astro-bridge-badge.warn .abb-dot { background: #fbbf24; box-shadow: 0 0 9px rgba(251,191,36,.8); }
.astro-bridge-badge.busy .abb-dot { animation: abbPulse 1s ease-in-out infinite; }
@keyframes abbPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-width: 600px) { .astro-bridge-badge .abb-text { display: none; } .astro-bridge-badge { padding: 6px; } }

.astro-burger { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 38px; cursor: pointer; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.astro-burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

@media (max-width: 820px) {
  .astro-topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0; }
  .astro-brand img { height: 34px; }
  .astro-burger { display: flex; }
  .astro-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 20px 16px;
    background: rgba(10,15,26,.96); border-bottom: 1px solid var(--border);
    display: none;
  }
  .astro-nav.open { display: flex; }
  .astro-nav-row { display: contents; }   /* flatten both rows into one stacked list */
  .astro-nav a { width: 100%; justify-content: flex-start; padding: 12px 14px; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding: 52px 0 30px; text-align: center; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: -30px; transform: translateX(-50%);
  width: 620px; height: 360px; max-width: 92vw; z-index: -1; pointer-events: none; filter: blur(6px);
  background: radial-gradient(ellipse at center, rgba(155,53,232,.20), rgba(230,35,122,.10) 45%, rgba(255,96,48,.06) 68%, transparent 74%);
}
.hero-mark { width: 78px; height: 78px; display: block; margin: 0 auto 16px; filter: drop-shadow(0 8px 26px rgba(155,53,232,.5)); }
.hero .eyebrow { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--brand); font-weight: 700; }
.hero h1 { font-size: clamp(38px, 7vw, 72px); margin: 14px 0 10px; line-height: 1.02; font-weight: 800;
  background: linear-gradient(180deg, #fff, #c7d2fe 70%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lede { font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); max-width: 620px; margin: 0 auto; }

.tonight-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px auto 0; max-width: 760px;
}
.tonight-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 16px; font-size: 14px; color: var(--text);
}
.tonight-chip .k { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.tonight-chip .v { font-weight: 700; }

/* ============================================================
   Sections + cards
   ============================================================ */
.section { margin: 46px 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 18px; }
.section-head h2 { font-size: 22px; margin: 0; font-weight: 750; }
.section-head .meta { font-size: 12.5px; color: var(--faint); margin-left: auto; }
.section-head .all { font-size: 13px; color: var(--accent-2); font-weight: 600; }

.grid { display: grid; gap: 14px; }
.grid.cards-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.cards-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; transition: .16s; position: relative; overflow: hidden;
}
.card.link { cursor: pointer; }
.card.link:hover { transform: translateY(-3px); border-color: var(--border-2); background: var(--panel-2); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; font-size: 15.5px; line-height: 1.3; font-weight: 650; }
.card .sub { font-size: 12.5px; color: var(--muted); }
.card .desc { font-size: 13px; color: var(--muted); margin-top: 8px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; }
.pill.go   { background: rgba(52,211,153,.16); color: var(--good); }
.pill.tbd  { background: rgba(251,146,60,.16); color: var(--warm); }
.pill.cool { background: rgba(56,189,248,.16); color: var(--cool); }
.pill.accent { background: rgba(139,92,246,.18); color: var(--accent-2); }
.pill.bad  { background: rgba(248,113,113,.16); color: #f87171; }

.card .countdown { font-variant-numeric: tabular-nums; font-weight: 750; color: #fff; }

/* event type accent stripe */
.card.evt::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.card.evt.eclipse::before { background: linear-gradient(var(--accent), var(--cool)); }
.card.evt.meteor::before  { background: linear-gradient(var(--warm), #ef4444); }
.card.evt.planet::before  { background: linear-gradient(var(--good), var(--cool)); }
.card.evt { padding-left: 20px; }

.launch-row { display: flex; gap: 13px; align-items: flex-start; }
.launch-thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; flex: 0 0 auto; background: var(--panel-2); border: 1px solid var(--border); }
.launch-site { margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.launch-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.launch-line { margin-top: 6px; }
.launch-cust { color: var(--faint); text-transform: uppercase; letter-spacing: .3px; font-size: 11px; font-weight: 700; margin-right: 4px; }
.card a.ext { color: var(--cool); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; opacity: .82; transition: opacity .15s; }
.card a.ext:hover { opacity: 1; }
.card a.ext.watch { color: var(--good); font-weight: 700; }

/* Upcoming / Recent segmented toggle */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; }
.seg-btn { appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 650; padding: 5px 15px; border-radius: 999px; cursor: pointer; transition: .15s; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { color: #fff; background: linear-gradient(90deg, rgba(139,92,246,.34), rgba(56,189,248,.20)); }

/* Sort + filter bar */
.launch-filters { margin: 0 0 18px; }
.lf-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lf-search { flex: 1 1 220px; min-width: 170px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; color: var(--text); font: inherit; font-size: 13px; padding: 8px 15px; }
.lf-search::placeholder { color: var(--faint); }
.lf-search:focus, .lf-select:focus { outline: none; border-color: var(--accent-2); }
.lf-select { background: var(--panel); border: 1px solid var(--border); border-radius: 999px; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; padding: 8px 13px; cursor: pointer; max-width: 200px; }
.lf-select option { background: #11182b; color: var(--text); }
.lf-clear { background: none; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 650; padding: 8px 15px; cursor: pointer; transition: .15s; }
.lf-clear:hover { color: #fff; border-color: var(--border-2); background: var(--panel-2); }

/* "Load more" past launches */
.launch-more { display: flex; justify-content: center; margin-top: 20px; }
.btn-more { appearance: none; font: inherit; font-size: 13px; font-weight: 650; color: var(--accent-2); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 9px 22px; cursor: pointer; transition: .15s; }
.btn-more:hover { background: var(--panel-2); border-color: var(--border-2); color: #fff; }
.btn-more:disabled { opacity: .55; cursor: default; }

/* ============================================================
   Calendar
   ============================================================ */
.cal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); padding-bottom: 4px; }
.cal-cell { min-height: 88px; border-radius: 9px; border: 1px solid transparent; padding: 6px; font-size: 12px; color: var(--muted); position: relative; display: flex; flex-direction: column; }
.cal-cell.in { border-color: var(--border); background: rgba(255,255,255,.02); }
.cal-cell.today { border-color: var(--accent); background: rgba(139,92,246,.12); color: #fff; }
.cal-cell .num { font-weight: 600; }
.cal-evts { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.cal-evt { display: block; font-size: 10px; line-height: 1.3; padding: 2px 5px; border-radius: 5px; background: rgba(139,92,246,.18); border: 1px solid var(--border); color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-evt:hover { background: rgba(139,92,246,.34); }
.cal-evt.meteor { background: rgba(251,146,60,.18); }
.cal-evt.eclipse { background: rgba(139,92,246,.22); }
.cal-evt.planet { background: rgba(52,211,153,.18); }
.cal-evt.external { background: rgba(56,189,248,.16); }
.cal-evt.more { background: transparent; border: none; color: var(--faint); font-weight: 600; padding: 1px 5px; }
@media (max-width: 560px) { .cal-cell { min-height: 60px; font-size: 10px; padding: 4px; } .cal-evt { font-size: 9px; } }

/* ============================================================
   States
   ============================================================ */
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 18px; grid-column: 1 / -1; }
.spinner { width: 16px; height: 16px; border-radius: 50%; animation: spin .8s linear infinite;
  background: conic-gradient(from 0deg, transparent 0%, var(--brand-2) 35%, var(--accent) 65%, var(--brand) 100%);
  -webkit-mask: radial-gradient(closest-side, transparent 58%, #000 60%);
  mask: radial-gradient(closest-side, transparent 58%, #000 60%); }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--faint); font-size: 14px; padding: 18px; grid-column: 1 / -1; }

/* ============================================================
   Footer
   ============================================================ */
.astro-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 28px 0 40px; }
.astro-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; color: var(--faint); font-size: 13px; }
.astro-footer a { color: var(--muted); }
.astro-footer a:hover { color: var(--text); }
.astro-footer .links { display: flex; gap: 16px; flex-wrap: wrap; }
.astro-foot-brand { display: flex; align-items: center; gap: 12px; }
.astro-foot-brand img { height: 30px; width: auto; display: block; opacity: .92; }

/* ---- Branded 404 ---- */
.nf-wrap { text-align: center; max-width: 620px; margin: 0 auto; padding: 56px 0 50px; }
.nf-mark { width: 96px; height: 96px; display: block; margin: 0 auto 22px; filter: drop-shadow(0 8px 30px rgba(155,53,232,.5)); }
.nf-code { font-family: Georgia, 'Times New Roman', serif; font-size: 64px; font-weight: 800; line-height: 1; background: linear-gradient(90deg, var(--brand-2), var(--accent) 55%, var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf-title { font-size: 26px; margin: 8px 0 10px; }
.nf-text { color: var(--muted); font-size: 15px; line-height: 1.6; }
.nf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.nf-btn { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 650; font-size: 14px; transition: .15s; }
.nf-btn:hover { background: var(--panel-2); border-color: var(--border-2); }
.nf-btn.primary { background: linear-gradient(90deg, rgba(155,53,232,.32), rgba(255,96,48,.22)); border-color: var(--border-2); color: #fff; }

/* page stub */
.stub { text-align: center; padding: 80px 0; }
.stub .big { font-size: 64px; }
.stub h1 { font-size: 34px; margin: 16px 0 8px; }
.stub p { color: var(--muted); max-width: 520px; margin: 0 auto; }

/* prose / legal pages */
.page-title { padding: 44px 0 4px; }
.page-title h1 { font-size: 34px; margin: 0 0 6px; font-weight: 800; }
.page-title .sub { color: var(--faint); font-size: 13px; }
.legal { margin: 18px 0; }
.legal h2 { font-size: 18px; margin: 24px 0 6px; font-weight: 700; }
.legal h2:first-child { margin-top: 4px; }
.legal p { color: var(--muted); font-size: 14.5px; margin: 0; }
.legal a { color: var(--accent-2); }
.legal code { background: rgba(255,255,255,.07); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; color: var(--accent-2); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---- shared "pop out" overlay for maps/graphics (assets/astro-expand.js) ---- */
.astro-expand-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: rgba(12,16,26,.9); color: var(--text); font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .15s; flex: 0 0 auto; }
.astro-expand-btn:hover { background: var(--panel-2); border-color: var(--border-2); }
/* The trigger button is hidden (via the `hidden` attribute) while its panel
   is expanded — without this, our own `display: flex` above outranks the
   browser's default [hidden]{display:none} at equal specificity and the
   button stays visible. */
.astro-expand-btn[hidden] { display: none; }
.astro-push-right { margin-left: auto; }
.astro-expand-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(4,7,14,.86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; }
.astro-expand-sheet { width: 100%; height: 100%; max-width: 1400px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
/* A dedicated header row (rather than floating the close button over the
   content) so it never overlaps a panel's own top-corner controls, e.g.
   the NEO map's zoom/rotate buttons. */
.astro-expand-head { flex: 0 0 auto; display: flex; justify-content: flex-end; padding: 8px 10px; }
.astro-expand-body { flex: 1; min-width: 0; min-height: 0; display: flex; }
.astro-expand-body > * { flex: 1; min-width: 0; min-height: 0; }
.astro-expand-close { width: 34px; height: 34px; border-radius: 50%; background: rgba(10,15,26,.7); border: 1px solid var(--border-2); color: var(--text); cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.astro-expand-close:hover { background: rgba(139,92,246,.4); }
body.astro-expand-lock { overflow: hidden; }
@media (max-width: 640px) {
  /* No spare chrome to give up on a phone screen — go straight to true
     fullscreen instead of a smaller floating modal. */
  .astro-expand-overlay { padding: 0; }
  .astro-expand-sheet { max-width: none; border-radius: 0; }
  .astro-expand-body { overflow-y: auto; }
  /* Bigger touch targets than the desktop 28px corner buttons. */
  .astro-expand-btn { width: 34px; height: 34px; font-size: 16px; }
  .astro-expand-close { width: 40px; height: 40px; font-size: 17px; }
}
