/* theme.css — design tokens, reset, base styles */

:root {
  color-scheme: dark;

  /* Backgrounds */
  --bg-0: #05070a;
  --bg-1: #0b0f19;
  --bg-2: #111827;
  --bg-3: #1f2937;
  --bg-elevated: rgba(31, 41, 55, 0.6);

  /* Text */
  --text-0: #f8fafc;
  --text-1: #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #64748b;

  /* Accents */
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;

  /* Surfaces */
  --surface: rgba(17, 24, 39, 0.7);
  --surface-border: rgba(148, 163, 184, 0.12);
  --surface-hover: rgba(148, 163, 184, 0.08);
  --border: var(--surface-border);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);

  /* Metrics */
  --radius-sm: 0.375rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-11: 2.75rem;
  --space-12: 3rem;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);

  --header-h: 4rem;
  --sidebar-w: 16rem;
  /* Shared height for form controls (inputs, selects, buttons, segmented) so they
     line up cleanly when sitting side by side in a filter/toolbar row. */
  --control-h: 2.75rem;

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --transition-fast: 150ms ease;
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  /* Glass + ambient identity (personal taste pass) */
  --glass-top-highlight: rgba(255, 255, 255, 0.06);
  --aurora-1: rgba(56, 189, 248, 0.14);   /* accent cyan */
  --aurora-2: rgba(129, 140, 248, 0.13);  /* indigo */
  --aurora-3: rgba(52, 211, 153, 0.08);   /* mint */
  --card-accent: var(--accent);            /* overridable per-card */
  --color-swatch-border: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f8fafc;
  --bg-1: #f1f5f9;
  --bg-2: #e2e8f0;
  --bg-3: #cbd5e1;
  --bg-elevated: rgba(255, 255, 255, 0.7);

  --text-0: #0f172a;
  --text-1: #1e293b;
  --text-2: #475569;
  --text-3: #94a3b8;

  --surface: rgba(255, 255, 255, 0.8);
  --surface-border: rgba(15, 23, 42, 0.1);
  --surface-hover: rgba(15, 23, 42, 0.05);
  --border: var(--surface-border);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);

  --glass-top-highlight: rgba(255, 255, 255, 0.7);
  --aurora-1: rgba(56, 189, 248, 0.16);
  --aurora-2: rgba(129, 140, 248, 0.14);
  --aurora-3: rgba(52, 211, 153, 0.10);
  --color-swatch-border: rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg-0: #f8fafc;
    --bg-1: #f1f5f9;
    --bg-2: #e2e8f0;
    --bg-3: #cbd5e1;
    --bg-elevated: rgba(255, 255, 255, 0.7);

    --text-0: #0f172a;
    --text-1: #1e293b;
    --text-2: #475569;
    --text-3: #94a3b8;

    --surface: rgba(255, 255, 255, 0.8);
    --surface-border: rgba(15, 23, 42, 0.1);
    --surface-hover: rgba(15, 23, 42, 0.05);
    --border: var(--surface-border);
    --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);

    --glass-top-highlight: rgba(255, 255, 255, 0.7);
    --aurora-1: rgba(56, 189, 248, 0.16);
    --aurora-2: rgba(129, 140, 248, 0.14);
    --aurora-3: rgba(52, 211, 153, 0.10);
    --color-swatch-border: rgba(0, 0, 0, 0.12);
  }
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-1);
  color: var(--text-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

p, h1, h2, h3, h4, h5, h6 {
  margin: 0;
  overflow-wrap: break-word;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

.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;
}

/* Numeric metrics read cleaner with lining tabular figures so digits don't jitter
   during count-up animations and don't shift widths between rows. */
.num,
.stat,
.card-title,
th, td,
.slider-bubble,
input[type="number"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.stat {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1, .app-title, .page-title {
  letter-spacing: -0.02em;
}
