/* ═══ PathViz 3.0 theme system ═══
 * Dark is default; :root[data-theme="light"] overrides.
 * Variables only — no hardcoded colors in component CSS.
 * ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Type */
  --font-display: "Outfit", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Monaco, monospace;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* Radii */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* Dark theme — default */
  --bg-0: #05080f;
  --bg-1: #0b1220;
  --bg-2: #111b2e;
  --bg-3: #1a2540;
  --surface: rgba(17, 27, 46, 0.72);
  --surface-hi: rgba(26, 37, 64, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.18);

  --text-1: #e7edf5;
  --text-2: #9aa7bd;
  --text-3: #5e6b82;

  --accent: #00e5c8;
  --accent-2: #7b9cff;
  --accent-soft: rgba(0, 229, 200, 0.16);

  /* Traffic-light colors (same palette as the spec widget) */
  --tl-off: #5e6b82;
  --tl-yellow: #efa627;
  --tl-green: #4fa733;
  --tl-red: #e24b4a;
}

:root[data-theme="light"] {
  --bg-0: #f6f7fa;
  --bg-1: #ffffff;
  --bg-2: #f0f3f8;
  --bg-3: #e5ecf5;
  --surface: #ffffff;
  --surface-hi: #f9fbfd;
  --border: rgba(10, 20, 40, 0.08);
  --border-hi: rgba(10, 20, 40, 0.18);

  --text-1: #0b1220;
  --text-2: #485063;
  --text-3: #7c8394;

  --accent: #00857a;
  --accent-2: #4260d6;
  --accent-soft: rgba(0, 133, 122, 0.14);

  --tl-off: #9ca4b5;
  --tl-yellow: #c97d0a;
  --tl-green: #338220;
  --tl-red: #c43a3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.app-header {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-1);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  padding: 2px 6px;
  border: 0.5px solid var(--border-hi);
  border-radius: var(--radius-sm);
}

.header-spacer { flex: 1; }

.header-nav {
  display: flex;
  gap: var(--sp-4);
  font-size: 12px;
}

.header-nav a {
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.header-nav a:hover { color: var(--text-1); border-bottom-color: var(--accent); text-decoration: none; }
.header-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.theme-toggle {
  background: transparent;
  color: var(--text-2);
  border: 0.5px solid var(--border-hi);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  cursor: pointer;
  text-transform: uppercase;
}

.theme-toggle:hover { color: var(--text-1); border-color: var(--accent); }

/* ── Main content area ───────────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: var(--sp-6) var(--sp-5);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.placeholder-hero {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
}

.placeholder-hero h1 {
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 var(--sp-3);
}

.placeholder-hero p {
  color: var(--text-2);
  max-width: 640px;
  margin: 0 auto var(--sp-4);
  font-size: 14px;
}

.part-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* ── Shared: subsystem pill (header strip) ───────────────────────────── */
.pill-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 700px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 0.5px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pill:hover {
  background: var(--surface-hi);
  border-color: var(--border-hi);
  color: var(--text-1);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Traffic-light colors on the pill dot */
.pill-dot.c-off { background: var(--tl-off); }
.pill-dot.c-yellow { background: var(--tl-yellow); }
.pill-dot.c-green { background: var(--tl-green); }
.pill-dot.c-red { background: var(--tl-red); }

/* Animations — shared with the Mission Control cards */
.a-blink { animation: tl-blink 1.2s ease-in-out infinite; }
.a-pulse { animation: tl-pulse 1.4s ease-in-out infinite; }
.a-solid { /* no-op */ }

@keyframes tl-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.22; }
}

@keyframes tl-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}
