/* ==========================================================================
   NMDB — National Minerals Database (Uganda)
   Design tokens, reset and theming
   Brider LLC · GIZ 10013716
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

:root {
  /* ---- Type ---- */
  --ff-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ff-display: 'Space Grotesk', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  /* ---- Radii / motion / layout ---- */
  --r-xs: 5px;  --r-sm: 8px;  --r: 12px;  --r-lg: 18px;  --r-pill: 999px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --t-fast: .12s var(--ease);
  --t: .2s var(--ease);
  --sbw: 246px;          /* sidebar width */
  --sbw-collapsed: 68px;
  --topbar-h: 58px;
  --mobnav-h: 60px;
  --maxw: 1560px;

  /* ---- Brand / semantic hues (hue-stable across themes) ---- */
  --h-gold: 41;
  --h-jade: 162;
  --h-sky: 208;
  --h-violet: 258;
  --h-copper: 17;
  --h-crimson: 353;
}

/* ==========================================================================
   DARK THEME (default)
   ========================================================================== */
:root, [data-theme="dark"] {
  color-scheme: dark;

  --bg:        #080b11;
  --bg-deep:   #05070b;
  --surface:   #0e131c;
  --surface-2: #131a26;
  --surface-3: #18212f;

  --card:      rgba(255,255,255,.035);
  --card-h:    rgba(255,255,255,.062);
  --card-solid:#111823;

  --line:      rgba(255,255,255,.075);
  --line-2:    rgba(255,255,255,.13);
  --line-str:  rgba(255,255,255,.22);

  --ink:       #e8eef7;
  --ink-2:     #94a7c0;
  --ink-3:     #5b6f89;
  --ink-4:     #3a4a5f;

  --gold:      #e3a92a;
  --gold-2:    #f7c65a;
  --gold-soft: rgba(227,169,42,.13);
  --gold-line: rgba(227,169,42,.30);

  --jade:      #21c99b;
  --jade-soft: rgba(33,201,155,.13);
  --jade-line: rgba(33,201,155,.30);

  --sky:       #3f9dff;
  --sky-soft:  rgba(63,157,255,.13);
  --sky-line:  rgba(63,157,255,.30);

  --violet:    #8f7cf8;
  --violet-soft: rgba(143,124,248,.13);
  --violet-line: rgba(143,124,248,.30);

  --copper:    #ef7f4c;
  --copper-soft: rgba(239,127,76,.13);
  --copper-line: rgba(239,127,76,.30);

  --crimson:   #f45b6a;
  --crimson-soft: rgba(244,91,106,.13);
  --crimson-line: rgba(244,91,106,.32);

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 6px 22px rgba(0,0,0,.42);
  --shadow-3: 0 18px 50px rgba(0,0,0,.55);

  --grid-line: rgba(255,255,255,.055);
  --overlay:   rgba(4,6,10,.72);
  --glass:     rgba(14,19,28,.86);
  --hl:        rgba(255,255,255,.04);
}

/* ==========================================================================
   LIGHT THEME
   ========================================================================== */
[data-theme="light"] {
  color-scheme: light;

  --bg:        #f4f6fa;
  --bg-deep:   #eaeef5;
  --surface:   #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;

  --card:      #ffffff;
  --card-h:    #f7f9fc;
  --card-solid:#ffffff;

  --line:      rgba(16,28,45,.10);
  --line-2:    rgba(16,28,45,.17);
  --line-str:  rgba(16,28,45,.30);

  --ink:       #101a27;
  --ink-2:     #4a5b70;
  --ink-3:     #74879e;
  --ink-4:     #9fb0c4;

  --gold:      #b07d05;
  --gold-2:    #8d6404;
  --gold-soft: rgba(176,125,5,.10);
  --gold-line: rgba(176,125,5,.26);

  --jade:      #07926d;
  --jade-soft: rgba(7,146,109,.10);
  --jade-line: rgba(7,146,109,.26);

  --sky:       #1668c7;
  --sky-soft:  rgba(22,104,199,.10);
  --sky-line:  rgba(22,104,199,.26);

  --violet:    #5b46cf;
  --violet-soft: rgba(91,70,207,.10);
  --violet-line: rgba(91,70,207,.26);

  --copper:    #c2551f;
  --copper-soft: rgba(194,85,31,.10);
  --copper-line: rgba(194,85,31,.26);

  --crimson:   #c8283a;
  --crimson-soft: rgba(200,40,58,.10);
  --crimson-line: rgba(200,40,58,.26);

  --shadow-1: 0 1px 2px rgba(16,28,45,.06);
  --shadow-2: 0 4px 16px rgba(16,28,45,.08);
  --shadow-3: 0 18px 44px rgba(16,28,45,.14);

  --grid-line: rgba(16,28,45,.07);
  --overlay:   rgba(20,28,40,.42);
  --glass:     rgba(255,255,255,.90);
  --hl:        rgba(16,28,45,.03);
}

/* ==========================================================================
   BASE
   ========================================================================== */
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv05' 1, 'ss01' 1, 'tnum' 0;
}

input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-str); background-clip: content-box; }

::selection { background: var(--gold-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Numeric alignment for all tabular figures */
.tnum, td.num, .stat-val, .money, table.tbl td { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   UTILITY
   ========================================================================== */
.mono { font-family: var(--ff-mono); font-size: .86em; letter-spacing: -.2px; }
.dsp  { font-family: var(--ff-display); letter-spacing: -.02em; }
.muted  { color: var(--ink-2); }
.muted2 { color: var(--ink-3); }
.tiny  { font-size: 11px; }
.sm    { font-size: 12.5px; }
.b     { font-weight: 600; }
.bb    { font-weight: 700; }
.up    { text-transform: uppercase; letter-spacing: .07em; }
.right { text-align: right; }
.center{ text-align: center; }
.nowrap{ white-space: nowrap; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide  { display: none !important; }
.grow  { flex: 1; }
.row   { display: flex; align-items: center; gap: 10px; }
.row-t { display: flex; align-items: flex-start; gap: 10px; }
.col   { display: flex; flex-direction: column; gap: 10px; }
.wrap  { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 6px; } .gap-3 { gap: 10px; }
.gap-4 { gap: 14px; } .gap-5 { gap: 18px; } .gap-6 { gap: 22px; } .gap-8 { gap: 30px; }
.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:20px}.mt-4{margin-top:30px}
.mb-1{margin-bottom:6px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:20px}.mb-4{margin-bottom:30px}

.c-gold{color:var(--gold)} .c-jade{color:var(--jade)} .c-sky{color:var(--sky)}
.c-violet{color:var(--violet)} .c-copper{color:var(--copper)} .c-crimson{color:var(--crimson)}
.c-ink{color:var(--ink)} .c-ink2{color:var(--ink-2)} .c-ink3{color:var(--ink-3)}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
