/* ============================================================
   OVERBYTE — Design tokens & base
   Dark "AI infrastructure" language: Stripe × Linear density,
   violet intelligence accent, mono-spaced data figures.
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces */
  --background: #08090d;
  --background-raised: #0b0d12;
  --surface: #0e1016;
  --surface-secondary: #13161d;
  --surface-tertiary: #191d26;
  --surface-hover: #1b202b;
  --surface-inverse: #f2f4f8;

  /* Borders */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(134, 122, 255, 0.55);

  /* Brand / AI */
  --primary: #8577ff;
  --primary-strong: #9a8fff;
  --primary-hover: #948bff;
  --primary-dim: rgba(133, 119, 255, 0.14);
  --primary-glow: rgba(133, 119, 255, 0.35);
  --accent: #22d3ee;              /* data / cyan */
  --accent-dim: rgba(34, 211, 238, 0.12);

  /* Semantic */
  --success: #34d399;
  --success-dim: rgba(52, 211, 153, 0.13);
  --warning: #f5a524;
  --warning-dim: rgba(245, 165, 36, 0.13);
  --danger: #f0564a;
  --danger-dim: rgba(240, 86, 74, 0.14);
  --info: #5eb1ff;
  --info-dim: rgba(94, 177, 255, 0.12);

  /* Text */
  --text-primary: #eef1f7;
  --text-secondary: #a2abbd;
  --text-muted: #667083;
  --text-faint: #454e60;

  /* Charts */
  --chart-1: #8577ff;
  --chart-2: #22d3ee;
  --chart-3: #34d399;
  --chart-4: #f5a524;
  --chart-5: #f0564a;
  --chart-grid: rgba(255, 255, 255, 0.05);

  /* Geometry */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-glow: 0 0 0 1px rgba(133, 119, 255, 0.25), 0 8px 32px -8px var(--primary-glow);

  /* Layout */
  --sidebar-w: 250px;
  --sidebar-w-compact: 76px;
  --topbar-h: 64px;
  --content-x: 32px;
  --content-y: 28px;

  /* Type */
  --font-sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1);
  --t-fast: 140ms;
  --t-med: 240ms;
  --t-slow: 420ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
}
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: rgba(133, 119, 255, 0.35); }

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Typography helpers ---------- */
.t-display {
  font-size: 42px; font-weight: 640; letter-spacing: -0.033em; line-height: 1.08;
}
.t-h1 { font-size: 24px; font-weight: 640; letter-spacing: -0.024em; line-height: 1.2; }
.t-h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.018em; }
.t-h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.t-body { font-size: 14px; color: var(--text-secondary); }
.t-sm { font-size: 13px; }
.t-xs { font-size: 12px; }
.t-cap {
  font-size: 11px; font-weight: 620; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-muted);
}
.t-num { font-family: var(--font-mono); font-weight: 550; letter-spacing: -0.03em; }
.t-num-lg { font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.04em; font-size: 26px; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.grad-text {
  background: linear-gradient(92deg, #fff 20%, var(--primary-strong) 75%, var(--accent) 105%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Utilities ---------- */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.flex-1 { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.center { display: flex; align-items: center; justify-content: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Page scaffolding */
.page { animation: pageIn var(--t-med) var(--ease-out) both; max-width: 1460px; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head .sub { margin-top: 4px; }
.page-grid { display: grid; gap: 20px; }
.stagger > * { animation: pageIn var(--t-med) var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }

/* AI visual language */
.ai-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 640; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary-strong);
  background: var(--primary-dim);
  border: 1px solid rgba(133, 119, 255, 0.28);
  border-radius: var(--radius-full);
  padding: 3px 10px 3px 8px;
}
.ai-panel {
  position: relative;
  background:
    radial-gradient(120% 140% at 85% -20%, rgba(133, 119, 255, 0.13), transparent 55%),
    var(--surface);
  border: 1px solid rgba(133, 119, 255, 0.22);
  border-radius: var(--radius-lg);
}
.ai-panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(133, 119, 255, 0.55), transparent);
}

/* Live pulse dot */
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); position: relative; flex: none; }
.pulse-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--success); opacity: 0.6; animation: pulseRing 2.2s ease-out infinite;
}
@keyframes pulseRing { 0% { transform: scale(0.5); opacity: 0.7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.pulse-dot.violet { background: var(--primary); } .pulse-dot.violet::after { border-color: var(--primary); }
.pulse-dot.amber { background: var(--warning); } .pulse-dot.amber::after { border-color: var(--warning); }
.pulse-dot.red { background: var(--danger); } .pulse-dot.red::after { border-color: var(--danger); }
.pulse-dot.still::after { display: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
