# BeFair Lab — Design

> A small studio. Our products, your projects.

This file is the source of truth for how BeFair Lab looks, sounds and moves. It comes before the code. Everything in `src/styles/*.css` and the live components on [/design](/design) is downstream of what's written here.

When the design changes: update this file first, then `/design`, then the tokens and styles, then the pages. In that order.

---

## 1. Positioning

BeFair Lab is a small studio. We build our own products and tools (SketchUp plugins, Mac apps), design and ship apps and websites for clients, and help teams bring AI into their work.

- **Headline:** We make things for **us** & for **you**. "us" and "you" are buttons that sort the shelf into our products and client work.
- **Brand line:** Let's be fair. It closes the page (CTA, footer) and means fair scope, honest estimates, straight answers.
- **AI** is one of the services and one of the tools. It is never the headline. When a project used it, the project page says so in a content block.

### Site structure

One page tells the story; the blog keeps its own rhythm.

| Where | What |
|---|---|
| `/` | Hero → **Work** (`#work`, the shelf with every visible project) → **Services** (`#services`) → **About** (`#about`, studio line + principles) → latest notes → CTA |
| `/projects/[slug]` | Project page. "All work" goes back to `/#work`. |
| `/blog`, `/blog/[slug]` | Posts. |
| `/contact` | The form. Every "Start a project" lands here. |
| `/support`, `/design`, legal | Footer only. |

Header nav: Work · Services · About · Blog. The first three are anchors on `/`; on the home page the section in view is highlighted (`useActiveSection`, `aria-current="true"`), on a project page Work stays lit. `/projects` and `/about` permanently redirect to `/#work` and `/#about`.

---

## 2. Voice

Plain, specific, a little dry. First-person plural ("we").

**Do**

- Say what we did, in the past tense.
- Name the tool when it mattered, AI included.
- Write buttons as the action they perform: "Start a project", "Send message", "Save settings".
- Sentence case for everything, including buttons, tags and nav.
- Errors say what happened and how to fix it. Empty states say what to do next.

**Don't**

- "Revolutionary", "powered by AI", "best-in-class", "delight", "magical".
- Exclamation marks.
- ALL CAPS labels, `§ NN` markers, "A · B · C" meta strings, arrows appended to button text.
- One word in a headline set in another colour or italic. Headlines are one voice.

---

## 3. The look: Playful workshop

A workshop wall. Warm paper, ink outlines, flat bright fills, hard offset shadows. Projects sit on a dotted board, a little crooked, and straighten when you reach for them. The one bold idea is the shelf; everything around it stays disciplined.

---

## 4. Type

| Role | Family | Notes |
|---|---|---|
| Everything | **Bricolage Grotesque** (variable: `wght` 200–800, `opsz` 12–96, `wdth` 75–100) | Display at 800, body at 400. |
| Labels | Bricolage at `font-stretch: 75%`, 600 | Replaces the old monospace labels. Class `.narrow`. |
| Cyrillic | **Onest** | Bricolage has no Cyrillic; the browser falls through to Onest per glyph. |
| Code | System `ui-monospace` | Only inside prose code blocks. |

| Token | Size | Use |
|---|---|---|
| Display | `clamp(46px, 8.2vw, 128px)` / 800 / `-0.05em` | Home + page heroes |
| Heading | `clamp(38px, 5vw, 72px)` / 800 / `-0.045em` | Section heads |
| Title | 26px / 800 / `-0.03em` | Tile titles, card titles |
| Lede | 18–22px / 400 / 1.5 | First paragraph after a heading |
| Body | 18px / 400 / 1.55 | Running text, `max-width: 68ch` |
| Tag | 14px / 600 / width 75% | Tags, dates, status |

---

## 5. Colour

Light only. Colour is always a flat fill inside a 2px ink outline. No gradients as decoration.

| Token | Hex | Use |
|---|---|---|
| `--ink` | `#1d1b16` | Text, outlines, hard shadows |
| `--ink-2` | `#4a463d` | Secondary text |
| `--ink-3` | `#6b6558` | Hints, placeholders, dates. 5.2:1 on paper, 4.5:1 on board |
| `--paper` | `#f6f2ea` | Page background |
| `--card` | `#fffcf6` | Surfaces, inputs, tiles |
| `--board` / `--board-dot` | `#ebe3d3` / `#d6ccb7` | The dotted board under the shelf, login, 404 |
| `--red` | `#ff4d2e` | Primary buttons, CTA block, logo tile |
| `--butter` | `#ffd43b` | Client tags, "you", focus halo on inputs, skip link |
| `--mint` | `#8fe0bd` | "us", success, saved |
| `--sky` | `#9cc6ff` | Tiles, websites |
| `--lilac` | `#c7b3ff` | Tiles, stickers, apps |
| `--navy` | `#1e2a5e` | Dark tile, browser mock-ups |
| `--danger` / `--danger-bg` | `#c8351f` / `#ffe9e3` | Errors and destructive actions only |
| `--live` | `#1fbf6a` | The Live status dot |

