/*
 * Design tokens. The source of the values in docs/design/DESIGN.md.
 * Change a value here, then update DESIGN.md (a token change is a PROPOSAL).
 * Dark values follow the OS setting unless data-theme is set on <html>.
 */

:root {
  color-scheme: light;

  /* Colour: light. From the UniSpace logo: navy #0e243c, teal #08a896. Links and focus use a
     darker teal, because bright teal text on white is too faint. */
  --color-bg: #f4f7f6;
  --color-surface: #ffffff;
  --color-text: #0e243c;
  --color-muted: #4d5f70;
  --color-border: #d3dedb;
  --color-primary: #0e243c;
  --color-link: #066e62;
  --color-on-primary: #ffffff;
  --color-accent: #08a896;
  --color-on-accent: #0e243c;
  --color-focus: #066e62;
  --color-success-bg: #d4f2ea;
  --color-success-text: #0a5c4e;
  --color-warning-bg: #fdebc8;
  --color-warning-text: #7a4a00;
  --color-danger-bg: #fbd9d4;
  --color-danger-text: #8a2118;
  --color-info-bg: #dbe7f2;
  --color-info-text: #1d3f63;
  --color-shadow: rgb(14 36 60 / 0.08);
  --color-slot-hover-bg: rgb(45 212 191 / 0.08);
  --color-slot-hover-border: rgb(45 212 191 / 0.35);
  --color-slot-icon: rgb(45 212 191 / 0.2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #0b1a2b;
    --color-surface: #12233a;
    --color-text: #e6eef6;
    --color-muted: #9fb3c6;
    --color-border: #2a4059;
    --color-primary: #1cc3ac;
    --color-link: #5ed8c6;
    --color-on-primary: #06201b;
    --color-accent: #08a896;
    --color-on-accent: #06201b;
    --color-focus: #5ed8c6;
    --color-success-bg: #123f35;
    --color-success-text: #9be6d4;
    --color-warning-bg: #4a3a14;
    --color-warning-text: #ffd68a;
    --color-danger-bg: #4a1f1c;
    --color-danger-text: #ffb8ae;
    --color-info-bg: #1a3350;
    --color-info-text: #bcd9f2;
    --color-shadow: rgb(0 0 0 / 0.45);
    --color-slot-hover-bg: rgb(45 212 191 / 0.08);
    --color-slot-hover-border: rgb(45 212 191 / 0.35);
    --color-slot-icon: rgb(45 212 191 / 0.2);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0b1a2b;
  --color-surface: #12233a;
  --color-text: #e6eef6;
  --color-muted: #9fb3c6;
  --color-border: #2a4059;
  --color-primary: #1cc3ac;
  --color-link: #5ed8c6;
  --color-on-primary: #06201b;
  --color-accent: #08a896;
  --color-on-accent: #06201b;
  --color-focus: #5ed8c6;
  --color-success-bg: #123f35;
  --color-success-text: #9be6d4;
  --color-warning-bg: #4a3a14;
  --color-warning-text: #ffd68a;
  --color-danger-bg: #4a1f1c;
  --color-danger-text: #ffb8ae;
  --color-info-bg: #1a3350;
  --color-info-text: #bcd9f2;
  --color-shadow: rgb(0 0 0 / 0.45);
  --color-slot-hover-bg: rgb(45 212 191 / 0.08);
  --color-slot-hover-border: rgb(45 212 191 / 0.35);
  --color-slot-icon: rgb(45 212 191 / 0.2);
}

:root {
  /* Typography */
  --font-sans:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.5rem;
  --leading-tight: 1.2;
  --leading-body: 1.55;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Shape and motion */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px var(--color-shadow), 0 6px 18px var(--color-shadow);
  --duration-fast: 150ms;
  --duration-base: 250ms;

  /* Layout */
  --container-max: 1120px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
  }
}
