/* Shared marketing-site chrome (top nav + footer + content pages).
   Served from /landing/ (bulk-copied by the Dockerfile) so every non-map
   page can link it with no extra nginx/Docker wiring. Existing pages
   (landing/privacy/terms) keep their own inline CSS for page bodies and
   only borrow the .site-nav / .site-footer classes here. */

:root {
  --bg: #0D1117;
  --surface: #161B22;
  --border: #30363D;
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --accent: #58A6FF;
  --accent-hover: #79B8FF;
}

/* ── Top nav (all non-map pages) ─────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(13, 17, 23, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}
.site-nav .brand img { height: 24px; width: 24px; }
.site-nav .nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;
}
.site-nav .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
/* CTA label swaps to the short form on very narrow screens (see media query). */
.site-nav .nav-cta .cta-mini { display: none; }
.site-nav .nav-links a:hover { color: var(--text-primary); }
.site-nav .nav-cta {
  /* White on accent in every link state — `:visited` was rendering the label
     in the default blue, i.e. blue-on-blue on the accent pill. */
  color: #fff !important;
  background: var(--accent);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  /* Keep "Open the Chart" on one line and let the pill size to its label
     instead of wrapping when the nav gets tight. */
  display: inline-block;
  white-space: nowrap;
  flex: 0 0 auto;
}
.site-nav .nav-cta:link,
.site-nav .nav-cta:visited,
.site-nav .nav-cta:hover,
.site-nav .nav-cta:active { color: #fff !important; }
.site-nav .nav-cta:hover { background: var(--accent-hover); }
/* Keep the whole header on ONE line as the screen narrows — shrink fonts +
   gaps rather than wrapping. */
@media (max-width: 540px) {
  .site-nav { padding: 10px 12px; gap: 8px; }
  .site-nav .brand { font-size: 14px; gap: 6px; }
  .site-nav .brand img { height: 20px; width: 20px; }
  .site-nav .nav-links { gap: 12px; }
  .site-nav .nav-links a { font-size: 13px; }
  .site-nav .nav-cta { padding: 7px 12px; }
}
@media (max-width: 430px) {
  .site-nav { padding: 9px 10px; gap: 6px; }
  .site-nav .brand { font-size: 13px; }
  .site-nav .nav-links { gap: 9px; }
  .site-nav .nav-links a { font-size: 12px; }
  .site-nav .nav-cta { padding: 6px 10px; font-size: 13px; }
  /* Shorten "Open the Chart" → "Open" so the row still fits. */
  .site-nav .nav-cta .cta-full { display: none; }
  .site-nav .nav-cta .cta-mini { display: inline; }
}

/* ── Content page shell (about / features / contact) ─────────────────── */
.site-body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.65;
}
.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
/* Features page needs room for legible map imagery — widen the column so the
   3-up grid gives ~360px cards instead of cramped 220px thumbnails. */
.page.page-wide { max-width: 1160px; }
.page.page-wide .lede { max-width: 640px; }
.page h1 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 8px;
}
.page .lede {
  color: var(--text-secondary);
  font-size: 18px;
  margin: 0 0 36px;
}
.page h2 {
  font-size: 22px;
  margin: 40px 0 12px;
}
.page h3 {
  font-size: 17px;
  margin: 24px 0 6px;
}
.page p { margin: 0 0 16px; color: var(--text-primary); }
.page .tagline {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: .02em;
  margin: -26px 0 36px;
}
.feature-card .label {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin: 10px 0 0;
}
.feature-card .label + h3 { margin-top: 2px; }
.page a { color: var(--accent); text-decoration: none; }
.page a:hover { text-decoration: underline; }

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin: 28px 0;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.feature-card .ico { font-size: 28px; }
/* Screenshot / video capture at the top of a feature card. Drop a file at
   the referenced path (img or <video autoplay muted loop playsinline>); until
   then the emoji fallback shows. 1:1 SQUARE crop of the map area — media is
   captured square so object-fit:cover never side-crops the feature. */
.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  margin: -4px 0 12px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media img,
.card-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}
.card-media .media-fallback { font-size: 36px; opacity: .45; }
/* Cards with no screenshot/video (solunar, waypoints, offline, best-data):
   an empty bordered box reads as a broken image. Give them an intentional
   gradient tile with a prominent, fully-opaque glyph instead. */
.card-media--icon {
  background: linear-gradient(135deg, #18242f 0%, #0d1117 100%);
}
.card-media--icon .media-fallback { font-size: 56px; opacity: .85; }
.feature-card h3 { margin: 10px 0 6px; font-size: 17px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; margin: 0; }

/* Contact card */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin: 28px 0;
}
.contact-card .email {
  display: inline-block;
  margin: 6px 0 18px;
  font-size: 20px;
  font-weight: 600;
}
.btn-primary {
  display: inline-block;
  background: var(--accent);
  /* !important so the white label beats the `.page a` accent color (higher
     specificity) — otherwise it's blue text on the blue button. */
  color: #fff !important;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}
.btn-primary:link,
.btn-primary:visited,
.btn-primary:hover,
.btn-primary:active { color: #fff !important; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }

/* ── Traditional footer (content + legal pages) ──────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .sep { opacity: 0.6; margin: 0 6px; }
