@brignano/design 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/DECISIONS.md +199 -0
  2. package/DESIGN.md +337 -13
  3. package/README.md +5 -1
  4. package/components.css +2248 -0
  5. package/icons/LICENSE +43 -0
  6. package/icons/arrow-down.svg +15 -0
  7. package/icons/arrow-left.svg +15 -0
  8. package/icons/arrow-right.svg +15 -0
  9. package/icons/arrow-up-down.svg +17 -0
  10. package/icons/arrow-up.svg +15 -0
  11. package/icons/bell.svg +15 -0
  12. package/icons/calendar.svg +17 -0
  13. package/icons/check.svg +14 -0
  14. package/icons/chevron-down.svg +14 -0
  15. package/icons/chevron-left.svg +14 -0
  16. package/icons/chevron-right.svg +14 -0
  17. package/icons/chevron-up.svg +14 -0
  18. package/icons/circle-check.svg +15 -0
  19. package/icons/circle-help.svg +16 -0
  20. package/icons/circle-x.svg +16 -0
  21. package/icons/clock.svg +15 -0
  22. package/icons/copy.svg +15 -0
  23. package/icons/download.svg +16 -0
  24. package/icons/ellipsis-vertical.svg +16 -0
  25. package/icons/ellipsis.svg +16 -0
  26. package/icons/external-link.svg +16 -0
  27. package/icons/eye-off.svg +17 -0
  28. package/icons/eye.svg +15 -0
  29. package/icons/funnel.svg +14 -0
  30. package/icons/house.svg +15 -0
  31. package/icons/info.svg +16 -0
  32. package/icons/link.svg +15 -0
  33. package/icons/lock.svg +15 -0
  34. package/icons/log-out.svg +16 -0
  35. package/icons/map-pin.svg +15 -0
  36. package/icons/menu.svg +16 -0
  37. package/icons/minus.svg +14 -0
  38. package/icons/monitor.svg +16 -0
  39. package/icons/moon.svg +14 -0
  40. package/icons/pencil.svg +15 -0
  41. package/icons/plus.svg +15 -0
  42. package/icons/refresh-cw.svg +17 -0
  43. package/icons/search.svg +15 -0
  44. package/icons/settings.svg +15 -0
  45. package/icons/sun.svg +22 -0
  46. package/icons/trash-2.svg +18 -0
  47. package/icons/triangle-alert.svg +16 -0
  48. package/icons/undo-2.svg +15 -0
  49. package/icons/upload.svg +16 -0
  50. package/icons/user.svg +15 -0
  51. package/icons/x.svg +15 -0
  52. package/package.json +11 -2
  53. package/product-page.css +31 -28
  54. package/scripts/colour.mjs +41 -0
  55. package/scripts/email-tokens.mjs +58 -0
  56. package/tailwind.css +28 -0
  57. package/templates/app-shell.css +346 -0
  58. package/templates/article.css +167 -0
  59. package/templates/changelog.css +53 -0
  60. package/templates/email.html +61 -0
  61. package/templates/email.txt +10 -0
  62. package/templates/error.css +81 -0
  63. package/templates/legal.css +65 -0
  64. package/templates/settings.css +95 -0
  65. package/tokens.css +140 -14
package/DECISIONS.md CHANGED
@@ -513,3 +513,202 @@ across the projects could tell them apart.
513
513
  added words are gone.
514
514
  - Driftwood, Guidebook and Sites each add a `BRIEF.md`, pick their identity
515
515
  and cut to the budgets in their own repos.
