# maskyr brand & engineering guidelines

**maskyr** (`maskyr.dev`) is a privacy gateway between applications and external AI models: detect, pseudonymise, restore.

> **Required attribution:**
> A [Sarja Technologies](https://sarja.dev) product. Model developed by [Fylume](https://fylu.me).

---

## 1. Product attribution & naming discipline

### Attribution
Every public surface—website footer, documentation home, CLI about output, and SDK README—must include the canonical attribution line with live links:

```markdown
A [Sarja Technologies](https://sarja.dev) product. Model developed by [Fylume](https://fylu.me).
```

- **Sarja Technologies** (`https://sarja.dev`): product ownership, engineering, and gateway platform.
- **Fylume** (`https://fylu.me`): specialised detection model developer (model currently in development and not yet integrated into the local gateway release).

### Lowercase rule
**Always write `maskyr` in lowercase everywhere.**

- **Allowed:** `maskyr`, `maskyr.dev`, `maskyr CLI`, `maskyr gateway`
- **Forbidden:** `Maskyr`, `MASKYR`, `Maskyr.dev`

Even at the start of a sentence or in a top-level `<h1>` heading, keep `maskyr` lowercase (or restructure the sentence so another word opens the clause). All-caps treatment (`MASKYR`) is strictly prohibited in UI copy, navigation, badges, and headings.

---

## 2. Visual identity & mark geometry

The visual system is architectural, editorial, and high-contrast—grounded in warm archival paper (`#FAFAF7`), crisp white (`#FFFFFF`), near-black ink (`#121210`), 1px structural hairlines (`#E2E0D6`), and calibrated signal yellow (`#F5CE00`).

### Mark geometry principles
- **Redaction bar motif:** Rectangular, sharp-edged proportions matching `--radius-none` (`0px`) to `--radius-xs` (`2px`). No soft organic blobs, glassmorphism, glowing gradients, or 3D isometric illustrations.
- **Flat elevation:** Hierarchy is established through surface stepping (`canvas` → `paper` → `stone` → `stone-deep`) and `1px` hairline borders—never blurred drop-shadow stacks.
- **Restrained corners:** Maximum container radius is `6px` (`--radius-md`). Pill shapes (`999px` / `rounded-full`) are forbidden for buttons, tags, and surrogate chips.

### Brand assets & usage
Required canonical brand assets (referenced in `.antislop.json`):

| Asset path | Purpose | Placement rules |
| :--- | :--- | :--- |
| `assets/brand/svg/maskyr-mark-dark.svg` | Standalone geometric mark (dark ink) | Header icon, square avatars, editorial callouts on `canvas`, `paper`, or `stone`. |
| `assets/brand/svg/maskyr-wordmark-dark.svg` | Primary lowercase `maskyr` wordmark + mark lockup | Primary navbar lockup (`height: 24px`–`28px`), documentation headers, footer attribution. |
| `assets/brand/svg/maskyr-favicon.svg` | Browser tab and manifest icon | `<link rel="icon" type="image/svg+xml">` across all HTML entry points. |

**Clearspace & minimum size:**
- Maintain clearspace equal to at least the height of the `m` cap/x-height on all four sides of the wordmark.
- Minimum wordmark width: `88px` on screen. Minimum mark width: `20px`.
- Never apply gradients, drop shadows, outlines, rotation, or hue shifts to the mark or wordmark.

---

## 3. Colour system & WCAG contrast ratios

All tokens are defined in `tokens/design-tokens.json` and compiled to `tokens/tokens.css` and `tokens/tailwind.preset.mjs`.

### Strict zero-purple rule
**Purple and violet hues (`255deg` to `325deg` in HSL or OKLCH) are strictly forbidden everywhere.**
This applies to UI surfaces, brand accents, hover states, focus rings, illustrations, badges, gradients, and code syntax highlighting tokens. `scripts/build-tokens.mjs` and `.antislop.json` (`"forbidPurple": true`) enforce this rule automatically.

### Core palette

| Token | Hex | OKLCH | Role |
| :--- | :--- | :--- | :--- |
| `--color-canvas` | `#FFFFFF` | `oklch(100% 0 0)` | Primary page canvas, secondary button fill, input fill |
| `--color-paper` | `#FAFAF7` | `oklch(98.43% 0.004 106.5)` | Warm archival reading surface, cards, light code blocks |
| `--color-stone` | `#F3F2EC` | `oklch(96.03% 0.008 98.9)` | Secondary surface bands, secondary button hover, table stripes |
| `--color-stone-deep` | `#E9E7DE` | `oklch(92.7% 0.0122 96.4)` | Active/pressed neutral surfaces and structural headers |
| `--color-hairline` | `#E2E0D6` | `oklch(90.55% 0.0136 97.5)` | `1px` dividers, nav bottom rule, card borders |
| `--color-border` | `#C7C4B6` | `oklch(81.88% 0.0195 96.9)` | Input borders, secondary button borders, interactive outlines |
| `--color-ink` | `#121210` | `oklch(18.14% 0.004 106.8)` | Primary typography, focus rings, dark code terminal background |
| `--color-ink-soft` | `#1C1C19` | `oklch(22.53% 0.0057 106.8)` | Elevated dark cards, dark surface panels, soft primary text |
| `--color-ink-secondary` | `#474640` | `oklch(39.31% 0.01 99.1)` | Supporting body copy, lead descriptions |
| `--color-ink-muted` | `#636159` | `oklch(49.19% 0.0127 95.3)` | Captions, metadata, timestamps, input placeholders |
| `--color-yellow` | `#F5CE00` | `oklch(85.93% 0.1765 95.1)` | Calibrated signal yellow primary CTA & active highlight |
| `--color-yellow-hover` | `#E2BD00` | `oklch(80.68% 0.1656 94.7)` | Primary CTA hover fill, surrogate chip border |
| `--color-yellow-wash` | `#FFF6CC` | `oklch(96.97% 0.0551 97.3)` | Surrogate chip background, callout highlight tint |
| `--color-yellow-ink` | `#6B5100` | `oklch(44.97% 0.092 87.1)` | High-contrast ochre text inside `yellow-wash` and on light surfaces |
| `--color-dark-text` | `#F5F4EE` | `oklch(96.63% 0.008 98.9)` | Primary typography on `--color-ink` / `--color-ink-soft` |
| `--color-dark-muted` | `#A8A69B` | `oklch(72.36% 0.0157 98.4)` | Secondary/muted typography and comments on dark surfaces |
| `--color-dark-border` | `#2C2C27` | `oklch(29.13% 0.0089 106.9)` | `1px` dividers and panel borders on dark surfaces |

### Verified WCAG 2.1 contrast ratios

All foreground/background pairings in `maskyr` meet or exceed WCAG 2.1 AA (`4.5:1` normal text), with primary text pairings clearing AAA (`7.0:1`):

| Foreground | Background | Contrast ratio | WCAG level |
| :--- | :--- | :--- | :--- |
| `ink` (`#121210`) | `canvas` (`#FFFFFF`) | **18.75:1** | AAA |
| `ink` (`#121210`) | `paper` (`#FAFAF7`) | **17.93:1** | AAA |
| `ink` (`#121210`) | `yellow-wash` (`#FFF6CC`) | **17.24:1** | AAA |
| `dark-text` (`#F5F4EE`) | `ink` (`#121210`) | **17.02:1** | AAA |
| `ink` (`#121210`) | `stone` (`#F3F2EC`) | **16.72:1** | AAA |
| `ink-soft` (`#1C1C19`) | `paper` (`#FAFAF7`) | **16.33:1** | AAA |
| `dark-text` (`#F5F4EE`) | `ink-soft` (`#1C1C19`) | **15.50:1** | AAA |
| `ink` (`#121210`) | `yellow` (`#F5CE00`) | **12.24:1** | AAA |
| `yellow` (`#F5CE00`) | `ink` (`#121210`) | **12.24:1** | AAA |
| `yellow` (`#F5CE00`) | `ink-soft` (`#1C1C19`) | **11.15:1** | AAA |
| `ink` (`#121210`) | `yellow-hover` (`#E2BD00`) | **10.28:1** | AAA |
| `ink-secondary` (`#474640`) | `canvas` (`#FFFFFF`) | **9.47:1** | AAA |
| `ink-secondary` (`#474640`) | `paper` (`#FAFAF7`) | **9.05:1** | AAA |
| `ink-secondary` (`#474640`) | `stone` (`#F3F2EC`) | **8.44:1** | AAA |
| `dark-muted` (`#A8A69B`) | `ink` (`#121210`) | **7.67:1** | AAA |
| `yellow-ink` (`#6B5100`) | `paper` (`#FAFAF7`) | **7.17:1** | AAA |
| `dark-muted` (`#A8A69B`) | `ink-soft` (`#1C1C19`) | **6.99:1** | AA / Large AAA |
| `yellow-ink` (`#6B5100`) | `yellow-wash` (`#FFF6CC`) | **6.89:1** | AA / Large AAA |
| `ink-muted` (`#636159`) | `canvas` (`#FFFFFF`) | **6.20:1** | AA / Large AAA |
| `ink-muted` (`#636159`) | `paper` (`#FAFAF7`) | **5.93:1** | AA / Large AAA |
| `ink-muted` (`#636159`) | `stone` (`#F3F2EC`) | **5.53:1** | AA / Large AAA |

> **Important:** Never set white (`#FFFFFF`) text on `--color-yellow` (`#F5CE00`). White on `#F5CE00` fails contrast (`1.53:1`). Always use `--color-ink` (`#121210`) on yellow fills, and `--color-yellow-ink` (`#6B5100`) for yellow-tinted text on light backgrounds.

---

## 4. Typography & forbidden defaults

### Self-hosted font stack
All font files are self-hosted in `assets/fonts/` as WOFF2 and declared in `tokens/tokens.css`:

- **UI & Editorial Sans (`--font-sans`):** `'Switzer', ui-sans-serif, system-ui, -apple-system, sans-serif`
  - Weights: `400` (regular), `500` (medium), `600` (semibold), `700` (bold)
  - Licence: Fontshare Free Font Licence (Indian Type Foundry)
- **Technical Monospace (`--font-mono`):** `'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace`
  - Weights: `400` (regular), `500` (medium) — Latin + Latin-Extended subsets
  - Licence: SIL Open Font License 1.1
  - Usage: **strictly** for code blocks, inline code, JSON payloads, CLI commands, CSS tokens, and surrogate IDs (e.g. `«PER_01»`, `«EMAIL_02»`). Never use `IBM Plex Mono` for marketing paragraphs or navigation links.

`font-synthesis: none;` is set globally on `:root` so browsers never fake italic or bold weights.

### Type scale, tracking & line heights

| Token | Value | Tracking | Leading | Typical use |
| :--- | :--- | :--- | :--- | :--- |
| `--text-display` | `clamp(2.5rem, 4.4vw, 4rem)` | `--tracking-tighter` (`-0.03em`) | `--leading-tight` (`1.1`) | Hero `<h1>` display headline |
| `--text-3xl` | `40px` | `--tracking-tight` (`-0.02em`) | `--leading-tight` (`1.1`) | Page titles |
| `--text-2xl` | `32px` | `--tracking-tight` (`-0.02em`) | `--leading-snug` (`1.25`) | Section headings (`<h2>`) |
| `--text-xl` | `24px` | `--tracking-snug` (`-0.01em`) | `--leading-snug` (`1.25`) | Subsection headings (`<h3>`) |
| `--text-lg` | `20px` | `--tracking-snug` (`-0.01em`) | `--leading-snug` (`1.25`) | Feature group titles |
| `--text-md` | `18px` | `--tracking-normal` (`0em`) | `--leading-normal` (`1.5`) | Lead copy, card headings |
| `--text-base` | `16px` | `--tracking-normal` (`0em`) | `--leading-normal` (`1.5`) | Standard body copy (`max-width: var(--measure)` = `64ch`) |
| `--text-sm` | `14px` | `--tracking-normal` (`0em`) | `--leading-relaxed` (`1.65`) | Compact UI controls, code blocks |
| `--text-xs` | `13px` | `--tracking-wide` (`0.04em`) | `--leading-normal` (`1.5`) | Metadata, table headers, surrogate chips |

### Forbidden typography defaults
- **No external font CDNs:** Never load Google Fonts, Adobe Fonts, or any third-party font stylesheet.
- **No generic AI/template fonts:** Never use `Inter`, `Roboto`, `Space Grotesk`, `Plus Jakarta Sans`, `Poppins`, or `JetBrains Mono`.
- **No uppercase spam:** `.antislop.json` sets `"maxUppercase": 6`. Use sentence case across UI controls, navigation, badges, and headings; reserve `text-transform: uppercase` (paired with `--tracking-wider` `0.08em`) for rare structural section kickers only.

---

## 5. Syntax highlighting palette (zero purple/violet)

Code examples and payload inspection panels must render in both light (`--color-paper`) and dark (`--color-ink`) themes using hues strictly outside `255deg`–`325deg`.

### Light syntax theme (`--sem-syntax-light-*` on `#FAFAF7`)

| Token | Hex | OKLCH | Hue (OKLCH / HSL) | Contrast on `#FAFAF7` | Role |
| :--- | :--- | :--- | :--- | :--- | :--- |
| `--sem-syntax-light-text` | `#121210` | `oklch(18.14% 0.004 106.8)` | `106.8°` / `60.0°` | 17.93:1 | Default code text |
| `--sem-syntax-light-comment` | `#636159` | `oklch(49.19% 0.0127 95.3)` | `95.3°` / `48.0°` | 5.93:1 | Comments |
| `--sem-syntax-light-keyword` | `#9A3412` | `oklch(46.98% 0.143 37.3)` | `37.3°` / `15.0°` | 6.99:1 | Keywords, HTTP verbs |
| `--sem-syntax-light-string` | `#115E59` | `oklch(43.7% 0.0705 188.2)` | `188.2°` / `176.1°` | 7.25:1 | String literals |
| `--sem-syntax-light-number` | `#6B5100` | `oklch(44.97% 0.092 87.1)` | `87.1°` / `45.4°` | 7.17:1 | Numbers, booleans |
| `--sem-syntax-light-function` | `#0E5A6F` | `oklch(43.49% 0.0758 222.2)` | `222.2°` / `193.0°` | 7.41:1 | Functions, types, classes |
| `--sem-syntax-light-surrogate-bg` | `#FFF6CC` | `oklch(96.97% 0.0551 97.3)` | `97.3°` / `49.4°` | — | Surrogate span highlight |
| `--sem-syntax-light-surrogate-text` | `#6B5100` | `oklch(44.97% 0.092 87.1)` | `87.1°` / `45.4°` | 6.89:1 (on `#FFF6CC`) | Surrogate token text |

### Dark syntax theme (`--sem-syntax-dark-*` on `#121210`)

| Token | Hex | OKLCH | Hue (OKLCH / HSL) | Contrast on `#121210` | Role |
| :--- | :--- | :--- | :--- | :--- | :--- |
| `--sem-syntax-dark-text` | `#F5F4EE` | `oklch(96.63% 0.008 98.9)` | `98.9°` / `51.4°` | 17.02:1 | Default code text & keys |
| `--sem-syntax-dark-comment` | `#A8A69B` | `oklch(72.36% 0.0157 98.4)` | `98.4°` / `50.8°` | 7.67:1 | Comments & operators |
| `--sem-syntax-dark-keyword` | `#F5CE00` | `oklch(85.93% 0.1765 95.1)` | `95.1°` / `50.4°` | 12.24:1 | Keywords, CLI flags |
| `--sem-syntax-dark-string` | `#5EEAD4` | `oklch(85.49% 0.1251 181.1)` | `181.1°` / `170.6°` | 12.68:1 | String literals |
| `--sem-syntax-dark-number` | `#FBBF24` | `oklch(83.69% 0.1644 84.4)` | `84.4°` / `43.3°` | 11.23:1 | Numbers, booleans |
| `--sem-syntax-dark-function` | `#7DD3FC` | `oklch(82.76% 0.1013 230.3)` | `230.3°` / `199.4°` | 11.25:1 | Functions, types, classes |
| `--sem-syntax-dark-punctuation` | `#8B897E` | `oklch(62.85% 0.0163 98.4)` | `98.4°` / `50.8°` | 5.34:1 | Braces, commas, colons |
| `--sem-syntax-dark-surrogate-bg` | `#2B2408` | `oklch(26.15% 0.0441 95.1)` | `95.1°` / `48.0°` | — | Surrogate span highlight |
| `--sem-syntax-dark-surrogate-text` | `#F5CE00` | `oklch(85.93% 0.1765 95.1)` | `95.1°` / `50.4°` | 10.09:1 (on `#2B2408`) | Surrogate token text |

---

## 6. Interactive UI component guidelines

### Buttons
- **Primary CTA:** `--cmp-button-primary-bg` (`#F5CE00`), `--cmp-button-primary-fg` (`#121210`), hover `--cmp-button-primary-bg-hover` (`#E2BD00`), `--cmp-button-radius` (`4px`), `--cmp-button-font-weight` (`500`), padding `12px 20px`.
- **Secondary / Outline:** `--cmp-button-secondary-bg` (`#FFFFFF`), `1px solid var(--cmp-button-secondary-border)` (`#C7C4B6`), hover `--cmp-button-secondary-bg-hover` (`#F3F2EC`).
- **Dark CTA:** `--cmp-button-dark-bg` (`#121210`), `--cmp-button-dark-fg` (`#F5F4EE`).
- **Focus state:** `outline: 2px solid var(--sem-focus-ring); outline-offset: 2px;` (on dark backgrounds, use `--sem-focus-ring-on-dark`, `#F5CE00`). Never remove `:focus-visible` outlines.

### Cards & structural panels
- Default card surface: `--cmp-card-bg` (`#FAFAF7`) with `1px solid var(--cmp-card-border)` (`#E2E0D6`), `--cmp-card-radius` (`6px`), `--cmp-card-padding` (`24px`).
- Alternate inset card: `--cmp-card-bg-alt` (`#F3F2EC`).
- Dark panel / inspector card: `--cmp-card-dark-bg` (`#1C1C19`) with `1px solid var(--cmp-card-dark-border)` (`#2C2C27`).
- Never stack multiple cards with heavy `box-shadow` elevations; rely on `1px` hairlines and surface contrast.

### Surrogate chips (domain-specific UI)
When displaying pseudonymised entities inline in text or JSON previews:
- Light surface: background `--cmp-surrogate-chip-bg` (`#FFF6CC`), text `--cmp-surrogate-chip-fg` (`#6B5100`), border `1px solid var(--cmp-surrogate-chip-border)` (`#E2BD00`), radius `--cmp-surrogate-chip-radius` (`2px`), font `IBM Plex Mono` `13px`.
- Dark surface: background `--cmp-surrogate-chip-bg-dark` (`#2B2408`), text `--cmp-surrogate-chip-fg-dark` (`#F5CE00`), border `1px solid var(--cmp-surrogate-chip-border-dark)` (`#6B5100`).

### Inputs & Navigation
- **Inputs:** `--cmp-input-height` (`40px`), `--cmp-input-radius` (`4px`), `1px solid var(--cmp-input-border)` (`#C7C4B6`), focus `1px solid var(--cmp-input-border-focus)` (`#121210`) + `2px` focus ring.
- **Navigation bar:** `--cmp-nav-height` (`64px`), `--cmp-nav-bg` (`#FFFFFF`), `1px solid var(--cmp-nav-border)` (`#E2E0D6`) bottom hairline, active route indicator in `--cmp-nav-active-indicator` (`#F5CE00`).

### Spacing & layout geometry
- Spacing scale is 4px-based (`--space-1` = `4px` through `--space-24` = `96px`, `--space-32` = `128px`).
- Standard container width: `--container-max` (`1280px`); wide architectural grid: `--container-wide` (`1360px`); editorial prose measure: `--measure` (`64ch`).

### Motion discipline
- `--dur-instant` (`90ms`): micro hover / active press.
- `--dur-fast` (`160ms`): buttons, links, surrogate chip highlights, input focus.
- `--dur-base` (`260ms`): panel transitions, drawer toggles.
- `--dur-step` (`360ms`): stepped detect → pseudonymise → restore pipeline demos.
- Easings: `--ease-snappy` (`cubic-bezier(0.2, 0, 0, 1)`) for UI state shifts; `--ease-out` (`cubic-bezier(0.22, 1, 0.36, 1)`) for reveals.
- Always honour `@media (prefers-reduced-motion: reduce)` by disabling transforms and collapsing transition durations.

---

## 7. Voice & copy discipline

`.antislop.json` sets `"claims": "none-verified"`. Copy must be concrete, architectural, and verifiable from code and product behaviour—never marketing hyperbole.

### Strictly prohibited claims
1. **Zero unverified security guarantees:** Never write "100% private", "unbreakable", "military-grade", "zero risk", or "guaranteed leak-proof". Instead, describe the mechanism: *maskyr intercepts outbound prompts locally, replaces detected entities with consistent surrogates before upstream egress, and restores original values in the response.*
2. **Zero unverified regulatory compliance claims:** Never write "GDPR compliant", "HIPAA certified", "SOC 2 Type II certified", or "ISO 27001 certified" unless formally audited and explicitly verified.
3. **Zero unverified performance or latency claims:** Never invent millisecond latencies, token/sec throughput, or percentage accuracy scores (e.g. "99.9% recall", "<5ms overhead") unless backed by a published, reproducible benchmark in this repository.
4. **Zero invented customer proof:** No fabricated logos, star ratings, user counts, or decorative trend charts without real underlying datasets.

### Writing style
- Short, declarative sentences. Active voice.
- Name actual mechanisms (`detect`, `pseudonymise`, `restore`, `surrogate map`, `egress proxy`, `upstream provider`).
- Keep `maskyr` lowercase in every sentence.

---

## 8. Asset & token inventory

| Directory / File | Contents | Notes |
| :--- | :--- | :--- |
| `tokens/design-tokens.json` | 3-layer W3C DTCG source (`primitive`, `semantic`, `component`) | Single source of truth for colour, type, spacing, radius, motion |
| `tokens/tokens.css` | Generated `@font-face` rules, `font-synthesis: none`, `:root` variables | Built via `npm run build:tokens` |
| `tokens/tailwind.preset.mjs` | Generated Tailwind CSS preset mapping theme keys to CSS variables | Import in `tailwind.config.*` |
| `scripts/build-tokens.mjs` | Zero-dependency token compiler + purple-hue validator | Outputs `tokens.css` and `tailwind.preset.mjs` |
| `assets/fonts/` | `switzer-{400,500,600,700}.woff2`, `ibm-plex-mono-{400,500}{-ext,}.woff2`, `LICENCE.txt` | Self-hosted WOFF2 fonts only |
| `assets/icons/` | `anthropic.svg`, `fylume.svg`, `openai.svg` | Provider & partner marks (`AS001` allowlist in `.antislop.json`) |
| `assets/brand/svg/` | `maskyr-mark-dark.svg`, `maskyr-wordmark-dark.svg`, `maskyr-favicon.svg` | Required brand SVG assets (`npm run build:assets`) |
| `.antislop.json` | Audit policy (`forbidPurple: true`, `claims: "none-verified"`, `maxUppercase: 6`) | Executed via `npm run audit` |
| `package.json` | Project scripts: `dev`, `build:tokens`, `build:assets`, `audit`, `start`, `test`, `typecheck`, `check:egress` | `"name": "maskyr-web"`, `"type": "module"` |

### Common commands

```bash
npm run build:tokens   # Compile tokens/design-tokens.json -> tokens/tokens.css + tokens/tailwind.preset.mjs
npm run dev            # Serve local workspace on http://localhost:4173
npm run audit          # Run antislop-audit across the workspace
```
