/* ═══════════════════════════════════════════════════
   LUMARA — Cosmic Design System (Dark Only)
   lumara-space.app
   ═══════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-void: #000000;
  --bg-panel: rgba(4, 4, 6, 0.88);
  --bg-card: #0A0A0E;
  --bg-card-hover: #121215;
  --border: #1A1A20;
  --border-light: #252530;

  --sun-glow: #FF9800;
  --sun-glow-soft: rgba(255, 152, 0, 0.15);
  --sun-glow-bright: rgba(255, 152, 0, 0.4);
  --moon-glow: #B0C4DE;
  --moon-glow-soft: rgba(176, 196, 222, 0.15);
  --moon-glow-bright: rgba(176, 196, 222, 0.4);

  --text-primary: #E8E8F0;
  --text-secondary: #9898A8;
  --text-tertiary: #686878;
  --green: #4CAF50;
  --red: #FF4444;
  --yellow: #FFD700;
  --cyan: #00BCD4;

  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --transition: 250ms ease;
  --transition-fast: 150ms ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text-primary);
  background: var(--bg-void);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sun-glow); text-decoration: none; transition: opacity var(--transition-fast); }
a:hover { opacity: 0.8; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ── Accessibility ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: 2px solid var(--sun-glow); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  #starfield-canvas, .preloader-ring { display: none; }
}
@media (prefers-contrast: more) {
  :root { --text-primary: #FFFFFF; --text-secondary: #CCCCCC; --border: #555555; }
}

/* ═══════════════════════════════════════════════════
   STARFIELD
   ═══════════════════════════════════════════════════ */
#starfield-css {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: var(--bg-void);
}
#starfield-css::before,
#starfield-css::after {
  content: ''; position: absolute; inset: 0;
}
/* Static deep stars generated via box-shadow (set by JS for random positions) */
#starfield-css::before { opacity: 0.8; }
#starfield-css::after { opacity: 0.5; }

#starfield-canvas {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
}

/* Nebula glow patches */
body::before {
  content: ''; position: fixed; z-index: 0; pointer-events: none;
  width: 600px; height: 600px; top: 10%; left: -5%;
  background: radial-gradient(ellipse, rgba(100, 50, 180, 0.04) 0%, transparent 70%);
  filter: blur(60px);
}
body::after {
  content: ''; position: fixed; z-index: 0; pointer-events: none;
  width: 500px; height: 500px; bottom: 5%; right: -5%;
  background: radial-gradient(ellipse, rgba(40, 80, 160, 0.04) 0%, transparent 70%);
  filter: blur(60px);
}

/* ═══════════════════════════════════════════════════
   PRELOADER
   ═══════════════════════════════════════════════════ */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-void);
  transition: opacity 0.6s ease;
}
#preloader.hidden { opacity: 0; pointer-events: none; }
.preloader-ring {
  width: 60px; height: 60px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top-color: var(--sun-glow);
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(255, 152, 0, 0.1);
}
.preloader-text {
  margin-top: 16px; font-size: 0.85rem; color: var(--text-tertiary);
  letter-spacing: 2px; text-transform: uppercase;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════ */
.nav-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 44px;
  background: rgba(6, 6, 10, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 152, 0, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 4px 24px rgba(0, 0, 0, 0.4);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-icon { border-radius: 6px; }
.nav-title {
  font-size: 0.85rem; font-weight: 200; letter-spacing: 6px;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(255, 152, 0, 0.15);
}
.mobile-tabs { display: none; }
.fullscreen-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  color: var(--text-tertiary); background: transparent;
  border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s ease;
}
.fullscreen-btn:hover {
  color: var(--text-primary); border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.04);
}
.fullscreen-btn.is-fullscreen .fs-icon-expand { display: none; }
.fullscreen-btn.is-fullscreen .fs-icon-compress { display: block !important; }
.nav-store-badges { display: flex; align-items: center; gap: 10px; }
.nav-play-badge { display: flex; align-items: center; transition: transform 0.2s ease; }
.nav-play-badge:hover { transform: scale(1.05); }
.nav-play-badge img { height: 36px; width: auto; }
.nav-app-store-link { display: flex; align-items: center; transition: transform 0.2s ease; opacity: 0.92; }
.nav-app-store-link:hover { transform: scale(1.05); opacity: 1; }
.nav-app-store-link img { height: 36px; width: auto; }

/* ═══════════════════════════════════════════════════
   WEATHER STRIP — compact bar under nav
   ═══════════════════════════════════════════════════ */
