/* ==========================================================================
   M222HP GLORY — Design System Tokens & Base Typography
   ========================================================================== */
:root {
  color-scheme: dark;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Premium Gold (Default) */
  --bg-primary: #08090D;
  --bg-secondary: #0C0E14;
  --bg-card: #11131A;
  --bg-card-hover: #161923;
  --bg-elevated: #171A24;
  --bg-input: #0A0C12;

  --accent: #F5B942;
  --accent-light: #FFD978;
  --accent-deep: #C88A16;
  --accent-rgb: 245, 185, 66;
  --accent-ink: #08090D;

  --accent-violet: #8B5CF6;
  --accent-violet-rgb: 139, 92, 246;

  --text-primary: #F8FAFC;
  --text-secondary: #8B95A7;
  --text-muted: #5F687A;

  --border: #232630;
  --border-strong: #343948;

  --online: #22C55E;
  --online-rgb: 34, 197, 94;
  --offline: #EF4444;
  --offline-rgb: 239, 68, 68;
  --warning: #F59E0B;
  --warning-rgb: 245, 158, 11;
  --info: #38BDF8;
  --info-rgb: 56, 189, 248;

  /* Spacing & Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-card: 0 12px 32px -12px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-dialog: 0 28px 80px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-accent: 0 8px 24px -6px rgba(var(--accent-rgb), 0.32);

  /* Layout */
  --sidebar-width: 256px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-med: 220ms;
  --dur-slow: 320ms;
}

/* Theme: Cyber Purple */
:root[data-theme="cyber-purple"] {
  --bg-primary: #07060D;
  --bg-secondary: #0D0B18;
  --bg-card: #131022;
  --bg-card-hover: #19152E;
  --bg-elevated: #1B1733;
  --bg-input: #090714;

  --accent: #8B5CF6;
  --accent-light: #C4B5FD;
  --accent-deep: #6D28D9;
  --accent-rgb: 139, 92, 246;
  --accent-ink: #FFFFFF;

  --accent-violet: #F5B942;
  --accent-violet-rgb: 245, 185, 66;

  --border: #27223D;
  --border-strong: #3B335C;
}

/* Theme: Midnight Black */
:root[data-theme="midnight"] {
  --bg-primary: #030406;
  --bg-secondary: #07090D;
  --bg-card: #0C0E14;
  --bg-card-hover: #11151F;
  --bg-elevated: #141824;
  --bg-input: #050609;

  --accent: #F5B942;
  --accent-light: #FFE394;
  --accent-deep: #B97D10;
  --accent-rgb: 245, 185, 66;
  --accent-ink: #040507;

  --accent-violet: #6366F1;
  --accent-violet-rgb: 99, 102, 241;

  --border: #1A1E29;
  --border-strong: #2A3042;
}

/* Theme: Graphite */
:root[data-theme="graphite"] {
  --bg-primary: #101216;
  --bg-secondary: #15181E;
  --bg-card: #1B1F27;
  --bg-card-hover: #222731;
  --bg-elevated: #242934;
  --bg-input: #12151B;

  --accent: #EAB308;
  --accent-light: #FDE047;
  --accent-deep: #CA8A04;
  --accent-rgb: 234, 179, 8;
  --accent-ink: #101216;

  --accent-violet: #94A3B8;
  --accent-violet-rgb: 148, 163, 184;

  --text-secondary: #9CA3B2;
  --border: #2B313D;
  --border-strong: #3E4656;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

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

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Subtle Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
