/* ==========================================================================
   PROJECT PHOSPHOR — Flagship Hub Shared Styles (Option A + Option B)
   3 Themes: CRT '96 | OFFICE | TURBO '96
   ========================================================================== */

:root,
[data-theme="crt"] {
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Consolas", "Cascadia Mono", "Courier New", monospace;

  --bg-app: #0a1015;
  --bg-panel: #121b23;
  --bg-panel-alt: #17232d;
  --bg-surface: #0e161d;
  --bg-input: #090f14;

  --border: #253746;
  --border-hi: #3a5469;

  --text-main: #e6f3ec;
  --text-muted: #8ea7b6;
  --text-dim: #607888;

  --accent: #39ff88;
  --accent-bg: rgba(57, 255, 136, 0.12);
  --accent-text: #06190d;
  --accent-2: #ffb84d;
  --cyan: #4cc9f0;
  --magenta: #f72585;

  --bevel: inset 1px 1px 0 rgba(255, 255, 255, 0.14), inset -1px -1px 0 rgba(0, 0, 0, 0.45);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --radius: 5px;
  --radius-lg: 8px;
  --scanline-opacity: 0.08;
}

[data-theme="office"] {
  --font-ui: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Consolas", "SFMono-Regular", monospace;

  --bg-app: #eff3f7;
  --bg-panel: #ffffff;
  --bg-panel-alt: #f5f8fb;
  --bg-surface: #f8fafc;
  --bg-input: #ffffff;

  --border: #cfd9e4;
  --border-hi: #aebfd2;

  --text-main: #162231;
  --text-muted: #506277;
  --text-dim: #77889c;

  --accent: #1d4ed8;
  --accent-bg: rgba(29, 78, 216, 0.09);
  --accent-text: #ffffff;
  --accent-2: #0f766e;
  --cyan: #0369a1;
  --magenta: #be185d;

  --bevel: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  --radius: 6px;
  --radius-lg: 10px;
  --scanline-opacity: 0;
}

[data-theme="turbo"] {
  --font-ui: "Consolas", "Cascadia Mono", "Courier New", monospace;
  --font-mono: "Consolas", "Cascadia Mono", "Courier New", monospace;

  --bg-app: #020804;
  --bg-panel: #041208;
  --bg-panel-alt: #061c0d;
  --bg-surface: #030e06;
  --bg-input: #010502;

  --border: #0f6f34;
  --border-hi: #00ff66;

  --text-main: #7affaa;
  --text-muted: #34c76e;
  --text-dim: #1d7a42;

  --accent: #00ff66;
  --accent-bg: rgba(0, 255, 102, 0.14);
  --accent-text: #011407;
  --accent-2: #ffb000;
  --cyan: #00f0ff;
  --magenta: #ff2e93;

  --bevel: inset 2px 2px 0 rgba(0, 255, 102, 0.35), inset -2px -2px 0 rgba(0, 20, 8, 0.9);
  --shadow: 0 0 22px rgba(0, 255, 102, 0.18);
  --radius: 0px;
  --radius-lg: 0px;
  --scanline-opacity: 0.22;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

[data-theme="turbo"] body {
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.35);
}

.crt-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--scanline-opacity);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.55) 3px,
    transparent 4px
  );
}

[data-theme="turbo"] .crt-scanlines::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.65) 100%);
}

/* ==========================================================================
   TOP NAVIGATION BAR
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  background: rgba(18, 27, 35, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
}

[data-theme="office"] .topbar { background: rgba(255, 255, 255, 0.95); }
[data-theme="turbo"] .topbar {
  background: rgba(4, 18, 8, 0.95);
  border-bottom: 1px solid #00ff66;
  box-shadow: 0 0 16px rgba(0, 255, 102, 0.22);
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 13px;
  display: grid;
  place-items: center;
  box-shadow: var(--bevel);
}

.brand-title {
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: 0.6px;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

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

.compare-pill {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}

.compare-link {
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: calc(var(--radius) - 1px);
  white-space: nowrap;
}

.compare-link:hover { color: var(--text-main); }

.compare-link.active {
  background: var(--accent);
  color: var(--accent-text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-switch {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}

.theme-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: calc(var(--radius) - 1px);
  cursor: pointer;
  white-space: nowrap;
}

.theme-btn:hover { color: var(--text-main); }

.theme-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--bevel);
}

/* ==========================================================================
   CONTAINER & SHARED SECTIONS
   ========================================================================== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.3px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: var(--bg-panel-alt);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--bevel);
  transition: filter 0.12s ease, transform 0.08s ease, border-color 0.12s ease;
}

.btn:hover {
  filter: brightness(1.08);
  border-color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.btn.small {
  padding: 6px 11px;
  font-size: 12px;
}

/* STATUS BADGES */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.live {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}

