Design system

People and coding agents use one source. This page reads the tokens from the CSS and the code, so it cannot show a value that the site does not use. Coding agents read the same tokens and rules as JSON.

1. Rules

Each rule says what to do and why. Where a test checks the rule, the test is named. The other rules are checked in review.

1. tokens-only

Use the color tokens (bg-background, text-fg-muted, border-border, text-brand). Do not write a color value in a component.

One edit to a token then changes the whole site, and the colors stay in one scheme.

2. text-size

No text under 12px, and no capitals made with CSS. Use text-xs (12px) as the smallest size, for short labels only; text-sm (14px) for controls and hints. The one exception to the capitals is the HUD of the world (data-hud): spaced capitals in font-hud, at 12px, because the face is wide. Its fields stay at 14px.

Small capital labels are hard to read and add noise without meaning.

Checked bye2e/pages.spec.ts (opens in a new tab)

3. no-eyebrows

Do not put a small label above a heading. Put the meaning in the heading, or number the heading.

A label above a heading repeats it, and screen readers read it as a separate line.

4. mono-for-code

Use the mono font only for code, file paths and ids, at 14px or more.

Mono marks text that a reader can copy into a terminal or an editor.

5. titles

In a reader, make headings with ReaderTitle and ReaderSection (src/components/reader/Reader.tsx). In the old page layout, use Title, PageHeading or SectionHeading. Use className for layout only, not for size, weight or color. A title has one color: do not give some of its words or its number another shade.

One scale for each layout. To change a size, change the component. A second shade in a title makes one title read as two.

6. text-tones

Show less important text with text-fg-secondary or text-fg-muted. Do not lower the opacity of text-foreground. Use text-fg-faint only for decoration and disabled text.

One opacity looks much dimmer on a dark background. Each tone has its own light and dark value, tested for APCA contrast in both schemes.

Checked bysrc/lib/design/tokens.test.ts (opens in a new tab)

7. color-not-alone

Never show a state with color alone. Add an icon and a text label.

WCAG 1.4.1. The claim checker grades each have an icon, a label and a color.

8. focus

Every control shows focus: the focus ring, or the fill of hud-fill. When an overlay closes, focus goes back to the control that opened it.

Keyboard users must always know where they are.

Checked bye2e/lab.spec.ts (opens in a new tab)

9. states

A view that waits for the network has these states: idle, pending, streaming, complete, stopped and failed. Esc stops it, and the text that arrived stays.

A stream can be slow, stop or fail at any point. Each case needs a clear screen.

Checked bye2e/chat.spec.ts (opens in a new tab)e2e/check.spec.ts (opens in a new tab)e2e/lab.spec.ts (opens in a new tab)

10. stale-events

Every stream event carries the attempt it belongs to. A reducer ignores events from an attempt that is not active.

A stopped answer must not write into a new one.

Checked bysrc/lib/chat/chat-machine.test.ts (opens in a new tab)

11. motion-tokens

Animate with a spring, ease and duration from src/lib/design/motion.ts. Do not write new values in a component.

The same kind of change then moves the same way on every page.

12. hud-controls

A link or button in the HUD style uses the hud-fill utility: the HUD color fills it from the bottom on hover and on keyboard focus, and the label turns dark. Do not add another hover style to it.

Every control in the world answers the same way, so a visitor learns it once.

13. one-movement

In the world, the zoom of the camera to an icon is the only movement into a page. Text fades in, one line after the other, and does not slide.

Two movements at once fight for the eye. The zoom already says where the visitor goes.

14. reduced-motion

Respect reduced motion. Motion does this through MotionConfig at the root. CSS animations need a prefers-reduced-motion block.

Large movement can make some people feel sick.

15. targets

Make click and touch targets at least 24 by 24px. Buttons are 32px high.

WCAG 2.5.8. Small targets are hard to hit on a phone.

16. buttons

Buttons have four variants (primary, secondary, ghost, destructive) and four sizes (md, lg, icon, icon-lg), all round. Use at most one primary button in a view or group, with secondary next to it. Use destructive only to delete. A link that looks like a button is a ButtonLink or a ButtonAnchor, never a Button with a link in render.

