/* Mission Control — HOLOGRAM-3D UI REVAMP (task-0132).
   Deep space black base, amber/gold primary accent, electric cyan secondary,
   purple depth layers. Glass morphism panels, animated hex grid, 3D depth.
   Rollback: git checkout f2f9348 -- public/ */

:root {
  color-scheme: dark;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Deep space palette */
  --bg:            #050508;
  --bg-2:          #07080f;
  --surface:       rgba(10, 12, 22, 0.72);
  --surface-solid: #0a0c16;
  --surface-2:     rgba(14, 17, 30, 0.80);
  --surface-2-solid: #0e111e;
  --border:        rgba(245, 158, 11, 0.18);
  --border-strong: rgba(245, 158, 11, 0.38);
  --text:          #e9eefb;
  --text-dim:      #7a8099;

  /* Amber/gold primary */
  --gold:        #f59e0b;
  --gold-2:      #fbbf24;
  --gold-dim:    #92680a;
  --accent:      #f59e0b;
  --accent-2:    #fbbf24;
  --accent-text: #050508;

  /* Electric cyan secondary */
  --cyan:        #06b6d4;
  --cyan-2:      #22d3ee;
  --cyan-dim:    #0e7490;

  /* Purple depth */
  --purple:      #7c3aed;
  --purple-2:    #a78bfa;

  /* Semantic */
  --danger:      #ff5c6c;
  --danger-bg:   rgba(46, 16, 22, 0.85);
  --ok:          #2ee6a8;
  --ok-bg:       rgba(14, 42, 38, 0.85);
  --warn:        #ffc857;
  --warning:     #ffc857;
  --warn-bg:     rgba(44, 36, 20, 0.85);
  --accent-2-bg: rgba(42, 33, 19, 0.85);
  --chip-bg:     rgba(20, 22, 40, 0.85);
  --code-bg:     rgba(8, 10, 20, 0.90);

  /* Glow tokens */
  --glow:        0 0 28px rgba(245, 158, 11, 0.50);
  --glow-soft:   0 0 14px rgba(245, 158, 11, 0.22);
  --glow-cyan:   0 0 20px rgba(6, 182, 212, 0.40);
  --glow-purple: 0 0 20px rgba(124, 58, 237, 0.38);
  --shadow:      0 16px 48px rgba(0,0,0,0.75), 0 0 0 1px rgba(245,158,11,0.06);

  --radius:      8px;
  --grad-accent: linear-gradient(120deg, var(--gold) 0%, var(--gold-2) 100%);
}

* { box-sizing: border-box; }

html { scrollbar-color: rgba(245,158,11,0.28) var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Layer 1: deep space nebula glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 900px 500px at 80% -10%, rgba(245,158,11,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 700px 600px at -5% 110%, rgba(6,182,212,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 600px 450px at 50% 55%, rgba(124,58,237,0.05) 0%, transparent 70%),
    linear-gradient(180deg, #07080f 0%, #050508 100%);
}

/* Layer 2: animated hex grid */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52' viewBox='0 0 60 52'%3E%3Cpath d='M15 1H45L59 26L45 51H15L1 26Z' fill='none' stroke='%23f59e0b' stroke-opacity='0.065' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 38%, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.18) 65%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 38%, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.18) 65%, transparent 100%);
}

@media (prefers-reduced-motion: no-preference) {
  body::after { animation: hex-grid-drift 22s ease-in-out infinite alternate; }
}
@keyframes hex-grid-drift {
  0%   { background-position: 0px 0px;  opacity: 1.0; }
  100% { background-position: 15px 8px; opacity: 0.6; }
}

/* Shell */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar: frosted glass hologram chrome */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  padding: 0.7rem 1.25rem;
  background: rgba(5, 5, 10, 0.86);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow:
    0 1px 0 rgba(245,158,11,0.12),
    0 8px 32px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(245,158,11,0.06);
  overflow: hidden;
}

/* Hex pattern on topbar */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='35' viewBox='0 0 40 35'%3E%3Cpath d='M10 1H30L39 17L30 34H10L1 17Z' fill='none' stroke='%23f59e0b' stroke-opacity='0.035' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 40px 35px;
}

