/*
 * Uniborn UI kit — design tokens
 * Same values as uniborn.com and beta.uniborn.com.
 *
 * Theme: light by default. Dark applies when
 *   <html data-theme="dark">, or
 *   no data-theme and the OS prefers dark, or
 *   Mantine sets data-mantine-color-scheme="dark".
 *
 * Fonts (Google Fonts, OFL):
 * <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Brygada+1918:wght@500;600&family=Public+Sans:wght@400;500;600;700&display=swap">
 */

:root {
  /* Type */
  --ub-font-sans: "Public Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --ub-font-serif: "Brygada 1918", Georgia, serif;
  --ub-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --ub-text-xs: 12px;   /* minimum, labels and captions */
  --ub-text-sm: 13px;   /* tables, secondary text */
  --ub-text-md: 14px;   /* interface default */
  --ub-text-lg: 16px;   /* reading text, mobile inputs */
  --ub-text-xl: 18px;
  --ub-title-sm: 20px;  /* Brygada: card and section titles in prose */
  --ub-title-md: 24px;  /* Brygada: key figures */
  --ub-title-lg: 30px;  /* Brygada: page titles */
  --ub-title-xl: 40px;  /* Brygada: hero figure, one per screen */

  /* Space: 4px grid */
  --ub-space-1: 4px;
  --ub-space-2: 8px;
  --ub-space-3: 12px;
  --ub-space-4: 16px;
  --ub-space-5: 20px;
  --ub-space-6: 24px;
  --ub-space-8: 32px;
  --ub-space-10: 40px;

  /* Radius */
  --ub-radius-xs: 2px;
  --ub-radius-sm: 4px;   /* badges, checkboxes */
  --ub-radius-md: 6px;   /* buttons, inputs, nav items */
  --ub-radius-lg: 10px;  /* cards, tables, alerts */
  --ub-radius-xl: 14px;  /* modals, panels */

  /* Control heights */
  --ub-control-sm: 28px;
  --ub-control-md: 34px;
  --ub-control-lg: 40px;

  /* Motion */
  --ub-ease: cubic-bezier(.2, .7, .2, 1);
  --ub-duration: 150ms;
}

/* Light (default) */
:root,
[data-theme="light"],
[data-mantine-color-scheme="light"] {
  color-scheme: light;
  --ub-bg: #f1ede4;          /* page, same as uniborn.com */
  --ub-sidebar: #ebe6db;     /* navigation column, alternate bands */
  --ub-surface: #faf8f3;     /* cards, inputs, table body */
  --ub-surface-2: #f4f0e8;   /* hover, table header, selected row */
  --ub-ink: #111214;         /* text, primary buttons, active states */
  --ub-muted: #55585c;       /* secondary text */
  --ub-faint: #8a8c8f;       /* placeholders, captions */
  --ub-rule: rgb(17 18 20 / 0.10);
  --ub-rule-strong: rgb(17 18 20 / 0.22);
  --ub-inverse: #f1ede4;     /* text on ink */
  --ub-focus: rgb(17 18 20 / 0.40);

  /* Outcomes only. Never for stages, categories or decoration. */
  --ub-positive: #2f5d42;    /* paid, approved, distributed */
  --ub-attention: #86611c;   /* someone must act: pay, sign, review */
  --ub-negative: #883a2f;    /* cancelled, rejected, failed, errors */

  --ub-shadow-pop: 0 12px 32px rgb(17 18 20 / 0.10);
}

/* Dark */
[data-theme="dark"],
[data-mantine-color-scheme="dark"] {
  color-scheme: dark;
  --ub-bg: #16181c;
  --ub-sidebar: #121417;
  --ub-surface: #1c1e23;
  --ub-surface-2: #23262b;
  --ub-ink: #ecebe7;
  --ub-muted: #a3a5aa;
  --ub-faint: #6f7278;
  --ub-rule: rgb(236 235 231 / 0.10);
  --ub-rule-strong: rgb(236 235 231 / 0.22);
  --ub-inverse: #16181c;
  --ub-focus: rgb(236 235 231 / 0.45);
  --ub-positive: #8db597;
  --ub-attention: #d4b265;
  --ub-negative: #cf897d;
  --ub-shadow-pop: 0 12px 32px rgb(0 0 0 / 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-mantine-color-scheme]) {
    color-scheme: dark;
    --ub-bg: #16181c;
    --ub-sidebar: #121417;
    --ub-surface: #1c1e23;
    --ub-surface-2: #23262b;
    --ub-ink: #ecebe7;
    --ub-muted: #a3a5aa;
    --ub-faint: #6f7278;
    --ub-rule: rgb(236 235 231 / 0.10);
    --ub-rule-strong: rgb(236 235 231 / 0.22);
    --ub-inverse: #16181c;
    --ub-focus: rgb(236 235 231 / 0.45);
    --ub-positive: #8db597;
    --ub-attention: #d4b265;
    --ub-negative: #cf897d;
    --ub-shadow-pop: 0 12px 32px rgb(0 0 0 / 0.35);
  }
}
