# Design
How Progression Radar looks and why, and the rules to follow when changing or adding UI. Read it together with
[PRODUCT.md](PRODUCT.md) (what the app does) and [ARCHITECTURE.md](ARCHITECTURE.md) (how it is built).

## Concept: a printed growth record
The default theme is inspired by Japanese print, after the 成長 ("growth") in the demo title. The page should feel
like a carefully typeset sheet that a manager and a person sit down with, not like a dashboard: a white sheet with a
band of washi paper across it, where the person and their radar sit.
| metaphor | in the UI |
|---------------------|---------------------------------------------------------------------------------|
| white sheet | almost white page: header, areas and footer (`--color-background`) |
| washi paper | full-width band behind the person and the radar, with a fractal-noise grain (`--color-band`, `--texture`) |
| sumi ink | near-black text, ink-filled active states |
| vermilion seal | the person: their hanko with initials, their radar series, the levels reached |
| indigo | the compared role: its radar series, the target level, categories "on target" |
| mincho type | editorial serif for titles, names and every number |
Three things carry the identity and must survive any change: the **seal**, the **two-colour person vs. role
language** and the **serif numbers**. Everything else stays quiet: few colours, few rules, generous space.
The theme is only a default. Adopters re-brand from their own `theme.css`, so every visual decision must be expressed
through the custom properties and stable class names described below, never hard-coded.
## Colour
### Tokens
Defined in `:root` in `src/styles.css`, with a dark palette in `@media (prefers-color-scheme: dark)`.
| token | light | dark | role |
|----------------------|-----------|-----------|-------------------------------------------------------------|
| `--color-primary` | `#c0361c` | `#ef6a4c` | accent: seal, reached levels, indices, links, focus ring |
| `--color-on-primary` | `#fff8ee` | `#1a0d08` | text on top of the accent |
| `--color-person` | `#c0361c` | `#ef6a4c` | the person's radar series, overall %, meter fill |
| `--color-compare` | `#24497d` | `#8fb0e3` | the compared role: series, target marker, "met" checks |
| `--color-text` | `#1c1915` | `#ede6d9` | ink: body text, rules, inverted (active) backgrounds |
| `--color-muted` | `#6a6258` | `#a39a8c` | labels, secondary text, descriptions |
| `--color-border` | `#d4cab9` | `#3b362e` | inner dividers and control borders |
| `--color-background` | `#fdfcf9` | `#16140f` | the sheet: page, header, areas and footer |
| `--color-surface` | `#ebe3d3` | `#211e18` | slightly darker paper for controls and the radar rings |
| `--color-grid` | `#d3c8b5` | `#3a352c` | radar rings and axes |
| `--color-band` | mix of background and surface (50% light, 70% surface dark) | | the washi band behind the person and the radar |
| `--color-heat` | `--color-text` | (follows it) | the Report only: the ink of the heat map where there is no role |
| `--color-below` | `#c0361c` | `#ef6a4c` | the Report only: levels below the compared role, the gap |
| `--color-above` | `#2f7a4a` | `#7fc495` | the Report only: levels above the compared role |
`--color-band` is derived with `color-mix`, so a theme that only changes `--color-background` and `--color-surface`
gets a matching band. Inside the band (`.overview`) `--color-background` is set to `--color-band`: whatever shows the
paper through (the seal's inner ring, the radar's even rings and hollow points) matches the band.
### Semantics
Colour has meaning here; keep it consistent:
- **Vermilion (`--color-primary` / `--color-person`) is the person** and what they act on: their seal, levels they
reached, the overall percentage, the selected radar label, numbering of the current item.
- **Indigo (`--color-compare`) is the role they compare to**: target markers, the role's series, "On target" stat,
the ✓ next to met categories and "meets …" status text. Never use indigo for anything that is not about the
compared role.
- **Ink (`--color-text`) is structure and selection**: rules, the inverted active category, the share button hover.
- **Muted** is for labels and supporting text. The app has no green/red success/error colours; errors use the accent
as a left border (`.error-message`).
- **The Report is the one exception**: it judges levels against a role, so red (`--color-below`) is the gap to the
role and green (`--color-above`) is what meets or passes it, always with a `−n` / `✓` / `+n` mark as well. To keep
red meaning only the gap there, the Report draws progress in ink (the overall figures, the levels without a role)
and the radar of a person's dates in ink and muted; vermilion stays on the seal. See "Report" below.
`--color-primary` and `--color-person` share a value by default but are separate tokens: adopters may split them.
Use `--color-person` for data about the person, `--color-primary` for UI accent.
### Tints
Derive tints and translucent fills with `color-mix`, never with new hex values:
```css
background: color-mix(in oklab, var(--color-surface) 55%, transparent);
```
This keeps tints correct in both palettes and under any theme override.
### Distinguishable without colour
The compared role is always **dashed and hatched** (radar area, legend swatch, the swatch in the "Compare to"
select), while the person is solid. Status is also given in text ("✓", "meets …", "3 levels below …"). Any new
person-vs-role visual must follow the same rule.
## Typography
| token | default | used for |
|------------------|------------------------------------------------|------------------------------------------------------------|
| `--font-display` | Shippori Mincho (700, 800) | app title, person name, category name, expectation summaries, all numbers (stats, indices, level numbers), the seal |
| `--font-family` | Zen Kaku Gothic New (400, 500, 700) | everything else |
| `--font-size` | `15px` | root body size, `line-height: 1.6` |
- Fonts are self-hosted Fontsource **Latin and Latin-ext subsets**, imported in `src/main.tsx`. CJK characters (the
成長 in the title) fall back to the system fonts in the stacks. Do not add a font from a CDN.
- **Only the loaded weights exist.** Display: 700 and 800. Body: 400, 500 and 700. Using 300 or 600 makes the browser
synthesise or substitute a weight; if a new weight is really needed, import its CSS in `main.tsx`.
- **Numbers are always serif and tabular** (`font-family: var(--font-display)` +
`font-variant-numeric: tabular-nums`), so they line up and read as "printed figures".
- Fluid sizes use `clamp()` for the large headings (`.app-title`, `.person-name`, `.category-name`).
- Readable measure: long text is capped at `62ch`–`68ch`.
### The small-caps label
Section labels, stat names, the header meta, eyebrows and the expectation list heading share one style: `0.7rem`, weight
700, `letter-spacing: 0.16em`, uppercase, muted. It is defined once as a selector list under "Small caps labels" in
`styles.css`. A new label joins that list instead of redefining the style. Buttons and tags use a close variant
(`0.68–0.72rem`, `0.12–0.14em`).
### Copy
English, sentence case, short. Plurals are handled (`1 level` / `2 levels`, `Level to go` / `Levels to go`). Indices
are zero-padded (`01 / 06`) and expectations are numbered `level.n` (`2.1`).
## Shape, lines and space
- **Almost square corners**: `--radius: 2px`. The only rounded element is the seal (`7px`, rotated `-5deg`).
- **Tone, not rules, separates the sections**: the header and the areas sit on the sheet, the overview on the washi
band, each band running the full width of the window. Do not add a rule where a band edge already separates.
- **Few rules**, never around a block, only where items need it:
- `1px solid var(--color-border)`: the footer's top (the colophon line).
- a hairline (`--color-border` at 60%) between expectations, none around the list.
- `1px dashed var(--color-border)`: empty or placeholder states (`.expectation-empty`).
- Category nav items have no rules: spacing, their meter and the hover tint separate them.
- **No drop shadows and no cards.** `box-shadow` is only used to draw rings (the seal's inner line, the pressed
level).
- Bands are full width; their content stays in a column of `--max-width: 1200px` with a gutter of
`clamp(1rem, 4vw, 3rem)`. Each band uses `padding-inline: var(--bleed)` (or `margin-inline` when the box itself must
stay in the column, like the footer rule and the notices), defined on `.app`, instead of a wrapper element.
Vertical rhythm is generous and uses `clamp()` for section gaps.
- Decorative details are small and geometric: the vermilion diamond before the footer title, the hatched swatches, the
meter target tick.
## Background
The page (`body`) is the flat sheet colour. The washi band (`.overview`) stacks three layers on `--color-band`:
1. `--texture`: an inline SVG `feTurbulence` grain (different tint and opacity per palette). `none` gives a flat band.
2. A faint vermilion glow at its top right (`--color-primary` at 9%).
3. A faint indigo glow at its bottom left (`--color-compare` at 6%).
The glows are derived from the tokens, so they follow a re-brand automatically.
## Layout
```
┌ app-header ──────────────────────────────────────────────────── sheet ┐
│ [logo] Title 6 AREAS · 5 ROLES [Copy] │
├ overview (grid 1fr / 2fr ≥ 900px) ─────────────────────── washi band ──┤
│ overview-side │ radar (SVG + legend) │
│ person-panel (seal, name, │ │
│ role, tags, compare to) │ │
│ progress-summary (stats) │ │
├ category-panel (grid 1fr / 3fr ≥ 900px) ───────────────────── sheet ───┤
│ category-sidebar (sticky) │ category-detail │
│ AREAS │ 01 / 06, name, description │
│ category-nav (name, level, │ level-nav (staircase) │
│ meter) │ level-status │
│ │ expectation-list → expectation × n │
│ app-footer ──────────────────────────────────────────────── hairline │
└────────────────────────────────────────────────────────────────────────┘
```
The header, the overview and the category panel span the window; the content of each stays in the centred column.
### Breakpoints
Only these exist; do not add new ones without a reason:
| query | what changes |
|----------------------|------------------------------------------------------------------------------------|
| `min-width: 900px` | two-column overview and category panel; sidebar becomes sticky |
| `max-width: 899px` | single column; category nav becomes a horizontal, scroll-snapping row of 12.5rem cards |
| `max-width: 600px` | radar labels grow in SVG units so they stay readable when the chart scales down |
## Components
Class names in bold are the **public theming contract** listed in `docs/guides/styles.md`: do not rename or remove
them. New classes meant for theming must be added to that list.
### Header — **`.app-header`**, **`.app-title`**, **`.app-logo`**, **`.share-button`**
A full-width band on the sheet colour: serif title with an optional logo, the "N areas · N roles" meta label and the
share button on the right. No rule under it: the washi band below marks the edge. The share button is outlined in ink, inverts to ink on hover and turns vermilion with a check
icon when the link is copied (`data-status="copied"`). Its label is announced with `aria-live`.
### Person — **`.person-panel`**, **`.person-seal`**
- **Seal**: the person's initials (or `?`) in the display font, vermilion, double-bordered (border + inset
box-shadows), rotated `-5deg`, with a noise mask that makes the ink look stamped, and `mix-blend-mode: multiply`
on light paper (`--seal-blend`, `normal` in dark mode). It plays the `stamp` animation on load. It is decorative
(`aria-hidden`).
- **Name**: an `` styled as a serif heading. A dashed underline appears on hover and a solid vermilion one
on focus; it must keep looking like text, not a form field.
- **Tags**: uppercase outlined chips.
- **Compare to**: a native `