@brignano/design 0.6.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
@@ -410,3 +410,106 @@ Decorative motion stays out.
410
410
  the page reads the same with the script off.
411
411
  - Any later animation in a tool has to meet the same four conditions or it is
412
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.
@@ -321,71 +324,153 @@ which is why changing the accent was a migration rather than a one-line edit.
321
324
 
322
325
  ## 13. Product pages
323
326
 
324
- A product's marketing page is one argument and one ask. `product-page.css` is its
325
- structure; `previews/product-page.html` is the skeleton to copy. Import it after
326
- 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>`.
327
362
 
328
363
  ```css
329
364
  @import '@brignano/design/tokens.css';
330
365
  @import '@brignano/design/product-page.css';
331
366
  ```
332
367
 
333
- The order is fixed, because each band answers the question the last one raised:
334
-
335
- 1. **Header** (`.pp-header`) — brand, two or three in-page links, the status, the
336
- primary action. Sticky, on `--surface-sticky`.
337
- 2. **Hero** (`.pp-hero`) — the status, a one-line **thesis** (`.pp-thesis`), a
338
- subhead of one or two sentences, the primary action and one secondary, and a
339
- **proof slot** (`.pp-media`). The proof is the product itself where it can be
340
- (a live demo), else a real screenshot or a short screen recording (see
341
- *Video in the proof slot* below). Never stock imagery.
342
- 3. **Story** (`ol.pp-story` of `.pp-chapter`) — three or four numbered chapters,
343
- usually *the problem*, *how it works*, *who it's for*, *why now*. Each is a mono
344
- label (`.pp-label`, numbered `01 /` by the list, so reordering renumbers), a
345
- headline that is a sentence, a short body, and optionally `.pp-points` (two to
346
- four ruled columns) or a `.pp-figure`.
347
- 4. **Close** (`.pp-close`) — the primary action again, with the room a form needs
348
- (`.pp-panel`). If the product has prices, they go in the left column under the
349
- subhead, as a **price list** (`dl.pp-price`, below). A short form is
350
- `.pp-form` of `.pp-field` (label above the control), then the button, then a
351
- `.pp-note` for the privacy line. Mark the optional fields (`.pp-optional`),
352
- not the required ones. A field that fails takes `aria-invalid="true"` and a
353
- `.pp-error` sentence under it; a failed send puts its error in the note
354
- (`.pp-note.is-error`). On success the form gives way to `.pp-done`, a heading
355
- and one line with `role="status"`, focused.
356
- 5. **Footer** (`.pp-footer`) — the brand and a line about it, a few links, then
357
- the **legal line** (`.pp-legal`): `© {year} Anthony Brignano. All rights
358
- reserved.` and, if the product has them, its Privacy and Terms links
359
- (`<nav aria-label="Legal">`). Leave out a link whose page doesn't exist.
360
-
361
- The year is the current year **at build time**. This package is CSS and HTML,
362
- so the consuming site's build fills it in (a template value from
363
- `new Date().getFullYear()`, or a bundler `define`). Never type it by hand, where
364
- it goes stale every January, and never write it from client script, where it
365
- flashes or is missing without JavaScript.
366
-
367
- 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
368
443
 
369
444
  - **One primary action per page.** `.pp-button` is that action, everywhere it
370
445
  appears. Anything else is `.pp-button.is-secondary` or a link.
371
- - **The status is a word with a dot** (`.pp-status`): "Pilot open", "In
372
- development". `data-state="open"` takes `--success` (you can join now),
373
- `"soon"` takes `--attention`; no attribute stays neutral. The word carries the
374
- meaning on its own (§3, never colour alone).
375
- - **Prices sit beside the ask, not apart from it.** `dl.pp-price` holds two to
376
- four options, one `<div>` each: the price as `<dt>` ("From $100"), one line
377
- of condition as `<dd>`. A single price needs no list; say it in the subhead.
378
- Its home is the close band, under the subhead, so the price is read right before the action.
379
- Only when pricing *is* the argument (tiers the reader has to choose between)
380
- does it get its own chapter, in the chapter body like `.pp-points`. An option
381
- never gets its own `.pp-button`: the one primary action stays in the panel and
382
- covers every option (the form can ask which). An option that needs a separate
383
- way in gets a plain link in its `<dd>`. Write the price the way you'd say it;
384
- no strike-through prices, "most popular" badges or highlighted tiers.
385
- - **Headlines are sentences.** Calm and declarative, no exclamation marks, no
386
- claims the page can't back up.
387
- - **Restraint carries the style.** Hairlines between chapters, whitespace, the
388
- 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.
389
474
 
390
475
  ### Video in the proof slot
391
476
 
@@ -397,6 +482,11 @@ or inside `.pp-device`, a phone frame. `previews/product-media.html` shows both.
397
482
  - **The clip.** `<video muted loop playsinline preload="metadata">` with
398
483
  `width`/`height` set, a `poster`, and no `autoplay` attribute. Keep it under
399
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.
400
490
  - **The poster is the finished state.** It is what shows before the clip
401
491
  loads, without JavaScript, and under `prefers-reduced-motion`, so it has to
402
492
  make the argument on its own (§7: content is visible by default).
@@ -443,20 +533,41 @@ runs only when the reader asks for it, the same terms as ADR-0009.
443
533
  Every class starts with `.pp-`, so the file sits beside a site's own stylesheet.
444
534
  A page can change `--pp-width` (default 1160px) and `--pp-gutter` on `.pp`.
445
535
 
446
- Before a product page ships, check it:
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
+ ```
447
545
 