.weather-strip {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 16px;
  background: rgba(6, 6, 10, 0.92);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════
   DASHBOARD — 2x2 viewport-filling grid
   ═══════════════════════════════════════════════════ */
.dashboard {
  position: relative; z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  padding: 44px 0 0; /* nav only */
  height: 100vh;
  width: 100%;
}

/* ── Cells — each quadrant fills its space ── */
.dash-cell {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
  text-align: center;
  padding: 8px;
  cursor: pointer;
}

.cell-title {
  font-size: 0.6rem; font-weight: 300; letter-spacing: 4px; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 4px;
  position: relative; z-index: 2;
}
.sun-accent { color: var(--sun-glow); }
.moon-accent { color: var(--moon-glow); }

/* ── Sun cell — wavelength rail on the LEFT, resolution row at bottom ── */
.dash-sun .sdo-viewer { padding-left: 130px; padding-right: 16px; }
.dash-sun .wavelength-row {
  position: absolute; top: 38px; bottom: 40px; left: 8px; width: 116px;
  flex-direction: column; flex-wrap: nowrap; justify-content: flex-start;
  align-items: stretch; gap: 4px; padding: 0; overflow-y: auto;
  z-index: 3;
}
.dash-sun .wave-pill { text-align: center; padding: 5px 8px; }
.dash-sun .resolution-row {
  /* Pinned to the top-right corner so it never collides with the
     "Chromosphere" wavelength label below the sun disk. */
  position: absolute; top: 10px; right: 12px; z-index: 3;
  margin: 0; gap: 6px;
}
.dash-sun .resolution-label { display: none; }
.dash-sun .res-btn {
  font-size: 0.6rem; padding: 2px 8px;
  background: rgba(10, 10, 15, 0.6); backdrop-filter: blur(4px);
}

/* ── Moon cell — data hidden by default, shown when maximized ── */
.dash-moon .lunar-data {
  position: absolute; bottom: 32px; left: 12px; right: 12px; z-index: 3;
  display: none; grid-template-columns: 1fr 1fr; gap: 1px 16px;
  background: rgba(0, 0, 0, 0.55); border-radius: 8px; padding: 6px 12px;
}
.dash-moon .city-selector {
  position: absolute; bottom: 8px; left: 12px; right: 12px; z-index: 3;
  display: none;
}

/* ── Solar video cell — toggle overlay ── */
.dash-solar-vid .video-mode-toggle {
  position: absolute; top: 4px; left: 0; right: 0; z-index: 5;
}
/* When Daily Timelapse mode is active, the wavelength pills appear under
   the toggle. Lift them above the cell-click-overlay (which sits at z-index 2)
   so the buttons are actually clickable. */
.dash-solar-vid .video-channel-pills {
  position: absolute; top: 38px; left: 0; right: 0; z-index: 5;
  background: rgba(10, 10, 15, 0.85); backdrop-filter: blur(6px);
  padding: 6px 8px; margin: 0;
}
.dash-solar-vid .cell-title { display: none; }
.dash-solar-vid .video-caption {
  position: absolute; bottom: 4px; left: 0; right: 0; z-index: 3;
}

/* ── Earth cell ── */
.dash-earth .cell-title { display: none; }
.dash-earth .earth-subtitle {
  position: absolute; top: 6px; left: 0; right: 0; z-index: 3;
}

/* ── Maximized cell — fills the whole viewport ──
   Uses position:fixed (not absolute) and z-index above the nav so it works
   on mobile where the dashboard is height:auto and would otherwise collapse,
   letting the below-fold weather events stack on top. */
.dash-cell.maximized {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-void);
  padding: 12px;
  cursor: default;
  animation: cellExpand 0.3s ease forwards;
  overflow-y: auto;
}
/* Lock page scroll while a cell is maximized so the user can't accidentally
   reach the below-fold content underneath. */
