@brignano/design 0.5.0 → 0.7.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.
package/DECISIONS.md CHANGED
@@ -381,3 +381,135 @@ step's OKLCH lightness and stays monotonic.
381
381
  - A visible change, so the release that carries it is a minor.
382
382
  - `--chart-1` is a separately validated categorical slot (ADR-0002) and is
383
383
  unchanged.
384
+
385
+ ---
386
+
387
+ ## ADR-0009 — Motion the reader asks for is allowed in the tool tier
388
+
389
+ **Status:** accepted · 2026-10-31
390
+
391
+ ### Context
392
+
393
+ The tool tier has no motion (§2). driftwood's request flow view answers the
394
+ first question on an incident call, "where does traffic come in and what does
395
+ it pass through", and its *Trace a request* control walks a request through the
396
+ diagram one hop at a time. Shown all at once, the order is only in the numbers;
397
+ walked, it is obvious.
398
+
399
+ ### Decision
400
+
401
+ Motion is allowed in the tool tier when the reader starts it and it shows an
402
+ order: it runs only on a click, can be stopped, every step it shows is also
403
+ listed as text, and `prefers-reduced-motion` gets the final state at once (the
404
+ whole path lit). It uses the selection treatment from §9, so it adds no hue.
405
+ Decorative motion stays out.
406
+
407
+ ### Consequences
408
+
409
+ - The §7 contract still holds: nothing is hidden until an animation runs, and
410
+ the page reads the same with the script off.
411
+ - Any later animation in a tool has to meet the same four conditions or it is
412
+ decorative.
413
+
414
+ ---
415
+
416
+ ## ADR-0010 — Product pages show, then tell
417
+
418
+ **Status:** accepted · 2026-11-01
419
+
420
+ ### Context
421
+
422
+ The first product page built on §13 (driftwood.brignano.io) was shown on a
423
+ phone to a technical reader outside its field. They scrolled once and handed
424
+ the phone back. Rendered at iPhone size, the first screen was a 10-word thesis
425
+ over four lines and a 47-word subhead, with no picture; the proof started a
426
+ screen and a half down and was cropped; the page ran to almost nine screens,
427
+ most of it four prose chapters (problem, how it works, who it's for, why now).
428
+ The template asked for exactly that: copy before proof on a phone, and a story
429
+ of chapters, which reads as a case study.
430
+
431
+ ### Decision
432
+
433
+ A product page shows, then tells. The hero splits into head (status, a thesis
434
+ of 8 words or fewer naming the outcome), proof, and body (one sentence, the
435
+ actions), and stacks in that order on a phone, so the proof is on the first
436
+ screen. The story chapters give way to two short bands: three "what you get"
437
+ cards that each lead with a picture, and three one-line steps. At most one
438
+ chapter stays; the longer argument moves to the docs. `scripts/fold.mjs`
439
+ checks the first phone screen and the page length in CI.
440
+
441
+ ### Consequences
442
+
443
+ - The older hero markup still lays out, so existing sites keep working until
444
+ they move to the split; `fold.mjs` fails them until they do.
445
+ - The pictures carry the colour (state hues with their words, §3); the page
446
+ around them stays restrained.
447
+ - driftwood, guidebook and sites each rewrite their copy to the new limits in
448
+ their own repos.
449
+ - A cold read of the first example still left a stranger asking who it was
450
+ for, whether they could try it, and what "Request access" leads to. So the
451
+ hero also carries an audience line (checked), the secondary action is a
452
+ live demo when one exists, the note says what happens next, and unbacked
453
+ claims are cut. Forced scroll animation was considered and rejected: it
454
+ slows phones and loses skimmers; a hero clip carries the motion instead.
455
+
456
+ ---
457
+
458
+ ## ADR-0011 — Product pages start from a brief, and each looks like itself
459
+
460
+ **Status:** accepted · 2026-11-02
461
+
462
+ ### Context
463
+
464
+ ADR-0010 fixed the layout, and every product page still needed several rounds
465
+ of "explain it to a stranger" review. Driftwood, Guidebook and Sites were
466
+ each rebuilt on §13, then reworked again in their own repos: pain-first
467
+ subheads, captions inside the clip, plain words in the mock, the person
468
+ behind it, a plain price. Three causes:
469
+
470
+ - Nothing fixed the **message** before the page. The words came from the
471
+ repo, README and spec, so they described how the product works; each
472
+ review was a positioning debate held through page edits.
473
+ - Each review **added a required element** (an audience line, a "what happens
474
+ next" note, the status in two places), so the first screen grew to ~100
475
+ words while passing every check. `fold.mjs` counted the thesis and subhead
476
+ but not the page.
477
+ - The only clarity test, "hand it to someone outside the field", was a
478
+ manual checkbox, so it didn't run.
479
+
480
+ Put side by side, the three pages were also the same page: one grey ground,
481
+ one cobalt audience line, one black thesis, one status pill twice, one proof
482
+ on the right, one band order. Only the picture changed, so nobody looking
483
+ across the projects could tell them apart.
484
+
485
+ ### Decision
486
+
487
+ - **Brief first.** Five lines (Who, Pain, Promise, Moment, Ask) in
488
+ `BRIEF.md`, approved before any page; the page is built from it.
489
+ - **Budgets, checked.** 40 words of copy on the first phone screen, 180 on the
490
+ page, the status once. `fold.mjs` fails a page over them.
491
+ - **The stranger test is a step, not a checkbox.** The first-screen shot goes
492
+ to a person or a context-free agent with a fixed prompt; the answers go in
493
+ the PR and must match the brief.
494
+ - **Each product looks like itself.** A product mark (`--mark-teal`,
495
+ `--mark-violet`, `--mark-magenta`) chosen with `data-mark`, a hero layout
496
+ (`split`, `mirror`, `stage`) and a proof frame (bare, phone, browser). No two
497
+ products share all three. Each page also picks its own signature band
498
+ (cards, a comparison, or something of its own) instead of always having
499
+ three cards.
500
+ - Learned in the product repos and now in the template: the subhead is the Pain
501
+ then the fix; clips carry captions; the mock speaks plain words; the
502
+ audience line is ink, not cobalt.
503
+
504
+ ### Consequences
505
+
506
+ - A product mark is the one place a hue appears as a wash: the stage behind
507
+ the hero proof, at 8%. That is a scoped exception to "identity is not a
508
+ fill" (§3). It is safe because the product hues mean nothing else in the
509
+ system, and the stage never sits behind a control or a state.
510
+ - Actions stay cobalt on every product, so "you can click this" still means
511
+ one thing everywhere.
512
+ - §13 is shorter: the rules that drive clarity stay, and the ones that only
513
+ added words are gone.
514
+ - Driftwood, Guidebook and Sites each add a `BRIEF.md`, pick their identity
515
+ and cut to the budgets in their own repos.
package/DESIGN.md CHANGED
@@ -102,7 +102,10 @@ The part that makes an interface feel built rather than styled.
102
102
 
103
103
  - `--i` fill, `--i-hover`, `--i-pressed`, `--i-ink` for links/icons/focus.
104
104
  - **Disabled is neutral, never hued** (`--i-disabled-bg` / `--i-disabled-ink`). A
105
- greyed-out control must stop signalling "click me".
105
+ greyed-out control must stop signalling "click me". Its low contrast is allowed
106
+ only because WCAG 1.4.3 exempts *inactive* controls, so the state must be real:
107
+ `disabled` on a button or input, `aria-disabled="true"` otherwise. Disabled
108
+ styling on an element that isn't marked disabled is just low-contrast text.
106
109
  - Focus is always visible: 2px `--i-ink` outline, 2px offset. Never remove it.
107
110
  - Hover and pressed surfaces on neutral elements come from `--surface-hover` and
108
111
  `--surface-active`, not from opacity tricks.
@@ -154,6 +157,14 @@ or is disabled is disqualified.
154
157
  and that block ships inside `tokens.css` so no surface can forget it. One easing
155
158
  curve (`--ease`), three durations, compositor-only properties.
156
159
 
160
+ **The tool tier has one exception: motion a person asks for.** A control that
161
+ walks through a sequence step by step, such as driftwood's *Trace a request*,
162
+ may animate, because the reader started it to follow an order of events, and
163
+ the order is the content. It runs only when clicked, never on load; it can be
164
+ stopped at any step; every state it passes through is also listed as text; and
165
+ 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.
167
+
157
168
  ## 8. Charts
158
169
 
159
170
  The one place the restraint rule does **not** apply: a categorical chart needs
@@ -197,6 +208,10 @@ is thirty coloured things, and the one that is down disappears among them.
197
208
  - **Selection** is the focus treatment: a 2px `--i-ink` outline, offset. Asking
198
209
  "what depends on this?" dims everything unrelated to ~30% opacity and inks the
199
210
  connecting edges in `--ink`; it never introduces a colour.
211
+ - **A path is numbered, not coloured.** A request path drawn over a diagram
212
+ numbers its hops in order (`1`, `2a`/`2b` for a branch) in `--mono`, in a
213
+ `--line-strong` ring, and lists them beside the picture. Tracing it lights each
214
+ hop with the selection treatment above, never with a new hue.
200
215
  - **Lead with the verdict.** A page about a deploy opens with one sentence saying
201
216
  what happened and what needs you, then the pills that back it up, then the
202
217
  picture.
@@ -309,66 +324,250 @@ which is why changing the accent was a migration rather than a one-line edit.
309
324
 
310
325
  ## 13. Product pages
311
326
 
312
- A product's marketing page is one argument and one ask. `product-page.css` is its
313
- structure; `previews/product-page.html` is the skeleton to copy. Import it after
314
- the tokens, put `tier-marketing` on `<html>` and `pp` on `<body>` (or a wrapper).
327
+ A product's marketing page has about five seconds on a phone to land, with
328
+ someone who has never heard of it: a buyer, a stranger at a meetup, your mum.
329
+ **Show, then tell**: the first phone screen says who it's for, shows the
330
+ product doing the thing, and offers one thing to do, without a paragraph.
331
+ The longer argument belongs in the docs.
332
+
333
+ Pages built from layout rules alone kept failing the same way (ADR-0011): the
334
+ words came from the repo, so they described how the product works instead of
335
+ why anyone should want it, and each review added another required line. So
336
+ the order of work is fixed: **brief, page, checks, stranger test.**
337
+
338
+ ### 1. Write the brief first
339
+
340
+ Five lines, in the words a stranger would use, kept as `BRIEF.md` in the
341
+ product's repo and approved before any page work. Every word on the page comes
342
+ from it; a change of message is a change to the brief, then the page.
343
+
344
+ | Line | Answers | Becomes |
345
+ |---|---|---|
346
+ | **Who** | who it's for, as they'd say it | `.pp-audience` |
347
+ | **Pain** | what goes wrong for them today | the first half of `.pp-subhead` |
348
+ | **Promise** | what they get, 8 words or fewer | `.pp-thesis` |
349
+ | **Moment** | the 10 seconds that prove it | the proof (`.pp-media`) |
350
+ | **Ask** | the one action, and what happens next | `.pp-button`, `.pp-note` |
351
+
352
+ No jargon in Who, Pain or Promise. Tool names (Terraform, CI, AWS) go in the
353
+ how-it-works steps. If a person outside the field can't repeat the Promise
354
+ back, rewrite the brief, not the page.
355
+
356
+ ### 2. Build the page from it
357
+
358
+ `product-page.css` is the structure; `previews/product-page.html` is the
359
+ skeleton (the brief template is at its top) and
360
+ `previews/product-page-example.html` is a worked example. Import it after the
361
+ tokens, put `tier-marketing` on `<html>` and `pp` on `<body>`.
315
362
 
316
363
  ```css
317
364
  @import '@brignano/design/tokens.css';
318
365
  @import '@brignano/design/product-page.css';
319
366
  ```
320
367
 
321
- The order is fixed, because each band answers the question the last one raised:
322
-
323
- 1. **Header** (`.pp-header`) — brand, two or three in-page links, the status, the
324
- primary action. Sticky, on `--surface-sticky`.
325
- 2. **Hero** (`.pp-hero`) — the status, a one-line **thesis** (`.pp-thesis`), a
326
- subhead of one or two sentences, the primary action and one secondary, and a
327
- **proof slot** (`.pp-media`). The proof is the product itself where it can be
328
- (a live demo), else a real screenshot. Never stock imagery.
329
- 3. **Story** (`ol.pp-story` of `.pp-chapter`) — three or four numbered chapters,
330
- usually *the problem*, *how it works*, *who it's for*, *why now*. Each is a mono
331
- label (`.pp-label`, numbered `01 /` by the list, so reordering renumbers), a
332
- headline that is a sentence, a short body, and optionally `.pp-points` (two to
333
- four ruled columns) or a `.pp-figure`.
334
- 4. **Close** (`.pp-close`) — the primary action again, with the room a form needs
335
- (`.pp-panel`).
336
- 5. **Footer** (`.pp-footer`) — the brand and a line about it, a few links, then
337
- the **legal line** (`.pp-legal`): `© {year} Anthony Brignano. All rights
338
- reserved.` and, if the product has them, its Privacy and Terms links
339
- (`<nav aria-label="Legal">`). Leave out a link whose page doesn't exist.
340
-
341
- The year is the current year **at build time**. This package is CSS and HTML,
342
- so the consuming site's build fills it in (a template value from
343
- `new Date().getFullYear()`, or a bundler `define`). Never type it by hand, where
344
- it goes stale every January, and never write it from client script, where it
345
- flashes or is missing without JavaScript.
346
-
347
- Rules:
368
+ The bands, in order:
369
+
370
+ 1. **Header** (`.pp-header`): brand, two or three in-page links, the primary
371
+ action. The status is not repeated here.
372
+ 2. **Hero** (`.pp-hero`), three parts: `.pp-hero-head` (the status, the
373
+ audience line, the thesis), the **proof** (`.pp-media`), then
374
+ `.pp-hero-body` (the subhead, the primary action and one secondary, and a
375
+ note). On a phone they stack in that order, so the proof is on the first
376
+ screen.
377
+ - The **subhead** is one sentence, the Pain then the fix: "When your app
378
+ goes down, Driftwood shows the broken piece, why, and what the last
379
+ deploy changed."
380
+ - The **proof** is the Moment: the product doing the thing, ideally
381
+ mid-story. In order of preference: a short captioned clip (*Video in the
382
+ proof slot*, below), a live demo, a real screenshot, a faithful mock from
383
+ the product's own components. Never stock imagery. Words inside the proof
384
+ are the product's own, in plain language ("Your shop is down"), not log
385
+ lines.
386
+ - **Demo first.** If anything can be tried without signing up, the
387
+ secondary action is "Try the live demo" and opens it directly.
388
+ - The **note** says what happens after the click, in about ten words
389
+ ("Demo needs no signup. We reply within two days.").
390
+ 3. **The signature band**: one band only this product could have. Three
391
+ "you get" cards (`ul.pp-gets`, each a picture, a heading, one line); the
392
+ product beside the obvious alternative (`.pp-compare`, below); or a band of
393
+ its own, such as a library of ready-made guides or the live demo itself.
394
+ Pick the one that answers the stranger's next question for *this* product.
395
+ 4. **How it works** (`ol.pp-how`): three numbered steps, a heading and one
396
+ line each.
397
+ 5. **Close** (`.pp-close`): the primary action again, with the room a form
398
+ needs (`.pp-panel`), and prices if any.
399
+ 6. **Footer** (`.pp-footer`): the brand and its promise, a few links, then the
400
+ legal line (`.pp-legal`): `© {year} Anthony Brignano. All rights
401
+ reserved.` and the product's Privacy and Terms links if it has them.
402
+
403
+ **Budgets** (`fold.mjs` enforces them): the thesis 8 words or fewer; the
404
+ subhead one sentence of 25 or fewer; **40 words of copy on the first phone
405
+ screen; 180 on the whole page**; 7 phone screens. Copy is what the reader has
406
+ to read: words inside pictures, the form, the header and footer don't count.
407
+ When a page is over, cut sentences, don't shrink type.
408
+
409
+ ### 3. Make it look like this product
410
+
411
+ Shared structure is what makes a page fast to build; shared looks is what made
412
+ Driftwood, Guidebook and Sites read as one page with the words swapped. Each
413
+ product makes three choices, and **no two products make all three the same**:
414
+
415
+ - **A mark** (`data-mark` on `.pp`: `teal`, `violet` or `magenta`; tokens
416
+ `--mark-teal` and so on). It inks the product's glyph (an inline SVG in
417
+ `currentColor`), the hero rule above the thesis, the **stage** (a faint field
418
+ behind the hero proof), the clip's current step and the how-it-works
419
+ numerals. Like `--mark` (§3), it is never a button, link, text or state: the
420
+ actions stay cobalt on every product, so "you can click this" means the same
421
+ thing everywhere.
422
+ - **A hero layout** (`data-layout` on `.pp-hero`): `split` (the default, proof
423
+ on the right), `mirror` (proof on the left, for a picture that should be
424
+ read first) or `stage` (centred words and actions, the proof full width
425
+ under them, for a wide picture such as a map). Phones stack all three the same.
426
+ - **A frame for the proof** that matches where the product lives: bare, a
427
+ phone (`.pp-device`) for something used on a phone, or a browser window
428
+ (`.pp-browser`, with `.pp-browser-bar` and `.pp-browser-url`) for an
429
+ extension or web app.
430
+
431
+ Then the voice: the thesis, the signature band and the close are written for
432
+ this product's reader, not copied from the last page.
433
+
434
+ ### Compare
435
+
436
+ `.pp-compare` holds two `<div>`s, each an `<h3>` and a `<ul>` of the same
437
+ three rows: the obvious alternative first, then ours with `.is-ours`, which
438
+ takes the mark on its top rule and stacks first on a phone. The rows are
439
+ words ("Pay monthly, forever" beside "Pay once"), never ticks and crosses
440
+ alone.
441
+
442
+ ### Rules
348
443
 
