/* ============================================================
   TOOLBOX — main.css
   Global design system: variables, reset, base styles
   ============================================================ */

/* --- 1. DESIGN TOKENS ---------------------------------------- */
:root {
  /* Colors */
  --bg:           #0d0d0d;
  --surface:      #111111;
  --surface-2:    #1a1a1a;
  --accent:       #00ff88;
  --accent-dim:   rgba(0, 255, 136, 0.12);
  --danger:       #ff4444;
  --danger-dim:   rgba(255, 68, 68, 0.12);
  --warning:      #ffaa00;
  --text:         #e0e0e0;
  --text-muted:   #888888;
  --border:       #2a2a2a;
  --border-hover: #3a3a3a;

  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-ui:   'Inter', system-ui, -apple-system, sans-serif;

  /* Sizing */
  --radius-card:  8px;
  --radius-input: 4px;
  --radius-btn:   6px;

  /* Layout */
  --max-width: 1280px;
  --header-height: 56px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
}

/* --- 3. SCROLLBAR -------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* --- 4. SELECTION -------------------------------------------- */
::selection {
  background: var(--accent);
  color: #000;
}

/* --- 5. TYPOGRAPHY ------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

p {
  line-height: 1.7;
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 1rem;
  overflow-x: auto;
}

/* --- 6. LINKS ------------------------------------------------ */
a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* --- 7. UTILITY CLASSES -------------------------------------- */
.mono    { font-family: var(--font-mono); }
.muted   { color: var(--text-muted); }
.accent  { color: var(--accent); }
.danger  { color: var(--danger); }
.warning { color: var(--warning); }

.text-center { text-align: center; }
.text-right  { text-align: right; }

.hidden  { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- 8. LAYOUT HELPERS --------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1       { gap: 0.5rem; }
.gap-2       { gap: 1rem; }
.gap-3       { gap: 1.5rem; }

/* --- 9. DIVIDER ---------------------------------------------- */
hr, .divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

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