### Semantic tokens

Components use semantic names, not palette names, so a contrast or brand fix happens once in `tokens.css`:

| Group | Tokens |
|---|---|
| Text | `--text`, `--text-muted`, `--text-subtle`, `--text-on-ink`, `--text-danger` |
| Surface | `--surface-page`, `--surface`, `--surface-sunken`, `--surface-inverse` |
| Border | `--border` (every control), `--border-subtle` (dividers only, never a control boundary) |
| Action | `--action-primary` / `--on-action-primary`, `--action-secondary`, `--action-danger` / `--on-action-danger` |
| Focus | `--focus-ring`, `--focus-ring-inverse`, `--focus-offset`, `--focus-halo` |

### Contrast rules (WCAG 2.2 AA)

- Text on red is **ink**, not white. White on `#ff4d2e` is 3.3:1 and fails at button sizes; ink is 5.2:1. The only white-on-red allowed is display-size type (CTA heading).
- `--ink-3` is the lightest text colour. Nothing smaller than 18px goes on a palette fill in `--ink-3`; use `--ink-2`.
- Control boundaries are ink. `--hairline` is for dividers.
- Information is never carried by colour alone (status = dot + word, chart series = colour + label).

Project tiles take their colour from `projects.highlight_style` (`sky`, `red`, `mint`, `lilac`, `butter`, `navy`). Empty means "pick by position" from sky → red → mint → lilac → butter.

---

## 6. Shape and space

- **Outline:** `--bw: 2px` solid ink on every surface that can be touched.
- **Shadow:** hard and offset, never blurred. `--shadow-sm` 3px, `--shadow` 4px, `--shadow-lg` 8px.
- **Radius grows with size:** `--r-sm` 12 (inputs) · `--r-md` 18 (cards, code) · `--r-lg` 26 (tiles, media) · `--r-xl` 40 (CTA, footer, forms). Pills are `999px`.
- **Shell:** `max-width: 1320px`, gutter `clamp(16px, 4vw, 48px)`.
- **Sections:** `padding: clamp(40px, 6vw, 80px) 0`. Section heads: heading + one-line description left, controls right.
- **Shelf grid:** 6 columns; the first visible tile spans 4, the rest span 2; one column under 900px.
- **Breakpoints:** `sm` 520px (phones), `md` 760px (small tablets), `lg` 900px (nav collapses, grids go single-column). Use only these in `@media`. Layouts must hold from 320px with no horizontal scroll.
- **Touch targets:** `--target` 44px for buttons, icon buttons and nav; never below `--target-min` 24px (inline text links excepted).
- **Safe areas:** `.shell` pads with `max(var(--gutter), env(safe-area-inset-*))`; fixed and bottom elements add `--safe-bottom`.
- **Layers:** `--z-raised` 1 · `--z-sticky` 30 · `--z-header` 50 · `--z-banner` 60 · `--z-overlay` 100 · `--z-toast` 200. No other z-index values.
- **Spacing:** `--space-1…7` (4, 8, 12, 16, 24, 32, 48px); sections use `--section-y`.

---

## 7. Components

Rendered live on [/design](/design).

**Site**