349
444
  - **One primary action per page.** `.pp-button` is that action, everywhere it
350
445
  appears. Anything else is `.pp-button.is-secondary` or a link.
351
- - **The status is a word with a dot** (`.pp-status`): "Pilot open", "In
352
- development". `data-state="open"` takes `--success` (you can join now),
353
- `"soon"` takes `--attention`; no attribute stays neutral. The word carries the
354
- meaning on its own (§3, never colour alone).
355
- - **Headlines are sentences.** Calm and declarative, no exclamation marks, no
356
- claims the page can't back up.
357
- - **Restraint carries the style.** Hairlines between chapters, whitespace, the
358
- type scale. No gradients, no tinted section backgrounds, no decorative colour.
446
+ - **The status is a word with a dot** (`.pp-status`), shown once in the hero
447
+ and again in the close: "Pilot open", "Private beta". `data-state="open"`
448
+ takes `--success`, `"soon"` takes `--attention`; the word carries the meaning
449
+ on its own (§3).
450
+ - **Every claim is backed or cut.** A time, a number or a superlative needs a
451
+ source the page can point to. Without one, drop it.
452
+ - **Prices sit beside the ask.** `dl.pp-price` holds two to four options, one
453
+ `<div>` each: the price as `<dt>`, one line of condition as `<dd>`, in the
454
+ close band under its subhead. A single price goes in the subhead. No option
455
+ gets its own button; no strike-through prices, badges or highlighted tiers.
456
+ - **Headlines are sentences.** Calm and declarative, no exclamation marks.
457
+ - **Scroll stays the reader's.** No scroll-jacking, pinned sections or
458
+ scroll-driven reveals. Motion lives in the hero clip (§7, ADR-0009).
459
+ - **Pictures over paragraphs.** Every band after the hero leads with a picture,
460
+ a list or a comparison, never prose. At most one story chapter
461
+ (`ol.pp-story`), and only when one point truly needs a paragraph.
462
+ - **Restraint carries the style; the product and its mark carry the colour.**
463
+ Hairlines between bands, whitespace, the type scale. No gradients, no tinted
464
+ bands. Colour lives in the proof (a red box with its word, a diff) and in
465
+ the product's mark.
466
+ - **Forms** (`.pp-form` of `.pp-field`, label above the control) mark the
467
+ optional fields, not the required ones. A field that fails takes
468
+ `aria-invalid="true"` and a `.pp-error` sentence; a failed send puts its
469
+ error in the note (`.pp-note.is-error`); on success the form gives way to
470
+ `.pp-done`, focused, with `role="status"`.
471
+ - **The year** in the legal line is filled in at build time (a template value,
472
+ a bundler `define`, or the Worker as it serves the page). Never typed, and
473
+ never written by client script.
474
+
475
+ ### Video in the proof slot
476
+
477
+ When the proof is something a person does, such as editing their site on a
478
+ phone and seeing it update, a short clip shows it better than a still.
479
+ `.pp-media` takes a `<video>` (or `<img>`) directly, framed like a hero surface,
480
+ or inside `.pp-device`, a phone frame. `previews/product-media.html` shows both.
481
+
482
+ - **The clip.** `<video muted loop playsinline preload="metadata">` with
483
+ `width`/`height` set, a `poster`, and no `autoplay` attribute. Keep it under
484
+ about 15 seconds and silent: it loops, and nobody turns sound on in a hero.
485
+ - **Captions in the clip.** A stranger can't tell what a clip shows without
486
+ them. Burn a plain sentence into each beat ("You deploy an update to your
487
+ shop", "The shop goes down"), about three seconds each, three or four beats.
488
+ The first frame already shows the product and its first caption, never an
489
+ empty screen.
490
+ - **The poster is the finished state.** It is what shows before the clip
491
+ loads, without JavaScript, and under `prefers-reduced-motion`, so it has to
492
+ make the argument on its own (§7: content is visible by default).
493
+ - **The phone frame** (`.pp-device`) is a 10px bezel in `--device`, which stays
494
+ dark in both themes. A phone is a dark object, and a bezel in `--ink` would
495
+ turn near-white in dark mode. Its one child is the screen, at 9 : 19.5.
496
+ `--pp-device-width` (default 280px) sizes it.
497
+ - **Steps** (`ol.pp-steps` in a `figcaption.pp-caption`) name what the clip
498
+ shows, in mono: *1 Change the hours, 2 Press Save, 3 The site updates*. Each
499
+ `<li data-at="3">` gives the second it starts at, and the step the clip is on
500
+ gets `aria-current="step"`, which inks it. The list is the sequence as text,
501
+ so it reads the same with the clip stopped.
502
+ - **Pause / Play** (`button.pp-play`) is required. Motion that runs longer than
503
+ five seconds needs a way to stop it (WCAG 2.2.2). It starts `hidden`, and the
504
+ script shows it.
505
+
506
+ The package is CSS, so the page carries this script, once, after the figure:
507
+
508
+ ```js
509
+ for (const fig of document.querySelectorAll('.pp-media')) {
510
+ const video = fig.querySelector('video'), button = fig.querySelector('.pp-play');
511
+ if (!video || !button) continue;
512
+ const steps = [...fig.querySelectorAll('.pp-steps > li[data-at]')];
513
+ const label = () => { button.textContent = video.paused ? 'Play' : 'Pause'; };
514
+ video.addEventListener('timeupdate', () => {
515
+ const now = steps.filter((s) => video.currentTime >= +s.dataset.at).pop();
516
+ for (const s of steps) {
517
+ if (s === now) s.setAttribute('aria-current', 'step');
518
+ else s.removeAttribute('aria-current');
519
+ }
520
+ });
521
+ video.addEventListener('play', label);
522
+ video.addEventListener('pause', label);
523
+ button.addEventListener('click', () => (video.paused ? video.play() : video.pause()));
524
+ button.hidden = false;
525
+ label();
526
+ if (!matchMedia('(prefers-reduced-motion: reduce)').matches) video.play().catch(label);
527
+ }
528
+ ```
529
+
530
+ Under reduced motion the clip waits on its poster with a **Play** button, so it
531
+ runs only when the reader asks for it, the same terms as ADR-0009.
359
532
 
360
533
  Every class starts with `.pp-`, so the file sits beside a site's own stylesheet.
361
534
  A page can change `--pp-width` (default 1160px) and `--pp-gutter` on `.pp`.
362
535
 
363
- Before a product page ships, check it:
364
-
365
- - [ ] Bands in order: header, hero, story, close, footer.
366
- - [ ] One primary action, the same everywhere it appears.
367
- - [ ] A status word with a dot, in the header and the hero.
368
- - [ ] A one-line thesis; every headline is a sentence.
369
- - [ ] The proof slot is the product (a live demo) or a real screenshot.
370
- - [ ] Three or four story chapters, numbered by the list.
371
- - [ ] Has a copyright footer: `© {year} Anthony Brignano. All rights reserved.`,
372
- the year filled in at build time, plus Privacy and Terms links for the
373
- pages the product has.
536
+ ### 4. Check it, then hand it to a stranger
537
+
538
+ `scripts/fold.mjs` checks the first phone screen and the budgets
539
+ (Playwright, 390 × 844):
540
+
541
+ ```sh
542
+ npm i --no-save playwright && npx playwright install chromium
543
+ node node_modules/@brignano/design/scripts/fold.mjs https://product.example/ --shots shots
544
+ ```
545
+
546
+ Then the **stranger test**, which no script can do. Give the first-screen shot
547
+ from `--shots` to someone outside the field for five seconds, or to a fresh
548
+ agent with no other context, and ask:
549
+
550
+ > You're seeing this website for the first time, on a phone. In one sentence
551
+ > each: what is it, who is it for, and what would you get? Would you tap the
552
+ > button, and what do you expect to happen if you do?
553
+
554
+ Compare the answers to the brief. If What, Who or Get doesn't match it, the
555
+ page fails: fix the words or the proof, and test again. An agent building a
556
+ page runs this before asking for review, and puts the answers in the PR.
557
+
558
+ - [ ] `BRIEF.md` exists and was approved before the page.
559
+ - [ ] `fold.mjs` passes: thesis, audience, proof and action on the first
560
+ screen; within the word budgets; 7 screens or fewer; no sideways scroll.
561
+ - [ ] The stranger test's answers match the brief (in the PR).
562
+ - [ ] The subhead is the Pain, then the fix.
563
+ - [ ] If anything can be tried without signing up, "Try the live demo" is the
564
+ secondary action.
565
+ - [ ] A mark, a hero layout and a proof frame chosen, not all three shared
566
+ with another product.
567
+ - [ ] One signature band, then three how-it-works steps.
568
+ - [ ] One primary action, the same everywhere; the status once in the hero.
569
+ - [ ] Every time, number or superlative is backed, or cut.
570
+ - [ ] A clip has a finished-state poster, a Pause / Play button, and no
571
+ `autoplay` attribute.
572
+ - [ ] Copyright footer with the year filled in at build time.
374
573
  - [ ] No hex outside `tokens.css` (`npm run check`).
package/README.md CHANGED
@@ -9,7 +9,7 @@ The shared design system for every brignano surface — `brignano.io`, `life`,
9
9
  | [`DECISIONS.md`](./DECISIONS.md) | Why the values are what they are. ADRs. |
10
10
  | [`tokens.css`](./tokens.css) | Single source of truth for colour, type, space, shape, motion. |
11
11
  | [`tokens.chart.css`](./tokens.chart.css) | Validated categorical palette for data viz. |
12
- | [`product-page.css`](./product-page.css) | The structure of a product's marketing page: header, thesis hero, numbered story, closing ask. DESIGN.md §13; skeleton in `previews/product-page.html`. |
12
+ | [`product-page.css`](./product-page.css) | The structure of a product's marketing page, built from a five-line brief: thesis and proof on the first phone screen, one signature band, how it works, closing ask; a product mark, hero layout and proof frame so each product looks like itself. DESIGN.md §13; skeleton in `previews/product-page.html`, worked example in `previews/product-page-example.html`, first-screen check in `scripts/fold.mjs`. |
13
13
  | [`previews/`](./previews) | Live swatches. Open one in a browser to see the tokens render. |
14
14
 
15
15
  ## The shape of it
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@brignano/design",
3
- "version": "0.5.0",
4
- "description": "Shared design system for brignano surfaces \u2014 colour, type, space, shape, motion.",
3
+ "version": "0.7.0",
4
+ "description": "Shared design system for brignano surfaces — colour, type, space, shape, motion.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -18,6 +18,7 @@
18
18
  "tokens.css",
19
19
  "tokens.chart.css",
20
20
  "product-page.css",
21
+ "scripts/fold.mjs",
21
22
  "tailwind.css",
22
23
  "DESIGN.md",
23
24
  "DECISIONS.md"
package/product-page.css CHANGED
@@ -4,23 +4,50 @@
4
4
  * @import '@brignano/design/product-page.css';
5
5
  * <html class="tier-marketing">
6
6
  *
7
- * One page, read top to bottom, that makes one argument and asks for one thing:
7
+ * Show, then tell. A stranger glancing at a phone gets what the product is,
8
+ * what it does for them, and the one thing to do, from the first screen and
9
+ * without reading a paragraph. Write the five-line brief first (DESIGN.md
10
+ * §13); the page is built from it.
8
11
  *
9
- * .pp-header brand, a few in-page links, the status, the primary action
10
- * .pp-hero status, a one-line thesis, a subhead, two actions, a proof slot
11
- * .pp-story 3–4 numbered chapters: problem, how it works, who it's for, why now
12
- * .pp-close the primary action again, with whatever it needs (a form)
12
+ * .pp-header brand, a few in-page links, the primary action
13
+ * .pp-hero .pp-hero-head (status, .pp-audience naming who it's for, a
14
+ * thesis of 8 words or fewer), the proof (.pp-media), then
15
+ * .pp-hero-body (the pain and the fix in one sentence, the
16
+ * ask, "Try the live demo" when there is one, and a short
17
+ * note). On a phone the proof sits between the thesis and
18
+ * the subhead, so it is on the first screen.
19
+ * one signature band, the one only this product could have:
20
+ * .pp-gets three cards, each a small picture of the product
21
+ * .pp-compare this product beside the obvious alternative
22
+ * or a band of the product's own (a library, an embedded demo)
23
+ * .pp-how three numbered steps, one line each
24
+ * .pp-close the primary action again, with whatever it needs: a short
25
+ * .pp-form of .pp-field (.pp-done once it's sent), and the
26
+ * prices (.pp-price) if the product has them
13
27
  * .pp-footer brand and links, then the legal line: © year, owner, and
14
28
  * the product's Privacy and Terms links if it has them
15
29
  *
16
- * The skeleton is previews/product-page.html: copy it, keep the order, replace
17
- * the words. Rules (DESIGN.md §13):
30
+ * Each product looks like itself (ADR-0011), with three choices on the page:
31
+ *
32
+ * data-mark on .pp teal | violet | magenta: the product's mark, which
33
+ * inks its glyph, the hero rule, the stage behind the
34
+ * proof and the step numerals. Never a button or text.
35
+ * data-layout on .pp-hero split (default) | mirror (proof on the left) |
36
+ * stage (centred words and actions, the proof full width under them)
37
+ * the proof's frame bare, .pp-device (a phone) or .pp-browser (a window)
38
+ *
39
+ * The skeleton is previews/product-page.html, and a worked example is
40
+ * previews/product-page-example.html: copy one, keep the order, replace the
41
+ * words and pictures. scripts/fold.mjs checks the first phone screen.
42
+ * Rules (DESIGN.md §13):
18
43
  *
19
44
  * - One primary action per page (.pp-button). Everything else is secondary.
20
45
  * - The status is a word with a dot, never a coloured badge on its own.
21
- * - The proof slot is the product itself where possible (a live demo), else a
22
- * real screenshot. No stock imagery, no illustrations of people.
23
- * - Chapters are numbered by the list, so reordering them renumbers them.
46
+ * - Every picture is the product: a live demo, a real screenshot, a screen
47
+ * recording, or a faithful mock built from the product's own components.
48
+ * No stock imagery, no illustrations of people.
49
+ * - Write for the person who will use it, in their words. Tool names
50
+ * (Terraform, CI, AWS) go in the steps, not the thesis.
24
51
  *
25
52
  * Every class starts with .pp- so it can sit beside a site's own stylesheet.
26
53
  * Colours are tokens only; widths are --pp-width / --pp-gutter, which a page
@@ -29,12 +56,19 @@
29
56
  .pp {
30
57
  --pp-width: 1160px;
31
58
  --pp-gutter: var(--s5);
59
+ /* The product's mark (ADR-0011): ink until data-mark picks one. The stage
60
+ is the field behind the hero proof, a faint wash of the mark. */
61
+ --pp-mark: var(--ink);
62
+ --pp-stage: color-mix(in srgb, var(--pp-mark) 8%, transparent);
32
63
  background: var(--bg);
33
64
  color: var(--ink);
34
65
  font: var(--text-base) / 1.6 var(--sans);
35
66
  font-variant-numeric: tabular-nums;
36
67
  -webkit-font-smoothing: antialiased;
37
68
  }
69
+ .pp[data-mark="teal"] { --pp-mark: var(--mark-teal); }
70
+ .pp[data-mark="violet"] { --pp-mark: var(--mark-violet); }
71
+ .pp[data-mark="magenta"] { --pp-mark: var(--mark-magenta); }
38
72
  /* On <body>, drop the browser's 8px margin so the sticky header and every band
39
73
  run to the screen edges. On a wrapper, the body is the site's business. */
40
74
  body.pp { margin: 0; }
@@ -60,6 +94,8 @@ body.pp { margin: 0; }
60
94
  font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.01em;
61
95
  }
62
96
  .pp-brand img, .pp-brand svg { width: 26px; height: 26px; }
97
+ /* An inline glyph drawn in currentColor takes the product's mark. */
98
+ .pp-brand svg { color: var(--pp-mark); }
63
99
  .pp-nav { display: flex; align-items: center; gap: var(--s5); margin-left: auto; }
64
100
  .pp-nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--text-sm); font-weight: 500; }
