/* ============================================================
   Nuclear Work Plan AI — design tokens & base
   Light technical "lab" system · grotesk + mono · blue signal
   Tone variants on [data-tone]; accent on [data-accent]
   ============================================================ */

:root {
  /* ---- type ---- */
  --font-display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-ui: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* ---- neutral ramp (cool off-white) ---- */
  --bg:        oklch(0.972 0.006 250);
  --bg-grid:   oklch(0.94 0.008 250);
  --surface:   #ffffff;
  --surface-2: oklch(0.985 0.004 250);
  --surface-3: oklch(0.965 0.006 250);
  --border:    oklch(0.905 0.009 250);
  --border-2:  oklch(0.85 0.012 250);
  --text:      oklch(0.26 0.022 264);
  --text-dim:  oklch(0.52 0.018 262);
  --text-faint:oklch(0.66 0.014 260);

  /* ---- accent (blue default) ---- */
  --accent:      oklch(0.55 0.19 260);
  --accent-deep: oklch(0.47 0.18 262);
  --accent-soft: oklch(0.95 0.035 258);
  --accent-line: oklch(0.86 0.06 258);
  --on-accent:   #ffffff;

  /* ---- status ---- */
  --ok:    oklch(0.62 0.15 150);
  --ok-soft: oklch(0.95 0.05 150);
  --warn:  oklch(0.74 0.15 75);
  --warn-soft: oklch(0.96 0.06 85);
  --warn-line: oklch(0.85 0.11 80);
  --danger: oklch(0.58 0.2 27);
  --danger-soft: oklch(0.95 0.05 27);

  /* ---- geometry (tone-controlled) ---- */
  --radius: 7px;
  --radius-sm: 5px;
  --radius-lg: 11px;
  --shadow-card: 0 1px 2px oklch(0.4 0.03 260 / 0.05), 0 1px 1px oklch(0.4 0.03 260 / 0.04);
  --shadow-pop: 0 12px 32px -8px oklch(0.3 0.04 260 / 0.18), 0 2px 6px oklch(0.3 0.04 260 / 0.08);
  --shadow-float: 0 4px 14px -4px oklch(0.3 0.04 260 / 0.14);
  --border-w: 1px;
  --grid-on: 1;
  --pad-unit: 1;
}

/* ---------- accent variants ---------- */
:root[data-accent="indigo"] {
  --accent: oklch(0.52 0.2 274); --accent-deep: oklch(0.45 0.19 275);
  --accent-soft: oklch(0.95 0.04 274); --accent-line: oklch(0.86 0.07 274);
}
:root[data-accent="teal"] {
  --accent: oklch(0.58 0.11 210); --accent-deep: oklch(0.5 0.1 212);
  --accent-soft: oklch(0.95 0.035 205); --accent-line: oklch(0.85 0.06 205);
}
:root[data-accent="green"] {
  --accent: oklch(0.56 0.13 155); --accent-deep: oklch(0.48 0.12 156);
  --accent-soft: oklch(0.95 0.045 155); --accent-line: oklch(0.85 0.07 155);
}
:root[data-accent="slate"] {
  --accent: oklch(0.42 0.03 262); --accent-deep: oklch(0.34 0.025 262);
  --accent-soft: oklch(0.93 0.008 262); --accent-line: oklch(0.84 0.012 262);
}

/* ---------- tone: utilitarian (default-ish, sharp & dense) ---------- */
:root[data-tone="utilitarian"] {
  --radius: 4px; --radius-sm: 2px; --radius-lg: 5px;
  --shadow-card: none;
  --shadow-float: 0 2px 6px -3px oklch(0.3 0.04 260 / 0.16);
  --border-w: 1px;
  --grid-on: 1;
  --pad-unit: 0.86;
}
/* ---------- tone: modern SaaS (rounded, soft, airy) ---------- */
:root[data-tone="saas"] {
  --radius: 12px; --radius-sm: 8px; --radius-lg: 18px;
  --shadow-card: 0 1px 2px oklch(0.4 0.03 260 / 0.06), 0 4px 12px -6px oklch(0.4 0.03 260 / 0.1);
  --shadow-float: 0 8px 24px -8px oklch(0.3 0.04 260 / 0.16);
  --border-w: 1px;
  --grid-on: 0;
  --pad-unit: 1.18;
  --bg: oklch(0.978 0.005 250);
}
/* ---------- tone: high-contrast technical (mono, gridlines, tight) ---------- */
:root[data-tone="technical"] {
  --radius: 3px; --radius-sm: 1px; --radius-lg: 4px;
  --shadow-card: none;
  --shadow-float: 0 3px 0 0 oklch(0.3 0.04 260 / 0.06);
  --border-w: 1.5px;
  --border: oklch(0.84 0.012 250);
  --border-2: oklch(0.74 0.016 250);
  --grid-on: 1;
  --pad-unit: 0.92;
  --font-ui: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
#root { height: 100%; }

::selection { background: var(--accent-soft); color: var(--accent-deep); }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
*::-webkit-scrollbar-track { background: transparent; }

/* type helpers */
.mono { font-family: var(--font-mono); font-feature-settings: "zero"; }
.display { font-family: var(--font-display); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 500;
}
.tnum { font-variant-numeric: tabular-nums; }

/* focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* keyframes */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes barfill { from { transform: scaleX(0); } }
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes sweep { from { left: -40%; } to { left: 120%; } }
@keyframes checkpop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

.rise { animation: rise 0.34s cubic-bezier(0.22,1,0.36,1) both; }
.fadein { animation: fadein 0.3s ease both; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; }
}