body.cell-maximized { overflow: hidden; }
.dash-cell.maximized .cell-title { font-size: 0.7rem; }
.dashboard.has-maximized .dash-cell:not(.maximized) {
  display: none;
}
.cell-collapse-btn {
  position: absolute; top: 14px; right: 14px; z-index: 250;
  font-size: 1.6rem; font-weight: 300; line-height: 1; color: var(--text-primary);
  background: rgba(20, 20, 28, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%; width: 46px; height: 46px;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s ease;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  /* Big, obvious close button — first user couldn't find ESC fallback. */
}
.dash-cell.maximized .cell-collapse-btn { display: flex; }
.cell-collapse-btn:hover, .cell-collapse-btn:active {
  color: #FFD27A; border-color: var(--sun-glow);
  background: rgba(40, 40, 50, 0.95); transform: scale(1.08);
  box-shadow: 0 2px 18px rgba(255, 200, 100, 0.35);
}
/* Resolution row on the sun cell sits at top-right too — push it left so it
   doesn't crowd the close button when the cell is maximized. */
.dash-sun.maximized .resolution-row { right: 72px; }
/* Subtle hint badge that appears for 3s after a cell maximizes, then fades.
   Tells the user how to escape — was implicit ESC-only before. */
.cell-close-hint {
  position: absolute; top: 22px; right: 70px; z-index: 249;
  font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(20, 20, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px; padding: 5px 10px;
  display: none; pointer-events: none;
  animation: closeHintFade 3.5s ease forwards;
  white-space: nowrap;
}
.dash-cell.maximized .cell-close-hint { display: block; }
@keyframes closeHintFade {
  0%   { opacity: 0; transform: translateX(8px); }
  10%  { opacity: 1; transform: translateX(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(0); }
}
/* Make the LUMARA brand title clickable when a cell is maximized.
   Provides a second escape affordance (UrlAgentFoo's suggestion). */
.dashboard.has-maximized ~ * .nav-brand,
body:has(.dashboard.has-maximized) .nav-brand {
  cursor: pointer;
}
body:has(.dashboard.has-maximized) .nav-brand:hover .nav-title {
  color: var(--sun-glow);
}
body:has(.dashboard.has-maximized) .nav-brand::after {
  content: '↩ Back';
  margin-left: 10px;
  font-size: 0.65rem; letter-spacing: 1.5px;
  color: var(--text-tertiary);
  opacity: 0.85;
}
/* Click overlay for video/iframe cells */
.cell-click-overlay {
  position: absolute; inset: 0; z-index: 2;
  cursor: pointer;
}
.dash-cell.maximized .cell-click-overlay { display: none; }
@keyframes cellExpand {
  from { opacity: 0.7; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
/* Maximized overrides for sun */
.dash-sun.maximized .sdo-image-wrap { max-width: 50%; max-height: calc(100% - 70px); }
/* Maximized overrides for moon — big moon + data */
.dash-moon.maximized #moon-canvas { max-width: 75vmin; max-height: calc(100% - 110px); }
.dash-moon.maximized .moon-phase-label { margin-top: 6px; }
.dash-moon.maximized .lunar-data {
  display: grid; left: 50%; right: auto; width: 340px; transform: translateX(-50%);
  bottom: 36px; gap: 2px 20px; padding: 8px 16px;
}
.dash-moon.maximized .city-selector {
  display: flex; left: 50%; right: auto; width: 340px; transform: translateX(-50%);
  bottom: 10px;
}
/* Maximized overrides for video cells */
.dash-solar-vid.maximized .video-player-wrap { width: 70%; max-height: calc(100% - 40px); }
.dash-earth.maximized .earth-player-wrap { width: 80%; }

/* Below-fold sections — side-by-side on desktop */
.below-fold-grid {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 32px; max-width: 1200px; margin: 0 auto; padding: 32px 32px 16px;
}
.events-below-fold {
  background: rgba(4, 4, 8, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}
.calendar-below-fold {
  background: rgba(4, 4, 8, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  text-align: center;
  /* Fixed-height scrollable card — current month + next month both render,
     user scrolls inside the card to reveal next month, page layout below
     stays anchored. */
  max-height: 540px; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.calendar-below-fold::-webkit-scrollbar { width: 6px; }
.calendar-below-fold::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
.calendar-below-fold::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════════════════════════════════════════
   SUN PANEL
   ═══════════════════════════════════════════════════ */
.sdo-viewer { text-align: center; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }

.sdo-image-wrap {
  position: relative; display: inline-block;
  width: auto; height: auto;
  /* Keep both dimensions inside the cell so the disk never gets clipped top/bottom
     and the cyan glow stays inside the cell instead of bleeding into the moon card.
     The max-height accounts for: cell-title (~24px) + wavelength-info (~58px) +
     resolution row (~36px) + breathing room (~18px) = ~136px subtracted. */
  max-width: min(70%, calc(100vh - 220px));
  max-height: calc(100% - 90px);
  aspect-ratio: 1;
  background: #000;
  transition: box-shadow 0.5s ease;
  margin-top: 4px;
}
.sdo-image-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.3s ease;
}
.sdo-loading {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
}
.sdo-loading.visible { display: flex; }
.sdo-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--sun-glow);
  animation: spin 0.8s linear infinite;
}

.sdo-wavelength-info {
  /* Pinned to the bottom of the cell so "Chromosphere" / "Inner Corona" / etc.
     can never be clipped by overflow:hidden no matter how tall the disk grows. */
  position: absolute; bottom: 8px; left: 130px; right: 16px;
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  z-index: 3;
}
.wavelength-name {
  font-size: 0.85rem; font-weight: 400; color: var(--text-primary);
  letter-spacing: 1px;
}
.wavelength-temp {
  font-size: 0.7rem; font-family: var(--font-mono); color: var(--text-tertiary);
}
.wavelength-res {
  display: inline-block; margin-top: 4px;
  font-size: 0.6rem; font-family: var(--font-mono); letter-spacing: 1px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); color: var(--text-secondary);
  background: rgba(255, 152, 0, 0.06);
}

/* Wavelength pills */
.wavelength-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin-bottom: 12px; padding: 0 4px;
}
.wave-pill {
  font-size: 0.6rem; font-weight: 400; letter-spacing: 0.5px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-secondary); background: transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.wave-pill:hover { border-color: var(--text-secondary); }
.wave-pill.active {
  color: var(--bg-void); font-weight: 600;
  /* background + border set dynamically by JS */
}

/* Resolution buttons */
.resolution-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 10px;
}
.resolution-label {
  font-size: 0.65rem; color: var(--text-tertiary); letter-spacing: 1px; text-transform: uppercase;
}
.resolution-buttons { display: flex; gap: 4px; }
.res-btn {
  font-size: 0.65rem; font-family: var(--font-mono);
  padding: 3px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.res-btn:hover { border-color: var(--text-secondary); }
.res-btn.active {
  background: var(--sun-glow); color: var(--bg-void);
  border-color: var(--sun-glow); font-weight: 600;
}

/* View toggle */
.view-toggle {
  display: flex; justify-content: center; gap: 4px; margin-bottom: 10px;
}
.toggle-btn {
  font-size: 0.65rem; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); color: var(--text-tertiary);
  transition: all var(--transition-fast);
}
.toggle-btn:hover { color: var(--text-secondary); }
.toggle-btn.active { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-light); }

/* Timelapse */
.timelapse-wrap {
  text-align: center; margin-bottom: 12px;
}
.timelapse-wrap video {
  width: 100%; max-width: 380px; aspect-ratio: 1; object-fit: cover;
  background: #000;
}
.video-caption {
  font-size: 0.6rem; color: var(--text-tertiary); margin-top: 6px; letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   MISSION CONTROL PANEL
   ═══════════════════════════════════════════════════ */
.activity-status {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  background: rgba(10, 10, 16, 0.8);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.status-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-tertiary);
  transition: background 0.5s ease;
}
.status-indicator[data-status="quiet"] { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-indicator[data-status="moderate"] { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.status-indicator[data-status="active"] { background: #FF9800; box-shadow: 0 0 6px #FF9800; }
.status-indicator[data-status="storming"] { background: var(--red); box-shadow: 0 0 6px var(--red); animation: pulse-status 1.5s ease-in-out infinite; }
.status-indicator[data-status="loading"] { background: var(--text-tertiary); animation: pulse-status 1.5s ease-in-out infinite; }
@keyframes pulse-status { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.status-text { font-size: 0.7rem; color: var(--text-secondary); }

/* Conditions grid */
.conditions-grid {
  display: flex; gap: 6px;
}
.condition-card {
  background: rgba(10, 10, 16, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 5px 14px;
  text-align: center;
  display: flex; align-items: center; gap: 6px;
}
.condition-label {
  font-size: 0.5rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-tertiary);
}
.condition-value {
  font-size: 0.75rem; font-family: var(--font-mono); font-weight: 400;
  color: var(--text-primary);
}

/* Timeline */
.timeline-title {
  font-size: 0.65rem; font-weight: 300; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.events-timeline {
  flex: 1; overflow-y: auto; max-height: 420px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.events-timeline::-webkit-scrollbar { width: 3px; }
.events-timeline::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.timeline-loading { font-size: 0.7rem; color: var(--text-tertiary); text-align: center; padding: 12px 0; }
.timeline-empty { font-size: 0.7rem; color: var(--text-tertiary); text-align: center; padding: 12px 0; }

.event-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; margin-bottom: 4px; border-radius: 8px;
  transition: background 0.2s ease;
  /* Anchor reset — entire event row is now a clickable link to NASA DONKI */
  color: inherit; text-decoration: none;
}
.event-item:hover { background: rgba(255, 255, 255, 0.05); cursor: pointer; opacity: 1; }
.event-item:hover .event-link { text-decoration: underline; }
.event-icon {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 600; margin-top: 1px;
}
.event-info { flex: 1; min-width: 0; }
.event-header {
  display: flex; align-items: center; gap: 6px;
}
.event-title {
  font-size: 0.75rem; font-weight: 400; color: var(--text-primary);
}
.event-badge {
  font-size: 0.55rem; font-weight: 600; font-family: var(--font-mono);
  padding: 1px 5px; border-radius: 4px;
  border: 0.5px solid; white-space: nowrap;
}
.event-detail-row {
  display: flex; align-items: center; gap: 4px; flex-wrap: nowrap;
}
.event-severity {
  font-size: 0.55rem; font-weight: 500; letter-spacing: 0.3px; text-transform: uppercase;
}
.event-speed-label {
  font-size: 0.55rem; font-weight: 400;
}
.event-meta { font-size: 0.55rem; font-family: var(--font-mono); color: var(--text-tertiary); margin-left: auto; white-space: nowrap; }
.event-link {
  font-size: 0.55rem; color: var(--sun-glow); display: inline; margin-left: 6px;
}

/* Solar video */
.center-video-wrap {
  text-align: center;
}
.video-section-title {
  font-size: 0.6rem; font-weight: 400; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 10px;
}
.video-mode-toggle {
  display: flex; gap: 6px; justify-content: center; margin-bottom: 8px;
  position: relative; z-index: 4;
}
.video-mode-btn {
  font-size: 0.7rem; font-weight: 500; letter-spacing: 1px;
  padding: 6px 16px; border-radius: var(--radius-pill);
  background: rgba(255, 152, 0, 0.06); color: var(--text-secondary);
  border: 1px solid var(--sun-glow-soft); cursor: pointer;
  transition: all 0.2s ease;
}
.video-mode-btn.active {
  background: var(--sun-glow); color: var(--bg-void); font-weight: 600;
  border-color: var(--sun-glow);
  box-shadow: 0 0 16px rgba(255, 152, 0, 0.35);
}
.video-mode-btn:hover:not(.active) {
  color: var(--sun-glow); border-color: var(--sun-glow);
  background: rgba(255, 152, 0, 0.12);
}
.video-channel-pills {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 8px; padding: 0 4px;
  position: relative; z-index: 4;
}
.vid-pill {
  font-size: 0.55rem; letter-spacing: 0.5px; padding: 3px 8px;
  border-radius: var(--radius-pill); cursor: pointer;
  background: transparent; color: var(--text-tertiary);
  border: 1px solid var(--border); transition: all 0.2s ease;
}
.vid-pill.active {
  background: color-mix(in srgb, var(--pill-color) 20%, transparent);
  color: var(--pill-color); border-color: var(--pill-color);
}
.vid-pill:hover:not(.active) { color: var(--text-secondary); border-color: var(--border-light); }
.video-player-wrap { position: relative; flex: 1; width: 90%; max-height: calc(100% - 32px); display: flex; align-items: center; justify-content: center; }
.video-player-wrap video {
  width: auto; height: 100%; max-height: 100%; aspect-ratio: 1; object-fit: cover;
  background: #000; display: block;
}
.video-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); font-size: 0.7rem; color: var(--text-tertiary);
  letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════
   LIVE EARTH VIEW
   ═══════════════════════════════════════════════════ */
.earth-subtitle {
  font-size: 0.6rem; color: var(--text-tertiary); letter-spacing: 1px;
  margin-bottom: 8px;
}
.earth-player-wrap {
  position: relative; width: 92%; flex: 1;
  border-radius: var(--radius-sm); overflow: hidden;
}
.earth-player-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}

/* Sun zoom modal — allows scroll-pan when image is larger than viewport
   so a 4096px image actually shows 4× the detail of a 1024px image, not
   just a downscaled version. */
.sun-modal {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; cursor: zoom-out;
  overflow: auto;
}
.sun-modal.active { display: flex; }
.sun-modal-inner { text-align: center; padding: 40px; }
#sun-zoom-img {
  max-width: none; max-height: none;
  width: min(90vmin, 100%); height: auto;
  image-rendering: high-quality;
  filter: drop-shadow(0 0 40px rgba(255,152,0,0.4));
}
.sun-modal.full-detail #sun-zoom-img {
  width: auto; height: auto;
}
.sun-modal-caption {
  color: var(--text-tertiary); font-size: 0.7rem; margin-top: 12px;
  letter-spacing: 1px; text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════
   MOON PANEL
   ═══════════════════════════════════════════════════ */
.moon-viz-wrap {
  text-align: center;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#moon-canvas {
  display: block; margin: 0 auto;
  max-width: 84%; max-height: calc(100% - 48px);
  width: auto; height: auto;
  filter: drop-shadow(0 0 24px var(--moon-glow-bright));
}

/* Moon zoom modal */
.moon-modal {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; cursor: zoom-out;
}
.moon-modal.active { display: flex; }
.moon-modal-inner { text-align: center; }
#moon-canvas-zoom {
  max-width: 90vmin; max-height: 90vmin; width: 900px; height: 900px;
  filter: drop-shadow(0 0 40px rgba(176,196,222,0.3));
}
.moon-modal-caption {
  color: var(--text-tertiary); font-size: 0.7rem; margin-top: 12px;
  letter-spacing: 1px; text-transform: uppercase;
}
.moon-phase-label {
  margin-top: 8px; padding: 0 8px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  /* Allow the label to wrap if name + illumination don't fit on one line */
  text-align: center;
}
.phase-name {
  font-size: 0.85rem; font-weight: 400; color: var(--text-primary); letter-spacing: 1px;
  line-height: 1.25; max-width: 100%; word-break: break-word;
}
.phase-illumination { font-size: 0.7rem; font-family: var(--font-mono); color: var(--text-tertiary); }

/* Lunar data rows */
.lunar-data { margin-bottom: 0; }
.lunar-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1px 0;
}
.lunar-label { font-size: 0.55rem; color: var(--text-secondary); letter-spacing: 0.5px; }
.lunar-value { font-size: 0.6rem; color: var(--text-primary); }
.mono { font-family: var(--font-mono); }

/* City selector */
.city-selector {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.city-label {
  font-size: 0.65rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-tertiary);
}
.city-dropdown {
  flex: 1; font-family: var(--font-body); font-size: 0.75rem;
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%239898A8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer;
}
.city-dropdown:focus { border-color: var(--moon-glow); outline: none; }

/* Moon calendar */
.calendar-title {
  font-size: 0.65rem; font-weight: 300; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 12px; text-align: center;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.calendar-title-next {
  margin-top: 24px;
}
.moon-calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  font-size: 0.65rem; text-align: center;
}
.cal-header {
  font-size: 0.6rem; color: var(--text-tertiary); padding: 4px 0;
  letter-spacing: 1.5px;
}
.cal-day {
  padding: 6px 4px; border-radius: 6px;
  color: var(--text-secondary); position: relative;
  line-height: 1.3; transition: background 0.2s ease;
}
.cal-day:hover { background: rgba(255, 255, 255, 0.03); }
.cal-day.today {
  background: var(--bg-card); color: var(--moon-glow);
  border: 1px solid var(--moon-glow);
}
.cal-day.full-moon {
  background: rgba(176,196,222,0.12);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(176,196,222,0.25);
}
.cal-day.full-moon .cal-num {
  color: var(--moon-glow);
  font-weight: 600;
}
.cal-day.new-moon { opacity: 0.5; }
.cal-day .cal-phase {
  display: block; font-size: 0.9rem; line-height: 1;
}
.cal-day .cal-num {
  display: block; font-size: 0.55rem; font-family: var(--font-mono);
  color: var(--text-tertiary); margin-top: 2px;
}

/* ═══════════════════════════════════════════════════
   DASHBOARD BOTTOM BAR
   ═══════════════════════════════════════════════════ */
.dashboard-bar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 24px;
  background: rgba(6, 6, 10, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  max-width: 1600px; margin: 0 auto;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.02);
}
.bar-link {
  font-size: 0.65rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-tertiary);
}
.bar-link:hover { color: var(--text-secondary); }
.bar-attribution {
  font-size: 0.6rem; color: var(--text-tertiary); letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   BELOW-FOLD CONTENT
   ═══════════════════════════════════════════════════ */
.content-section {
  position: relative; z-index: 10;
  max-width: 1000px; margin: 0 auto;
  padding: 64px 24px;
}

.section-heading {
  font-size: 1.4rem; font-weight: 200; letter-spacing: 4px;
  color: var(--text-primary); text-align: center;
  margin-bottom: 40px;
}

/* Stats strip */
.stats-strip {
  display: flex; justify-content: center; align-items: center; gap: 0;
  flex-wrap: wrap; margin-bottom: 48px;
  padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stat-block { text-align: center; padding: 0 28px; }
.stat-number {
  display: block; font-size: 1.3rem; font-family: var(--font-mono); font-weight: 300;
  letter-spacing: 1px; color: var(--text-primary);
}
.stat-label {
  display: block; font-size: 0.6rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-tertiary); margin-top: 4px;
}
.stat-divider {
  width: 1px; height: 36px; background: var(--border);
}

/* Educational cards */
.edu-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.edu-card {
  background: linear-gradient(180deg, rgba(6, 6, 10, 0.92) 0%, rgba(4, 4, 8, 0.88) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  text-align: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.edu-card::before {
  content: ''; position: absolute; top: 0; left: 16px; right: 16px;
  height: 1px; border-radius: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
.edu-card:hover {
  border-color: var(--border-light); transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.edu-icon {
  font-size: 2rem; margin-bottom: 12px; display: block;
  filter: grayscale(0.3);
}
.edu-title {
  font-size: 0.75rem; font-weight: 400; letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 12px;
}
.edu-card {
  cursor: pointer; user-select: none;
}
.edu-card p {
  font-size: 0.8rem; color: var(--text-secondary); line-height: 1.7; text-align: left;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.edu-click-hint {
  display: block; margin-top: 14px;
  font-size: 0.55rem; color: var(--text-tertiary);
  letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.5;
  transition: opacity 0.2s ease;
}
.edu-card:hover .edu-click-hint { opacity: 1; }
.edu-card:active { transform: translateY(0) scale(0.99); }

/* FAQ — mission briefing */
.faq-section { padding-top: 32px; padding-bottom: 48px; }
.faq-label {
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 3px;
  color: var(--text-tertiary); text-align: center; margin-bottom: 24px;
  text-transform: uppercase;
}
.faq-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; max-width: 900px; margin: 0 auto;
  background: var(--border); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}
.faq-item {
  background: rgba(4,4,6,0.85); padding: 0;
}
.faq-item summary {
  padding: 14px 16px; font-size: 0.78rem; font-weight: 400;
  color: var(--text-secondary); cursor: pointer; letter-spacing: 0.3px;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  transition: color 0.2s ease, background 0.2s ease;
}
.faq-item summary:hover { color: var(--text-primary); background: rgba(255,255,255,0.02); }
.faq-item summary::after {
  content: '+'; font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-tertiary);
  margin-left: 8px; flex-shrink: 0;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item[open] summary { color: var(--text-primary); }
.faq-item p {
  padding: 0 16px 14px; font-size: 0.75rem; color: var(--text-tertiary); line-height: 1.6;
}

/* CTA Section */
.cta-section { text-align: center; }
.cta-subtitle {
  font-size: 0.95rem; color: var(--text-secondary); max-width: 500px;
  margin: -20px auto 32px; line-height: 1.6;
}
.cta-features {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  margin-bottom: 32px;
}
.cta-feature {
  font-size: 0.8rem; color: var(--text-secondary);
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--bg-card); border: 1px solid var(--border);
}
.cta-icon { margin-right: 6px; }
.cta-store-badges { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; }
.play-badge-link { display: inline-block; transition: transform var(--transition-fast); }
.play-badge-link:hover { transform: scale(1.05); opacity: 1; }
.play-badge-large { height: 60px; width: auto; }
.app-store-link { display: inline-block; transition: transform var(--transition-fast); opacity: 0.92; }
.app-store-link:hover { transform: scale(1.05); opacity: 1; }
.app-store-large { height: 60px; width: auto; }

/* Privacy */
.privacy-section { text-align: center; max-width: 600px; }
.privacy-badge { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.lock-icon { color: var(--green); }
.privacy-title { font-size: 1rem; font-weight: 300; letter-spacing: 3px; color: var(--green); }
.privacy-text { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.7; }

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
.site-footer {
  position: relative; z-index: 10;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}
.footer-content {
  max-width: 800px; margin: 0 auto; text-align: center;
}
.footer-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 16px;
}
.footer-icon { border-radius: 4px; }
.footer-name { font-size: 0.85rem; font-weight: 400; letter-spacing: 2px; }
.footer-by { font-size: 0.75rem; color: var(--text-tertiary); }
.footer-links {
  display: flex; justify-content: center; gap: 24px; margin-bottom: 20px;
}
.footer-links a { font-size: 0.75rem; color: var(--text-secondary); letter-spacing: 1px; }
.footer-links a:hover { color: var(--text-primary); }
.footer-attribution { margin-bottom: 16px; }
.footer-attribution p { font-size: 0.65rem; color: var(--text-tertiary); margin-bottom: 4px; }
.footer-copy { font-size: 0.65rem; color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════
   STICKY MOBILE CTA
   ═══════════════════════════════════════════════════ */
.sticky-cta {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  padding: 8px 16px; text-align: center;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  transition: opacity var(--transition), transform var(--transition);
}
.sticky-cta.visible { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.sticky-cta.hidden-scroll { opacity: 0; transform: translateY(100%); pointer-events: none; }
.sticky-cta-btn { display: inline-flex; align-items: center; }
.sticky-cta-btn img { height: 36px; width: auto; }

/* ═══════════════════════════════════════════════════
   FADE-IN ANIMATION
   ═══════════════════════════════════════════════════ */
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .dashboard { gap: 2px; }
  .dash-moon .lunar-data { font-size: 0.5rem; }
  .below-fold-grid { grid-template-columns: 1fr; padding: 24px 20px; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .weather-strip { flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
  .dashboard {
    grid-template-columns: 1fr;
    height: auto; padding-top: 44px;
  }
  .dash-cell {
    display: none; min-height: 60vh;
  }
  .dash-cell.active-panel { display: flex; }
  .dash-moon .lunar-data { position: static; display: flex; flex-direction: column; background: none; }
  .dash-moon .city-selector { position: static; display: flex; }
  /* Sun cell on mobile — undo the desktop 130px left rail and let wavelengths scroll
     horizontally beneath the image. Image takes the full cell width. */
  .dash-sun .sdo-viewer { padding-left: 0; padding-right: 0; }
  .sdo-image-wrap { max-width: 100%; }
  .dash-sun .wavelength-row {
    position: static; top: auto; left: auto; width: 100%;
    flex-direction: row; flex-wrap: nowrap; overflow-x: auto;
    justify-content: flex-start; padding: 6px 8px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .dash-sun .wave-pill { flex: 0 0 auto; padding: 5px 10px; }
  .dash-sun .resolution-row { position: static; left: auto; right: auto; top: auto; }
  /* On mobile, let the wavelength info flow under the image instead of being
     pinned to the cell bottom (where it would float over other content). */
  .dash-sun .sdo-wavelength-info {
    position: static; left: auto; right: auto; margin-top: 8px;
  }

  .mobile-tabs { display: flex; gap: 4px; }
  .mobile-tab {
    font-size: 0.7rem; font-weight: 400; letter-spacing: 2px; text-transform: uppercase;
    padding: 6px 14px; border-radius: var(--radius-pill);
    color: var(--text-tertiary); border: 1px solid transparent;
    transition: all var(--transition-fast);
  }
  .mobile-tab.active { color: var(--text-primary); border-color: var(--border-light); background: var(--bg-card); }

  .nav-store-badges { display: none; }
  .sticky-cta { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
  /* ISS Earth feed stays hidden on mobile (it's a YouTube iframe — heavy + duplicates content).
     Solar Timelapse video cell is now reachable via the "Video" tab. */
  .dash-earth { display: none !important; }
  .dashboard-bar { display: none; }
  /* On mobile, fit the whole solar timelapse disk into the cell instead of cropping
     it (the desktop "cover" zoom was producing a 10x-zoomed slice on phones). */
  .video-player-wrap { width: 100%; max-height: calc(100% - 80px); }
  .video-player-wrap video {
    width: 100%; height: auto; max-width: 100%; max-height: 100%;
    object-fit: contain;
  }

  .section-heading { font-size: 1.1rem; letter-spacing: 3px; }
  .stats-strip { gap: 8px; }
  .stat-block { padding: 0 14px; }
  .stat-number { font-size: 1rem; }
  .stat-divider { display: none; }
  .edu-grid { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .cta-features { flex-direction: column; align-items: center; }
  .below-fold-grid { grid-template-columns: 1fr; padding: 16px; gap: 16px; }

  .dash-sun { display: flex; }
}

/* Very small screens */
@media (max-width: 400px) {
  .wavelength-row { gap: 4px; }
  .wave-pill { font-size: 0.55rem; padding: 3px 7px; }
  .sdo-image-wrap { max-width: 240px; }
}

/* Large desktop */
@media (min-width: 1600px) {
  .dashboard { gap: 4px; }
}