Few buttons that look the same everywhere make the site read as one product. Button with a link in render gives the link role="button".

Checked bysrc/components/ui/button.test.ts (opens in a new tab)

17. dividers

Separate sections, and a heading from its content, with space (py-section, mb-section, pb-section-content), not with a line. Use a line only between the rows of a list or a table: put divide-y on the list, so there is no line above the first row or below the last. Lines use the default border color.

A line at every edge makes every edge equal, so the page reads as a stack of boxes. Space groups content, and a line then means "more of the same".

18. components

Build on the shadcn/ui base-nova components in src/components/ui, on Base UI. Merge classes with cn from the cn package. Use Lucide icons.

The primitives handle focus, keyboard and ARIA. Do not rebuild them.

2. Color

Colors are OKLCH custom properties. The site is dark only: the root gives every token its dark value. The world has its own tokens, for the HUD, the sky and the ground. A test checks the APCA contrast of the text tones.

Surface

  • bg-background

    The page.

  • bg-card

    Cards and panels that sit on the page.

  • bg-popover

    Hover cards, menus and drawers.

  • bg-secondary

    Quiet filled controls.

  • bg-muted

    Wells and hover fills.

  • bg-sky-warm

    The sky of the world, on the side of the sun.

  • bg-sky-cool

    The sky of the world, away from the sun.

  • bg-sky-haze

    The dark haze at the horizon of the world.

  • bg-ground

    The ground of the world, before the 3D scene loads.

Text

  • text-foreground

    All text. Lower its opacity for less important text.

  • text-fg-secondary

    Supporting text next to primary text. APCA Lc 75 or more.

  • text-fg-muted

    Descriptions, metadata and hints. APCA Lc 60 or more.

  • text-fg-faint

    Disabled text and decoration only.

  • text-card-foreground

    Text on a card.

  • text-popover-foreground

    Text on a popover.

  • text-secondary-foreground

    Text on a secondary fill.

  • text-muted-foreground

    Text on a muted fill.

Action

  • bg-primary

    The main button of a view.

  • text-primary-foreground

    Text on a primary fill.

  • bg-accent

    Hover fill of menu items.

  • text-accent-foreground

    Text on an accent fill.

  • bg-ring

    The focus ring. Every control shows it.

  • bg-brand

    A light orange of the HUD, light enough for text: selection, the active citation and the active states of the lab. Not for titles.

  • text-brand-foreground

    Text on a brand fill.

  • bg-chrome

    The dark base of the liquid metal on a primary button on hover.

  • text-chrome-foreground

    The label on the liquid metal. APCA Lc 90 or more on chrome.

  • bg-hud

    The HUD of the world, the outline on the ground and the edge of a sheet under the pointer.

Line

  • border-border

    Dividers and card edges.

  • border-input

    Edges of fields.

Status

  • bg-destructive

    Errors and actions that delete.

  • bg-verified

    The claim checker: verified.

  • bg-partial

    The claim checker: partly verified.

  • bg-contradicted

    The claim checker: contradicted.

Each circle shows the light value on the left and the dark value on the right. The page follows the color scheme of your system.

3. Type

Two faces. A wide face in spaced capitals for everything short, and a plain face for everything long. 12px is the smallest size, for short labels only.

Michroma · HUD

The HUD and the readers: titles, labels, lists and links, in capitals spaced 0.42em.

On purpose

A label, a list line or a link

DM Sans Variable

Long text in sentence case, and all text of the old page layout.

The answer streams in, and each claim links to its source.

JetBrains Mono

Code, file paths and ids only. Never for labels.

src/lib/design/tokens.ts

Tone · Primary

Headings and body text.

Tone · Secondary

Supporting text next to primary text.

Tone · Muted

Descriptions, metadata and hints.

Tone · Faint

Disabled text and decoration. Never for text that people must read.

4. Space and shape

