# Xaelin colours

Generated by `Source/scripts/build_kit.py` from `Source/palette.json`. Do not hand-edit; change the palette and rebuild.

## Brand

Xaelin is **black and white only**. There is no brand colour, accent or gradient.

| Token | Hex | Use |
|-------|-----|-----|
| Ink | `#0B0B0C` | The brand. Tile on light, glyph on the white tile, wordmark on light. |
| White | `#FFFFFF` | The brand. Glyph on the ink tile, tile on dark, wordmark on dark. |

**Tile system.** On light: ink tile, white glyph. On dark (the dark app): white tile, ink glyph. An ink tile on a dark page disappears, so never use it there; there is no brand grey to fix that, switch to the white tile.

**Mono grey** `#71717A` exists only for the single-colour `grey` files in `Monochrome/` and the lockup folders. Grey is a single-colour utility for the Monochrome set: it is not a brand colour and is not in the UI theme as one.

## Theme tokens (light / dark)

The neutral rows (background, surface, border, text, muted) are an **interface theme**, plain greys picked so the black-and-white mark sits well. They are not brand colours. Success, warning and error are standard **functional** colours; one set is used in both modes because each is at least 3:1 on both `#FFFFFF` and `#0B0F17`.

| Token | Light | Dark | Role |
|-------|-------|------|------|
| Primary | `#0B0B0C` | `#FFFFFF` | brand |
| Primary hover | `#27272A` | `#E4E4E7` | brand (state) |
| Accent | `#0B0B0C` | `#FFFFFF` | brand (no separate accent) |
| Background | `#FFFFFF` | `#0B0B0C` | neutral theme |
| Surface | `#F4F4F5` | `#161618` | neutral theme |
| Border | `#E4E4E7` | `#2A2A2E` | neutral theme |
| Text | `#0B0B0C` | `#F4F4F5` | neutral theme |
| Muted | `#52525B` | `#A1A1AA` | neutral theme |
| Success | `#15803D` | `#15803D` | functional |
| Warning | `#B45309` | `#B45309` | functional |
| Error | `#DC2626` | `#DC2626` | functional |
| Brand gradient | none | none | Xaelin is flat black and white. No gradient. |

## CSS variables

`Web/colors.css` (same content):

```css
/* Xaelin colours. Generated by Source/scripts/build_kit.py from Source/palette.json. Do not hand-edit. */
/* Brand = ink + white only. Background/surface/border/text/muted are neutral theme tokens, not brand colours.
   Success/warning/error are standard functional colours. */
:root {
  --xl-ink: #0B0B0C;
  --xl-white: #FFFFFF;
  --xl-mono-grey: #71717A;
  --xl-primary: #0B0B0C;
  --xl-primary-hover: #27272A;
  --xl-accent: #0B0B0C;
  --xl-background: #FFFFFF;
  --xl-surface: #F4F4F5;
  --xl-border: #E4E4E7;
  --xl-text: #0B0B0C;
  --xl-muted: #52525B;
  --xl-success: #15803D;
  --xl-warning: #B45309;
  --xl-error: #DC2626;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --xl-primary: #FFFFFF;
    --xl-primary-hover: #E4E4E7;
    --xl-accent: #FFFFFF;
    --xl-background: #0B0B0C;
    --xl-surface: #161618;
    --xl-border: #2A2A2E;
    --xl-text: #F4F4F5;
    --xl-muted: #A1A1AA;
    --xl-success: #15803D;
    --xl-warning: #B45309;
    --xl-error: #DC2626;
    color-scheme: dark;
  }
}

[data-theme="light"] {
  --xl-primary: #0B0B0C;
  --xl-primary-hover: #27272A;
  --xl-accent: #0B0B0C;
  --xl-background: #FFFFFF;
  --xl-surface: #F4F4F5;
  --xl-border: #E4E4E7;
  --xl-text: #0B0B0C;
  --xl-muted: #52525B;
  --xl-success: #15803D;
  --xl-warning: #B45309;
  --xl-error: #DC2626;
  color-scheme: light;
}

[data-theme="dark"] {
  --xl-primary: #FFFFFF;
  --xl-primary-hover: #E4E4E7;
  --xl-accent: #FFFFFF;
  --xl-background: #0B0B0C;
  --xl-surface: #161618;
  --xl-border: #2A2A2E;
  --xl-text: #F4F4F5;
  --xl-muted: #A1A1AA;
  --xl-success: #15803D;
  --xl-warning: #B45309;
  --xl-error: #DC2626;
  color-scheme: dark;
}
```

## Tailwind

`Web/tailwind.colors.js` exposes `xaelin.*` semantic keys that read the CSS variables (so they follow light/dark), plus raw hex in `tokens.light` / `tokens.dark`.

```js
const xl = require('./tailwind.colors.js');
module.exports = { theme: { extend: { colors: { xaelin: xl.xaelin } } } };
// bg-xaelin-primary, text-xaelin-muted, border-xaelin-border, bg-xaelin-error …
```

## Contrast

Text and controls on their own theme background (WCAG 2.x):

| Mode | Token | On | Ratio |
|------|-------|----|-------|
| Light | Primary `#0B0B0C` | `#FFFFFF` | 19.67:1 |
| Light | Primary hover `#27272A` | `#FFFFFF` | 14.89:1 |
| Light | Text `#0B0B0C` | `#FFFFFF` | 19.67:1 |
| Light | Muted `#52525B` | `#FFFFFF` | 7.73:1 |
| Light | Success `#15803D` | `#FFFFFF` | 5.02:1 |
| Light | Warning `#B45309` | `#FFFFFF` | 5.02:1 |
| Light | Error `#DC2626` | `#FFFFFF` | 4.83:1 |
| Dark | Primary `#FFFFFF` | `#0B0B0C` | 19.67:1 |
| Dark | Primary hover `#E4E4E7` | `#0B0B0C` | 15.50:1 |
| Dark | Text `#F4F4F5` | `#0B0B0C` | 17.90:1 |
| Dark | Muted `#A1A1AA` | `#0B0B0C` | 7.68:1 |
| Dark | Success `#15803D` | `#0B0B0C` | 3.92:1 |
| Dark | Warning `#B45309` | `#0B0B0C` | 3.92:1 |
| Dark | Error `#DC2626` | `#0B0B0C` | 4.07:1 |

Fills against the two reference backgrounds the brief asks for (`#FFFFFF` and `#0B0F17`, need at least 3:1):

| Colour | On `#FFFFFF` | On `#0B0F17` |
|--------|-----------|-----------|
| Ink `#0B0B0C` | 19.67:1 | 1.03:1 |
| White `#FFFFFF` | 1.00:1 | 19.18:1 |
| Mono grey `#71717A` | 4.83:1 | 3.97:1 |
| Success `#15803D` | 5.02:1 | 3.82:1 |
| Warning `#B45309` | 5.02:1 | 3.82:1 |
| Error `#DC2626` | 4.83:1 | 3.97:1 |

Ink on `#0B0F17` is about 1:1 by design: that is why the dark version of every asset uses the white tile and white wordmark. White on `#FFFFFF` is 1:1 for the same reason the other way round.