/* Glowing gradient scan line at bottom */
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(245,158,11,0.55) 25%,
    rgba(6,182,212,0.65) 50%,
    rgba(245,158,11,0.55) 75%,
    transparent 100%);
}

@media (prefers-reduced-motion: no-preference) {
  .topbar::after { animation: topbar-scan 5s ease-in-out infinite; }
}
@keyframes topbar-scan {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.80; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-shadow: 0 0 22px rgba(245,158,11,0.28);
}
.wordmark::before {
  content: "\29C6";
  color: var(--gold);
  font-size: 0.95em;
  filter: drop-shadow(0 0 8px rgba(245,158,11,0.9)) drop-shadow(0 0 2px rgba(245,158,11,1));
  line-height: 1;
}
.wordmark span {
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-2) 45%, var(--cyan-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

.page-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0;
  padding-left: 1rem;
  border-left: 1px solid rgba(245,158,11,0.22);
  color: var(--text-dim);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}
.page-title::before { content: "\29C6 "; color: var(--cyan); opacity: 0.85; }
.page-title.home {
  border-left: none;
  padding-left: 0;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(245,158,11,0.45);
}

.topnav {
  display: flex;
  gap: 0.2rem;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.nav-link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(245,158,11,0.07);
  border-color: rgba(245,158,11,0.18);
}
.nav-link.active {
  color: var(--gold);
  background: rgba(245,158,11,0.10);
  border-color: rgba(245,158,11,0.32);
  box-shadow: var(--glow-soft), inset 0 0 10px rgba(245,158,11,0.05);
  text-shadow: 0 0 10px rgba(245,158,11,0.55);
}
/* Glowing underline for active nav tab */
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 15%; right: 15%;
  bottom: 2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--cyan), transparent);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(245,158,11,0.7);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.5rem;
  position: relative;
  z-index: 1;
}

.summary {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.14rem 0.55rem;
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius);
  background: rgba(10,12,22,0.65);
}
.summary:empty { display: none; }

/* Main content */
main, .board, .status-main, .wiki-main, .jobs-main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Buttons */
.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(245,158,11,0.22);
  background: rgba(10,12,22,0.75);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: var(--glow-soft);
  background: rgba(245,158,11,0.08);
}
.btn.primary {
  background: var(--grad-accent);
  color: var(--accent-text);
  border-color: transparent;
  font-weight: 700;
  box-shadow: var(--glow-soft);
  backdrop-filter: none;
}
.btn.primary:hover {
  filter: brightness(1.10);
  box-shadow: var(--glow);
}

/* Legacy: terminal-surface becomes glass */
.terminal-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Status dots with bloom */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex: 0 0 auto;
}
.status-dot.ok    { background: var(--ok);     box-shadow: 0 0 8px var(--ok),     0 0 18px rgba(46,230,168,0.35); }
.status-dot.warn  { background: var(--warn);   box-shadow: 0 0 8px var(--warn),   0 0 18px rgba(255,200,87,0.35); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 8px var(--danger), 0 0 18px rgba(255,92,108,0.35); }
.status-dot.live  { background: var(--cyan);   box-shadow: 0 0 8px var(--cyan),   0 0 18px rgba(6,182,212,0.45); }

@media (prefers-reduced-motion: no-preference) {
  .status-dot.ok, .status-dot.live { animation: dot-bloom 2.8s ease-in-out infinite; }
}
@keyframes dot-bloom {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* Data flash on live updates */
@keyframes data-flash {
  0%   { box-shadow: 0 0 0 2px var(--cyan), var(--shadow); }
  100% { box-shadow: var(--shadow); }
}
@keyframes card-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 640px) {
  .topbar { gap: 0.5rem; padding: 0.6rem 0.9rem; }
  .topnav {
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(245,158,11,0.10);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .brand { flex: 1; }
  .page-title { font-size: 0.8rem; }
  main, .status-main, .wiki-main, .jobs-main { padding: 1rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
