@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #0a0c0f;
  --surface: #111418;
  --border: #1e2530;
  --border-light: #2a3340;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #334155;
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.1);
  --amber: #f59e0b;
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,0.1);
  --blue: #3b82f6;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  /* Surfaces that need a different value per theme rather than a fixed tint */
  --shade: rgba(0,0,0,0.15);      /* inset panels, e.g. the expanded checks row */
  --overlay: rgba(0,0,0,0.7);     /* behind modals */
  color-scheme: dark;
}

/* Light theme. js/theme.js sets data-theme="light"|"dark" on <html> (resolving
   "System" from the OS) before first paint; the :root block above is the dark
   default. Accent colours are darkened so text on white and on their own
   translucent tints keeps readable contrast; the low-alpha tints used across the
   pages (slate/amber/blue/green/purple/red rgba) work over either background. */
:root[data-theme="light"] {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #d5dce5;
  --border-light: #c2ccd8;
  --text: #1a2332;
  --text-muted: #566578;
  --text-dim: #8493a6;
  --green: #15803d;
  --red: #b91c1c;
  --amber: #b45309;
  --purple: #7e22ce;
  --blue: #1d4ed8;
  --shade: rgba(15,23,42,0.04);
  --overlay: rgba(15,23,42,0.4);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Nav ── */
.nav-bar {
  display: flex;
  gap: 4px;
}

.nav-link {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.12s;
}

.nav-link:hover { color: var(--text); background: rgba(100,116,139,0.08); }
.nav-link.active { color: var(--text); background: var(--surface); border: 1px solid var(--border); }

/* ── Theme control (System / Light / Dark), injected into <header> by js/theme.js ── */
.theme-control {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
/* Directly after the nav there is nothing else pushing right, so push the control there */
header > nav + .theme-control { margin-left: auto; }

.theme-control button {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  padding: 5px 9px;
  cursor: pointer;
}
.theme-control button + button { border-left: 1px solid var(--border); }
.theme-control button:hover { color: var(--text); }
.theme-control button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.theme-control button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
