/* ==========================================================================
   THEME.CSS — Apex Nexus / Nova Bastion UI
   Design tokens, CSS custom properties, global resets, typography.
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Backgrounds */
  --bg:          #0b0f17;
  --bg-subtle:   #0e1321;
  --panel:       #111827;
  --panel-hover: #162033;

  /* Text */
  --text:        #e2e8f0;
  --text-bright: #f8fafc;
  --muted:       #64748b;

  /* Borders & Dividers */
  --border:      #243041;
  --border-light:#1e293b;

  /* Accent: neon teal / cyan */
  --accent:      #06d6a0;
  --accent-dim:  #06d6a033;
  --accent2:     #38bdf8;
  --accent2-dim: #38bdf833;

  /* Semantic */
  --danger:      #ef4444;
  --danger-dim:  #ef444433;
  --warn:        #f59e0b;
  --warn-dim:    #f59e0b33;
  --ok:          #22c55e;
  --ok-dim:      #22c55e33;

  /* Shadow & Glow */
  --shadow:      0 2px 8px rgba(0,0,0,.45);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.55);
  --glow-accent: 0 0 20px var(--accent-dim);

  /* Sizing */
  --nav-h:       56px;
  --radius:      8px;
  --radius-sm:   4px;

  /* Typography – system font stack only */
  --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
                 Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --font-mono:   "Cascadia Code", "Fira Code", "SF Mono", "Consolas",
                 "Liberation Mono", Menlo, monospace;

  /* Transitions */
  --ease:        cubic-bezier(.4,0,.2,1);
  --dur:         180ms;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;

  /* Subtle grid background */
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-bright);
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin-bottom: .5rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover  { color: var(--accent2); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

code, .text--mono { font-family: var(--font-mono); }

/* ---------- Accessibility: skip link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: var(--bg);
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
}
.skip-link:focus {
  top: 8px;
}

/* ---------- Focus outlines ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent-dim);
  color: var(--text-bright);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ---------- Text utilities ---------- */
.text--right  { text-align: right; }
.text--center { text-align: center; }
.text--mono   { font-family: var(--font-mono); }
.text--muted  { color: var(--muted); }
.text--accent { color: var(--accent); }
.text--up     { color: var(--ok); }
.text--down   { color: var(--danger); }
.text--warn   { color: var(--warn); }

/* ---------- Animated accent glow (lightweight CSS) ---------- */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px var(--accent-dim); }
  50%      { box-shadow: 0 0 20px var(--accent-dim); }
}