65
101
  .pp-nav a:hover { color: var(--ink); }
@@ -112,21 +148,226 @@ body.pp { margin: 0; }
112
148
  .pp-note { margin: var(--s3) 0 0; font-size: var(--text-sm); color: var(--ink-soft); }
113
149
 
114
150
  /* ── Hero ──────────────────────────────────────────────────────────────
115
- Copy on the left, proof on the right; stacked below 960px with the copy
116
- first. The thesis is one line of argument, not a tagline. */
117
- .pp-hero { padding: var(--s8) 0 var(--s8); }
151
+ Split into .pp-hero-head (status, thesis), the proof (.pp-media), and
152
+ .pp-hero-body (subhead, actions, note). On a phone they stack in that
153
+ order, so the proof is on the first screen; from 960px the head and body
154
+ share the left column and the proof takes the right.
155
+
156
+ The older markup, one copy <div> then the figure, still lays out (copy
157
+ first, proof under it on a phone), but it puts the proof below the first
158
+ phone screen, so new pages use the split. */
159
+ .pp-hero { padding: var(--s7) 0 var(--s8); }
160
+ @media (max-width: 560px) { .pp-hero { padding: var(--s5) 0 var(--s7); } }
118
161
  .pp-hero > .pp-wrap { display: grid; gap: var(--s7); align-items: center; grid-template-columns: minmax(0, 1fr); }
