/* design.css — Unified Nexum / Luddan Svcs design tokens.
 * Single source of truth for color, typography, spacing across all surfaces.
 * Updated 2026-06-12: Spatial theme — deep space dark, teal accent, Inter font.
 *
 * Per Ludwig 2026-05-10: "all of our projects should be connected like a unified
 * system, same designs everywhere."
 *
 * © 2026 Luddan Services LLC.
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* —— DARK SURFACES — SPATIAL THEME (updated 2026-06-12) ——————————— */
  --bg:          #04080f;                /* deep space dark */
  --panel:       #0a1525;                /* card panels */
  --panel-2:     #0d1c30;                /* elevated panels / alt rows */
  --line:        rgba(0,212,200,0.09);   /* teal-tinted border */
  --line-hi:     rgba(0,212,200,0.28);   /* teal border highlight */
  --fg:          rgba(255,255,255,0.92); /* primary text */
  --dim:         rgba(255,255,255,0.52); /* secondary text */
  --dim-2:       rgba(255,255,255,0.24); /* tertiary text */
  --accent:      #00d4c8;                /* teal primary action */
  --accent-soft: rgba(0,212,200,0.50);
  --accent-glow: rgba(0,212,200,0.10);
  --purple:      #7c6fff;                /* secondary brand accent */
  --ok:          #30d158;                /* green */
  --warn:        #ff9f0a;                /* amber */
  --bad:         #ff453a;                /* red */

  /* —— TYPOGRAPHY ———————————————————————————————————————————————————— */
  --font:      'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, monospace;
  --fs-xs: 11px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px;
  --fs-lg: 20px; --fs-xl: 28px; --fs-2xl: 38px; --fs-3xl: 52px;
  --fw-reg: 400; --fw-med: 500; --fw-sb: 600; --fw-b: 700;
  --leading-tight: 1.25; --leading-base: 1.5; --leading-loose: 1.65;

  /* —— SPACING (4-8-12-16-24-32-48-64) ————————————————————————————— */
  --s1: 4px;  --s2: 8px;   --s3: 12px;  --s4: 16px;
  --s5: 24px; --s6: 32px;  --s7: 48px;  --s8: 64px;

  /* —— RADIUS ——————————————————————————————————————————————————————— */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 24px;

  /* —— SHADOWS (deep space with subtle teal wash) ——————————————————— */
  --sh-1: 0 1px 4px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,200,0.05);
  --sh-2: 0 4px 16px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,212,200,0.08);
  --sh-3: 0 16px 48px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,212,200,0.10);
}

/* Light mode — for marketing pages. Accent stays teal. */
[data-theme="light"], .theme-light {
  --bg:      #f5f7fc;
  --panel:   #ffffff;
  --panel-2: #edf0f7;
  --line:    rgba(0,180,172,0.15);
  --line-hi: rgba(0,180,172,0.35);
  --fg:      #0d1520;
  --dim:     #4a5568;
  --dim-2:   #8a909e;
  --sh-1: 0 1px 2px rgba(10,20,40,0.06);
  --sh-2: 0 4px 14px rgba(10,20,40,0.08);
  --sh-3: 0 10px 30px rgba(10,20,40,0.12);
}

/* —— BASE RESET + DEFAULTS ———————————————————————————————————————— */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: var(--fs-base);
  line-height: var(--leading-base);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; }

/* —— BRAND BAR ———————————————————————————————————————————————————— */
.nx-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  background: rgba(4,8,15,0.75);
}
.nx-brand {
  font-weight: var(--fw-b); font-size: var(--fs-md);
  letter-spacing: -0.02em; color: var(--fg);
  display: inline-flex; align-items: baseline; gap: var(--s2);
}
/* Canonical Nxm wordmark — gradient purple→teal */
.nx-brand .nxm-mark, .nxm-mark {
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #7c6fff 0%, #00d4c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.nx-brand .by {
  color: var(--dim); font-weight: var(--fw-reg);
  font-size: var(--fs-xs);
  text-transform: none;
}
.nx-nav { display: flex; gap: var(--s1); flex-wrap: wrap; }
.nx-nav a {
  color: var(--dim); font-size: var(--fs-sm);
  padding: 6px 12px; border-radius: var(--r-sm);
  min-height: 36px; display: inline-flex; align-items: center;
  transition: color 0.15s, background 0.15s;
}
.nx-nav a:hover { color: var(--fg); background: rgba(0,212,200,0.06); }
.nx-nav a.on {
  color: var(--accent); background: rgba(0,212,200,0.08);
  font-weight: var(--fw-med);
  border-left: 2px solid var(--accent); padding-left: 10px;
}