Spacing follows the Tailwind scale of 4px steps. Two tokens set the rhythm of sections in the old page layout, and they grow at the sm (40rem) and lg (64rem) breakpoints. Controls in the HUD style have square corners.

TokenPhoneFrom 40remFrom 64rem
--header-heightThe fixed site header. Offsets under it use it (h-header, top-header).60px60px60px
--section-paddingSpace above and below a page section.3rem4rem5rem
--section-content-gapSpace between a section title and its content.2rem2.5rem3rem
--radiusCorner radius of controls. Cards use radius + 4px, pills use full.0.5rem——

5. Motion

In the world, the zoom of the camera to an icon is the movement into a page. Text only fades in, one line after the other. Springs for things that move, because a spring can stop and turn back with the pointer. Eases for things that fade. With reduced motion on, only opacity changes.

Springs

  • Panels and cards that move or resize.

  • List items that enter, and indicators that slide.

  • Citation chips and counts that appear.

  • Decorative pieces on the home page that bloom in.

  • Decorative pieces that answer the pointer.

Eases and durations

EASE_OUT
cubic-bezier(0.22, 1, 0.36, 1) · Things that enter.
EASE_IN
cubic-bezier(0.64, 0, 0.78, 0) · Things that leave.
DURATIONS.enter
280 ms · A message or panel that enters.
DURATIONS.exit
200 ms · Something that leaves.
DURATIONS.page
550 ms · A view that replaces another.
DURATIONS.reveal
700 ms · Content that scrolls into view, and the mobile menu.
DURATIONS.showcase
1100 ms · Large decorative pieces on the home page.

6. Components

In the world, a control is text in the HUD face. On hover and on keyboard focus, the HUD color fills it from the bottom (hud-fill). Try these.

A link

The old page layout (the lab and the claim checker) uses the shadcn/ui components below, in each state.

Button

Base UI button. Four variants, four sizes, all round. A link that looks like a button is a ButtonLink (a page of the site) or a ButtonAnchor (another site), not a Button. The focus state is the ring that keyboard focus shows. Disabled buttons that a stream turns off stay focusable, so focus is not lost.

primary

The main action of a view, in the brand color. At most one in each view or group. On hover, it fills with liquid metal.

Rest
Focus
Disabled
With icon

secondary

The action next to the main one, and other bordered actions, such as Stop and Retry. On hover, a chrome ring turns on its border.

Rest
Focus
Disabled
With icon

ghost

Actions in toolbars and lists, and most buttons that show only an icon.

Rest
Focus
Disabled
With icon

destructive

Actions that delete.

Rest
Focus
Disabled
With icon

md

The default: 32px high.

lg

The main actions of a page, such as the hero and the closing call to action: 44px high.

icon

An icon only: a 32px circle. Give it an aria-label.

icon-lg

An icon only that floats over content: a 40px circle.

Verdict badge

The five grades of the claim checker. Each has an icon, a label and a color, so color is never the only signal.

  • Verified

    The sources state this.

  • Partly verified

    The sources support part of this, but not all of it.

  • Not supported

    The sources cover this topic, but they do not show this.

  • Contradicted

    The sources state something different.

  • Unknown

    The public record does not cover this.

Citation chip

A number in the answer text that opens its source. It is a toggle button: aria-pressed shows the source in view.

Streams

Rest

Streams

Hover, or its source has the pointer

Streams

Active

Streams

Focus

Streams, drawers and panels

The parts that change with time have every state on a control bar in the Lab: idle, loading, slow, streaming, interrupted, error and done.

7. For agents

Coding agents work on this site. They read the same system as people do, from the files below, before they change the interface.

Tokens and rules as JSON

Colors with their values and Tailwind names, type, space, motion and all rules. Built from the same modules as this page.

/design/tokens.json

Instructions

The commands, the code style and a pointer to these rules. Agents read this file first.

AGENTS.md (opens in a new tab)

Checks

A unit test fails when a color in the CSS has no description, or a rule names a test that does not exist. The end-to-end tests check text sizes, focus and stream states.

src/lib/design/tokens.test.ts (opens in a new tab)

Ali Abbas