119
162
  @media (min-width: 960px) { .pp-hero > .pp-wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
120
- .pp-hero .pp-status { margin-bottom: var(--s5); }
163
+ .pp-hero > .pp-wrap:has(> .pp-hero-head) { gap: var(--s5); grid-template-areas: "head" "media" "body"; }
164
+ .pp-hero-head { grid-area: head; }
165
+ .pp-hero-body { grid-area: body; }
166
+ .pp-hero-head ~ .pp-media { grid-area: media; }
167
+ @media (min-width: 960px) {
168
+ .pp-hero > .pp-wrap:has(> .pp-hero-head) {
169
+ gap: var(--s4) var(--s7); align-items: stretch;
170
+ grid-template-areas: "head media" "body media"; grid-template-rows: 1fr 1fr;
171
+ }
172
+ .pp-hero-head { align-self: end; }
173
+ .pp-hero-body { align-self: start; }
174
+ .pp-hero-head ~ .pp-media { align-self: center; }
175
+ }
176
+ .pp-hero .pp-status { margin-bottom: var(--s4); }
177
+ /* The hero rule: a short bar in the product's mark, the first thing on the
178
+ page that is this product's and nobody else's. */
179
+ .pp-hero-head::before {
180
+ content: ""; display: block; width: 48px; height: 4px; border-radius: 2px;
181
+ background: var(--pp-mark); margin-bottom: var(--s4);
182
+ }
183
+ /* Who it's for, in a few words, above the thesis: "For teams running on AWS".
184
+ A stranger decides "is this for me?" before reading anything else. Ink,
185
+ not cobalt: cobalt says "you can act on this", and this is a label. */
186
+ .pp-audience { margin: 0 0 var(--s2); font-size: var(--text-base); font-weight: 600; line-height: 1.4; color: var(--ink-soft); }
187
+ /* The thesis names the outcome in 8 words or fewer. On a phone it steps down
188
+ from --text-4xl so it takes two or three lines, not five. */
121
189
  .pp-thesis {
122
- font-size: var(--text-4xl); font-weight: 600; line-height: 1.04; letter-spacing: -0.035em;
123
- margin: 0 0 var(--s4); max-width: 14ch; text-wrap: balance;
190
+ font-size: min(var(--text-4xl), 1.25rem + 4vw); font-weight: 600; line-height: 1.04; letter-spacing: -0.035em;
191
+ margin: 0 0 var(--s4); max-width: 16ch; text-wrap: balance;
124
192
  }
125
- .pp-subhead { font-size: var(--text-lg); line-height: 1.5; color: var(--ink-soft); margin: 0 0 var(--s6); max-width: 40ch; }
193
+ .pp-hero-head .pp-thesis { margin-bottom: 0; }
194
+ /* The subhead is one sentence, 25 words or fewer. */
195
+ .pp-subhead { font-size: var(--text-lg); line-height: 1.5; color: var(--ink-soft); margin: 0 0 var(--s5); max-width: 40ch; text-wrap: pretty; }
126
196
  .pp-media { margin: 0; min-width: 0; }
197
+ /* The stage: the proof sits on a field of the product's mark, so the eye
198
+ lands on it first and each product's first screen has its own colour. */
199
+ .pp-hero .pp-media { box-sizing: border-box; padding: var(--s6); border-radius: calc(var(--radius-lg) * 2); background: var(--pp-stage); }
200
+ @media (max-width: 560px) { .pp-hero .pp-media { padding: var(--s4); border-radius: var(--radius-lg); } }
201
+
202
+ /* Hero layouts (ADR-0011). Split is the default above. Mirror puts the proof
203
+ on the left, for a product whose picture should be read first. Stage
204
+ centres the words and the actions, then gives the proof the full width
205
+ under them, for a wide picture: a map, a dashboard, a before and after.
206
+ The actions sit above the proof so they stay on a laptop's first screen.
207
+ On a phone all three stack the same way: head, proof, body. */
208
+ @media (min-width: 960px) {
209
+ .pp-hero[data-layout="mirror"] > .pp-wrap:has(> .pp-hero-head) {
210
+ grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); grid-template-areas: "media head" "media body";
211
+ }
212
+ .pp-hero[data-layout="stage"] > .pp-wrap:has(> .pp-hero-head) {
213
+ grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body" "media"; grid-template-rows: auto;
214
+ gap: var(--s6); justify-items: center; text-align: center;
215
+ }
216
+ .pp-hero[data-layout="stage"] .pp-hero-head::before { margin-inline: auto; }
217
+ .pp-hero[data-layout="stage"] .pp-thesis { max-width: 20ch; margin-inline: auto; }
218
+ .pp-hero[data-layout="stage"] .pp-subhead { max-width: 52ch; margin-inline: auto; }
219
+ .pp-hero[data-layout="stage"] .pp-actions { justify-content: center; }
220
+ .pp-hero[data-layout="stage"] .pp-hero-head ~ .pp-media { width: 100%; max-width: 1000px; }
221
+ .pp-hero[data-layout="stage"] .pp-media { text-align: start; }
222
+ }
223
+
224
+ /* A browser window around the proof, for a product that lives in a web page
225
+ (an extension, a web app). The bar holds the address, in mono. */
226
+ .pp-browser {
227
+ overflow: hidden; background: var(--card); border: 1px solid var(--line);
228
+ border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
229
+ }
230
+ .pp-browser-bar {
231
+ display: flex; align-items: center; gap: var(--s3); padding: 8px 12px;
232
+ background: var(--bg); border-bottom: 1px solid var(--line);
233
+ }
234
+ .pp-browser-bar::before {
235
+ content: ""; flex: none; width: 44px; height: 10px;
236
+ background: radial-gradient(circle at 5px 5px, var(--line-strong) 4px, transparent 4.5px) 0 0 / 17px 10px repeat-x;
237
+ }
238
+ .pp-browser-url {
239
+ flex: 1; min-width: 0; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
240
+ font: var(--text-xs) / 1.4 var(--mono); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
241
+ }
242
+ .pp-browser > :not(.pp-browser-bar) { display: block; width: 100%; height: auto; }
243
+
244
+ /* ── Proof media: a clip, a phone frame, the steps it shows ───────────────
245
+ The proof slot holds an <img> or a <video>, bare or in a .pp-device phone
246
+ frame, and optionally a row of .pp-steps naming what the clip shows.
247
+
248
+ <figure class="pp-media">
249
+ <div class="pp-device">
250
+ <video muted loop playsinline preload="metadata" width="390" height="844"
251
+ poster="finished.png" aria-describedby="clip-steps">
252
+ <source src="clip.mp4" type="video/mp4"></video>
253
+ </div>
254
+ <figcaption class="pp-caption">
255
+ <ol class="pp-steps" id="clip-steps">
256
+ <li data-at="0">Change the hours</li>
257
+ <li data-at="3">Press Save</li>
258
+ <li data-at="6">The site updates</li>
259
+ </ol>
260
+ <button class="pp-play" type="button" hidden>Pause</button>
261
+ </figcaption>
262
+ </figure>
263
+
264
+ No autoplay attribute: the small script in DESIGN.md §13 starts the clip
265
+ unless the reader prefers reduced motion, shows the Pause / Play button,
266
+ and lights the step the clip is on. Without the script, or with reduced
267
+ motion, the poster stands still, so the poster is the finished state. */
268
+ .pp-media > img, .pp-media > video {
269
+ display: block; width: 100%; height: auto; background: var(--card);
270
+ border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
271
+ }
272
+
273
+ /* A phone around the clip. The bezel is --device, dark in both themes; the
274
+ screen is whatever the frame's one child is (video, img, or a stand-in). */
275
+ .pp-device {
276
+ --pp-device-width: 280px;
277
+ box-sizing: border-box; width: min(100%, var(--pp-device-width)); margin: 0 auto;
278
+ padding: 10px; background: var(--device); border-radius: 44px; box-shadow: var(--shadow-3);
279
+ }
280
+ .pp-device > * {
281
+ display: block; box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 9 / 19.5;
282
+ object-fit: cover; overflow: hidden; border-radius: 34px; background: var(--card);
283
+ }
284
+
285
+ /* Under the clip: the steps in mono, then the control. Centred, because the
286
+ phone is. */
287
+ .pp-caption {
288
+ display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: var(--s3) var(--s5);
289
+ margin-top: var(--s5);
290
+ }
291
+ .pp-steps {
292
+ list-style: none; margin: 0; padding: 0; counter-reset: pp-step;
293
+ display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s4);
294
+ }
295
+ .pp-steps > li {
296
+ counter-increment: pp-step; padding-top: var(--s2); border-top: 2px solid var(--line-strong);
297
+ font: 500 var(--text-xs) / 1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft);
298
+ transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
299
+ }
300
+ .pp-steps > li::before { content: counter(pp-step) " "; color: var(--ink); }
301
+ /* The step the clip is on: the word inks, the bar takes the product's mark.
302
+ Identity, not state, so it never needs a word of its own. */
303
+ .pp-steps > li[aria-current="step"] { color: var(--ink); border-top-color: var(--pp-mark); }
304
+
305
+ /* Pause / Play. A word, because moving content that runs past five seconds
306
+ needs a way to stop it (WCAG 2.2.2). Hidden until the script wires it. */
307
+ .pp-play {
308
+ display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; cursor: pointer;
309
+ font: 500 var(--text-xs) / 1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
310
+ padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-control);
311
+ background: transparent; color: var(--ink);
312
+ }
313
+ .pp-play:hover { background: var(--surface-hover); }
314
+ .pp-play:active { background: var(--surface-active); }
315
+ .pp-play:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
316
+ .pp-play[hidden] { display: none; }
317
+ @media (pointer: coarse) { .pp-play { min-height: 44px; } }
318
+
319
+ /* ── Bands: what you get, how it works ─────────────────────────────────
320
+ A band is a hairline, a short title that is a sentence, and a grid. */
321
+ .pp-band { padding: var(--s8) 0; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
322
+ @media (max-width: 560px) { .pp-band { padding: var(--s7) 0; } }
323
+ .pp-title {
324
+ font-size: clamp(var(--text-xl), 1rem + 2vw, var(--text-3xl)); font-weight: 600; line-height: 1.15;
325
+ letter-spacing: -0.025em; margin: 0; max-width: 24ch; text-wrap: balance;
326
+ }
327
+
328
+ /* What you get: three cards. Each is a small picture of the product doing the
329
+ thing, a short heading, and one line. The picture carries it; the words
330
+ name it. On a phone they stack; from about 820px they sit in a row. */
331
+ .pp-gets { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s4);
332
+ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
333
+ .pp-get { display: flex; flex-direction: column; overflow: hidden;
334
+ background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
335
+ .pp-get-media { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center;
336
+ background: var(--bg); border-bottom: 1px solid var(--line); }
337
+ .pp-get-media > img, .pp-get-media > video { display: block; width: 100%; height: 100%; object-fit: cover; }
338
+ .pp-get h3 { margin: var(--s4) var(--s4) 4px; font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
339
+ .pp-get p { margin: 0 var(--s4) var(--s4); color: var(--ink-soft); }
340
+
341
+ /* Compare: this product beside the thing the reader would otherwise use
342
+ ("a site builder", "a wiki of screenshots"). Two columns, the same rows in
343
+ each, said as words, so nothing rests on colour. Ours is on the right and
344
+ carries the mark on its top rule. On a phone they stack, ours first. */
345
+ .pp-compare { margin: var(--s6) 0 0; display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
346
+ @media (min-width: 720px) { .pp-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
347
+ .pp-compare > div { padding: var(--s5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
348
+ .pp-compare > .is-ours { border-top: 4px solid var(--pp-mark); box-shadow: var(--shadow-2); }
349
+ @media (max-width: 719px) { .pp-compare > .is-ours { order: -1; } }
350
+ .pp-compare h3 { margin: 0 0 var(--s3); font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
351
+ .pp-compare > :not(.is-ours) h3 { color: var(--ink-soft); }
352
+ .pp-compare ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
353
+ .pp-compare li { padding-top: var(--s2); border-top: 1px solid var(--line); }
354
+ .pp-compare > :not(.is-ours) li { color: var(--ink-soft); }
355
+
356
+ /* How it works: three numbered steps, one line each, numbered by the list. */
357
+ .pp-how { list-style: none; margin: var(--s6) 0 0; padding: 0; counter-reset: pp-how; display: grid; gap: var(--s5);
358
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
359
+ .pp-how > li { counter-increment: pp-how; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--s3); align-items: baseline; }
360
+ .pp-how > li::before {
361
+ content: counter(pp-how); grid-row: span 2; display: inline-grid; place-items: center; width: 28px; height: 28px;
362
+ border-radius: 50%; border: 2px solid var(--pp-mark); font: 600 var(--text-sm) / 1 var(--mono); color: var(--ink);
363
+ }
364
+ .pp-how h3 { margin: 0; font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
365
+ .pp-how p { margin: 0; color: var(--ink-soft); }
366
+ .pp-band .pp-figure { margin-top: var(--s6); }
127
367
 
128
368
  /* ── Story ─────────────────────────────────────────────────────────────
129
- An <ol> of chapters. Each opens on a hairline with "01 / Label" in mono,
369
+ Optional, and at most one chapter on a product page (the longer argument
370
+ belongs in the docs). An <ol> of chapters. Each opens on a hairline with "01 / Label" in mono,
130
371
  then a headline that is a sentence, then a short body and an optional
131
372
  figure. Wide screens put the label in its own column. */
132
373
  .pp-story { list-style: none; margin: 0; padding: 0; counter-reset: pp-chapter; }
@@ -169,6 +410,62 @@ body.pp { margin: 0; }
169
410
  .pp-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: var(--s6); }
170
411
  @media (max-width: 560px) { .pp-panel { padding: var(--s5) var(--s4); } }
171
412
 
413
+ /* ── Form ──────────────────────────────────────────────────────────────
414
+ The short form a close panel may need: a few .pp-field, then the primary
415
+ action in .pp-actions, then a .pp-note for the privacy line (or, after a
416
+ failed send, the error). Mark the optional fields with .pp-optional inside
417
+ the label; required is the default and goes unmarked.
418
+
419
+ A field that fails takes aria-invalid="true" on its control and a
420
+ .pp-error message under it, tied with aria-describedby. The message is a
421
+ sentence, so the colour is never the only sign (DESIGN.md §3).
422
+
423
+ On success the form is replaced in the panel by .pp-done: a short heading
424
+ and one line, with role="status" so it is announced, and tabindex="-1" so
425
+ script can move focus to it. */
426
+ .pp-form { display: grid; gap: var(--s4); margin: 0; }
427
+ .pp-form .pp-actions { margin-top: var(--s2); }
428
+ /* [hidden] is how the form gives way to .pp-done; display: grid would beat it. */
429
+ .pp-form[hidden], .pp-error[hidden], .pp-done[hidden] { display: none; }
430
+ .pp-field { display: grid; gap: 6px; min-width: 0; }
431
+ .pp-field > label { font-size: var(--text-sm); font-weight: 500; line-height: 1.4; color: var(--ink); }
432
+ .pp-optional { font-weight: 400; color: var(--ink-soft); }
433
+ .pp-field input, .pp-field textarea {
434
+ box-sizing: border-box; width: 100%; margin: 0; min-width: 0;
435
+ font: var(--text-base) / 1.5 var(--sans); color: var(--ink);
436
+ background: var(--card); border: 1px solid var(--line-control); border-radius: var(--radius-sm);
437
+ padding: 10px 12px;
438
+ transition: border-color var(--dur-fast) var(--ease);
439
+ }
440
+ .pp-field textarea { min-height: 7em; resize: vertical; }
441
+ .pp-field input::placeholder, .pp-field textarea::placeholder { color: var(--slate); opacity: 1; }
442
+ /* Hover darkens the edge rather than lightening it: --line-strong would drop
443
+ the boundary under 3:1 (DESIGN.md §4). */
444
+ .pp-field input:hover, .pp-field textarea:hover { border-color: var(--ink-soft); }
445
+ .pp-field input:focus-visible, .pp-field textarea:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
446
+ .pp-field input:disabled, .pp-field textarea:disabled { background: var(--surface-hover); color: var(--ink-soft); cursor: not-allowed; }
447
+ .pp-field [aria-invalid="true"], .pp-field [aria-invalid="true"]:hover { border-color: var(--danger); }
448
+ .pp-error { margin: 0; font-size: var(--text-sm); line-height: 1.4; color: var(--danger-ink); }
449
+ /* A send error reuses the note under the button. */
450
+ .pp-note.is-error { color: var(--danger-ink); }
451
+
452
+ .pp-done h3 { margin: 0 0 var(--s2); font-size: var(--text-xl); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
453
+ .pp-done p { margin: 0; color: var(--ink-soft); }
454
+ .pp-done:focus { outline: none; }
455
+ .pp-done:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 4px; border-radius: var(--radius-sm); }
456
+ /* ── Price ─────────────────────────────────────────────────────────────
457
+ Two to four ways to pay, as a <dl>: one <div> per option, the price as <dt>,
458
+ one line of condition as <dd>. Ruled like .pp-points, narrower so three fit
459
+ in the close band's left column. It goes under the close's subhead (or in a
460
+ chapter body, if pricing is the argument). The options carry no buttons:
461
+ the page's one .pp-button stays in the panel, and an option that needs its
462
+ own way in gets a plain link in its <dd>. */
463
+ .pp-price { margin: var(--s6) 0 0; display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
464
+ .pp-price > div { border-top: 2px solid var(--ink); padding-top: var(--s3); }
465
+ .pp-price dt { margin: 0 0 6px; font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
466
+ .pp-price dd { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
467
+ .pp-price dd a { color: var(--i-ink); }
468
+
172
469
  /* ── Footer ────────────────────────────────────────────────────────────── */
173
470
  .pp-footer { border-top: 1px solid var(--line); padding: var(--s6) 0 var(--s7); color: var(--ink-soft); font-size: var(--text-sm); }
174
471
  .pp-footer > .pp-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4) var(--s6); }
@@ -0,0 +1,135 @@
1
+ // fold.mjs — the first phone screen of a product page, checked instead of hoped for.
2
+ //
3
+ // node scripts/fold.mjs <url> [<url> ...] [--shots <dir>]
4
+ //
5
+ // Opens each page at iPhone size (390 × 844) and fails when a stranger
6
+ // glancing at it would not get what it is and what to do (DESIGN.md §13):
7
+ //
8
+ // 1. the thesis (h1.pp-thesis) is not wholly on the first screen, or runs
9
+ // past 8 words, or the hero has no audience line (.pp-audience);
10
+ // 2. the hero subhead runs past 25 words;
11
+ // 3. less than 160px of the proof (.pp-hero .pp-media) is on the first
12
+ // screen, or the proof is wider than its box (cropped on a phone);
13
+ // 4. no primary action (.pp-button) is visible on the first screen;
14
+ // 5. the page scrolls sideways;
15
+ // 6. the page is longer than 7 phone screens, the length at which it has
16
+ // become a case study;
17
+ // 7. the words are over budget: more than 40 words of copy on the first
18
+ // screen, or 180 on the whole page. Copy is what the reader has to read:
19
+ // the words inside pictures (.pp-media, .pp-get-media), the form, the
20
+ // header and the footer don't count, nor anything marked
21
+ // data-fold="skip" (the preview site's own bar);
22
+ // 8. the status (.pp-status) shows more than once on the first screen.
23
+ //
24
+ // It can't tell whether a stranger gets it. That is the stranger test in
25
+ // DESIGN.md §13: hand the first-screen shot (--shots) to someone, or a fresh
26
+ // agent with no context, and compare what they say to the page's brief.
27
+ //
28
+ // Needs Playwright with Chromium (`npm i --no-save playwright` and
29
+ // `npx playwright install chromium`, or set CHROME_PATH); the design package itself stays
30
+ // dependency-free, so this script is run in CI and by the sites that copy it,
31
+ // not by `npm run check`. --shots writes a first-screen PNG per page.
32
+
33
+ import { mkdirSync } from 'node:fs';
34
+ import { createRequire } from 'node:module';
35
+
36
+ const require = createRequire(import.meta.url);
37
+ const { chromium } = (() => { try { return require('playwright'); } catch { return require('playwright-core'); } })();
38
+
39
+ const args = process.argv.slice(2);
40
+ const shotsAt = args.indexOf('--shots');
41
+ const shots = shotsAt >= 0 ? args.splice(shotsAt, 2)[1] : null;
42
+ if (!args.length) {
43
+ console.error('usage: node scripts/fold.mjs <url> [<url> ...] [--shots <dir>]');
44
+ process.exit(2);
45
+ }
46
+ if (shots) mkdirSync(shots, { recursive: true });
47
+
48
+ const W = 390, H = 844;
49
+ const LIMITS = { thesisWords: 8, subheadWords: 25, proofVisible: 160, screens: 7, foldWords: 40, pageWords: 180 };
50
+
51
+ // CHROME_PATH points at an installed Chrome instead of Playwright's own
52
+ // download (CI uses the runner's Chrome, which tracks new OS images).
53
+ const browser = await chromium.launch(process.env.CHROME_PATH ? { executablePath: process.env.CHROME_PATH } : {});
54
+ const page = await browser.newPage({ viewport: { width: W, height: H }, deviceScaleFactor: 2, isMobile: true, hasTouch: true });
55
+ await page.route(/googletagmanager|google-analytics|plausible|cloudflareinsights/, (r) => r.abort());
56
+
57
+ let failed = 0;
58
+ for (const url of args) {
59
+ await page.goto(url, { waitUntil: 'load' });
60
+ await page.evaluate(() => document.fonts.ready);
61
+ const r = await page.evaluate(({ W, H }) => {
62
+ const words = (el) => (el ? el.textContent.trim().split(/\s+/).filter(Boolean).length : 0);
63
+ const box = (el) => (el ? el.getBoundingClientRect() : null);
64
+ const thesis = document.querySelector('h1.pp-thesis');
65
+ const subhead = document.querySelector('.pp-hero .pp-subhead');
66
+ const media = document.querySelector('.pp-hero .pp-media');
67
+ const buttons = [...document.querySelectorAll('.pp-button')].filter((b) => {
68
+ const r = b.getBoundingClientRect();
69
+ return r.width > 0 && r.top >= 0 && r.bottom <= H;
70
+ });
71
+ const audience = document.querySelector('.pp-hero .pp-audience');
72
+ // Copy words: text the reader has to read, outside pictures, form, header, footer.
73
+ const skip = '.pp-media, .pp-get-media, .pp-form, .pp-done, .pp-header, .pp-footer, .pp-skip, script, style, [hidden], [data-fold="skip"]';
74
+ let foldWords = 0, pageWords = 0;
75
+ const walk = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
76
+ while (walk.nextNode()) {
77
+ const el = walk.currentNode.parentElement;
78
+ if (!el || el.closest(skip)) continue;
79
+ const r = el.getBoundingClientRect();
80
+ if (!r.width || !r.height) continue;
81
+ const n = walk.currentNode.textContent.split(/\s+/).filter(Boolean).length;
82
+ pageWords += n;
83
+ if (r.top < H && r.bottom > 0) foldWords += n;
84
+ }
85
+ const statuses = [...document.querySelectorAll('.pp-status')].filter((s) => {
86
+ const r = s.getBoundingClientRect();
87
+ return r.width > 0 && r.top < H && r.bottom > 0;
88
+ }).length;
89
+ const tb = box(thesis), mb = box(media);
90
+ return {
91
+ thesis: thesis ? { words: words(thesis), bottom: tb.bottom } : null,
92
+ audience: audience ? audience.textContent.trim() : '',
93
+ subheadWords: words(subhead),
94
+ media: media ? { visible: Math.max(0, Math.min(mb.bottom, H) - mb.top), overflow: media.scrollWidth - media.clientWidth } : null,
95
+ buttons: buttons.length,
96
+ foldWords, pageWords, statuses,
97
+ scrollWidth: document.documentElement.scrollWidth,
98
+ height: document.documentElement.scrollHeight,
99
+ };
100
+ }, { W, H });
101
+
102
+ const problems = [];
103
+ if (!r.thesis) problems.push('no h1.pp-thesis');
104
+ else {
105
+ if (r.thesis.bottom > H) problems.push(`thesis ends at ${Math.round(r.thesis.bottom)}px, below the first screen (${H}px)`);
106
+ if (r.thesis.words > LIMITS.thesisWords) problems.push(`thesis is ${r.thesis.words} words (max ${LIMITS.thesisWords})`);
107
+ }
108
+ if (!r.audience) problems.push('no audience line (.pp-hero .pp-audience) saying who it is for');
109
+ if (r.subheadWords > LIMITS.subheadWords) problems.push(`hero subhead is ${r.subheadWords} words (max ${LIMITS.subheadWords})`);
110
+ if (!r.media) problems.push('no proof (.pp-hero .pp-media)');
111
+ else {
112
+ if (r.media.visible < LIMITS.proofVisible) problems.push(`only ${Math.round(r.media.visible)}px of the proof is on the first screen (min ${LIMITS.proofVisible})`);
113
+ if (r.media.overflow > 1) problems.push(`the proof is ${r.media.overflow}px wider than its box, so it is cropped on a phone`);
114
+ }
115
+ if (!r.buttons) problems.push('no .pp-button visible on the first screen');
116
+ if (r.scrollWidth > W) problems.push(`page scrolls sideways (${r.scrollWidth}px wide)`);
117
+ if (r.foldWords > LIMITS.foldWords) problems.push(`${r.foldWords} words of copy on the first screen (max ${LIMITS.foldWords}): let the proof say it`);
118
+ if (r.pageWords > LIMITS.pageWords) problems.push(`${r.pageWords} words of copy on the page (max ${LIMITS.pageWords}): move the argument to the docs`);
119
+ if (r.statuses > 1) problems.push(`the status shows ${r.statuses} times on the first screen (once is enough)`);
120
+ const screens = r.height / H;
121
+ if (screens > LIMITS.screens) problems.push(`page is ${screens.toFixed(1)} phone screens long (max ${LIMITS.screens})`);
122
+
123
+ if (shots) {
124
+ const name = new URL(url).pathname.split('/').filter(Boolean).pop()?.replace(/\.html$/, '') || 'index';
125
+ await page.screenshot({ path: `${shots}/${name}-fold.png` });
126
+ }
127
+ if (problems.length) {
128
+ failed++;
129
+ console.log(`✗ ${url}\n${problems.map((p) => ` ${p}`).join('\n')}`);
130
+ } else {
131
+ console.log(`✓ ${url} · thesis ${r.thesis.words} words, ${r.foldWords} words on screen one, ${r.pageWords} on the page, ${Math.round(r.media.visible)}px of proof, ${screens.toFixed(1)} screens`);
132
+ }
133
+ }
134
+ await browser.close();
135
+ process.exit(failed ? 1 : 0);
package/tokens.css CHANGED
@@ -137,6 +137,11 @@
137
137
  for (3.39:1 on card, 3.68:1 on bg). */
138
138
  --line-control: light-dark(#8a8a8f, #6b6b73);
139
139
  --on-dark: light-dark(#fafafb, #0d0d0f); /* n-25 / n-0 */
140
+ /* A phone's bezel (.pp-device). A phone is a dark object in either theme,
141
+ so this stays dark rather than flipping with --ink, which would draw a
142
+ near-white bezel in dark mode. Dark lifts it to n-300 so the frame still
143
+ has an edge against the near-black page. Decoration, not a boundary. */
144
+ --device: light-dark(#111114, #3a3a41); /* n-900 / n-300 */
140
145
 
141
146
  /* ── Interactive — cobalt ─────────────────────────────────────────────
142
147
  Everything you can act on: links, buttons, focus, selection. Chosen to
@@ -236,6 +241,19 @@
236
241
  --mark: light-dark(#b4741f, #e0a44f);
237
242
  --mark-ink: light-dark(#8a5714, #e0a44f); /* when the mark carries a label, 6.08:1 / 8.17:1 */
238
243
 
244
+ /* ── Product marks — one per product page ─────────────────────────────
245
+ Each product's marketing page picks one, so Driftwood, Guidebook and
246
+ Sites don't read as the same page with the words swapped (ADR-0011).
247
+ Same contract as --mark: it inks the product's graphics (its glyph,
248
+ the hero rule, the proof's stage, step numerals), never a button,
249
+ link, text or state. Hues sit away from cobalt (act), forest
250
+ (success), amber (attention) and rust (danger). All ≥ 3:1 on --bg and
251
+ --card in both themes. product-page.css maps one onto --pp-mark via
252
+ data-mark on .pp. */
253
+ --mark-teal: light-dark(#0e7c86, #4cc0cb);
254
+ --mark-violet: light-dark(#7148c9, #a990f2);
255
+ --mark-magenta: light-dark(#b1366f, #ea7fb0);
256
+
239
257
  /* ── Legacy aliases ───────────────────────────────────────────────────
240
258
  Kept so existing `life` components keep compiling. Do not use in new
241
259
  work — reach for the semantic tokens above.