/* —— PAGE LAYOUT ————————————————————————————————————————————————— */
.nx-main {
  max-width: 1280px; margin: 0 auto;
  padding: var(--s6) var(--s5) calc(var(--s8) + env(safe-area-inset-bottom));
}
.nx-h1 { font-size: var(--fs-2xl); font-weight: var(--fw-b); letter-spacing: -0.03em; margin: 0 0 var(--s1); }
.nx-sub { color: var(--dim); font-size: var(--fs-base); margin-bottom: var(--s6); }

/* —— CARDS ———————————————————————————————————————————————————— */
.nx-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--sh-1);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.nx-card:hover { border-color: var(--line-hi); transform: translateY(-1px); box-shadow: var(--sh-2); }
.nx-card.lift { box-shadow: var(--sh-2); }

/* —— SECTION HEADER ——————————————————————————————————————————————— */
.nx-section { margin-bottom: var(--s7); }
.nx-section h2 {
  font-size: var(--fs-xs);
  font-weight: var(--fw-sb);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 var(--s4);
  display: flex; align-items: baseline; justify-content: space-between;
}

/* —— STAT TILES (big number + label) ————————————————————————————— */
.nx-stat-grid {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: var(--s6);
}
.nx-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s4);
  transition: border-color 0.2s, background 0.2s;
}
.nx-stat:hover { border-color: var(--line-hi); background: var(--panel-2); }
.nx-stat .lbl {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin-bottom: var(--s2);
}
.nx-stat .val {
  font-size: var(--fs-xl);
  font-weight: var(--fw-b);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.nx-stat.good .val { color: var(--ok); }
.nx-stat.bad  .val { color: var(--bad); }
.nx-stat.warn .val { color: var(--warn); }
.nx-stat .ctx { font-size: var(--fs-xs); color: var(--dim); margin-top: 6px; }

/* —— TABLES ——————————————————————————————————————————————————— */
.nx-table {
  width: 100%; border-collapse: collapse;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
  font-size: var(--fs-sm);
}
.nx-table th, .nx-table td {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.nx-table tr:last-child td { border-bottom: none; }
.nx-table th {
  background: var(--panel-2); color: var(--dim);
  font-weight: var(--fw-med);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nx-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.nx-table tr:hover td { background: rgba(0,212,200,0.04); }

/* —— PILLS / BADGES ————————————————————————————————————————————— */
.nx-pill {
  display: inline-block; padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--fs-xs); font-weight: var(--fw-med);
  letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--panel-2); color: var(--dim);
}
.nx-pill.ok   { background: rgba(48,209,88,0.13);   color: var(--ok); }
.nx-pill.warn { background: rgba(255,159,10,0.13);   color: var(--warn); }
.nx-pill.bad  { background: rgba(255,69,58,0.13);    color: var(--bad); }

/* —— BUTTONS ———————————————————————————————————————————————————— */
.nx-btn {
  padding: 10px 16px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  font-size: var(--fs-sm); font-weight: var(--fw-med);
  cursor: pointer; min-height: 44px;
  transition: all 0.15s ease;
}
.nx-btn:hover { border-color: var(--accent); color: var(--accent); }
.nx-btn:active { transform: scale(0.97); }
.nx-btn.primary {
  background: var(--accent); color: #000;
  border-color: var(--accent); font-weight: var(--fw-sb);
}
.nx-btn.primary:hover { opacity: 0.88; transform: translateY(-1px); }
.nx-btn.danger { color: var(--bad); }
.nx-btn.danger:hover { border-color: var(--bad); color: var(--bad); }

/* —— FORM ELEMENTS ————————————————————————————————————————————— */
.nx-input {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px; color: var(--fg);
  font-family: inherit; font-size: var(--fs-base);
  width: 100%; min-height: 44px;
  transition: border-color 0.15s;
}
.nx-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(0,212,200,0.12); }

/* —— FOOTER ————————————————————————————————————————————————————— */
.nx-foot {
  margin-top: var(--s7);
  padding: var(--s4);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: var(--fs-xs); color: var(--dim);
}

/* —— EMPTY STATE ——————————————————————————————————————————————— */
.nx-empty {
  padding: var(--s6) var(--s4);
  text-align: center;
  color: var(--dim);
  font-style: italic;
}

/* —— RESPONSIVE ————————————————————————————————————————————————— */
@media (max-width: 720px) {
  .nx-main { padding: var(--s4) var(--s4) var(--s8); }
  .nx-h1 { font-size: var(--fs-xl); }
  .nx-bar { padding: var(--s3) var(--s4); }
}

/* —— BIG-SCREEN / TV ————————————————————————————————————————————— */
@media (min-width: 1920px) {
  :root { --fs-base: 16px; --fs-xl: 32px; --fs-2xl: 44px; --fs-3xl: 60px; }
  .nx-btn { min-height: 56px; padding: 14px 20px; font-size: var(--fs-md); }
  .nx-nav a { min-height: 44px; padding: 10px 16px; font-size: var(--fs-md); }
}
