/*
  Global shell — design tokens, conflict fixes, mobile menu, worldwide footer
  Load last among SR custom CSS.
*/

:root {
  --sr-nav-h: 4.25rem;
  --sr-trust-h: 1.85rem;
  --sr-header-total: calc(var(--sr-nav-h) + var(--sr-trust-h) + env(safe-area-inset-top, 0px));
  --sr-cyan: #38bdf8;
  --sr-gold: #fbbf24;
  --sr-ink: #030712;
  --sr-glass: rgba(3, 7, 18, 0.88);
  --sr-border: rgba(255, 255, 255, 0.08);
  --sr-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 1023px) {
  :root {
    --sr-trust-h: 0px;
    --sr-header-total: calc(var(--sr-nav-h) + env(safe-area-inset-top, 0px));
  }
}

/* Fix legacy shell conflicts */
.sr-site .nav-glass .brand-caption,
.sr-site .nav-glass .brand-subcopy {
  display: none !important;
}

.sr-site .nav-glass .sr-brand-kicker {
  display: block !important;
}

.sr-site .nav-glass .sr-brand-tagline {
  display: none !important;
}

@media (min-width: 1280px) {
  .sr-site .nav-glass .sr-brand-tagline {
    display: block !important;
  }
}

.sr-site #dashboard,
.sr-site #about,
.sr-site #guide,
.sr-site #search-guide,
.sr-site #spectrogram,
.sr-site #solar,
.sr-site .hero-stage {
  scroll-margin-top: calc(var(--sr-header-total) + 0.75rem) !important;
}

/* ── Mobile menu — global premium ── */
html body.sr-site .nav-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--sr-header-total) + 0.65rem) 0.85rem 1.25rem;
  background: rgba(2, 6, 16, 0.82) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s var(--sr-ease), visibility 0.32s;
}

html body.sr-site .nav-mobile-overlay.active,
html body.sr-site .nav-mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html body.sr-site .nav-mobile-menu {
  width: min(100%, 26rem);
  max-height: calc(100dvh - var(--sr-header-total) - 1.5rem);
  overflow: auto;
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45) !important;
  padding: 0.85rem !important;
}

html body.sr-site .sr-mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem 0.85rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

html body.sr-site .sr-mobile-brand .sr-brand-icon-wrap {
  width: 2.75rem;
  height: 2.75rem;
}

html body.sr-site .nav-mobile-links {
  display: grid;
  gap: 0.35rem;
}

html body.sr-site .nav-mobile-link {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem !important;
  border-radius: 0.65rem !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: rgba(226, 232, 240, 0.88) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

html body.sr-site .nav-mobile-link:hover,
html body.sr-site .nav-mobile-link.active {
  color: #f8fafc !important;
  background: rgba(14, 165, 233, 0.14) !important;
  border-color: rgba(56, 189, 248, 0.28) !important;
}

html body.sr-site .nav-mobile-link.star-link {
  color: #fde68a !important;
  background: rgba(251, 191, 36, 0.08) !important;
  border-color: rgba(251, 191, 36, 0.2) !important;
}

html body.sr-site .nav-mobile-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── Partner badges ── */
.sr-partner-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.sr-partner-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 0.55rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, 0.9);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none !important;
  transition: border-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.sr-partner-badge:hover {
  color: #f8fafc;
  border-color: rgba(56, 189, 248, 0.28);
  transform: translateY(-1px);
}

/* Language pills — footer only (sr-footer-premium.css owns layout) */

html[dir="rtl"] footer.footer-premium .footer-premium-col a:hover {
  transform: translateX(-4px);
}

@media (prefers-reduced-motion: reduce) {
  html body.sr-site .nav-mobile-overlay {
    transition: none;
  }
}
