/* Design tokens + reset. Everything else builds on these. */

:root {
  /* Surfaces: near-black base, each level slightly lifted */
  --bg: #0c0f17;
  --surface-1: #131824;
  --surface-2: #1a2030;
  --surface-3: #232b3d;
  --surface-hover: #202839;

  /* Text */
  --text: #eef2f8;
  --text-muted: #98a3b8;
  --text-dim: #6b7689;

  /* Accent */
  --accent: #4f7cff;
  --accent-hover: #6a90ff;
  --accent-soft: rgba(79, 124, 255, 0.14);
  --accent-border: rgba(79, 124, 255, 0.45);

  /* Semantic */
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  /* File type hues, used by icons */
  --type-image: #f472b6;
  --type-video: #a78bfa;
  --type-audio: #fb923c;
  --type-document: #60a5fa;
  --type-archive: #fbbf24;
  --type-text: #34d399;
  --type-other: #94a3b8;
  --type-folder: #7dd3fc;

  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);

  /* Scales */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);

  --z-sticky: 100;
  --z-dropdown: 200;
  --z-uploads: 300;
  --z-modal: 400;
  --z-toast: 500;

  --topbar-h: 62px;
  --sidebar-w: 232px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* the content pane scrolls, not the page */
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

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

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

/* Focus: visible for keyboard users, quiet for mouse users */
:focus {
  outline: none;
}

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

::selection {
  background: var(--accent-soft);
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: var(--r-full);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #2e3850;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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