# Roboto Studio token guidelines

Color, type and surface rules for robotostudio.com page UI. The tokens live in `packages/ui/src/styles/globals.css` (Tailwind v4). Scenes have their own token set in [motion.md](https://robotostudio.com/design/motion.md); charts add the series palette in [charts.md](https://robotostudio.com/design/charts.md).

## Which layer is allowed

Color comes from one of two layers, and nothing else:

1. **Zinc utilities with a `dark:` pair**: `text-zinc-600 dark:text-zinc-400`. This is how most of the site is written.
2. **Semantic utilities** that flip with the mode on their own: `bg-background`, `text-foreground`, `text-muted-foreground`, `text-destructive`, `border-line`, `divide-line`.

This governs the classes you write. The shadcn components in `packages/ui` carry their own semantic classes (`border-input`, `bg-accent`); leave those alone and don't copy them into new markup.

Never:

- hex, `rgb()` or `hsl()` in a `className` or `style` (the chart and Scene palettes are the only raw values, and they have their own guides);
- `gray-*`, `slate-*`, `neutral-*` or `stone-*`. The site's neutral is zinc. `prose-slate` in `prose-scale.ts` is the typography plugin's base theme and is overridden with zinc; don't copy it;
- a zinc utility without its `dark:` pair. It reads fine in light mode and breaks in dark.

## Text color

```
What is the text?
 ├── A field's validation message → text-destructive (FormMessage and form-fields.tsx already set it)
 ├── A form-level error → FormErrorAlert (text-red-600 dark:text-red-400)
 ├── Body copy, a heading, or a button label → set nothing; body inherits text-foreground
 ├── A heading that must stand out from muted copy → text-zinc-900 dark:text-zinc-100
 ├── Secondary copy: descriptions, card body, paragraphs under a title → text-zinc-600 dark:text-zinc-400
 ├── A label, eyebrow, caption, metadata → text-zinc-500 dark:text-zinc-400
 ├── A centered section label (both Subheadings) → text-zinc-600 dark:text-zinc-400
 └── Decorative: section counters, placeholder glyphs → text-zinc-400 dark:text-zinc-600
```

Inside MDX, `<Highlight>` sets `text-zinc-500` for the second half of a display heading. Use it there, not a hand-written span.

## Backgrounds

```
What is the surface?
 ├── The page, or a cell inside a grid → set nothing; body is bg-background
 ├── The primary call to action → bg-zinc-950 dark:bg-zinc-50 (use ArrowCtaButton or Button, don't hand-build it)
 ├── A muted fill (inline code, a callout, a quiet card) → bg-zinc-100 dark:bg-zinc-900
 ├── Hover on a whole-card link → hover:bg-zinc-50 dark:hover:bg-zinc-900/50
 └── An error box → FormErrorAlert (red-50 / red-900 at 10%); don't rebuild it
```

`bg-black` and `bg-white` appear only behind a logo preview, where the mark needs a true black or white field.

## Borders

| Need | Utility |
|---|---|
| Any hairline: grid rails, cell dividers, card edges | `border-line` (zinc-200 `#E4E4E7`, zinc-800 `#27272A` in dark) |
| Dividers between children | `divide-line` |
| The edge of a pressable control | `border-zinc-300 dark:border-zinc-700`, hover `zinc-400` / `zinc-600` |

`border-line` replaces `border-zinc-200 dark:border-zinc-800`. Write the utility so the hairline color has one owner.

Grid cells share one line, never two. A cell draws its right and bottom edges; the outer frame comes from `GridContainer` (see [components.md](https://robotostudio.com/design/components.md)).

## Typography

Two families, both variable, loaded in `apps/web/src/app/layout.tsx`:

- **Geist** (`font-geist`, the body default) for everything people read.
- **Geist Mono** (`font-mono`) only for labels and machine strings: eyebrows, metadata, captions, code, paths, IDs, URLs, figures. Label-styled headings count as labels (both `Subheading`s render a mono `h2`). Never body copy or display headings. The one exception is a client's words: `Quote` sets them in mono.

Weights:

- Headings are `font-normal`. Hierarchy comes from size and color, not weight. Blog posts set every prose heading to `font-normal`.
- The one exception is the typography plugin's own scale inside `OffsetSection`: its h3s, and its h2s when the title is the page h1, stay `font-semibold` at `text-xl` and below. Don't add `font-semibold` anywhere else.
- Emphasis inside copy and button labels is `font-medium` (500).
- Never `font-bold`. A bold display heading reads as a different brand.

Sizes:

| Role | Classes | Source |
|---|---|---|
| Page title (h1) | `text-5xl` | `HeadingBlock` in `components/sections/heading.tsx` |
| Display h2 in a section | `text-2xl` to `lg:text-5xl` | `PROSE_WIDE` in `components/mdx/prose-scale.ts` |
| Lede under a title | `text-xl leading-relaxed` | `HeadingBlock` |
| Body | prose default (16px) | `PROSE_BASE` |
| UI text: buttons, nav, card copy | `text-sm` | `Button`, `ArrowLink` |
| Meta and captions | `text-xs` | `Figure` captions |
| Mono label | `text-[10px]`, the one arbitrary size allowed | see below |

Never go below 10px, and only mono labels go that small.

The label recipe, copied exactly wherever a label appears:

```tsx
<p className="font-mono text-[10px] text-zinc-500 uppercase tracking-[2px] dark:text-zinc-400">
  Machine readable
</p>
```

The service template's hero h1 (`app/services/[service]/page.tsx`) is `font-medium`; every other page h1 is `HeadingBlock` at `font-normal`. Use `HeadingBlock` for a new page.

Sentence case on every string: "Get started", not "Get Started". Uppercase labels are styled with `uppercase`; the source text stays sentence case.

## Corners

Sharp is the default on everything in the page: cards, containers, buttons, images, inputs, tables, chart frames. Don't write `rounded-sm`, `rounded-md`, `rounded-lg` or `rounded-xl` on page UI.

`rounded-full` is allowed in exactly three places, because each is a circle or floats above the page:

- avatars and icon discs (the `ArrowLink` arrow disc, `Quote` portraits, the `CentralHero` plus disc);
- floating chrome: fixed pills, pickers and toolbars over content, which are frosted glass (translucent fill, `backdrop-blur`, a bright top edge);
- Scenes, which depict product UI (rules in motion.md).

`Badge` and the Radix wrappers in `packages/ui` (dialog, dropdown, select, tooltip, toggle) still carry shadcn radii. Strip them with a class (`rounded-none`) where page UI uses one.

```tsx
// Correct: sharp card, hairline, zinc pair
<div className="grid gap-3 border-line border-b p-6 lg:p-8">

// Incorrect: radius on a page card, raw gray, no dark pair
<div className="rounded-lg border border-gray-200 p-6">
```