448
- - [ ] Bands in order: header, hero, story, close, footer.
449
- - [ ] One primary action, the same everywhere it appears.
450
- - [ ] A status word with a dot, in the header and the hero.
451
- - [ ] A one-line thesis; every headline is a sentence.
452
- - [ ] The proof slot is the product (a live demo), a real screenshot, or a
453
- real screen recording.
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.
454
570
  - [ ] A clip has a finished-state poster, a Pause / Play button, and no
455
571
  `autoplay` attribute.
456
- - [ ] Three or four story chapters, numbered by the list.
457
- - [ ] Prices, if any, are a `.pp-price` of two to four options in the close
458
- band (or one chapter), with no buttons of their own.
459
- - [ ] Has a copyright footer: `© {year} Anthony Brignano. All rights reserved.`,
460
- the year filled in at build time, plus Privacy and Terms links for the
461
- pages the product has.
572
+ - [ ] Copyright footer with the year filled in at build time.
462
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.6.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,26 +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-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
12
24
  * .pp-close the primary action again, with whatever it needs: a short
13
25
  * .pp-form of .pp-field (.pp-done once it's sent), and the
14
26
  * prices (.pp-price) if the product has them
15
27
  * .pp-footer brand and links, then the legal line: © year, owner, and
16
28
  * the product's Privacy and Terms links if it has them
17
29
  *
18
- * The skeleton is previews/product-page.html: copy it, keep the order, replace
19
- * 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):
20
43
  *
21
44
  * - One primary action per page (.pp-button). Everything else is secondary.
22
45
  * - The status is a word with a dot, never a coloured badge on its own.
23
- * - The proof slot is the product itself where possible (a live demo), else a
24
- * real screenshot or a screen recording, optionally in a .pp-device phone
25
- * frame. No stock imagery, no illustrations of people.
26
- * - 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.
27
51
  *
28
52
  * Every class starts with .pp- so it can sit beside a site's own stylesheet.
29
53
  * Colours are tokens only; widths are --pp-width / --pp-gutter, which a page
@@ -32,12 +56,19 @@
32
56
  .pp {
33
57
  --pp-width: 1160px;
34
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);
35
63
  background: var(--bg);
36
64
  color: var(--ink);
37
65
  font: var(--text-base) / 1.6 var(--sans);
38
66
  font-variant-numeric: tabular-nums;
39
67
  -webkit-font-smoothing: antialiased;
40
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); }
41
72
  /* On <body>, drop the browser's 8px margin so the sticky header and every band
42
73
  run to the screen edges. On a wrapper, the body is the site's business. */
43
74
  body.pp { margin: 0; }
@@ -63,6 +94,8 @@ body.pp { margin: 0; }
63
94
  font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.01em;
64
95
  }
65
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); }
66
99
  .pp-nav { display: flex; align-items: center; gap: var(--s5); margin-left: auto; }
67
100
  .pp-nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--text-sm); font-weight: 500; }
68
101
  .pp-nav a:hover { color: var(--ink); }
@@ -115,18 +148,98 @@ body.pp { margin: 0; }
115
148
  .pp-note { margin: var(--s3) 0 0; font-size: var(--text-sm); color: var(--ink-soft); }
116
149
 
117
150
  /* ── Hero ──────────────────────────────────────────────────────────────
118
- Copy on the left, proof on the right; stacked below 960px with the copy
119
- first. The thesis is one line of argument, not a tagline. */
120
- .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); } }
121
161
  .pp-hero > .pp-wrap { display: grid; gap: var(--s7); align-items: center; grid-template-columns: minmax(0, 1fr); }
122
162
  @media (min-width: 960px) { .pp-hero > .pp-wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
123
- .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. */
124
189
  .pp-thesis {
125
- font-size: var(--text-4xl); font-weight: 600; line-height: 1.04; letter-spacing: -0.035em;
126
- 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;
127
192
  }
128
- .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; }
129
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; }
130
243
 
131
244
  /* ── Proof media: a clip, a phone frame, the steps it shows ───────────────
132
245
  The proof slot holds an <img> or a <video>, bare or in a .pp-device phone
@@ -185,8 +298,9 @@ body.pp { margin: 0; }
185
298
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
186
299
  }
187
300
  .pp-steps > li::before { content: counter(pp-step) " "; color: var(--ink); }
188
- /* The step the clip is on. Ink, not a hue: it is emphasis, not state. */
189
- .pp-steps > li[aria-current="step"] { color: var(--ink); border-top-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); }
190
304
 
191
305
  /* Pause / Play. A word, because moving content that runs past five seconds
192
306
  needs a way to stop it (WCAG 2.2.2). Hidden until the script wires it. */
@@ -202,8 +316,58 @@ body.pp { margin: 0; }
202
316
  .pp-play[hidden] { display: none; }
203
317
  @media (pointer: coarse) { .pp-play { min-height: 44px; } }
204
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); }
367
+
205
368
  /* ── Story ─────────────────────────────────────────────────────────────
206
- 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,
207
371
  then a headline that is a sentence, then a short body and an optional
208
372
  figure. Wide screens put the label in its own column. */
209
373
  .pp-story { list-style: none; margin: 0; padding: 0; counter-reset: pp-chapter; }
@@ -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
@@ -241,6 +241,19 @@
241
241
  --mark: light-dark(#b4741f, #e0a44f);
242
242
  --mark-ink: light-dark(#8a5714, #e0a44f); /* when the mark carries a label, 6.08:1 / 8.17:1 */
243
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
+
244
257
  /* ── Legacy aliases ───────────────────────────────────────────────────
245
258
  Kept so existing `life` components keep compiling. Do not use in new
246
259
  work — reach for the semantic tokens above.