/* =========================================================================
   HELIOS DYNAMICS — INSTITUTIONAL SCIENTIFIC DESIGN SYSTEM
   Theme: High-Credibility, Professional UK Research Organisation
   Palette:
   - Deep Atmospheric Blue: #071326
   - Navy Surface: #0B1D3A
   - Card Navy: #0E2448
   - Clean Accent Cyan: #00A8E8
   - Solar Gold: #E5B232
   - Magnetosphere Violet: #6355DE
   - Severe Alert: #E63946
   - Neutral Slate: #F1F5F9 (Text Primary), #94A3B8 (Text Secondary), #475569 (Muted)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-space: #040A14;
  --bg-primary: #071326;
  --bg-surface: #0B1D3A;
  --bg-card: rgba(14, 36, 72, 0.7);
  --bg-card-solid: #0E2448;
  --bg-card-hover: rgba(18, 46, 92, 0.85);

  --accent-cyan: #00A8E8;
  --accent-cyan-subtle: rgba(0, 168, 232, 0.12);
  --solar-gold: #E5B232;
  --solar-gold-subtle: rgba(229, 178, 50, 0.12);
  --mag-violet: #6355DE;
  --mag-violet-subtle: rgba(99, 85, 222, 0.12);
  --alert-red: #E63946;
  --alert-red-subtle: rgba(230, 57, 70, 0.12);
  --status-green: #10B981;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 168, 232, 0.35);
  --border-card: rgba(0, 168, 232, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-cyan: 0 0 24px rgba(0, 168, 232, 0.2);

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-space);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #0B1D3A 0%, #040A14 65%);
}

.main-content {
  flex: 1;
  padding-top: 80px; /* offset fixed header */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-muted);
}

.mono {
  font-family: var(--font-mono);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
  position: relative;
}

.section-header {
  margin-bottom: 48px;
}

.section-header.centered {
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 14px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Buttons & Links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #030811;
  box-shadow: var(--shadow-cyan);
}

.btn-primary:hover {
  background: #33BAEE;
  box-shadow: 0 0 30px rgba(0, 168, 232, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

/* Badges & Indicators */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-live {
  background: rgba(16, 185, 129, 0.12);
  color: var(--status-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cyan {
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 168, 232, 0.3);
}

.badge-gold {
  background: var(--solar-gold-subtle);
  color: var(--solar-gold);
  border: 1px solid rgba(229, 178, 50, 0.3);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse-live 2s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* =========================================================================
   TOPBAR NAVIGATION
   ========================================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(7, 19, 38, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  height: 80px;
  display: flex;
  align-items: center;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-main);
}

.logo-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0B1D3A, #071326);
  border: 1px solid rgba(0, 168, 232, 0.4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #FFFFFF;
}

.brand-title span {
  color: var(--accent-cyan);
}

.brand-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: #FFFFFF;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* =========================================================================
   PAGE HERO BANNERS (INTERNAL PAGES)
   ========================================================================= */
.page-banner {
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(11, 29, 58, 0.6) 0%, transparent 100%);
}

.banner-content {
  max-width: 820px;
}

.banner-title {
  font-size: 2.8rem;
  margin-bottom: 16px;
}

.banner-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* =========================================================================
   CARDS & GRIDS
   ========================================================================= */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 32px;
  backdrop-filter: blur(12px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 168, 232, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.card p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* =========================================================================
   SCIENTIFIC INSTRUMENT & TELEMETRY PANELS
   ========================================================================= */
.instrument-panel {
  background: #06101E;
  border: 1px solid rgba(0, 168, 232, 0.25);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(11, 29, 58, 0.8);
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #FFFFFF;
}

.panel-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 460px;
}

.panel-visual {
  padding: 24px;
  background: #03070E;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.panel-sidebar {
  padding: 24px;
  background: rgba(11, 29, 58, 0.35);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.metric-box {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.metric-box:last-child { border-bottom: none; }

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.metric-number {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFFFFF;
}

.metric-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.metric-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 3px;
}

/* =========================================================================
   TABLES & DATA LISTS (RESEARCH / DATASETS)
   ========================================================================= */
.data-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  padding: 16px 20px;
  background: rgba(11, 29, 58, 0.9);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* =========================================================================
   FORMS & INPUTS (CONTACT / ACCESS)
   ========================================================================= */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(0, 168, 232, 0.06);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.15);
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
  background: #030811;
  border-top: 1px solid var(--border-subtle);
  padding: 70px 0 36px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #FFFFFF;
  margin-bottom: 18px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 1024px) {
  .panel-body { grid-template-columns: 1fr; }
  .panel-sidebar { border-left: none; border-top: 1px solid var(--border-subtle); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-menu { display: none; }
  .mobile-toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .banner-title { font-size: 2.2rem; }
  .section-title { font-size: 1.85rem; }
}