- **Button (`.btn`)**: red pill, ink outline, ink text, 4px shadow. Variants `.alt` (card), `.yellow`, `.ink`, `.danger`, `.sm`, `.wrap` (label from content may wrap). Legacy `.cta`/`.submit` render the same. Disabled = `disabled` or `aria-disabled="true"`, 55% opacity, no lift.
- **Icon button (`.icon-btn`, `.icon-btn.sm`)**: round, 44px (36px small), ink outline. Always has an `aria-label`. Used for menu, close, carousel arrows, row actions.
- **Focus**: one indicator everywhere, a 3px ink outline with 3px offset. Inputs add the butter halo on top. On dark overlays the ring is butter.
- **Skip link (`.skip-link`)**: first focusable element on every page, jumps to `<main id="main">`.
- **Chip (`.chip`, `.chip.on` / `[aria-pressed="true"]`)**: filters and small toggles. Never a primary action. Has a disabled style.
- **Tag (`.tag`, `.tag.client`)**: static labels. Client work is butter.
- **Status (`.status.live|beta|soon|archived|draft`)**: dot + word.
- **Segmented (`.seg` + `.ind`)**: options with a sliding ink pill. Header nav (follows the section in view on `/`) and shelf filter. Positioned by `useSlidingPill`, which marks the item under the pill `[data-lit]` so its text turns light; before JS runs the active item paints its own ink fill. Scrolls sideways rather than overflowing the page on narrow screens.
- **Shelf (`<Shelf>`)**: board + tiles + "Straighten" + filter, optional type chips and search (`browse`). The last cell is an empty slot that links to /contact.
- **Tile (`.tile`)**: colour plate with a tag and art (browser mock-up with a screenshot for websites, icon, cover image, or initial), then title, status and one line.
- **Hero words (`.word.us`, `.word.you`)**: headline buttons that drive the shelf filter.
- **Sticker (`.sticker`)**: draggable "N things live now" badge in the home hero.
- **Service row (`<ServiceList>`)**: shape icon, title, description, example link; colour sweeps in on hover.
- **CTA block (`<CtaBlock>`)**: red slab, "Let's be fair about it", terms from settings as tilted tags.
- **Post row (`.post-row`)**: date, title + excerpt, type tag; butter sweep on hover.
- **Form field (`.field`)**: bold label above, tied to the input with `htmlFor`/`id`; outlined input; ink focus ring + butter halo; error text in `--danger`, linked with `aria-describedby`, and `aria-invalid` on the input. Placeholders are examples, never the label.

**Admin**

Same language, calmer: no tilts, no drops.

- **Sidebar (`.admin-sidebar`)**: logo tile, pill nav with ink active state.
- **Page header (`.admin-page-header`)**: crumb, big heading, actions.
- **Sticky form bar (`.admin-sticky-stack`)**: title, save status pill (butter while saving, mint when saved), section pills.
- **Inputs (`.admin-input`, `.admin-textarea`, `.admin-select`, `.is-compact`)**: card fill, ink outline, ink focus ring + butter halo. Every input has a label (visible, or `aria-label` in dense block editors). No inline-styled inputs.
- **Table (`.admin-table`)**: outlined card, butter row hover, flags as small pills.
- **Stats (`.admin-stats`)**: colour cards in palette order.
- **Swatches (`.swatch`)**: tile colour picker.

---

## 8. Motion

One thing moves by itself: the first time the shelf scrolls into view, its tiles drop onto the board one after another. Everything else answers a person.

| Pattern | Where | Detail |
|---|---|---|
| Drop | Shelf, first time in view | 1.1s, stagger 110ms, overshoot then settle at the tile's tilt. Skipped if the shelf is already on screen at load. |
| Straighten | Tile hover, "Straighten" toggle | `--spring`, 0.6s; toggle staggers 55ms per tile. |
| Lift and press | Buttons, tiles, chips | Hover −2px with a bigger shadow; active presses into the shadow (80–100ms). |
| Sliding pill | Nav, filters | `--spring`, 0.4s. |
| FLIP re-sort | Shelf filter, type, search | Tiles slide to new spots, newcomers drop in. |
| Colour sweep | Service rows, post rows | `scaleX` 0 → 1 from the left, `--out`, 0.5s. |
| Drag | Home sticker | Follows the pointer and tilts while held. |

`prefers-reduced-motion: reduce` sets every duration to ~0 and skips the drop.

---

## 9. Imagery

Real screenshots and icons only. No stock photos, no illustrations of "AI". A website without a screenshot gets a browser mock-up in its tile colour; anything else without art gets its first letter on a card.

---

## 10. Anti-patterns

- Soft grey drop shadows, glows, blurred gradients.
- A different colour or italic for one word in a headline.
- ALL CAPS, `§` markers, middle-dot meta strings, monospace labels.
- Arrows appended to button text.
- Animating things nobody asked to move.
- Identical cards with identical radii regardless of what they are.
- Hard-coded hex values in components. A colour used twice earns a token.

---

## 11. File map

| File | What it owns |
|---|---|
| `src/content/design.md` | This document. |
| `src/content/site.ts`, `src/content/services.ts` | Positioning copy and the services list. |
| `src/styles/tokens.css` | Tokens, plus legacy aliases for old variable names. |
| `src/styles/base.css` | Reset, type, buttons, chips, tags, prose, media. |
| `src/styles/public.css` | Site chrome, shelf, pages, 404. |
| `src/styles/admin.css` | Admin. |
| `src/styles/design-page.css` | The /design page. |
| `src/components/shelf/*`, `src/lib/shelf.ts` | The shelf. |
| `src/app/(public)/design/page.tsx` | Live renders of the system. |

---

*v 2.0 · October 2026*