516
+
517
+ ---
518
+
519
+ ## ADR-0012 — Shared components ship as plain CSS in a cascade layer
520
+
521
+ **Status:** accepted · 2026-11-07 · proposal `proposals/component-layer.md` (#45, #85)
522
+
523
+ ### Context
524
+
525
+ The package shipped tokens and the product-page template. Buttons, fields,
526
+ messages and pills existed only on the preview pages, so every consumer rebuilt
527
+ them, and they drifted (brignano.io: about five button styles, an `opacity-40`
528
+ disabled state that §4 forbids).
529
+
530
+ ### Decision
531
+
532
+ - Components ship as **plain CSS classes**: `components.css` for controls and
533
+ patterns, `templates/<name>.css` per page template. No React wrappers, no JS.
534
+ - Short unprefixed names (`.btn`, `.field`) inside `@layer brignano.components`,
535
+ so a consumer's own CSS and utilities win without `!important`. States come
536
+ from real attributes (`disabled`, `aria-invalid`, `[open]`), never classes.
537
+ - **Native first:** `<dialog>`, `popover`, `<details>`, anchor positioning.
538
+ Where behaviour needs JS, design documents the ARIA contract and the consumer
539
+ owns the script.
540
+ - `.pp-button` / `.pp-field` become aliases of the shared classes until 1.0.
541
+ - The full catalog is decided now in three waves; wave 3 is built only when a
542
+ product needs it.
543
+
544
+ ### Consequences
545
+
546
+ - One import gives any surface, React or not, the same controls.
547
+ - Every class must appear on a docs page, and contrast is checked in both
548
+ themes (`npm run check`).
549
+ - Behaviour bugs live in consumers' JS, not here; the docs pages carry the
550
+ contract so they are written the same way.
551
+
552
+ ---
553
+
554
+ ## ADR-0013 — Overlays may move as they open and close
555
+
556
+ **Status:** accepted · 2026-11-09 · #116, from #55
557
+
558
+ ### Context
559
+
560
+ The tool tier has no motion (§2), and §7 rules out entrance animation.
561
+ ADR-0009 allowed one exception: motion the reader starts that shows an order.
562
+ The component catalog (#55 dialog, #56 popover and menu, #58 toast) asked for
563
+ open and close motion on overlays, which meets none of ADR-0009's conditions.
564
+ Dialogs and sheets first shipped still (#115). A sheet that appears from
565
+ nowhere doesn't say which edge it belongs to, and a dialog that blinks in
566
+ reads as a page jump. Anthony chose to allow the motion with its own entry.
567
+
568
+ ### Decision
569
+
570
+ An overlay (dialog, sheet, popover or menu, toast) may animate as it opens
571
+ and closes, in both tiers, when:
572
+
573
+ - the person opened it, or it answers something they just did;
574
+ - only `opacity` and `transform` move, for `--dur-fast` on `--ease`: a fade
575
+ plus a slide of a few pixels, or a sheet sliding from its own edge;
576
+ - the open state is fully shown without the animation (it comes from
577
+ `@starting-style`), so a browser that lacks it shows the overlay at once;
578
+ - `prefers-reduced-motion` makes it instant, `::backdrop` included.
579
+
580
+ ### Consequences
581
+
582
+ - §2's motion row and §7 name this as the one exception beside ADR-0009.
583
+ Content on the page itself still never animates in.
584
+ - `.dialog` and `.sheet` get the motion now. Popover, menu and toast use the
585
+ same timing when they are built. The site header's phone menu (#54) can
586
+ adopt it in a later change.
587
+ - Anything else that wants to move still has to meet ADR-0009 or it is
588
+ decorative.
589
+
590
+ ---
591
+
592
+ ## ADR-0014 — Identity is a mono voice, a product's mark inside its app, and heavy Geist
593
+
594
+ **Status:** accepted · 2026-11-12 · #137, [`proposals/identity.md`](proposals/identity.md)
595
+ **Supersedes:** the identity elements named in ADR-0004 (the trail, Silkscreen)
596
+
597
+ ### Context
598
+
599
+ ADR-0004 moved identity off amber fills and onto "the things that were always
600
+ carrying it": the trail, the `A|B` monogram and the Silkscreen display face.
601
+ The trail was later removed from brignano.io because it didn't help the
602
+ experience, and neither of the other two ever shipped in the package. An app
603
+ built from the system had no identity at all, and the product marks
604
+ (ADR-0011) stopped at the product page. Anthony chose a direction from a
605
+ wireframe (`previews/wireframes/identity.html`) and accepted the proposal.
606
+
607
+ ### Decision
608
+
609
+ - **A mono voice.** Every screen opens with one small uppercase mono label,
610
+ and numbers, dates and codes are set in mono. A written rule, not a check.
611
+ - **A product's mark follows it into its app.** `data-mark` on `<html>` sets
612
+ the mark for everything below it: the brand glyph in the header and on
613
+ error pages, and the rule above a hero heading. With no attribute the mark
614
+ is the family amber (`--mark`), so personal tools share it. A product gets
615
+ its own hue when it gets a product page.
616
+ - **Heavy, tight Geist is the display treatment**, in both tiers, for an
617
+ error code or the `A|B` stamp. Silkscreen is removed in the next minor
618
+ release, after brignano.io has swapped it out.
619
+ - A mark is still never a button, link, text or state (ADR-0004, ADR-0011).
620
+ Cobalt stays the only colour that means "you can act on this".
621
+
622
+ ### Consequences
623
+
624
+ - The trail is no longer part of the identity; DESIGN.md §1, §3 and §5 and
625
+ the comments in `tokens.css` drop it when the build lands.
626
+ - `components.css` gains `.eyebrow`, `.num`, `.display`, `.stamp` and
627
+ `.rule`; `tokens.css` gains the `data-mark` rules. `product-page.css`
628
+ reads the same variable, so `.pp[data-mark]` keeps working.
629
+ - `--display` stays as a token name, so nothing breaks by name when the
630
+ Silkscreen override and font file go.
631
+ - brignano.io, driftwood, guidebook and sites each get an issue: the first to
632
+ swap Silkscreen, the others to set `data-mark`.
633
+
634
+ ---
635
+
636
+ ## ADR-0015 — A white label on cobalt in both themes; controls answer a press and a switch
637
+
638
+ **Status:** accepted · 2026-11-12 · #136
639
+ **Amends:** ADR-0001 (the dark steps of cobalt), ADR-0013 (what may move)
640
+
641
+ ### Context
642
+
643
+ A review of the whole system found three things that made the components
644
+ read as a default kit. In dark the primary button was a pale blue with a dark
645
+ label, and its hover and pressed steps were paler still, so the most
646
+ important control on a screen looked washed out. Buttons, inputs, cards and
647
+ dialogs shared corners that didn't say which was nested in which (a 12px
648
+ button in a 12px card, beside a 6px input). And a control gave no feedback
649
+ beyond a colour step, while switching a tab was an instant swap.
650
+
651
+ ### Decision
652
+
653
+ - **The cobalt fill takes a white label in both themes.** Dark `--i` is a
654
+ saturated mid-cobalt (hue 256°, as light as a white label allows at 4.5:1),
655
+ and `--i-hover` and `--i-pressed` step darker, as they do in light. `--i-ink`
656
+ is unchanged, so in dark the fill and the ink are now different steps.
657
+ `--on-i` is white everywhere; a `--danger` fill gets its own `--on-danger`,
658
+ because rust still lifts to a pale fill with a dark label in dark.
659
+ - **Controls have their own radius.** `--radius-control` (8px) for buttons,
660
+ inputs, selects, the segmented control and menu items, between
661
+ `--radius-sm` (chips, pills) and `--radius` (cards).
662
+ - **A control may answer the person who used it.** A button settles by 2%
663
+ while pressed, and a switch of view (a tab, a segment) may cross-fade
664
+ through `document.startViewTransition()`, at the browser's default 250ms.
665
+ The package styles nothing on the transition, so it can't change a site's
666
+ own. Both are only ever started by the person, and neither happens under
667
+ `prefers-reduced-motion`.
668
+
669
+ ### Consequences
670
+
671
+ - Everything drawn in `--i` in dark gets more saturated and darker: the
672
+ checked checkbox and switch, the selected segment, the current page number,
673
+ progress bars, the info dot, and the washes (`--i-surface`, `--i-line`,
674
+ `--i-selection`), which mix the fill. All still clear their floors.
675
+ - The danger button in dark keeps its pale fill and dark label. Bringing it
676
+ in line means moving a state hue, which is a separate decision.
677
+ - §7's list of what may move gains a third entry. Entrance, hover and scroll
678
+ animation are still out.
679
+ - Sheets and dialogs already move under ADR-0013 and get nothing new.
680
+
681
+ ---
682
+
683
+ ## ADR-0016 — The danger button has its own fills; the state hue doesn't move
684
+
685
+ **Status:** accepted · 2026-11-12 · #147
686
+ **Follows:** ADR-0015, which left the dark danger button as it was
687
+
688
+ ### Context
689
+
690
+ After ADR-0015 the primary button in dark is a deep cobalt with a white
691
+ label. The danger button still filled with the state hue `--danger`, which in
692
+ dark is a pale rust chosen to be read as text and marks on dark surfaces, so
693
+ the button carried a dark label and went lighter on hover. Beside the primary
694
+ the destructive action looked the softer of the two. Deepening `--danger`
695
+ itself would have darkened every message, pill and field error with it.
696
+
697
+ ### Decision
698
+
699
+ A destructive button fills with tokens of its own: `--danger-fill`,
700
+ `--danger-fill-hover` and `--danger-fill-pressed`, under a white
701
+ `--on-danger` label in both themes. In light they are `--danger` and
702
+ `--danger-ink`, so nothing changes there, and `npm run check` holds them to
703
+ those. In dark they sit at rust's hue and chroma, as light as a white label
704
+ allows at 4.5:1, stepping darker on hover and press: the method ADR-0015 used
705
+ for cobalt.
706
+
707
+ ### Consequences
708
+
709
+ - `--danger`, `--danger-ink` and the danger washes are untouched, so
710
+ messages, pills, toasts, field errors and diagram states look as before.
711
+ - "Fill" and "state" are now separate roles for danger, as `--i` and `--i-ink`
712
+ are for cobalt. Success and attention have no filled control, so they get
713
+ no fill tokens until something needs one.
714
+
package/DESIGN.md CHANGED
@@ -18,6 +18,11 @@ colour used so sparingly that when it appears you look at it.
18
18
  Nothing here should read as a developer-portfolio template, and nothing should
19
19
  read as a toy.
20
20
 
21
+ What makes a screen recognisably one of these (ADR-0014): a **mono voice** (a
22
+ small uppercase mono label opens every screen, and every number, date and code
23
+ is set in mono), the product's own mark on its glyph, and one heavy, tight
24
+ Geist moment where a screen has something big to say. §5 has the classes.
25
+
21
26
  ## 2. Two tiers, one foundation
22
27
 
23
28
  The professional site should be more polished than a private trip planner. That
@@ -31,7 +36,7 @@ family, motion and shape are identical; what changes is how much room things get
31
36
  | Section rhythm | `--s9` (96px) | `--s6` (32px) |
32
37
  | Measure | 68ch | 780px |
33
38
  | Display face | Silkscreen — monogram, hero eyebrows | none (aliases to `--sans`) |
34
- | Motion | the trail, scroll reveal | none |
39
+ | Motion | scroll reveal, overlays opening and closing (ADR-0013), a press and a switch of view (ADR-0015) | none, except overlays opening and closing (ADR-0013), a press and a switch of view (ADR-0015) |
35
40
  | Density | whitespace carries the layout | scanning beats reading |
36
41
 
37
42
  ## 3. Colour — one hue, one meaning
@@ -63,17 +68,36 @@ system coherent across a marketing site and an operational tool.
63
68
 
64
69
  ### Identity is not a fill
65
70
 
66
- `--mark` inks a **graphic**: the trail line, the `A|B` monogram, a hero rule.
71
+ `--mark` inks a **graphic**: a product's glyph, the `A|B` monogram, a hero rule.
67
72
  That is its entire permitted use. It is never a button, chip, badge, wash, border,
68
73
  or link.
69
74
 
70
75
  This is the resolution of a real problem. Amber used to be both the brand colour
71
76
  and the warning colour, kept apart by a rule about scale — and rules enforced by
72
77
  remembering get forgotten. Identity moved to the things that were always carrying
73
- it (the trail, the monogram, the type, restraint), so amber in UI chrome now only
78
+ it (the monogram, the type, restraint; ADR-0014), so amber in UI chrome now only
74
79
  ever means *attention*. If you're reaching for `--mark` to tint an interface
75
80
  element, the answer is a neutral or a state colour.
76
81
 
82
+ ### A product's mark follows it
83
+
84
+ Each product has one mark colour (`--mark-teal`, `--mark-violet`,
85
+ `--mark-magenta`; §13), and it is the same on its marketing page, inside its
86
+ app and on its error pages (ADR-0014). Set it once:
87
+
88
+ ```html
89
+ <html data-mark="teal">
90
+ ```
91
+
92
+ `data-mark` sets `--mark-current` for everything inside the element. The brand
93
+ glyph in `.site-brand` and `.error-page-mark` (an inline SVG in `currentColor`)
94
+ and `.rule` draw in it; the name beside the glyph stays `--ink`. With no
95
+ attribute the mark is the family amber, so personal tools share it. A product
96
+ gets its own hue when it gets a product page, not before.
97
+
98
+ The contract is `--mark`'s: a graphic only. Buttons and links stay cobalt on
99
+ every product, so "you can act on this" looks the same everywhere.
100
+
77
101
  ### Colour is a surface, not text
78
102
 
79
103
  A wash (12% light / 20% dark via `color-mix`) behind an element with the text kept
@@ -90,6 +114,15 @@ Every state ships with an **icon and a word**. Colour is the accelerant, not the
90
114
  signal — this covers colour-vision deficiency, greyscale printing, and forced-colours
91
115
  mode in one rule.
92
116
 
117
+ ### Code is the one non-interactive cobalt
118
+
119
+ Syntax keywords (`--code-keyword`) and a highlighted line (`--code-highlight`)
120
+ borrow the cobalt ink and wash, though nothing there can be acted on. It's
121
+ deliberate and contained: inside a code block, a reader scanning for structure
122
+ needs one accent, and cobalt is the only hue that can't be misread as a state.
123
+ Everything else in code is neutral (§9). Nowhere outside a code block does
124
+ cobalt mean anything but *you can act on this*.
125
+
93
126
  ### What does NOT get colour
94
127
 
95
128
  Event type. Six types in six colours is exactly the complication this avoids —
@@ -100,7 +133,13 @@ type is already carried by a text label. Nor `idea`, `planning`, `someday`, or
100
133
 
101
134
  The part that makes an interface feel built rather than styled.
102
135
 
103
- - `--i` fill, `--i-hover`, `--i-pressed`, `--i-ink` for links/icons/focus.
136
+ - `--i` fill, `--i-hover`, `--i-pressed`, `--i-ink` for links/icons/focus. The
137
+ fill is a saturated cobalt with a white label (`--on-i`) in both themes, and
138
+ hover and pressed step darker in both. In dark the fill and the ink are
139
+ different steps: fill a surface with `--i`, write or draw on a surface with
140
+ `--i-ink`, and a hovered link takes `--i-ink-hover`, never the fill's hover. A destructive button fills with `--danger-fill` (and its
141
+ `-hover` and `-pressed` steps) under a white `--on-danger` label, not with
142
+ the state hue `--danger`, which in dark is a pale rust for reading.
104
143
  - **Disabled is neutral, never hued** (`--i-disabled-bg` / `--i-disabled-ink`). A
105
144
  greyed-out control must stop signalling "click me". Its low contrast is allowed
106
145
  only because WCAG 1.4.3 exempts *inactive* controls, so the state must be real:
@@ -111,8 +150,12 @@ The part that makes an interface feel built rather than styled.
111
150
  `--surface-active`, not from opacity tricks.
112
151
  - A control's own edge — an input, a secondary button — is `--line-control`
113
152
  (≥ 3:1). `--line-strong` is a divider, too faint to tell you a control is there.
114
- - Native checkboxes, radios and ranges inherit `accent-color: var(--i)` from
115
- `tokens.css`; don't restyle them just to recolour them.
153
+ - Checkboxes and radios in a `.choice` row are drawn from tokens
154
+ (`components.css`), so they look the same on every OS. Bare ones, ranges and
155
+ progress bars stay native and inherit `accent-color: var(--i)` from
156
+ `tokens.css`; don't restyle those just to recolour them. `.progress` and
157
+ `.meter` on a native `<progress>` or `<meter>` draw it from tokens, for
158
+ when a bar must look the same everywhere.
116
159
 
117
160
  ## 5. Type
118
161
 
@@ -129,15 +172,72 @@ Three roles, no more:
129
172
 
130
173
  No serif. Abstract over literal — no mascots, clip-art, or stock scenery.
131
174
 
175
+ **The voice** (ADR-0014) is these three roles used the same way everywhere:
176
+
177
+ - **One eyebrow per screen.** `.eyebrow` is a small uppercase mono label above
178
+ the screen's heading that says where you are ("Production" above
179
+ "Services"). One, not one per card. Written in sentence case; the CSS
180
+ uppercases it (§15).
181
+ - **Numbers in mono.** A number, date, time or code a person might compare or
182
+ copy takes `.num` (mono, tabular figures). A table's numeric column and a
183
+ stat's value already do.
184
+ - **One heavy moment.** `.display` sets an error code or a single headline
185
+ figure in Geist at `--weight-heavy` (800), tight and large; `.stamp` sets the
186
+ `A|B` monogram at the same weight, spaced open (`--tracking-caps`) so the bar
187
+ doesn't read as an I, for a footer or an about page. This is the
188
+ display treatment, in both tiers. It is the one use of a weight above 600,
189
+ and at most once a screen. `.rule` is the short bar in the mark in force (`--mark-current`, §3)
190
+ above a hero heading. (`--display` still names Silkscreen on the marketing tier until
191
+ #142 removes it.)
192
+
193
+ Sizes change with the tier (`--text-xs` … `--text-4xl`); weight, leading and
194
+ tracking don't:
195
+
196
+ | Token | Value | For |
197
+ |---|---|---|
198
+ | `--weight-regular` / `-medium` / `-semibold` | 400 / 500 / 600 | text / controls and labels / headings. Nothing lighter or bolder. |
199
+ | `--weight-heavy` | 800 | `.display` and `.stamp` only |
200
+ | `--leading-display` | 1.15 | display headings |
201
+ | `--leading-title` | 1.3 | titles |
202
+ | `--leading-ui` | 1.4 | interface text |
203
+ | `--leading-body` | 1.6 | paragraphs |
204
+ | `--tracking-title` / `--tracking-display` | -0.01em / -0.025em | headings / large display headings |
205
+ | `--tracking-caps` | 0.08em | uppercase mono eyebrows; the `.stamp` monogram |
206
+
207
+ They are named by role because Tailwind already owns `--leading-tight`,
208
+ `--tracking-tight` and the rest; the bridge adds `leading-display`,
209
+ `tracking-title` and so on and leaves Tailwind's own utilities alone.
210
+
211
+ A heading or title balances its lines (`text-wrap: balance`) and running text
212
+ avoids a one-word last line (`pretty`). On a touch screen the tool tier's
213
+ `--text-xs` rises from 11px to 12px.
214
+
132
215
  ## 6. Space, shape, elevation
133
216
 
134
- 4px base (`--s1` … `--s9`). Radius: `--radius-sm` for chips and pills, `--radius`
135
- for cards, `--radius-lg` for hero surfaces.
217
+ 4px base (`--s1` … `--s9`). Radius steps by what the thing is, so a control
218
+ inside a card reads as nested rather than as a smaller card: `--radius-sm`
219
+ (6px) for chips and pills, `--radius-control` (8px) for buttons, inputs,
220
+ selects, the segmented control and menu items, `--radius` (12px) for cards,
221
+ messages, popovers and code blocks, `--radius-lg` (18px) for dialogs and
222
+ hero surfaces.
136
223
 
137
224
  **Elevation differs by theme.** Light mode separates surfaces with a hairline plus
138
225
  a shadow (`--shadow-1/2/3`). Dark mode does not use borders — surfaces get
139
226
  *lighter* with elevation. This is why `--line` can stay nearly invisible in dark.
140
227
 
228
+ **Stacking** is named, not numbered: `--z-raised` (a control above its card's
229
+ stretched link), `--z-sticky` (a header), `--z-float` (a floating label),
230
+ `--z-skip` (the skip link), `--z-toast`. Dialogs, popovers and sheets sit in the
231
+ browser's top layer and need none.
232
+
233
+ **Breakpoints are a short list, not tokens**, because a CSS variable can't be
234
+ used in a media query. Components and templates size to their own container
235
+ (`@container`) wherever they can, so the same markup works in a narrow column
236
+ and a wide page. The steps in use: 30rem (480px) and 35rem (560px) for a
237
+ phone, 48rem (768px) where a second column appears, 60rem (960px) for a
238
+ desktop layout, 75rem (1200px) where a third column appears. Reach for one of
239
+ these before adding another.
240
+
141
241
  **Sticky chrome** — a header or toolbar that content scrolls under — is
142
242
  `--surface-sticky` with `backdrop-filter: blur(8px)`: 92% of the card in light,
143
243
  of the page ground in dark, so it reads as the surface it sits on, not a new layer.
@@ -157,13 +257,44 @@ or is disabled is disqualified.
157
257
  and that block ships inside `tokens.css` so no surface can forget it. One easing
158
258
  curve (`--ease`), three durations, compositor-only properties.
159
259
 
160
- **The tool tier has one exception: motion a person asks for.** A control that
260
+ **The tool tier has two exceptions. The first is motion a person asks for.** A control that
161
261
  walks through a sequence step by step, such as driftwood's *Trace a request*,
162
262
  may animate, because the reader started it to follow an order of events, and
163
263
  the order is the content. It runs only when clicked, never on load; it can be
164
264
  stopped at any step; every state it passes through is also listed as text; and
165
265
  under `prefers-reduced-motion` it shows the final state (the whole sequence lit)
166
- at once. Nothing decorative qualifies: no entrance, hover or scroll animation.
266
+ at once. Nothing decorative qualifies: no entrance, hover or scroll animation,
267
+ except the overlay case below.
268
+
269
+ **The second: overlays may move as they open and close, in both tiers**
270
+ (ADR-0013). A dialog, sheet, popover, menu or toast that someone opened, or that answers what they
271
+ just did, fades and slides a few pixels (a sheet from its own edge) over
272
+ `--dur-fast`. Only opacity and transform move; the open state is always fully
273
+ shown, so a browser without `@starting-style` shows it at once; and under
274
+ `prefers-reduced-motion` it is instant, backdrop included. An overlay that is
275
+ already open when the page loads doesn't animate. That is the whole
276
+ exception: content on the page itself still never animates in.
277
+
278
+ **The third: a control may answer the person who used it** (ADR-0015). Two
279
+ cases, both only ever started by the person:
280
+
281
+ - **A press.** A `.btn` settles by 2% over `--dur-fast` while it is held down. Not when it is
282
+ disabled or busy.
283
+ - **A switch of view.** When someone picks a tab or a segment, the script that
284
+ swaps the content may wrap the swap in `document.startViewTransition()`, and
285
+ the old view cross-fades to the new one at the browser's default, 250ms
286
+ (the same as `--dur`). The package sets nothing on the transition, so a
287
+ site that already uses view transitions is not affected. Opt in per switch;
288
+ a browser without the API swaps at once.
289
+
290
+ Under `prefers-reduced-motion` neither happens. Nothing here runs on load, on
291
+ hover or on scroll.
292
+
293
+ **Print is the light theme.** `tokens.css` forces `color-scheme: light` on
294
+ paper whatever the screen was showing, and `components.css` drops sticky
295
+ chrome, shadows, popovers, sheets and controls that do nothing on paper, keeps cards and table
296
+ rows whole across a page break, and writes an outside link's address after it
297
+ in `.prose`.
167
298
 
168
299
  ## 8. Charts
169
300
 
@@ -205,6 +336,10 @@ is thirty coloured things, and the one that is down disappears among them.
205
336
  The diff tokens alias the state hues on purpose (added is *settled*, a change is
206
337
  *informational*, a removal is the change that can lose data), so a diff adds no
207
338
  hue to the system. Health wins the fill (`-surface`); a diff only takes the edge.
339
+ - **Code is neutral too.** `--code-keyword` is the cobalt ink; strings are
340
+ `--code-string` (`--ink-soft`), comments `--code-comment` (`--slate`, italic),
341
+ everything else `--code-ink`. A highlighted line is `--code-highlight`. No
342
+ syntax rainbow: a reader scanning code needs the keywords, not a palette.
208
343
  - **Selection** is the focus treatment: a 2px `--i-ink` outline, offset. Asking
209
344
  "what depends on this?" dims everything unrelated to ~30% opacity and inks the
210
345
  connecting edges in `--ink`; it never introduces a colour.
@@ -254,7 +389,7 @@ not just `<html>`.** A dark hero band on a light marketing page is
254
389
  Two consequences for code that touches tokens directly:
255
390
 
256
391
  - **Don't read a token's value with `getPropertyValue`.** It returns the
257
- declaration text, `light-dark(#076bd3, #6ba5f3)`, not a colour. To get the
392
+ declaration text, `light-dark(#076bd3, #0371e0)`, not a colour. To get the
258
393
  colour a chart library needs, resolve it on an element in the right subtree:
259
394
  set `el.style.color = 'var(--chart-1)'` and read `getComputedStyle(el).color`.
260
395
  Re-read it when the theme changes.
@@ -282,7 +417,7 @@ alone. In the consumer's `package.json`:
282
417
  ```
283
418
 
284
419
  Verified with Lightning CSS: older targets lower the tokens; these targets
285
- pass `light-dark(#076bd3, #6ba5f3)` through untouched.
420
+ pass `light-dark(#076bd3, #0371e0)` through untouched.
286
421
 
287
422
  ### Tailwind
288
423
 
@@ -412,7 +547,8 @@ Shared structure is what makes a page fast to build; shared looks is what made
412
547
  Driftwood, Guidebook and Sites read as one page with the words swapped. Each
413
548
  product makes three choices, and **no two products make all three the same**:
414
549
 
415
- - **A mark** (`data-mark` on `.pp`: `teal`, `violet` or `magenta`; tokens
550
+ - **A mark** (`data-mark` on `.pp` or on `<html>`, the same attribute its app
551
+ uses, §3: `teal`, `violet` or `magenta`; tokens
416
552
  `--mark-teal` and so on). It inks the product's glyph (an inline SVG in
417
553
  `currentColor`), the hero rule above the thesis, the **stage** (a faint field
418
554
  behind the hero proof), the clip's current step and the how-it-works
@@ -571,3 +707,191 @@ page runs this before asking for review, and puts the answers in the PR.
571
707
  `autoplay` attribute.
572
708
  - [ ] Copyright footer with the year filled in at build time.
573
709
  - [ ] No hex outside `tokens.css` (`npm run check`).
710
+
711
+ ## 14. Components
712
+
713
+ Shared controls and patterns ship as plain CSS in
714
+ [`components.css`](./components.css), and whole-page layouts as
715
+ `templates/<name>.css`. Why plain CSS and not React: ADR-0012. What gets built
716
+ and in what order: [`proposals/component-layer.md`](./proposals/component-layer.md).
717
+
718
+ ```css
719
+ @import '@brignano/design/tokens.css';
720
+ @import '@brignano/design/components.css';
721
+ ```
722
+
723
+ - **One layer.** Everything is inside `@layer brignano.components`. A consumer's
724
+ unlayered CSS and Tailwind utilities beat it without `!important`, so a site
725
+ can adjust a component without fighting it.
726
+ - **Names.** `.name` for the component, `.name-variant` for a variant
727
+ (`.btn`, `.btn-primary`). State is never a class: it comes from the attribute
728
+ that makes it true (`disabled`, `aria-invalid="true"`, `aria-current`,
729
+ `aria-expanded`, `[open]`), so the look can't disagree with what assistive
730
+ tech is told.
731
+ - **Native first.** `<dialog>`, the `popover` attribute, `<details>` and CSS
732
+ anchor positioning before any script. Where a component needs JS (a toast
733
+ queue, tab arrow keys), its preview page documents the ARIA contract and the
734
+ consumer writes the script. Design ships no JS.
735
+ - **Tokens only.** No hex. Every rule here that sets a background is
736
+ contrast-checked in both themes (`npm run check`): its text colour at 4.5:1,
737
+ its border or outline at 3:1. A control's edge is `--line-control`; the
738
+ divider tokens (`--line`, `--line-soft`, `--line-strong`) are exempt from the
739
+ edge check because they are never a control's edge.
740
+ - **Every class is shown.** A class in `components.css` or a template that no
741
+ preview page uses fails the check: if it isn't shown, it isn't reviewed.
742
+ - **Every preview is its docs page.** A component or template page carries
743
+ `data-status` on `<html>` (`stable`, `beta` or `planned`; the header shows it
744
+ and the index card repeats it) and, under its live examples, a `.docs` block
745
+ with four sections tagged `data-doc`: **Use it** (`usage`, a copy-paste
746
+ snippet), **Use when** (`use-when`), **Don't use when** (`dont-use`, naming
747
+ the better choice) and **Accessibility** (`a11y`: keyboard, screen reader,
748
+ required attributes). Other sections (variants, states, behaviour your script
749
+ owns) sit between them. `npm run check` fails on a missing section or a status
750
+ the index disagrees with. Planned components are listed on the index with a
751
+ link to their issue.
752
+ - **One icon set.** `icons/` holds the only icons a surface uses: outline
753
+ icons from Lucide (ISC, `icons/LICENSE`) on a 24px grid at a 2px stroke, in
754
+ `currentColor`, so pasted inline they take their text's colour (through
755
+ `<img>` they draw black). Size them with `.icon-sm`,
756
+ `.icon` or `.icon-lg` (1.25× the text beside them). Decorative icons are
757
+ `aria-hidden`; an icon-only button carries an `aria-label`. Need one that
758
+ isn't there? Add it from Lucide in a PR; don't draw one or pull in another
759
+ set. Brand logos are the exception and stay with their brands.
760
+ - **Switch or checkbox.** A switch (`.switch`, `role="switch"`) is only for a
761
+ setting that takes effect the moment it flips. Anything sent with a form's
762
+ submit button is a checkbox, because a switch promises an effect the form
763
+ hasn't made yet.
764
+
765
+
766
+ ## 15. Content
767
+
768
+ Words are part of the interface. A product that labels one button "Save" and
769
+ the next "Submit changes" reads as inconsistent as one with two greys. These
770
+ rules cover the words inside a product: controls, messages, data. Marketing copy
771
+ follows the brief in §13. English only for now.
772
+
773
+ Each rule has one do and one don't. The live page is
774
+ [`previews/writing.html`](./previews/writing.html); `npm run check` fails when
775
+ a rule here has no section there.
776
+
777
+ ### Voice
778
+
779
+ Competent, calm, plain words. Say what happened and what to do next, the way a
780
+ colleague who knows the system would. No hype, no jokes, no apology theatre.
781
+
782
+ - Do: "Changes saved."
783
+ - Don't: "Awesome! Your changes have been successfully saved!"
784
+
785
+ ### Sentence case
786
+
787
+ Everything is in sentence case: buttons, headings, labels, menu items, tabs,
788
+ page titles. Capitalise only the first word and proper nouns. An eyebrow can be
789
+ uppercase through CSS, but it is written in sentence case.
790
+
791
+ - Do: "Account settings", "Sign in with GitHub"
792
+ - Don't: "Account Settings", "SIGN IN"
793
+
794
+ ### Buttons and links
795
+
796
+ A button is a verb and its object, so it still makes sense read on its own. A
797
+ link names where it goes. The button that confirms an action repeats that
798
+ action's verb.
799
+
800
+ - Do: "Delete trip", "Read the release notes"
801
+ - Don't: "OK", "Click here"
802
+
803
+ ### Form labels
804
+
805
+ A label is a short noun phrase above its field, never a placeholder. Mark the
806
+ optional fields with "(optional)", not the required ones, and put formats in
807
+ the hint below.
808
+
809
+ - Do: "Phone (optional)", with the hint "We only call about bookings."
810
+ - Don't: "Phone*", or "Please enter your phone number" as the placeholder
811
+
812
+ ### Errors
813
+
814
+ Say what happened and how to fix it, in that order, next to the thing that
815
+ went wrong. Name the field or the action, never the person. No codes unless
816
+ someone will search for them, and then in mono after the words.
817
+
818
+ - Do: "That date has passed. Pick today or later."
819
+ - Don't: "Invalid input.", "You entered a wrong date."
820
+
821
+ ### Empty states
822
+
823
+ Say what will be here and give the one action that fills it. If the person
824
+ can't fill it (no results, nothing assigned yet), say why it's empty and what
825
+ would change that.
826
+
827
+ - Do: "No trips yet", then "Plan one and it shows up here." and a "Plan a trip" button
828
+ - Don't: "Nothing to see here!"
829
+
830
+ ### Confirmations
831
+
832
+ Ask only before something that can't be undone. The title names the action and
833
+ the object, the body says what goes with it, and the buttons are the verb and
834
+ a way out ("Cancel", or "Keep trip" when that reads better). Where an action
835
+ can be undone, do it and offer Undo instead of asking.
836
+
837
+ - Do: "Delete Lisbon 2027?" / "Its 12 photos go with it. This can't be undone." / "Delete trip", "Keep trip"
838
+ - Don't: "Are you sure?" / "Yes", "No"
839
+
840
+ ### Success messages
841
+
842
+ Past tense, the object first, and Undo when there is one. A success message
843
+ is quiet: a toast or an inline line, never a dialog.
844
+
845
+ - Do: "Trip deleted", with Undo
846
+ - Don't: "Success!"
847
+
848
+ ### Dates
849
+
850
+ In the interface a date is day, short month, year: "7 Nov 2026", with the
851
+ weekday first when it helps planning ("Sat 7 Nov 2026"). Drop the year inside
852
+ the current year when nothing is ambiguous. Data a person might copy, sort or
853
+ search (logs, IDs, exports, timestamps in a table) uses ISO 8601 in `--mono`.
854
+
855
+ - Do: "7 Nov 2026" in a sentence, `2026-11-07` in a log row
856
+ - Don't: "11/07/2026", "November 7th, 2026"
857
+
858
+ ### Times
859
+
860
+ Twelve-hour, with a space and capital AM or PM; drop ":00" on the hour in prose.
861
+ Add the zone when the reader might be elsewhere. 24-hour time is not used,
862
+ except inside ISO 8601 data in mono (`2026-11-07T21:30Z` in a log). For
863
+ something in the last day, a relative time ("5 min ago") is fine, with the full
864
+ date and time in a tooltip or `title`.
865
+
866
+ - Do: "9:30 AM", "3 PM ET", "2–3 AM UTC"
867
+ - Don't: "21:30", "9:30am"
868
+
869
+ ### Numbers
870
+
871
+ Numerals for every number, a comma every three digits, and a space before a
872
+ unit except %. Compact durations in tables and mono data ("2h 11m", "150ms")
873
+ can drop the space. Words a person typed, like a quoted message, stay as
874
+ written. Figures that line up in a column use tabular figures, which the
875
+ type tokens already set.
876
+
877
+ - Do: "3 trips · 10,482 photos · 64 GB · 64%"
878
+ - Don't: "three trips · 10482 photos · 64GB · 64 %"
879
+
880
+ ### Currency
881
+
882
+ The symbol before the number with no space. Whole amounts drop ".00" in prose;
883
+ a table of prices shows two decimals on every row so they line up. Name the
884
+ currency ("US$", "€") only when the reader could mistake it.
885
+
886
+ - Do: "$1,240", "$12.50"
887
+ - Don't: "$1240.00", "12.5 USD"
888
+
889
+ ### What never appears
890
+
891
+ These don't appear in a product's interface: exclamation marks; "simply",
892
+ "just" or "easy" when they play a task down (they blame the person when it
893
+ isn't); "Oops" or "Uh-oh"; emoji as words; ALL CAPS typed into the text; and,
894
+ on marketing pages, jargon the reader has to look up.
895
+
896
+ - Do: "Couldn't load your trips. Try again."
897
+ - Don't: "Oops! Something went wrong!! Simply refresh."