[data-theme="office"] .status-badge.live {
  color: #047857;
  border-color: #10b981;
  background: #ecfdf5;
}

.status-badge.beta {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.status-badge.soon {
  color: var(--text-muted);
}

/* ==========================================================================
   OPTION A: HERO & SHAREWARE LAUNCHER GRID
   ========================================================================== */
.hero-a {
  background: var(--bg-panel);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

[data-theme="crt"] .hero-a,
[data-theme="turbo"] .hero-a {
  background-image:
    radial-gradient(circle at 85% 20%, rgba(57, 255, 136, 0.12), transparent 46%),
    linear-gradient(rgba(57, 255, 136, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 136, 0.03) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

[data-theme="office"] .hero-kicker {
  color: #047857;
  background: #ecfdf5;
  border-color: #10b981;
}

.hero-a h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.4px;
}

.hero-lead {
  max-width: 680px;
  margin: 0 0 22px;
  font-size: 15.5px;
  color: var(--text-muted);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.stat-chip strong {
  color: var(--accent);
  font-size: 14px;
}

.filter-tabs {
  display: inline-flex;
  gap: 5px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}

.filter-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: calc(var(--radius) - 1px);
  cursor: pointer;
}

.filter-tab.active {
  background: var(--accent);
  color: var(--accent-text);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.app-card.hidden-card { display: none; }

.app-thumb {
  height: 142px;
  background: #060b10;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.app-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}

.app-body {
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
}

.app-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
}

.mini-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.app-domain {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ==========================================================================
   MANIFESTO, SPONSOR DECK & DISPATCH
   ========================================================================== */
.pledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.pledge-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px;
  box-shadow: var(--shadow);
}

.pledge-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 5px;
}

.pledge-card h3 {
  margin: 0 0 5px;
  font-size: 14.5px;
}

.pledge-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.info-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-panel h3 {
  margin: 0;
  font-size: 16px;
}

.info-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.dispatch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dispatch-list li {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  padding: 7px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dispatch-ver {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a,
.footer-links button {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-decoration: none;
  cursor: pointer;
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================================================================
   OPTION B: FULL-BLEED 3D STRETCHED-PIXEL CRT CORE + CONNECTED CONSTELLATION
   ========================================================================== */
.constellation-stage {
  position: relative;
  min-height: calc(100vh - 56px);
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 48%, #071912 0%, #03090c 58%, #010406 100%);
  border-bottom: 1px solid var(--border-hi);
}

[data-theme="office"] .constellation-stage {
  background: radial-gradient(circle at 50% 48%, #f8fbff 0%, #e7eef6 60%, #dbe5f0 100%);
}

[data-theme="turbo"] .constellation-stage {
  background: radial-gradient(circle at 50% 48%, #042210 0%, #010a04 60%, #000402 100%);
}

#crt3dCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.constellation-hud {
  position: relative;
  z-index: 10;
  width: min(1340px, 97vw);
  min-height: 670px;
  display: grid;
  grid-template-columns: 248px 1fr 248px;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 10px 24px;
  pointer-events: none;
}

.hud-top-banner {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.hud-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(8, 16, 20, 0.78);
  border: 1px solid var(--border-hi);
  color: var(--accent);
  backdrop-filter: blur(4px);
}

[data-theme="office"] .hud-pill {
  background: rgba(255, 255, 255, 0.9);
  color: #1e3a5f;
}

.node-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: auto;
}

.core-spacer {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

/* ==========================================================================
   1996 PHYSICAL CRT WORKSTATION MONITOR (OPTION B CENTERPIECE)
   ========================================================================== */
.crt-monitor {
  pointer-events: auto;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.crt-bezel {
  width: 100%;
  background: linear-gradient(180deg, #27313b 0%, #1a222a 55%, #12181f 100%);
  border: 2px solid #3c4d5d;
  border-radius: 16px;
  padding: 12px 16px 12px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.12),
    inset -3px -3px 0 rgba(0, 0, 0, 0.55),
    0 22px 48px rgba(0, 0, 0, 0.72),
    0 0 42px rgba(57, 255, 136, 0.12);
  position: relative;
}

[data-theme="office"] .crt-bezel {
  background: linear-gradient(180deg, #e7e2d5 0%, #d5cfc0 60%, #c4bdae 100%);
  border-color: #a9a192;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.75),
    inset -3px -3px 0 rgba(0, 0, 0, 0.16),
    0 18px 36px rgba(15, 23, 42, 0.18);
}

[data-theme="turbo"] .crt-bezel {
  background: linear-gradient(180deg, #0b2414 0%, #05140a 60%, #020a05 100%);
  border: 2px solid #00ff66;
  border-radius: 4px;
  box-shadow:
    inset 2px 2px 0 rgba(0, 255, 102, 0.25),
    inset -2px -2px 0 rgba(0, 0, 0, 0.9),
    0 0 36px rgba(0, 255, 102, 0.28);
}

.crt-vent-top {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.crt-vent-top span {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="office"] .crt-vent-top span {
  background: rgba(60, 54, 44, 0.28);
}

.crt-screen-recess {
  background: #05080a;
  border-radius: 14px;
  padding: 7px;
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.92),
    0 1px 0 rgba(255, 255, 255, 0.1);
}

.crt-screen-window {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 18px / 14px;
  overflow: hidden;
  background: #020604;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.85);
}

#crtTubeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.crt-glass-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 24% 16%, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.02) 34%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.52) 100%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.78);
}

.crt-tube-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.32) 3px,
    transparent 4px
  );
  opacity: 0.65;
}

.crt-chin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 0 4px;
}

.crt-model-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #8ea6b5;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

[data-theme="office"] .crt-model-tag {
  color: #5b564b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="turbo"] .crt-model-tag {
  color: #00ff66;
}

.crt-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.crt-phys-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 3px;
  border: 1px solid #415464;
  background: linear-gradient(180deg, #25313c, #172028);
  color: #d3e5df;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.14), 0 2px 3px rgba(0, 0, 0, 0.45);
}

[data-theme="office"] .crt-phys-btn {
  background: linear-gradient(180deg, #ebe6da, #cbc4b4);
  border-color: #9b9384;
  color: #2f2c26;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.18);
}

.crt-phys-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.crt-phys-btn:active {
  transform: translateY(1px);
}

.crt-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.crt-led.booting {
  background: #ffb84d;
  box-shadow: 0 0 8px #ffb84d;
}

.crt-led.on {
  background: #39ff88;
  box-shadow: 0 0 9px #39ff88;
}

.crt-stand-neck {
  width: 110px;
  height: 12px;
  background: linear-gradient(180deg, #0f151b, #1c2630);
  border-left: 1px solid #2d3c4a;
  border-right: 1px solid #2d3c4a;
}

.crt-stand-base {
  width: 220px;
  height: 11px;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(180deg, #27323d, #131a21);
  border: 1px solid #3c4d5d;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
}

[data-theme="office"] .crt-stand-neck {
  background: linear-gradient(180deg, #aea696, #c6bfb0);
  border-color: #9e9687;
}

[data-theme="office"] .crt-stand-base {
  background: linear-gradient(180deg, #dad4c6, #bcb5a6);
  border-color: #9e9687;
}

[data-theme="turbo"] .crt-stand-neck,
[data-theme="turbo"] .crt-stand-base {
  background: #041208;
  border-color: #00ff66;
}

.core-caption {
  pointer-events: auto;
  text-align: center;
  background: rgba(6, 14, 18, 0.8);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 10px 16px;
  backdrop-filter: blur(6px);
  max-width: 440px;
  box-shadow: var(--shadow);
}

[data-theme="office"] .core-caption {
  background: rgba(255, 255, 255, 0.92);
}

.core-caption-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.7px;
}

.core-caption-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.app-node {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-main);
  background: rgba(14, 22, 29, 0.88);
  border: 1.5px solid var(--border-hi);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

[data-theme="office"] .app-node {
  background: rgba(255, 255, 255, 0.95);
}

.app-node:hover,
.app-node.active-node {
  transform: scale(1.035);
  border-color: var(--node-color, var(--accent));
  box-shadow: 0 0 22px color-mix(in srgb, var(--node-color, var(--accent)) 45%, transparent);
}

.node-art {
  height: 86px;
  background: #050a0e;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.node-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.node-info {
  padding: 9px 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.node-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.node-title {
  font-weight: 800;
  font-size: 13.5px;
}

.node-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.scroll-cue {
  grid-column: 1 / -1;
  text-align: center;
  pointer-events: auto;
}

.scroll-cue a {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8, 16, 20, 0.72);
}

[data-theme="office"] .scroll-cue a {
  background: rgba(255, 255, 255, 0.88);
}

.scroll-cue a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   FULL-STAGE WIDESCREEN 1996 CRT TV CONTAINING ENTIRE CONSTELLATION
   ========================================================================== */
.tv-stage {
  padding: 16px 18px 20px;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 45%, #111b22 0%, #070b0f 65%, #030507 100%);
}

[data-theme="office"] .tv-stage {
  background: radial-gradient(circle at 50% 45%, #eef2f6 0%, #dfe6ee 65%, #cfd9e4 100%);
}

[data-theme="turbo"] .tv-stage {
  background: radial-gradient(circle at 50% 45%, #041b0c 0%, #010803 70%, #000301 100%);
}

.crt-tv-chassis {
  width: min(1320px, 96vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tv-bezel {
  padding: 12px 18px 13px;
  border-radius: 22px;
}

[data-theme="turbo"] .tv-bezel {
  border-radius: 6px;
}

.tv-recess {
  border-radius: 18px;
  padding: 8px;
}

.tv-screen {
  aspect-ratio: auto;
  min-height: 620px;
  width: 100%;
  border-radius: 22px / 16px;
  background: radial-gradient(circle at 50% 46%, #071912 0%, #03090c 60%, #010406 100%);
  position: relative;
  overflow: hidden;
}

[data-theme="office"] .tv-screen {
  background: radial-gradient(circle at 50% 46%, #081c16 0%, #040d0f 62%, #020507 100%);
}

[data-theme="turbo"] .tv-screen {
  background: radial-gradient(circle at 50% 46%, #052612 0%, #010a04 62%, #000402 100%);
}

/* Inside the dark CRT TV glass, cards keep crisp dark CRT readability even in Office putty casing */
[data-theme="office"] .tv-screen .app-node {
  background: rgba(12, 22, 28, 0.92);
  color: #e6f3ec;
  border-color: #2f4d5e;
}

[data-theme="office"] .tv-screen .node-sub {
  color: #9bb3c2;
}

[data-theme="office"] .tv-screen .core-caption,
[data-theme="office"] .tv-screen .hud-pill,
[data-theme="office"] .tv-screen .scroll-cue a {
  background: rgba(8, 18, 22, 0.85);
  color: #8ce8b6;
  border-color: #2c4a58;
}

[data-theme="office"] .tv-screen .core-caption-title {
  color: #39ff88;
}

[data-theme="office"] .tv-screen .core-caption-sub {
  color: #9bb3c2;
}

.tv-inner-content {
  position: relative;
  width: 100%;
  min-height: 620px;
  transform-origin: center center;
  will-change: transform, opacity, filter;
}

#crtFxCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.tv-hud {
  width: 100%;
  min-height: 620px;
  grid-template-columns: 244px 1fr 244px;
  padding: 16px 20px 18px;
  gap: 14px;
}

.tv-core-spacer {
  min-height: 390px;
  justify-content: flex-end;
  padding-bottom: 6px;
}

.tv-neck {
  width: 190px;
  height: 14px;
}

.tv-base {
  width: 390px;
  height: 13px;
}

@media (max-width: 980px) {
  .tv-hud {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 14px 14px 16px;
    gap: 12px;
  }
  .tv-core-spacer { min-height: 225px; order: -1; }
  .tv-neck { width: 120px; height: 10px; }
  .tv-base { width: 220px; height: 10px; }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand-title { font-size: 13px; }
  .theme-btn { font-size: 10.5px; padding: 4px 6px; }
  .tv-stage {
    padding: 8px 6px 14px;
    min-height: auto;
  }
  .crt-tv-chassis { width: 100%; }
  .tv-bezel {
    padding: 8px 8px 10px;
    border-radius: 14px;
  }
  .tv-recess {
    padding: 5px;
    border-radius: 12px;
  }
  .tv-screen {
    border-radius: 14px / 10px;
    min-height: auto;
  }
  .tv-inner-content { min-height: auto; }
  .hud-top-banner { gap: 5px; }
  .hud-pill { font-size: 9.5px; padding: 3px 7px; }
  .hud-pill.desktop-only { display: none; }
  .tv-core-spacer { min-height: 175px; padding-bottom: 0; }
  .core-caption { padding: 7px 10px; }
  .core-caption-title { font-size: 10.5px; }
  .core-caption-sub { font-size: 10.5px; }
  .node-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .node-art { height: 64px; }
  .node-info { padding: 7px 8px; }
  .node-title { font-size: 12px; }
  .node-sub { font-size: 10.5px; }
  .node-row { flex-wrap: wrap; gap: 4px; }
  .crt-chin { flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-top: 8px; }
  .crt-model-tag { font-size: 9px; }
  .tv-neck, .tv-base { display: none; }
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.7);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop[hidden] { display: none !important; }

.modal-window {
  width: 100%;
  max-width: 520px;
  background: var(--bg-panel);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-titlebar {
  background: var(--bg-panel-alt);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 24px;
  height: 24px;
  border-radius: 3px;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-lbl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.text-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

@media (max-width: 980px) {
  .brand-sub { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .constellation-hud {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .core-spacer { min-height: 260px; order: -1; }
  .node-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}
