@brignano/design 0.6.0 → 0.8.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/components.css ADDED
@@ -0,0 +1,2134 @@
1
+ /* components.css — the shared controls and patterns every brignano surface
2
+ uses: buttons, fields, messages, pills, cards, dialogs and the rest.
3
+ DESIGN.md §14; the catalog and its order are in proposals/component-layer.md.
4
+
5
+ @import '@brignano/design/tokens.css';
6
+ @import '@brignano/design/components.css';
7
+
8
+ Rules for anything added here (ADR-0012):
9
+ - Everything sits in the `brignano.components` cascade layer, so a
10
+ consumer's own CSS and utilities win without !important.
11
+ - Short names: `.name`, `.name-variant`. State comes from real attributes
12
+ (disabled, aria-invalid, aria-current, aria-expanded, [open]), never from
13
+ a state class.
14
+ - Native first: <dialog>, popover, <details>. Where behaviour needs JS, the
15
+ component's preview page documents the ARIA contract; the consumer owns
16
+ the script.
17
+ - Tokens only. No hex, no colour that isn't a var() (npm run check).
18
+ - Every class here appears on a preview page, and every rule that sets both
19
+ a text colour and a background is contrast-checked in both themes. */
20
+
21
+ @layer brignano.components;
22
+
23
+ /* ── Button and link (#47) ────────────────────────────────────────────────
24
+ <button class="btn btn-primary">Save</button>
25
+ <a class="btn btn-secondary" href="…">Cancel</a>
26
+ Variants: .btn-primary (one per view), .btn-secondary (the default look of
27
+ a bare .btn), .btn-ghost, .btn-danger (the only non-cobalt fill). Sizes:
28
+ .btn-sm, default, .btn-lg. .btn-icon is square and needs aria-label;
29
+ .btn-block fills its row. Works the same on <button> and <a>.
30
+ State comes from attributes:
31
+ - disabled, or aria-disabled="true" on a link or a button that must stay
32
+ focusable: neutral --i-disabled-*, never opacity, no hover;
33
+ - aria-busy="true": the label hides behind a spinner and the button keeps
34
+ its width. Your script sets it and ignores clicks while it is set.
35
+ .link is the inline link for running text. */
36
+ @layer brignano.components {
37
+ .btn {
38
+ position: relative;
39
+ display: inline-flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ gap: var(--s2);
43
+ min-height: 40px;
44
+ padding: 0 var(--s4);
45
+ font: inherit;
46
+ font-size: var(--text-sm);
47
+ font-weight: 500;
48
+ line-height: 20px;
49
+ white-space: nowrap;
50
+ text-decoration: none;
51
+ vertical-align: middle;
52
+ cursor: pointer;
53
+ user-select: none;
54
+ border: 1px solid var(--line-control);
55
+ border-radius: var(--radius);
56
+ background: transparent;
57
+ color: var(--ink);
58
+ transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
59
+ }
60
+ .btn > svg { flex: none; width: 1.25em; height: 1.25em; }
61
+ .btn:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
62
+
63
+ .btn:hover, .btn-secondary:hover { background: var(--surface-hover); }
64
+ .btn:active, .btn-secondary:active { background: var(--surface-active); }
65
+ .btn-secondary { border-color: var(--line-control); background: transparent; color: var(--ink); }
66
+
67
+ .btn-primary { border-color: transparent; background: var(--i); color: var(--on-i); }
68
+ .btn-primary:hover { background: var(--i-hover); }
69
+ .btn-primary:active { background: var(--i-pressed); }
70
+
71
+ .btn-ghost { border-color: transparent; background: transparent; color: var(--i-ink); }
72
+ .btn-ghost:is(:hover, :active) { background: var(--i-surface); }
73
+
74
+ /* Danger has no hover/pressed tokens of its own: hover deepens to
75
+ --danger-ink, the same direction --i-hover takes in each theme. */
76
+ .btn-danger { border-color: transparent; background: var(--danger); color: var(--on-i); }
77
+ .btn-danger:hover, .btn-danger:active { background: var(--danger-ink); }
78
+
79
+ .btn-sm { min-height: 32px; padding: 0 var(--s3); font-size: var(--text-xs); line-height: 16px; }
80
+ .btn-lg { min-height: 48px; padding: 0 var(--s5); font-size: var(--text-base); line-height: 24px; }
81
+ .btn-icon { aspect-ratio: 1; padding: 0; }
82
+ .btn-block { display: flex; width: 100%; }
83
+
84
+ /* Disabled: neutral, never opacity. Its low contrast is allowed only
85
+ because the control is really inactive (WCAG 1.4.3, DESIGN.md §4);
86
+ check.mjs exempts exactly this pair on :disabled / aria-disabled rules. */
87
+ .btn:is(:disabled, [aria-disabled='true']) {
88
+ border-color: transparent;
89
+ background: var(--i-disabled-bg);
90
+ color: var(--i-disabled-ink);
91
+ cursor: not-allowed;
92
+ }
93
+
94
+ /* Busy: the text goes transparent but keeps its box, so the width holds;
95
+ the spinner draws in the text colour. */
96
+ .btn[aria-busy='true'] { -webkit-text-fill-color: transparent; cursor: progress; pointer-events: none; }
97
+ .btn[aria-busy='true'] > * { visibility: hidden; }
98
+ .btn[aria-busy='true']::after {
99
+ content: '';
100
+ position: absolute;
101
+ inset: 0;
102
+ width: 1em;
103
+ height: 1em;
104
+ margin: auto;
105
+ border: 2px solid currentColor;
106
+ border-right-color: transparent;
107
+ border-radius: 50%;
108
+ animation: spinner-spin 0.7s linear infinite;
109
+ }
110
+ /* Shared with .spinner (#59). */
111
+ @keyframes spinner-spin { to { transform: rotate(1turn); } }
112
+
113
+ .link { color: var(--i-ink); text-decoration: underline; text-underline-offset: 3px; border-radius: 2px; }
114
+ .link:hover { color: var(--i-hover); }
115
+ .link:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
116
+
117
+ @media (pointer: coarse) {
118
+ .btn:not(.btn-lg) { min-height: 44px; }
119
+ .btn-icon { min-width: 44px; }
120
+ }
121
+ /* Forced colours repaint the hidden label, so the busy button takes
122
+ system colours itself and the spinner draws on a clean face. */
123
+ @media (forced-colors: active) {
124
+ .btn[aria-busy='true'] { forced-color-adjust: none; background: ButtonFace; color: ButtonText; border-color: ButtonText; }
125
+ }
126
+ /* Under reduced motion tokens.css stops the spin: a still arc, and
127
+ aria-busy still says the button is working. */
128
+ @media (prefers-reduced-motion: reduce) {
129
+ .btn { transition: none; }
130
+ }
131
+ }
132
+
133
+ /* ── Text field (#48) ─────────────────────────────────────────────────────
134
+ <div class="field">
135
+ <label for="email">Email <span class="field-optional">(optional)</span></label>
136
+ <input id="email" type="email" aria-describedby="email-hint email-error">
137
+ <p class="field-hint" id="email-hint">We only use it to reply.</p>
138
+ <p class="field-error" id="email-error"><svg …></svg>Enter an email like name@example.com</p>
139
+ </div>
140
+ The label sits above, never a placeholder in its place. Required fields
141
+ carry no star; mark the optional ones. Text-like <input>, <textarea> and a
142
+ native <select> are styled inside .field. State comes from attributes:
143
+ aria-invalid="true" turns the edge to --danger, disabled goes neutral.
144
+ .field-affix wraps a control with a prefix or suffix (a unit or an icon);
145
+ name the unit in the label too. When to validate is your script's call. */
146
+ @layer brignano.components {
147
+ .field { display: grid; align-content: start; gap: 6px; min-width: 0; }
148
+ .field > label { font-size: var(--text-sm); font-weight: 500; line-height: 1.4; color: var(--ink); }
149
+ .field-optional { font-weight: 400; color: var(--ink-soft); }
150
+ .field-hint { margin: 0; font-size: var(--text-sm); line-height: 1.4; color: var(--ink-soft); }
151
+ .field-error { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: var(--text-sm); line-height: 1.4; color: var(--danger-ink); }
152
+ .field-error > svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--danger); }
153
+ .field-error[hidden] { display: none; }
154
+
155
+ .field :is(input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='hidden'], [type='submit'], [type='button'], [type='reset'], [type='image'])), textarea, select),
156
+ .field-affix {
157
+ box-sizing: border-box;
158
+ width: 100%;
159
+ min-width: 0;
160
+ min-height: 40px;
161
+ margin: 0;
162
+ border: 1px solid var(--line-control);
163
+ border-radius: var(--radius-sm);
164
+ background-color: var(--card);
165
+ color: var(--ink);
166
+ transition: border-color var(--dur-fast) var(--ease);
167
+ }
168
+ /* At least 16px, so phones don't zoom in on focus (the tool tier's base is 15px). */
169
+ .field :is(input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='hidden'], [type='submit'], [type='button'], [type='reset'], [type='image'])), textarea, select) { padding: 7px 12px; font: max(1rem, var(--text-base)) / 24px var(--sans); }
170
+ .field textarea { min-height: 7em; resize: vertical; }
171
+ .field :is(input, textarea)::placeholder { color: var(--slate); opacity: 1; }
172
+
173
+ /* Native select, no custom dropdown: the chevron is two gradients in the
174
+ text colour, so it follows the theme and needs no image. */
175
+ .field select {
176
+ appearance: none;
177
+ padding-right: 36px;
178
+ background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
179
+ background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
180
+ background-size: 5px 5px;
181
+ background-repeat: no-repeat;
182
+ cursor: pointer;
183
+ }
184
+
185
+ /* Hover darkens the edge: --line-strong would drop it under 3:1 (DESIGN.md §4). */
186
+ .field :is(input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='hidden'], [type='submit'], [type='button'], [type='reset'], [type='image'])), textarea, select):hover, .field-affix:hover { border-color: var(--ink-soft); }
187
+ .field :is(input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='hidden'], [type='submit'], [type='button'], [type='reset'], [type='image'])), textarea, select):focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
188
+
189
+ .field [aria-invalid='true'], .field [aria-invalid='true']:hover,
190
+ .field-affix:has([aria-invalid='true']) { border-color: var(--danger); background-color: var(--card); }
191
+
192
+ /* Disabled stays readable: a disabled field can still hold a value the
193
+ reader needs, so its text keeps the 4.5:1 floor. The edge goes, so it
194
+ no longer reads as something to type in. */
195
+ .field :is(input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='hidden'], [type='submit'], [type='button'], [type='reset'], [type='image'])), textarea, select):disabled,
196
+ .field-affix:has(:disabled) { border-color: transparent; background-color: var(--surface-hover); color: var(--ink-soft); cursor: not-allowed; }
197
+
198
+ /* Affix: the wrapper draws the edge and the focus ring; the control inside
199
+ goes bare. */
200
+ .field-affix { display: flex; align-items: center; gap: var(--s2); padding: 0 12px; font-size: max(1rem, var(--text-base)); color: var(--ink-soft); }
201
+ .field-affix > svg { flex: none; width: 18px; height: 18px; }
202
+ .field .field-affix > :is(input, select) {
203
+ flex: 1;
204
+ width: auto;
205
+ min-height: 38px;
206
+ padding: 7px 0;
207
+ border: 0;
208
+ border-radius: 0;
209
+ background-color: transparent;
210
+ color: var(--ink);
211
+ outline: 0;
212
+ }
213
+ .field .field-affix > :disabled { color: var(--ink-soft); }
214
+ .field .field-affix > select { padding-right: 24px; background-position: calc(100% - 7px) 50%, calc(100% - 2px) 50%; }
215
+ .field-affix:has(:focus-visible) { outline: 2px solid var(--i-ink); outline-offset: 2px; }
216
+
217
+ @media (pointer: coarse) {
218
+ .field :is(input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='hidden'], [type='submit'], [type='button'], [type='reset'], [type='image'])), select), .field-affix { min-height: 44px; }
219
+ .field .field-affix > :is(input, select) { min-height: 42px; }
220
+ }
221
+ /* Forced colours drop the gradient chevron: give the select its native arrow back. */
222
+ @media (forced-colors: active) {
223
+ .field select { appearance: auto; background-image: none; }
224
+ }
225
+ @media (prefers-reduced-motion: reduce) {
226
+ .field :is(input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='hidden'], [type='submit'], [type='button'], [type='reset'], [type='image'])), textarea, select), .field-affix { transition: none; }
227
+ }
228
+ }
229
+
230
+ /* ── Checkbox, radio, switch, segmented control (#49) ─────────────────────
231
+ <fieldset class="choice-group">
232
+ <legend>Notify me</legend>
233
+ <label class="choice"><input type="checkbox" name="n" value="email"><span>By email</span></label>
234
+ <div class="choice">
235
+ <input type="radio" id="ship-fast" name="ship" aria-describedby="ship-fast-hint">
236
+ <label for="ship-fast">Express</label>
237
+ <p class="choice-hint" id="ship-fast-hint">Two working days.</p>
238
+ </div>
239
+ </fieldset>
240
+ Inside .choice, checkboxes and radios are drawn from tokens (issue 118): an
241
+ --line-control box on --card, filled --i with an --on-i mark when
242
+ checked, a dash when indeterminate. The tick is the row's ::before laid
243
+ over the box, because an <input> can't reliably hold a pseudo-element.
244
+ Outside .choice they stay native and take accent-color (DESIGN.md §4). .switch goes on <input type="checkbox" role="switch">,
245
+ only for a setting that applies at once; a form you submit uses a
246
+ checkbox. .segmented is a row of radios drawn as one control: keep the
247
+ real radios inside it, so arrow keys and the group name come for free. */
248
+ @layer brignano.components {
249
+ .choice-group { display: grid; gap: var(--s2); min-width: 0; margin: 0; padding: 0; border: 0; }
250
+ .choice-group > legend { margin: 0 0 6px; padding: 0; font-size: var(--text-sm); font-weight: 500; line-height: 1.4; color: var(--ink); }
251
+
252
+ .choice { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s2); align-items: start; line-height: 1.5; color: var(--ink); cursor: pointer; }
253
+ .choice > input { grid-column: 1; font: inherit; cursor: inherit; }
254
+ .choice > input:not(.switch) { width: 18px; height: 18px; margin: calc((1.5em - 18px) / 2) 0 0; }
255
+ .choice > input:is([type='checkbox'], [type='radio']):not(.switch) {
256
+ appearance: none;
257
+ box-sizing: border-box;
258
+ grid-area: 1 / 1;
259
+ flex: none;
260
+ border: 1px solid var(--line-control);
261
+ border-radius: var(--radius-sm);
262
+ background-color: var(--card);
263
+ background-repeat: no-repeat;
264
+ background-position: center;
265
+ }
266
+ .choice > input[type='radio']:not(.switch) { border-radius: 50%; } /* (0,3,1), after the base rule */
267
+ .choice > input:is([type='checkbox'], [type='radio']):not(.switch):not(:disabled):hover { border-color: var(--ink-soft); }
268
+ .choice > input:is([type='checkbox']:is(:checked, :indeterminate), [type='radio']:checked):not(.switch) {
269
+ border-color: transparent;
270
+ background-color: var(--i);
271
+ color: var(--on-i);
272
+ }
273
+ .choice > input:is([type='checkbox']:is(:checked, :indeterminate), [type='radio']:checked):not(.switch):not(:disabled):hover { background-color: var(--i-hover); }
274
+ .choice > input[type='radio']:checked { background-image: radial-gradient(circle, currentColor 0 3.5px, transparent 4px); }
275
+ .choice > input[type='checkbox']:indeterminate { background-image: linear-gradient(currentColor, currentColor); background-size: 10px 2px; }
276
+ .choice > input:is([type='checkbox'], [type='radio']):not(.switch):disabled { border-color: transparent; background-color: var(--i-disabled-bg); color: var(--i-disabled-ink); cursor: not-allowed; }
277
+ /* The tick: the row's ::before sits in the box's grid cell, masked to a check. */
278
+ .choice:has(> input[type='checkbox']:checked:not(:indeterminate, .switch))::before {
279
+ content: '';
280
+ grid-area: 1 / 1;
281
+ width: 18px;
282
+ height: 18px;
283
+ margin: calc((1.5em - 18px) / 2) 0 0;
284
+ background-color: var(--on-i);
285
+ pointer-events: none;
286
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9.5l3 3 6-7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
287
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9.5l3 3 6-7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
288
+ }
289
+ .choice:has(> input[type='checkbox']:checked:disabled)::before { background-color: var(--i-disabled-ink); }
290
+ .choice > :not(input) { grid-column: 2; }
291
+ .choice > label { cursor: inherit; }
292
+ .choice-hint { margin: 0; font-size: var(--text-sm); line-height: 1.4; color: var(--ink-soft); }
293
+ .choice > input:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
294
+ .choice:has(> input:disabled) { color: var(--i-disabled-ink); cursor: not-allowed; }
295
+
296
+ /* Switch: track and knob drawn on the input itself. The knob is a radial
297
+ gradient in the text colour, so on and off read by its position, not
298
+ by colour alone. */
299
+ .switch {
300
+ appearance: none;
301
+ box-sizing: border-box;
302
+ flex: none;
303
+ width: 40px;
304
+ height: 24px;
305
+ margin: 0;
306
+ border: 1px solid var(--line-control);
307
+ border-radius: 999px;
308
+ background-color: var(--card);
309
+ background-image: radial-gradient(circle, currentColor 0 7px, transparent 7.5px);
310
+ background-size: 22px 22px;
311
+ background-position: 0 50%;
312
+ background-repeat: no-repeat;
313
+ color: var(--ink-soft);
314
+ cursor: pointer;
315
+ vertical-align: middle;
316
+ transition: background-position var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
317
+ }
318
+ .switch:checked { border-color: transparent; background-color: var(--i); background-position: 100% 50%; color: var(--on-i); }
319
+ .switch:not(:disabled):hover { border-color: var(--ink-soft); }
320
+ .switch:checked:not(:disabled):hover { border-color: transparent; background-color: var(--i-hover); }
321
+ .switch:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
322
+ .switch:disabled { border-color: transparent; background-color: var(--i-disabled-bg); color: var(--i-disabled-ink); cursor: not-allowed; }
323
+ /* In a .choice row the switch sits in the first column like a checkbox. */
324
+ .choice > .switch { margin: calc((1.5em - 24px) / 2) 0 0; }
325
+
326
+ /* Segmented: a track with the chosen option filled. The radio stays in
327
+ the tab order but out of sight; its label is the visible segment. */
328
+ .segmented {
329
+ display: inline-flex;
330
+ flex-wrap: wrap;
331
+ gap: 2px;
332
+ width: fit-content;
333
+ max-width: 100%;
334
+ padding: 2px;
335
+ border: 1px solid var(--line-control);
336
+ border-radius: var(--radius);
337
+ background-color: var(--card);
338
+ }
339
+ .segmented > label {
340
+ position: relative;
341
+ display: inline-flex;
342
+ align-items: center;
343
+ justify-content: center;
344
+ min-height: 34px;
345
+ padding: 0 var(--s3);
346
+ border-radius: calc(var(--radius) - 3px);
347
+ font-size: var(--text-sm);
348
+ font-weight: 500;
349
+ line-height: 20px;
350
+ color: var(--ink);
351
+ cursor: pointer;
352
+ user-select: none;
353
+ transition: background-color var(--dur-fast) var(--ease);
354
+ }
355
+ .segmented > label > input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
356
+ .segmented > label:not(:has(:disabled)):hover { background-color: var(--surface-hover); }
357
+ .segmented > label:has(:checked), .segmented > label:has(:checked):hover { background-color: var(--i); color: var(--on-i); }
358
+ .segmented > label:has(:focus-visible) { outline: 2px solid var(--i-ink); outline-offset: 2px; }
359
+ .segmented > label:has(:disabled) { color: var(--i-disabled-ink); cursor: not-allowed; }
360
+ .segmented > label:has(:checked:disabled) { background-color: var(--i-disabled-bg); color: var(--i-disabled-ink); }
361
+
362
+ @media (pointer: coarse) {
363
+ .choice { min-height: 44px; align-content: center; }
364
+ .segmented > label { min-height: 44px; }
365
+ }
366
+ @media (forced-colors: active) {
367
+ .switch { forced-color-adjust: none; border-color: CanvasText; background-color: Canvas; color: CanvasText; }
368
+ .switch:checked { border-color: Highlight; background-color: Highlight; color: HighlightText; }
369
+ .switch:disabled { border-color: GrayText; background-color: Canvas; color: GrayText; }
370
+ .choice > input:is([type='checkbox'], [type='radio']):not(.switch) { forced-color-adjust: none; border-color: CanvasText; background-color: Canvas; color: HighlightText; }
371
+ .choice > input:is([type='checkbox']:is(:checked, :indeterminate), [type='radio']:checked):not(.switch) { border-color: Highlight; background-color: Highlight; }
372
+ .choice > input:is([type='checkbox'], [type='radio']):not(.switch):disabled { border-color: GrayText; background-color: Canvas; color: GrayText; }
373
+ .choice:has(> input[type='checkbox']:checked:not(:indeterminate, .switch))::before { forced-color-adjust: none; background-color: HighlightText; }
374
+ .choice:has(> input[type='checkbox']:checked:disabled)::before { background-color: GrayText; }
375
+ /* Hover and focus keep system colours too (forced-color-adjust: none stops the browser doing it). */
376
+ .choice > input:is([type='checkbox'], [type='radio']):not(.switch):not(:disabled):hover { border-color: CanvasText; }
377
+ .choice > input:is([type='checkbox']:is(:checked, :indeterminate), [type='radio']:checked):not(.switch):not(:disabled):hover { border-color: Highlight; background-color: Highlight; }
378
+ .choice > input:focus-visible, .switch:focus-visible { outline-color: CanvasText; }
379
+ .switch:not(:disabled):hover { border-color: CanvasText; }
380
+ .switch:checked:not(:disabled):hover { border-color: Highlight; background-color: Highlight; }
381
+ .segmented > label { forced-color-adjust: none; color: CanvasText; }
382
+ .segmented > label:has(:checked) { background-color: Highlight; color: HighlightText; }
383
+ .segmented > label:has(:disabled) { color: GrayText; }
384
+ .segmented > label:has(:focus-visible) { outline-color: CanvasText; }
385
+ }
386
+ @media (prefers-reduced-motion: reduce) {
387
+ .switch, .segmented > label { transition: none; }
388
+ }
389
+ }
390
+
391
+ /* ── Message and banner (#50) ─────────────────────────────────────────────
392
+ <div class="msg msg-danger" role="alert">
393
+ <svg aria-hidden="true" …></svg>
394
+ <div class="msg-content">
395
+ <p class="msg-title">Couldn't reach WakaTime</p>
396
+ <p class="msg-body">Showing the last cached week.</p>
397
+ <div class="msg-actions"><button class="btn btn-sm">Try again</button></div>
398
+ </div>
399
+ <button class="btn btn-ghost btn-icon btn-sm msg-close" aria-label="Dismiss">…</button>
400
+ </div>
401
+ Kinds: .msg-info (neutral, cobalt icon: not a fourth hue; a bare .msg
402
+ looks the same), .msg-success,
403
+ .msg-attention, .msg-danger. Every kind carries an icon and words, never
404
+ colour alone. role="status" for info and success, role="alert" for
405
+ danger, and for attention when it needs action now. .banner is the same
406
+ message as a full-width strip above the site header, .banner-info and the
407
+ rest. The icon slot takes any inline SVG; dismissing is your script. */
408
+ @layer brignano.components {
409
+ .msg {
410
+ display: flex;
411
+ gap: 10px;
412
+ align-items: flex-start;
413
+ padding: 12px 14px;
414
+ border: 1px solid var(--line-strong);
415
+ border-radius: var(--radius);
416
+ background-color: var(--card);
417
+ color: var(--ink);
418
+ font-size: var(--text-sm);
419
+ line-height: 1.45;
420
+ }
421
+ .msg > svg, .banner > svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--i); }
422
+ .msg-content { display: grid; gap: 2px; flex: 1; min-width: 0; }
423
+ .msg-title { margin: 0; font-weight: 600; }
424
+ .msg-body { margin: 0; color: var(--ink-soft); }
425
+ .msg-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
426
+ /* An outlined button's --line-control edge is under 3:1 on a status wash,
427
+ so in a message it sits on its own --card fill. Zero-specificity
428
+ :where() keeps hover, pressed and disabled winning. */
429
+ :where(.msg-actions) > .btn:where(:not(.btn-primary, .btn-danger, .btn-ghost)) { background-color: var(--card); }
430
+ .msg-close { flex: none; margin: -6px -8px -6px 0; color: var(--ink-soft); }
431
+
432
+ /* Banner: the same parts in a strip, edge to edge, above the header. */
433
+ .banner {
434
+ display: flex;
435
+ gap: 10px;
436
+ align-items: flex-start;
437
+ padding: 10px var(--s4);
438
+ border: 0;
439
+ border-bottom: 1px solid var(--line-strong);
440
+ background-color: var(--surface-hover);
441
+ color: var(--ink);
442
+ font-size: var(--text-sm);
443
+ line-height: 1.45;
444
+ }
445
+ /* The wash alone marks the box. Its -line token is under 3:1 on the wash,
446
+ so it can't be the edge (DESIGN.md §4); the border stays, transparent,
447
+ so every kind is the same size. */
448
+ .msg-success, .banner-success { border-color: transparent; background-color: var(--success-surface); color: var(--ink); }
449
+ .msg-attention, .banner-attention { border-color: transparent; background-color: var(--attention-surface); color: var(--ink); }
450
+ .msg-danger, .banner-danger { border-color: transparent; background-color: var(--danger-surface); color: var(--ink); }
451
+ :is(.msg-info, .banner-info) > svg { color: var(--i); }
452
+ :is(.msg-success, .banner-success) > svg { color: var(--success); }
453
+ :is(.msg-attention, .banner-attention) > svg { color: var(--attention); }
454
+ :is(.msg-danger, .banner-danger) > svg { color: var(--danger); }
455
+
456
+ .banner .msg-content { display: flex; flex-wrap: wrap; column-gap: var(--s2); align-items: baseline; }
457
+ .banner .msg-actions { margin: 0; }
458
+ }
459
+
460
+ /* ── Pill, badge and tag (#51) ────────────────────────────────────────────
461
+ <span class="pill pill-success">Booked</span>
462
+ <button class="btn btn-ghost btn-icon" aria-label="Notifications, 3 unread">
463
+ <svg …></svg><span class="badge" aria-hidden="true">3</span>
464
+ </button>
465
+ <span class="tag">Kayak<button type="button" class="tag-remove" aria-label="Remove Kayak"><svg …></svg></button></span>
466
+ .pill is a status label: neutral by default; .pill-success, -attention,
467
+ -danger and -info add a dot and their wash. Status always carries a word,
468
+ and categories stay neutral (no new hues). Domain names (booked, overdue)
469
+ belong to the consumer: map them onto these kinds. .badge is a count on
470
+ an icon button; put the count in the button's name too. .tag is a
471
+ removable filter chip; your script removes it. */
472
+ @layer brignano.components {
473
+ .pill {
474
+ display: inline-flex;
475
+ align-items: center;
476
+ gap: 6px;
477
+ padding: 2px 8px;
478
+ border: 1px solid transparent;
479
+ border-radius: var(--radius-sm);
480
+ background-color: var(--surface-hover);
481
+ color: var(--ink-soft);
482
+ font-family: var(--mono);
483
+ font-size: var(--text-xs);
484
+ font-weight: 500;
485
+ line-height: 16px;
486
+ letter-spacing: .04em;
487
+ text-transform: uppercase;
488
+ white-space: nowrap;
489
+ vertical-align: middle;
490
+ }
491
+ .pill-success { background-color: var(--success-surface); color: var(--success-ink); }
492
+ .pill-attention { background-color: var(--attention-surface); color: var(--attention-ink); }
493
+ .pill-danger { background-color: var(--danger-surface); color: var(--danger-ink); }
494
+ .pill-info { background-color: var(--info-surface); color: var(--info-ink); }
495
+ :is(.pill-success, .pill-attention, .pill-danger, .pill-info)::before {
496
+ content: '';
497
+ flex: none;
498
+ width: 6px;
499
+ height: 6px;
500
+ border-radius: 50%;
501
+ background-color: currentColor;
502
+ }
503
+ .pill-success::before { background-color: var(--success); }
504
+ .pill-attention::before { background-color: var(--attention); }
505
+ .pill-danger::before { background-color: var(--danger); }
506
+ .pill-info::before { background-color: var(--info); }
507
+
508
+ /* Badge: a count pinned to the corner of an icon button (.btn is
509
+ position: relative). The ring in the card colour lifts it off the icon. */
510
+ .badge {
511
+ display: inline-flex;
512
+ align-items: center;
513
+ justify-content: center;
514
+ box-sizing: border-box;
515
+ min-width: 18px;
516
+ height: 18px;
517
+ padding: 0 4px;
518
+ border: 1px solid transparent;
519
+ border-radius: 999px;
520
+ background-color: var(--i);
521
+ color: var(--on-i);
522
+ font-size: 11px;
523
+ font-weight: 600;
524
+ line-height: 1;
525
+ font-variant-numeric: tabular-nums;
526
+ }
527
+ .btn > .badge { position: absolute; top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--card); }
528
+
529
+ /* Tag: a filter chip with a remove button. The button is 24px, and 44px
530
+ of hit area on touch through an invisible ::before. */
531
+ .tag {
532
+ display: inline-flex;
533
+ align-items: center;
534
+ gap: 4px;
535
+ min-height: 28px;
536
+ padding: 0 2px 0 10px;
537
+ border: 1px solid var(--line-control);
538
+ border-radius: var(--radius-sm);
539
+ background-color: var(--card);
540
+ color: var(--ink);
541
+ font-size: var(--text-sm);
542
+ line-height: 20px;
543
+ white-space: nowrap;
544
+ vertical-align: middle;
545
+ }
546
+ .tag-remove {
547
+ position: relative;
548
+ display: inline-flex;
549
+ align-items: center;
550
+ justify-content: center;
551
+ width: 24px;
552
+ height: 24px;
553
+ margin: 0;
554
+ padding: 0;
555
+ border: 0;
556
+ border-radius: calc(var(--radius-sm) - 2px);
557
+ background: transparent;
558
+ color: var(--ink-soft);
559
+ cursor: pointer;
560
+ }
561
+ .tag-remove > svg { width: 14px; height: 14px; }
562
+ .tag-remove:hover { background-color: var(--surface-hover); color: var(--ink); }
563
+ .tag-remove:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
564
+
565
+ @media (pointer: coarse) {
566
+ .tag-remove::before { content: ''; position: absolute; inset: -10px; }
567
+ }
568
+ @media (forced-colors: active) {
569
+ :is(.pill-success, .pill-attention, .pill-danger, .pill-info)::before { background-color: CanvasText; }
570
+ .pill, .badge { border-color: CanvasText; }
571
+ }
572
+ }
573
+
574
+ /* ── Card (#52) ───────────────────────────────────────────────────────────
575
+ <article class="card card-link">
576
+ <div class="card-media"><img src="…" alt=""></div>
577
+ <header class="card-header">
578
+ <h3 class="card-title"><a href="/trips/lisbon">Lisbon, 4 days</a></h3>
579
+ <p class="card-meta">12–15 Mar · 2 people</p>
580
+ </header>
581
+ <div class="card-body"><p>…</p></div>
582
+ <footer class="card-footer"><span class="pill pill-success">Booked</span></footer>
583
+ </article>
584
+ .card is a static surface; every part is optional. .card-link makes the
585
+ whole card one target through the title link's ::after (a stretched
586
+ link), so the markup stays a heading and a link, not a link wrapped
587
+ round blocks. One focus ring goes round the card. Other buttons and
588
+ links inside a .card-link still work: they sit above the stretched area.
589
+ .card-media goes first and runs edge to edge. No cards inside cards. */
590
+ @layer brignano.components {
591
+ .card {
592
+ position: relative;
593
+ display: flex;
594
+ flex-direction: column;
595
+ gap: var(--s3);
596
+ min-width: 0;
597
+ padding: var(--s5);
598
+ border: 1px solid var(--line);
599
+ border-radius: var(--radius);
600
+ background-color: var(--card);
601
+ color: var(--ink);
602
+ box-shadow: var(--shadow-1);
603
+ overflow: hidden;
604
+ }
605
+ .card-media { margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) 0; }
606
+ .card-media > :is(img, video, picture, svg) { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
607
+ .card-header { display: grid; gap: var(--s1); }
608
+ .card-title { margin: 0; font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
609
+ .card-title a { color: inherit; text-decoration: none; }
610
+ .card-meta { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
611
+ .card-body { color: var(--ink-soft); }
612
+ .card-body > :first-child { margin-top: 0; }
613
+ .card-body > :last-child { margin-bottom: 0; }
614
+ .card-footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: auto; }
615
+
616
+ /* Link card: the title link stretches over the card. */
617
+ .card-link { transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
618
+ .card-link .card-title a::after { content: ''; position: absolute; inset: 0; z-index: 0; }
619
+ /* Zero-specificity so components that position their own parts (for example .segmented) still win. */
620
+ :where(.card-link :is(a, button, input, select, textarea, label):not(.card-title a)) { position: relative; z-index: 1; }
621
+ .card-link:hover { background-color: var(--surface-hover); box-shadow: var(--shadow-2); }
622
+ .card-link:hover .card-title a { text-decoration: underline; text-underline-offset: 3px; }
623
+ /* The ring moves to the card only where :has() works; elsewhere the link keeps its own ring. */
624
+ .card-link:has(.card-title a:focus-visible) { outline: 2px solid var(--i-ink); outline-offset: 2px; }
625
+ .card-link:has(.card-title a:focus-visible) .card-title a { outline: none; }
626
+
627
+ @media (forced-colors: active) {
628
+ .card { border-color: CanvasText; }
629
+ }
630
+ @media (prefers-reduced-motion: reduce) {
631
+ .card-link { transition: none; }
632
+ }
633
+ }
634
+
635
+ /* ── Layout primitives (#53) ──────────────────────────────────────────────
636
+ <main class="container"><section class="section stack gap-5">…</section></main>
637
+ Gap-based only: no margins between children, no 12-column grid.
638
+ - .container: the tier's measure (780px tool, 68ch marketing) plus an --s4
639
+ gutter each side. .container-wide: 1160px, the product page width.
640
+ - .stack: a column. .cluster: a wrapping row. .grid: auto-fit columns,
641
+ each at least --grid-min (default 16rem) and never wider than the row,
642
+ so it can't overflow a phone. Set --grid-min on the element to change it.
643
+ - .gap-2 … .gap-6 set the gap from the --s* scale on any of them. They
644
+ sit at the end of this file so they beat any component's own gap.
645
+ - .section: the tier's section rhythm (--section-gap) above and below; two
646
+ sections in a row share one gap. .divider: a hairline on <hr>. */
647
+ @layer brignano.components {
648
+ /* The measure is the text width; the gutters sit outside it. width: 100%
649
+ keeps it full width inside a flex column, where auto margins would
650
+ otherwise shrink it to its content. */
651
+ .container {
652
+ --container-max: var(--measure);
653
+ box-sizing: border-box;
654
+ width: 100%;
655
+ max-width: calc(var(--container-max) + 2 * var(--s4));
656
+ margin-inline: auto;
657
+ padding-inline: var(--s4);
658
+ }
659
+ .container-wide { --container-max: 1160px; }
660
+
661
+ .stack { display: flex; flex-direction: column; gap: var(--s4); }
662
+ .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
663
+ .grid {
664
+ display: grid;
665
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 16rem)), 1fr));
666
+ gap: var(--s4);
667
+ }
668
+ /* Children of a stack or grid can't push it wider than its parent. */
669
+ :where(.stack, .grid) > * { min-width: 0; }
670
+
671
+ .section { padding-block: var(--section-gap); }
672
+ .section + .section { padding-block-start: 0; }
673
+
674
+ .divider {
675
+ width: 100%;
676
+ height: 0;
677
+ margin: 0;
678
+ border: 0;
679
+ border-block-start: 1px solid var(--line);
680
+ }
681
+
682
+ @media (forced-colors: active) {
683
+ .divider { border-block-start-color: CanvasText; }
684
+ }
685
+ }
686
+
687
+ /* ── Site header, nav and footer (#54) ────────────────────────────────────
688
+ <a class="skip-link" href="#main">Skip to content</a>
689
+ <header class="site-header">
690
+ <div class="site-header-inner container container-wide">
691
+ <a class="site-brand" href="/">…</a>
692
+ <nav class="site-nav" id="site-menu" popover aria-label="Main">
693
+ <button type="button" class="btn btn-ghost btn-icon site-menu-close"
694
+ popovertarget="site-menu" popovertargetaction="hide"
695
+ aria-label="Close menu" autofocus>…</button>
696
+ <ul><li><a href="/" aria-current="page">Home</a></li>…</ul>
697
+ </nav>
698
+ <div class="site-actions">…</div>
699
+ <button type="button" class="btn btn-ghost btn-icon site-menu-button"
700
+ popovertarget="site-menu" aria-label="Menu">…</button>
701
+ </div>
702
+ </header>
703
+ - The header is sticky on --surface-sticky with an 8px blur (DESIGN.md §6).
704
+ One header for both tiers; the marketing tier only makes it taller.
705
+ - The nav is a popover. Wide, it is shown inline and the popover is never
706
+ opened. When the header is narrower than 45rem the links hide behind the
707
+ menu button, which opens the nav as a sheet from the top, with no script:
708
+ Esc or a click outside closes it, the autofocus close button takes focus
709
+ when it opens, and focus goes back to the menu button when it closes.
710
+ - aria-current="page" marks the current link: ink text, a cobalt underline.
711
+ - .site-footer: .site-footer-columns of link lists, each under a
712
+ .site-footer-heading, then .site-footer-legal and .site-footer-small. */
713
+ @layer brignano.components {
714
+ .skip-link {
715
+ position: absolute;
716
+ top: var(--s3);
717
+ left: var(--s4);
718
+ z-index: 30;
719
+ padding: var(--s2) var(--s3);
720
+ border-radius: var(--radius-sm);
721
+ background-color: var(--card);
722
+ color: var(--ink);
723
+ font-weight: 500;
724
+ box-shadow: var(--shadow-2);
725
+ transform: translateY(calc(-100% - var(--s5)));
726
+ }
727
+ .skip-link:focus { transform: none; outline: 2px solid var(--i-ink); outline-offset: 2px; }
728
+
729
+ .site-header {
730
+ container: site-header / inline-size;
731
+ position: sticky;
732
+ top: 0;
733
+ z-index: 10;
734
+ border-bottom: 1px solid var(--line);
735
+ background-color: var(--surface-sticky);
736
+ color: var(--ink);
737
+ -webkit-backdrop-filter: blur(8px);
738
+ backdrop-filter: blur(8px);
739
+ }
740
+ .site-header-inner {
741
+ display: flex;
742
+ align-items: center;
743
+ gap: var(--s4);
744
+ min-height: 56px;
745
+ }
746
+ .tier-marketing .site-header-inner { min-height: 72px; gap: var(--s5); }
747
+
748
+ .site-brand {
749
+ display: inline-flex;
750
+ align-items: center;
751
+ gap: var(--s2);
752
+ min-height: 40px;
753
+ margin-inline-end: auto; /* pushes the nav and actions to the end */
754
+ color: var(--ink);
755
+ font-weight: 600;
756
+ font-size: var(--text-lg);
757
+ letter-spacing: -0.01em;
758
+ text-decoration: none;
759
+ }
760
+ .site-brand > :is(img, svg) { flex: none; width: 24px; height: 24px; }
761
+
762
+ /* Wide: the popover is shown in the flow, never opened. */
763
+ .site-nav[popover] {
764
+ display: block;
765
+ position: static;
766
+ inset: auto;
767
+ width: auto;
768
+ height: auto;
769
+ margin: 0;
770
+ padding: 0;
771
+ overflow: visible;
772
+ border: 0;
773
+ background: none;
774
+ color: inherit;
775
+ }
776
+ .site-nav ul { display: flex; align-items: center; gap: var(--s1); margin: 0; padding: 0; list-style: none; }
777
+ .site-nav a {
778
+ display: inline-flex;
779
+ align-items: center;
780
+ min-height: 40px;
781
+ padding: 0 var(--s3);
782
+ border-radius: var(--radius-sm);
783
+ color: var(--ink-soft);
784
+ font-size: var(--text-sm);
785
+ font-weight: 500;
786
+ text-decoration: none;
787
+ }
788
+ .site-nav a:hover { color: var(--ink); }
789
+ .site-nav a[aria-current='page'] {
790
+ color: var(--ink);
791
+ text-decoration: underline 2px var(--i);
792
+ text-underline-offset: 6px;
793
+ }
794
+ .site-nav a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
795
+
796
+ .site-actions { display: flex; align-items: center; gap: var(--s2); }
797
+ .site-menu-button, .site-menu-close { display: none; }
798
+
799
+ /* Narrow: the links move into a sheet behind the menu button. */
800
+ @container site-header (max-width: 45rem) {
801
+ .site-header .site-header-inner { gap: var(--s2); } /* beats the marketing gap */
802
+ .site-brand { min-width: 0; }
803
+ .site-menu-button { display: inline-flex; }
804
+ .site-nav[popover]:not(:popover-open) { display: none; }
805
+ }
806
+
807
+ /* The open sheet, at any width, so it stays usable if the header widens
808
+ while it is open (a rotated tablet, a resized window). */
809
+ .site-nav[popover]:popover-open {
810
+ position: fixed;
811
+ inset: 0 0 auto;
812
+ display: flex;
813
+ flex-direction: column;
814
+ gap: var(--s2);
815
+ width: 100%;
816
+ max-height: 100dvh;
817
+ box-sizing: border-box;
818
+ padding: var(--s3) var(--s4) var(--s5);
819
+ overflow-y: auto;
820
+ border-bottom: 1px solid var(--line);
821
+ background-color: var(--card);
822
+ color: var(--ink);
823
+ box-shadow: var(--shadow-3);
824
+ }
825
+ .site-nav[popover]::backdrop { background-color: var(--scrim); }
826
+ .site-nav:popover-open .site-menu-close { display: inline-flex; align-self: flex-end; }
827
+ .site-nav:popover-open ul { flex-direction: column; align-items: stretch; }
828
+ .site-nav:popover-open a { width: 100%; min-height: 44px; font-size: var(--text-base); }
829
+
830
+ @media (pointer: coarse) {
831
+ .site-nav a { min-height: 44px; }
832
+ }
833
+
834
+ .site-footer {
835
+ padding-block: var(--s6) var(--s7);
836
+ border-top: 1px solid var(--line);
837
+ color: var(--ink-soft);
838
+ font-size: var(--text-sm);
839
+ }
840
+ .site-footer-columns {
841
+ display: grid;
842
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
843
+ gap: var(--s5);
844
+ }
845
+ .site-footer-heading { margin: 0 0 var(--s2); color: var(--ink); font-size: var(--text-sm); font-weight: 600; }
846
+ .site-footer ul { display: grid; gap: var(--s1); margin: 0; padding: 0; list-style: none; }
847
+ .site-footer a { color: var(--ink-soft); text-decoration: none; }
848
+ .site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
849
+ .site-footer ul a { display: inline-flex; align-items: center; min-height: 28px; }
850
+ .site-footer-legal {
851
+ display: flex;
852
+ flex-wrap: wrap;
853
+ align-items: center;
854
+ gap: var(--s2) var(--s4);
855
+ margin: var(--s6) 0 0;
856
+ padding-top: var(--s4);
857
+ border-top: 1px solid var(--line-soft);
858
+ }
859
+ .site-footer-small { margin: var(--s2) 0 0; font-size: var(--text-xs); }
860
+
861
+ @media (pointer: coarse) {
862
+ .site-footer ul a { min-height: 44px; }
863
+ }
864
+ @media (forced-colors: active) {
865
+ .site-header { border-bottom-color: CanvasText; }
866
+ .site-nav a[aria-current='page'] { text-decoration-color: CanvasText; }
867
+ .site-nav[popover]:popover-open { border: 1px solid CanvasText; }
868
+ }
869
+ @media (prefers-reduced-transparency: reduce) {
870
+ .site-header { background-color: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
871
+ }
872
+ }
873
+
874
+ /* ── Dialog and sheet (#55) ───────────────────────────────────────────────
875
+ <dialog class="dialog" id="rename" aria-labelledby="rename-title">
876
+ <div class="dialog-header">
877
+ <h2 class="dialog-title" id="rename-title">Rename trip</h2>
878
+ <form method="dialog"><button class="btn btn-ghost btn-icon btn-sm dialog-close" aria-label="Close">…</button></form>
879
+ </div>
880
+ <div class="dialog-body">…</div>
881
+ <div class="dialog-footer">…actions, primary last…</div>
882
+ </dialog>
883
+ Open it with dialog.showModal(), or with no script at all where
884
+ <button commandfor="rename" command="show-modal"> is supported. Native
885
+ <dialog> only: the browser traps focus, Esc closes it, and focus goes back
886
+ to the opener. Never open a dialog on top of a dialog. Use <div>s for the
887
+ header and footer: a <header> or <footer> inside a dialog reads as the
888
+ page's banner or footer landmark.
889
+ - .dialog-confirm: a narrow confirm. The destructive button names the
890
+ action ("Delete trip"), never "OK".
891
+ - .sheet (with .dialog): slides in from the right on a wide screen and up
892
+ from the bottom on a phone.
893
+ - Open and close: a fade and a short slide over --dur-fast, from the
894
+ edge a sheet comes from (ADR-0013), for modal dialogs only: one that is
895
+ open in the markup renders still. Only opacity and transform move, and
896
+ the open state is always fully shown, so a browser without
897
+ @starting-style just shows it at once. Instant under
898
+ prefers-reduced-motion. */
899
+ @layer brignano.components {
900
+ .dialog {
901
+ box-sizing: border-box;
902
+ width: min(100% - 2 * var(--s4), 32rem);
903
+ max-width: none;
904
+ max-height: min(100dvh - 2 * var(--s4), 44rem);
905
+ padding: 0;
906
+ border: 1px solid var(--line);
907
+ border-radius: var(--radius-lg);
908
+ background-color: var(--card);
909
+ color: var(--ink);
910
+ box-shadow: var(--shadow-3);
911
+ flex-direction: column; /* here, not on [open], so it holds while closing */
912
+ opacity: 0;
913
+ transform: translateY(8px);
914
+ transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
915
+ }
916
+ /* display only while open, so the UA's display: none still hides it closed. */
917
+ .dialog[open] { display: flex; opacity: 1; transform: none; }
918
+ @starting-style {
919
+ .dialog:modal { opacity: 0; transform: translateY(8px); }
920
+ }
921
+ .dialog::backdrop {
922
+ background-color: var(--scrim);
923
+ opacity: 0;
924
+ transition: opacity var(--dur-fast) var(--ease);
925
+ }
926
+ .dialog[open]::backdrop { opacity: 1; }
927
+ @starting-style {
928
+ .dialog:modal::backdrop { opacity: 0; }
929
+ }
930
+ /* Closing animates only where the dialog can stay in the top layer while it
931
+ fades (overlay). Elsewhere it would drop into the page flow, so it closes
932
+ at once. */
933
+ @supports (overlay: auto) {
934
+ .dialog {
935
+ transition:
936
+ opacity var(--dur-fast) var(--ease),
937
+ transform var(--dur-fast) var(--ease),
938
+ overlay var(--dur-fast) allow-discrete,
939
+ display var(--dur-fast) allow-discrete;
940
+ }
941
+ .dialog::backdrop {
942
+ transition:
943
+ opacity var(--dur-fast) var(--ease),
944
+ overlay var(--dur-fast) allow-discrete,
945
+ display var(--dur-fast) allow-discrete;
946
+ }
947
+ }
948
+
949
+ .dialog-header {
950
+ display: flex;
951
+ align-items: flex-start;
952
+ gap: var(--s3);
953
+ padding: var(--s5) var(--s5) 0;
954
+ }
955
+ .dialog-title { margin: 0; padding-top: 2px; font-size: var(--text-lg); font-weight: 600; line-height: 1.4; }
956
+ .dialog-header > form { display: contents; }
957
+ .dialog-close { flex: none; margin: -6px -8px 0 auto; }
958
+ .dialog-body {
959
+ flex: 1 1 auto;
960
+ min-height: 0;
961
+ padding: var(--s3) var(--s5);
962
+ overflow-y: auto;
963
+ color: var(--ink-soft);
964
+ }
965
+ .dialog-body > :first-child { margin-top: 0; }
966
+ .dialog-body > :last-child { margin-bottom: 0; }
967
+ .dialog-footer {
968
+ display: flex;
969
+ flex-wrap: wrap;
970
+ justify-content: flex-end;
971
+ gap: var(--s2);
972
+ padding: var(--s4) var(--s5) var(--s5);
973
+ }
974
+ .dialog-footer > form { display: contents; }
975
+
976
+ .dialog-confirm { width: min(100% - 2 * var(--s4), 26rem); }
977
+
978
+ /* Sheet: from the right on a wide screen. */
979
+ .sheet {
980
+ width: min(100%, 28rem);
981
+ height: 100dvh;
982
+ max-height: 100dvh;
983
+ margin: 0 0 0 auto;
984
+ border-width: 0 0 0 1px;
985
+ border-radius: 0;
986
+ opacity: 1;
987
+ transform: translateX(100%);
988
+ }
989
+ .sheet[open] { transform: none; }
990
+ @starting-style {
991
+ .sheet:modal { opacity: 1; transform: translateX(100%); }
992
+ }
993
+
994
+ /* Phone: dialogs fill the width; a sheet comes up from the bottom. */
995
+ @media (max-width: 40rem) {
996
+ /* The forms are display: contents, so their buttons are flex items too. */
997
+ .dialog-footer > .btn, .dialog-footer > form > .btn { flex: 1 1 auto; }
998
+ .sheet {
999
+ width: 100%;
1000
+ height: fit-content; /* auto would stretch between inset 0 and 0 */
1001
+ max-height: 85dvh;
1002
+ margin: auto 0 0;
1003
+ border-width: 1px 0 0;
1004
+ border-radius: var(--radius-lg) var(--radius-lg) 0 0;
1005
+ transform: translateY(100%);
1006
+ }
1007
+ @starting-style {
1008
+ .sheet:modal { transform: translateY(100%); }
1009
+ }
1010
+ }
1011
+
1012
+ @media (forced-colors: active) {
1013
+ .dialog { border-color: CanvasText; }
1014
+ }
1015
+ /* tokens.css stops transitions for *, ::before and ::after, not ::backdrop. */
1016
+ @media (prefers-reduced-motion: reduce) {
1017
+ .dialog, .dialog::backdrop { transition: none; transform: none; }
1018
+ }
1019
+ }
1020
+
1021
+ /* ── Popover and menu (#56) ───────────────────────────────────────────────
1022
+ <button class="btn" popovertarget="trip-menu">Trip</button>
1023
+ <div class="popover" id="trip-menu" popover>
1024
+ <div class="menu">
1025
+ <button class="menu-item">Rename</button>
1026
+ <a class="menu-item" href="…">Open itinerary</a>
1027
+ <hr class="menu-separator">
1028
+ <button class="menu-item menu-item-danger">Delete trip</button>
1029
+ </div>
1030
+ </div>
1031
+ The popover attribute (popover="auto") gives light dismiss: Esc or a click
1032
+ outside closes it, and opening another one closes this one. Content of any
1033
+ kind can sit in a .popover; .menu is for a list of actions or links.
1034
+ - Position: below the button that opened it, lined up with its start edge,
1035
+ with CSS anchor positioning. The opener is the anchor when it opens the
1036
+ popover with popovertarget (or commandfor); otherwise set anchor-name on
1037
+ the opener and position-anchor on the popover. Flips above or to the other
1038
+ side when there's no room. Without anchor positioning, set --popover-top
1039
+ and --popover-left from the opener's box on the toggle event (the preview
1040
+ page has the four lines); with neither, the browser centres it.
1041
+ - Menu items are <button> or <a>, never a <div>. .menu-item-danger is for
1042
+ the destructive action, last and after a separator. .menu-item-hint
1043
+ holds a shortcut or count at the end of the row.
1044
+ - ARIA: without a script, leave roles off. The items are plain buttons and
1045
+ links that Tab moves through, which needs nothing more. role="menu" and
1046
+ role="menuitem" promise arrow keys, Home/End and focus moving into the
1047
+ menu on open, so add them only with a script that does all of that.
1048
+ - Open and close: a fade and a 4px slide over --dur-fast (ADR-0013).
1049
+ Instant under prefers-reduced-motion. */
1050
+ @layer brignano.components {
1051
+ .popover {
1052
+ box-sizing: border-box;
1053
+ min-width: 12rem;
1054
+ max-width: min(100vw - 2 * var(--s4), 22rem);
1055
+ max-height: min(100dvh - 2 * var(--s4), 28rem);
1056
+ padding: var(--s3);
1057
+ overflow-y: auto;
1058
+ border: 1px solid var(--line);
1059
+ border-radius: var(--radius);
1060
+ background-color: var(--card);
1061
+ color: var(--ink);
1062
+ box-shadow: var(--shadow-2);
1063
+ transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
1064
+ }
1065
+ /* Hidden state on :not(:popover-open), so a browser without popover
1066
+ support shows the content rather than an invisible, focusable box. */
1067
+ .popover:not(:popover-open) { opacity: 0; transform: translateY(-4px); }
1068
+ @starting-style {
1069
+ .popover:popover-open { opacity: 0; transform: translateY(-4px); }
1070
+ }
1071
+ @supports (overlay: auto) {
1072
+ .popover {
1073
+ transition:
1074
+ opacity var(--dur-fast) var(--ease),
1075
+ transform var(--dur-fast) var(--ease),
1076
+ overlay var(--dur-fast) allow-discrete,
1077
+ display var(--dur-fast) allow-discrete;
1078
+ }
1079
+ }
1080
+ .popover:has(> .menu) { padding: var(--s1); }
1081
+
1082
+ @supports (position-area: block-end) {
1083
+ .popover {
1084
+ inset: auto;
1085
+ margin: var(--s1) 0;
1086
+ position-area: block-end span-inline-end;
1087
+ position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
1088
+ }
1089
+ }
1090
+ @supports not (position-area: block-end) {
1091
+ .popover[style*='--popover-top'] {
1092
+ inset: var(--popover-top) auto auto var(--popover-left);
1093
+ margin: var(--s1) 0 0;
1094
+ }
1095
+ }
1096
+
1097
+ .menu { display: flex; flex-direction: column; gap: 1px; }
1098
+ .menu-item {
1099
+ box-sizing: border-box;
1100
+ display: flex;
1101
+ align-items: center;
1102
+ gap: var(--s2);
1103
+ width: 100%;
1104
+ min-height: 36px;
1105
+ padding: var(--s2) var(--s3);
1106
+ border: 0;
1107
+ border-radius: var(--radius-sm);
1108
+ background-color: transparent;
1109
+ color: var(--ink);
1110
+ font: inherit;
1111
+ font-size: var(--text-sm);
1112
+ line-height: 1.4;
1113
+ text-align: start;
1114
+ text-decoration: none;
1115
+ cursor: pointer;
1116
+ }
1117
+ .menu-item > svg { flex: none; width: 16px; height: 16px; color: var(--ink-soft); }
1118
+ .menu-item:hover, .menu-item:focus-visible { background-color: var(--surface-hover); color: var(--ink); }
1119
+ .menu-item:active { background-color: var(--surface-active); color: var(--ink); }
1120
+ .menu-item:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
1121
+ .menu-item-hint { margin-inline-start: auto; padding-inline-start: var(--s3); color: var(--ink-soft); font-size: var(--text-xs); }
1122
+ .menu-item-danger, .menu-item-danger > svg { color: var(--danger-ink); }
1123
+ .menu-item-danger:is(:hover, :focus-visible, :active) { background-color: var(--danger-surface); color: var(--danger-ink); }
1124
+ .menu-item:is(:disabled, [aria-disabled='true']) { background-color: transparent; color: var(--i-disabled-ink); cursor: not-allowed; }
1125
+ .menu-item:is(:disabled, [aria-disabled='true']) > svg { color: inherit; }
1126
+ .menu-separator {
1127
+ height: 0;
1128
+ margin: var(--s1) calc(-1 * var(--s1));
1129
+ border: 0;
1130
+ border-block-start: 1px solid var(--line);
1131
+ }
1132
+
1133
+ @media (pointer: coarse) {
1134
+ .menu-item { min-height: 44px; }
1135
+ }
1136
+ @media (forced-colors: active) {
1137
+ .popover { border-color: CanvasText; }
1138
+ /* forced-color-adjust: none, or the text backplate (Canvas) hides
1139
+ HighlightText on the Highlight row. */
1140
+ .menu-item:not(:disabled, [aria-disabled='true']):is(:hover, :focus-visible) {
1141
+ forced-color-adjust: none;
1142
+ background-color: Highlight;
1143
+ color: HighlightText;
1144
+ }
1145
+ .menu-item:not(:disabled, [aria-disabled='true']):is(:hover, :focus-visible) > * { color: inherit; }
1146
+ .menu-item:focus-visible { outline-color: CanvasText; }
1147
+ .menu-item:is(:disabled, [aria-disabled='true']) { background-color: Canvas; color: GrayText; }
1148
+ }
1149
+ @media (prefers-reduced-motion: reduce) {
1150
+ .popover { transition: none; transform: none; }
1151
+ }
1152
+ }
1153
+
1154
+ /* ── Tooltip (#57) ─────────────────────────────────────────────────────────
1155
+ <span class="tooltip-wrap">
1156
+ <button class="btn btn-icon" interestfor="tip-share" aria-labelledby="tip-share">…svg…</button>
1157
+ <span class="tooltip" id="tip-share" popover="hint" role="tooltip">Share trip</span>
1158
+ </span>
1159
+ A tooltip only names the thing it points at, in one short phrase. Anything
1160
+ longer, or anything a reader needs, is a popover or text on the page:
1161
+ touch users never hover, so a tooltip is never the only place something is
1162
+ said. The trigger takes its accessible name from the tooltip
1163
+ (aria-labelledby), so the two can't disagree. It stays open while the
1164
+ pointer is on it, so a magnifier user can move onto it to read it.
1165
+ - Where interestfor is supported, the browser opens it as a hint popover on
1166
+ hover or keyboard focus after 300ms and closes it at once when interest
1167
+ leaves; it sits above the trigger with anchor positioning and flips below
1168
+ when there's no room. Elsewhere, .tooltip-wrap shows it on :hover and
1169
+ :focus-visible with the same 300ms delay in and none out. That fallback
1170
+ can't close on Esc or flip at the top of the viewport, and an
1171
+ overflow: hidden ancestor clips it.
1172
+ - A 150ms fade in only. Under prefers-reduced-motion the fade goes and the
1173
+ delay stays: it's a wait, not motion. */
1174
+ @layer brignano.components {
1175
+ .tooltip-wrap { position: relative; display: inline-flex; vertical-align: middle; }
1176
+ .tooltip {
1177
+ box-sizing: border-box;
1178
+ width: max-content;
1179
+ max-width: 16rem;
1180
+ margin: 0;
1181
+ padding: 4px var(--s2);
1182
+ overflow: visible;
1183
+ border: 1px solid transparent;
1184
+ border-radius: var(--radius-sm);
1185
+ background-color: var(--ink);
1186
+ color: var(--card);
1187
+ font-family: var(--sans);
1188
+ font-size: var(--text-xs);
1189
+ font-weight: 500;
1190
+ line-height: 1.4;
1191
+ text-align: center;
1192
+ }
1193
+ /* A transparent strip over the gap on both block sides, so the pointer can
1194
+ move from the trigger onto the tooltip without losing it (WCAG 1.4.13). */
1195
+ .tooltip::before {
1196
+ content: '';
1197
+ position: absolute;
1198
+ inset: calc(-1 * var(--s1) - 1px) 0;
1199
+ z-index: -1;
1200
+ }
1201
+ .tooltip-wrap > [interestfor] { interest-delay: 300ms 0s; }
1202
+
1203
+ @supports selector(:interest-source) {
1204
+ .tooltip {
1205
+ inset: auto;
1206
+ margin: var(--s1) 0;
1207
+ position-area: block-start;
1208
+ position-try-fallbacks: flip-block;
1209
+ opacity: 0;
1210
+ transition: opacity var(--dur-fast) var(--ease);
1211
+ }
1212
+ .tooltip:popover-open { opacity: 1; }
1213
+ @starting-style {
1214
+ .tooltip:popover-open { opacity: 0; }
1215
+ }
1216
+ }
1217
+ @supports not selector(:interest-source) {
1218
+ .tooltip {
1219
+ display: block;
1220
+ position: absolute;
1221
+ inset: auto auto 100% 50%;
1222
+ translate: -50% 0;
1223
+ margin: 0 0 var(--s1);
1224
+ visibility: hidden;
1225
+ opacity: 0;
1226
+ }
1227
+ .tooltip-wrap:has(> :hover, > :focus-visible) > .tooltip {
1228
+ visibility: visible;
1229
+ opacity: 1;
1230
+ transition: opacity var(--dur-fast) var(--ease) 300ms, visibility 0s linear 300ms;
1231
+ }
1232
+ }
1233
+
1234
+ @media (forced-colors: active) {
1235
+ .tooltip { border-color: CanvasText; }
1236
+ }
1237
+ }
1238
+
1239
+ /* ── Toast (#58) ───────────────────────────────────────────────────────────
1240
+ <section class="toast-region" aria-label="Notifications">
1241
+ <div class="toast-list" role="status"></div> ← success and attention
1242
+ <div class="toast-list" role="alert"></div> ← danger
1243
+ </section>
1244
+ …and what your script adds to a list:
1245
+ <div class="toast toast-success">
1246
+ <svg aria-hidden="true" …></svg>
1247
+ <div class="toast-content">
1248
+ <p class="toast-title">Trip saved</p>
1249
+ <p class="toast-body">Lisbon, 4 days is in your list.</p>
1250
+ </div>
1251
+ <button class="btn btn-ghost btn-sm toast-action">Undo</button>
1252
+ <button class="btn btn-ghost btn-icon btn-sm toast-close" aria-label="Dismiss">…</button>
1253
+ </div>
1254
+ A short note that something happened. Kinds: .toast-success,
1255
+ .toast-attention, .toast-danger, each with its icon, an edge in its colour
1256
+ and a title that says in words what happened, never colour alone. There's
1257
+ no info toast: use a .msg on the page.
1258
+ - The region and both lists are in the page from the start, empty. Two
1259
+ live regions, never nested: role="status" (polite) for success and
1260
+ attention, role="alert" for danger, which sits below them. Newest at the
1261
+ bottom of each; bottom-centre on a phone, bottom-right from 40rem.
1262
+ - Script is yours (design ships none): add toasts to a list; remove a
1263
+ success toast after 5s, pausing while it's hovered or has focus; leave
1264
+ attention and danger until dismissed. To remove one, set data-leaving,
1265
+ then take it out on its own transitionend (or after 200ms, whichever is
1266
+ first). The transition still runs, in 0.01ms, under reduced motion, so
1267
+ transitionend always fires. If focus was inside it, move focus to the
1268
+ next toast, or back to where it was before.
1269
+ - While a modal dialog is open, everything outside it is inert, toasts
1270
+ included: report inside the dialog with a .msg instead.
1271
+ - Enter and leave: a fade and an 8px slide over --dur-fast (ADR-0013).
1272
+ Instant under prefers-reduced-motion. */
1273
+ @layer brignano.components {
1274
+ .toast-region {
1275
+ position: fixed;
1276
+ z-index: 40;
1277
+ inset: auto var(--s4) var(--s4);
1278
+ display: flex;
1279
+ flex-direction: column;
1280
+ align-items: center;
1281
+ pointer-events: none;
1282
+ }
1283
+ /* A flex column, not display: contents, which some browsers still drop
1284
+ from the accessibility tree, live region and all. Never display: none
1285
+ either: a hidden live region misses what's added as it appears. */
1286
+ .toast-list {
1287
+ display: flex;
1288
+ flex-direction: column;
1289
+ align-items: inherit;
1290
+ align-self: stretch;
1291
+ gap: var(--s2);
1292
+ }
1293
+ .toast-list:not(:empty) ~ .toast-list:not(:empty) { margin-top: var(--s2); }
1294
+ .toast-region .toast { pointer-events: auto; }
1295
+ @media (min-width: 40rem) {
1296
+ .toast-region { inset: auto var(--s5) var(--s5) auto; align-items: flex-end; }
1297
+ }
1298
+
1299
+ .toast {
1300
+ box-sizing: border-box;
1301
+ display: flex;
1302
+ align-items: flex-start;
1303
+ gap: 10px;
1304
+ width: min(100%, 24rem);
1305
+ padding: 12px 10px 12px 14px;
1306
+ border: 1px solid var(--line);
1307
+ border-inline-start: 3px solid var(--line-control);
1308
+ border-radius: var(--radius);
1309
+ background-color: var(--card);
1310
+ color: var(--ink);
1311
+ box-shadow: var(--shadow-2);
1312
+ font-size: var(--text-sm);
1313
+ line-height: 1.45;
1314
+ transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
1315
+ }
1316
+ @starting-style {
1317
+ .toast { opacity: 0; transform: translateY(8px); }
1318
+ }
1319
+ .toast[data-leaving] { opacity: 0; transform: translateY(8px); }
1320
+ .toast > svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
1321
+ .toast-content { display: grid; gap: 2px; flex: 1; min-width: 0; }
1322
+ .toast-title { margin: 0; font-weight: 600; }
1323
+ .toast-body { margin: 0; color: var(--ink-soft); }
1324
+ .toast-action { flex: none; margin: -4px 0; }
1325
+ .toast-close { flex: none; margin: -4px -2px -4px 0; color: var(--ink-soft); }
1326
+
1327
+ .toast-success { border-inline-start-color: var(--success); }
1328
+ .toast-attention { border-inline-start-color: var(--attention); }
1329
+ .toast-danger { border-inline-start-color: var(--danger); }
1330
+ .toast-success > svg { color: var(--success); }
1331
+ .toast-attention > svg { color: var(--attention); }
1332
+ .toast-danger > svg { color: var(--danger); }
1333
+
1334
+ @media (forced-colors: active) {
1335
+ .toast { border-color: CanvasText; }
1336
+ }
1337
+ /* tokens.css cuts the transition to 0.01ms, which keeps transitionend
1338
+ firing for the script that removes a leaving toast; no slide either. */
1339
+ @media (prefers-reduced-motion: reduce) {
1340
+ .toast, .toast[data-leaving] { transform: none; }
1341
+ }
1342
+ }
1343
+
1344
+ /* ── Loading and empty states (#59) ─────────────────────────────────────────
1345
+ Spinner, for a wait whose layout isn't known yet:
1346
+ <p class="cluster"><span class="spinner" aria-hidden="true"></span> Loading trips…</p>
1347
+ Sizes: .spinner-sm (16px), default (24px). Always with words beside it,
1348
+ or role="img" aria-label="Loading" when there's no room for any. Under
1349
+ reduced motion it holds still (tokens.css stops animations); the words
1350
+ carry the meaning. .btn[aria-busy='true'] draws the same ring.
1351
+ Skeleton, only when the layout is known ahead:
1352
+ <div role="group" aria-busy="true" aria-label="Loading trip">
1353
+ <span class="skeleton skeleton-circle" aria-hidden="true"></span>
1354
+ <span class="skeleton skeleton-text" aria-hidden="true"></span>
1355
+ </div>
1356
+ .skeleton-text (a line of text; the last in a run is shorter),
1357
+ .skeleton-circle (an avatar), .skeleton-rect (media, 16:9). The shimmer
1358
+ stops under reduced motion.
1359
+ Progress and meter: native elements, drawn from tokens.
1360
+ <progress class="progress" value="40" max="100">40%</progress>
1361
+ <meter class="meter" value="0.8" low="0.5" high="0.75" optimum="0.2">80%</meter>
1362
+ Label them (<label for>, or aria-label). With no value, a progress bar is
1363
+ indeterminate and shows a pulsing centre segment. A meter's fill is cobalt when
1364
+ its value is in the optimum range, --attention one range off and --danger
1365
+ two off. Bare <progress> and <meter> stay native (DESIGN.md §4).
1366
+ Empty state: an icon, one line, at most one action, no illustration.
1367
+ <div class="empty">
1368
+ <svg aria-hidden="true" …></svg>
1369
+ <p class="empty-title">No trips yet</p>
1370
+ <p class="empty-body">Trips you save show up here.</p>
1371
+ <a class="btn btn-primary" href="…">Plan a trip</a>
1372
+ </div> */
1373
+ @layer brignano.components {
1374
+ .spinner {
1375
+ display: inline-block;
1376
+ flex: none;
1377
+ box-sizing: border-box;
1378
+ width: 24px;
1379
+ height: 24px;
1380
+ border: 2.5px solid currentColor;
1381
+ border-right-color: transparent;
1382
+ border-radius: 50%;
1383
+ color: var(--i);
1384
+ vertical-align: middle;
1385
+ animation: spinner-spin 0.7s linear infinite;
1386
+ }
1387
+ .spinner-sm { width: 16px; height: 16px; border-width: 2px; }
1388
+
1389
+ /* The shimmer is a transformed ::after (compositor only, DESIGN.md §7).
1390
+ At rest it sits off the block, so under reduced motion, where
1391
+ tokens.css ends the animation at once, nothing is left showing. */
1392
+ .skeleton {
1393
+ position: relative;
1394
+ display: block;
1395
+ overflow: hidden;
1396
+ border-radius: var(--radius-sm);
1397
+ background-color: var(--surface-hover);
1398
+ }
1399
+ .skeleton::after {
1400
+ content: '';
1401
+ position: absolute;
1402
+ inset: 0;
1403
+ background-image: linear-gradient(90deg, transparent 0, var(--surface-active) 50%, transparent 100%);
1404
+ transform: translateX(-100%);
1405
+ animation: skeleton-shimmer 1.4s var(--ease) infinite;
1406
+ }
1407
+ @keyframes skeleton-shimmer { to { transform: translateX(100%); } }
1408
+ .skeleton-text { height: 0.75em; margin-block: 0.4em; }
1409
+ .skeleton-text:last-child:not(:first-child) { width: 60%; }
1410
+ .skeleton-circle { width: 40px; height: 40px; flex: none; border-radius: 50%; }
1411
+ .skeleton-rect { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); }
1412
+
1413
+ .progress, .meter {
1414
+ appearance: none;
1415
+ box-sizing: border-box;
1416
+ display: block;
1417
+ width: 100%;
1418
+ height: 8px;
1419
+ overflow: hidden;
1420
+ border: 0;
1421
+ border-radius: 999px;
1422
+ background-color: var(--surface-active);
1423
+ }
1424
+ .progress::-webkit-progress-bar { border-radius: inherit; background-color: var(--surface-active); }
1425
+ .progress::-webkit-progress-value { border-radius: inherit; background-color: var(--i); }
1426
+ .progress::-moz-progress-bar { border-radius: inherit; background-color: var(--i); }
1427
+ /* Indeterminate: a centred segment that can't be read as an amount, which
1428
+ pulses (opacity only, DESIGN.md §7). Under reduced motion it holds
1429
+ still at full strength. */
1430
+ .progress:indeterminate {
1431
+ background-image: linear-gradient(90deg, transparent 35%, var(--i) 35% 65%, transparent 65%);
1432
+ animation: progress-pulse 1.4s var(--ease) infinite alternate;
1433
+ }
1434
+ .progress:indeterminate::-webkit-progress-bar { background-color: transparent; }
1435
+ .progress:indeterminate::-moz-progress-bar { background-color: transparent; }
1436
+ @keyframes progress-pulse { to { opacity: 0.45; } }
1437
+
1438
+ .meter::-webkit-meter-bar { height: 8px; border: 0; border-radius: inherit; background: var(--surface-active); }
1439
+ .meter::-webkit-meter-optimum-value { border-radius: inherit; background: var(--i); }
1440
+ .meter::-webkit-meter-suboptimum-value { border-radius: inherit; background: var(--attention); }
1441
+ .meter::-webkit-meter-even-less-good-value { border-radius: inherit; background: var(--danger); }
1442
+ .meter::-moz-meter-bar { border-radius: inherit; background: var(--i); }
1443
+ .meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--attention); }
1444
+ .meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--danger); }
1445
+
1446
+ .empty {
1447
+ display: flex;
1448
+ flex-direction: column;
1449
+ align-items: center;
1450
+ justify-content: center;
1451
+ gap: var(--s2);
1452
+ padding: var(--s7) var(--s4);
1453
+ text-align: center;
1454
+ }
1455
+ .empty > svg { width: 32px; height: 32px; margin-bottom: var(--s2); color: var(--ink-soft); }
1456
+ .empty-title { margin: 0; font-size: var(--text-base); font-weight: 600; color: var(--ink); }
1457
+ .empty-body { max-width: 32ch; margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
1458
+ .empty > .btn { margin-top: var(--s3); }
1459
+
1460
+ /* Vendor pseudo-elements each get their own rule: one unknown selector in
1461
+ a list drops the whole rule in the other engine. */
1462
+ @media (forced-colors: active) {
1463
+ .spinner { forced-color-adjust: none; border-color: CanvasText; border-right-color: transparent; }
1464
+ .skeleton { background: GrayText; }
1465
+ .skeleton::after { display: none; }
1466
+ .progress, .meter { forced-color-adjust: none; border: 1px solid CanvasText; background: Canvas; }
1467
+ .progress::-webkit-progress-bar { background: Canvas; }
1468
+ .meter::-webkit-meter-bar { background: Canvas; }
1469
+ .progress::-webkit-progress-value { background: Highlight; }
1470
+ .progress::-moz-progress-bar { background: Highlight; }
1471
+ .meter::-webkit-meter-optimum-value { background: Highlight; }
1472
+ .meter::-webkit-meter-suboptimum-value { background: Highlight; }
1473
+ .meter::-webkit-meter-even-less-good-value { background: Highlight; }
1474
+ .meter::-moz-meter-bar { background: Highlight; }
1475
+ .progress:indeterminate { background-image: linear-gradient(90deg, transparent 35%, Highlight 35% 65%, transparent 65%); }
1476
+ .progress:indeterminate::-webkit-progress-bar { background: transparent; }
1477
+ }
1478
+ }
1479
+
1480
+ /* ── Table (#61) ───────────────────────────────────────────────────────────
1481
+ <div class="table-wrap"><table class="table">…</table></div>
1482
+ Numbers right-aligned with .num; sortable headers carry aria-sort and a
1483
+ <button>; .table-sticky pins the header inside a scrolling .table-wrap.
1484
+ On a phone the table scrolls sideways inside .table-wrap; rows are never
1485
+ stacked into cards, so columns stay comparable. No zebra stripes. */
1486
+ @layer brignano.components {
1487
+ .table-wrap {
1488
+ overflow-x: auto;
1489
+ max-width: 100%;
1490
+ /* Scroll shadows: an edge darkens only while there is more to scroll. */
1491
+ background:
1492
+ linear-gradient(to right, var(--card) 30%, transparent) left / 40px 100% no-repeat local,
1493
+ linear-gradient(to left, var(--card) 30%, transparent) right / 40px 100% no-repeat local,
1494
+ radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--ink) 16%, transparent), transparent) left / 12px 100% no-repeat scroll,
1495
+ radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--ink) 16%, transparent), transparent) right / 12px 100% no-repeat scroll;
1496
+ background-color: var(--card);
1497
+ }
1498
+ .table {
1499
+ width: 100%;
1500
+ border-collapse: collapse;
1501
+ font-size: var(--text-sm);
1502
+ font-variant-numeric: tabular-nums;
1503
+ color: var(--ink);
1504
+ }
1505
+ .table caption {
1506
+ caption-side: top;
1507
+ text-align: left;
1508
+ font-weight: 600;
1509
+ padding: 0 0 var(--s2);
1510
+ }
1511
+ .table th,
1512
+ .table td {
1513
+ padding: var(--s2) var(--s3);
1514
+ text-align: left;
1515
+ vertical-align: top;
1516
+ border-bottom: 1px solid var(--line);
1517
+ }
1518
+ .table th {
1519
+ font-weight: 600;
1520
+ color: var(--ink-soft);
1521
+ white-space: nowrap;
1522
+ border-bottom-color: var(--line-strong);
1523
+ }
1524
+ .table tbody tr:hover { background: var(--surface-hover); }
1525
+ .table .num { text-align: right; white-space: nowrap; }
1526
+ .table tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; }
1527
+
1528
+ /* Sortable header: the <button> fills the cell; the arrow is decoration,
1529
+ aria-sort on the <th> is what assistive tech reads. */
1530
+ .table th[aria-sort] { padding: 0; }
1531
+ .table th[aria-sort] > button {
1532
+ all: unset;
1533
+ box-sizing: border-box;
1534
+ display: flex;
1535
+ align-items: center;
1536
+ gap: var(--s1);
1537
+ width: 100%;
1538
+ padding: var(--s2) var(--s3);
1539
+ cursor: pointer;
1540
+ border-radius: var(--radius-sm);
1541
+ }
1542
+ .table th.num[aria-sort] > button { justify-content: flex-end; }
1543
+ .table th[aria-sort] > button:hover { color: var(--ink); }
1544
+ .table th[aria-sort] > button:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
1545
+ .table th[aria-sort] > button::after { content: '↕' / ''; color: var(--slate); }
1546
+ .table th[aria-sort='ascending'] > button::after { content: '↑' / ''; color: var(--ink); }
1547
+ .table th[aria-sort='descending'] > button::after { content: '↓' / ''; color: var(--ink); }
1548
+ .table th[aria-sort='ascending'],
1549
+ .table th[aria-sort='descending'] { color: var(--ink); }
1550
+ @media (pointer: coarse) {
1551
+ .table th[aria-sort] > button { min-height: 44px; }
1552
+ }
1553
+
1554
+ /* Sticky header: .table-wrap scrolls sideways, which also makes it the
1555
+ header's scroll container, so the header only sticks when the wrap has a
1556
+ max-height and scrolls vertically itself. Without one, it scrolls away
1557
+ with the page. */
1558
+ .table-sticky thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
1559
+
1560
+ .tier-marketing .table { font-size: var(--text-base); }
1561
+ .tier-marketing .table th,
1562
+ .tier-marketing .table td { padding: var(--s3) var(--s4); }
1563
+ .tier-marketing .table th[aria-sort] { padding: 0; }
1564
+ .tier-marketing .table th[aria-sort] > button { padding: var(--s3) var(--s4); }
1565
+ }
1566
+
1567
+ /* ── Key-value list (#62) ──────────────────────────────────────────────────
1568
+ <dl class="kv"><dt>Booked</dt><dd>7 Nov 2026</dd>…</dl>
1569
+ Two columns when there's room, stacked on a phone. A <div> may wrap each
1570
+ dt/dd pair (valid HTML); it doesn't affect the layout. */
1571
+ @layer brignano.components {
1572
+ .kv {
1573
+ display: grid;
1574
+ grid-template-columns: minmax(8rem, max-content) 1fr;
1575
+ gap: var(--s2) var(--s5);
1576
+ margin: 0;
1577
+ font-size: var(--text-sm);
1578
+ }
1579
+ .kv > div { display: contents; }
1580
+ .kv dt { color: var(--ink-soft); }
1581
+ .kv dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
1582
+ @media (max-width: 480px) {
1583
+ .kv { grid-template-columns: 1fr; row-gap: 0; }
1584
+ .kv dd { margin-bottom: var(--s3); }
1585
+ }
1586
+ .tier-marketing .kv { font-size: var(--text-base); }
1587
+ }
1588
+
1589
+ /* ── Stat tile (#62) ───────────────────────────────────────────────────────
1590
+ <div class="stat">
1591
+ <span class="stat-label">Visitors</span>
1592
+ <span class="stat-value">1,284</span>
1593
+ <span class="stat-delta" data-dir="up" data-tone="good">Up 12% from last week</span>
1594
+ </div>
1595
+ The number is mono with tabular figures (DESIGN.md §5). A delta always says
1596
+ its direction in words; the arrow is decoration. data-tone="good" / "bad"
1597
+ colours it only when up or down is good or bad for the reader; without a
1598
+ tone it stays neutral. */
1599
+ @layer brignano.components {
1600
+ .stat {
1601
+ display: flex;
1602
+ flex-direction: column;
1603
+ gap: var(--s1);
1604
+ min-width: 0;
1605
+ padding: var(--s4) var(--s5);
1606
+ color: var(--ink);
1607
+ background: var(--card);
1608
+ border: 1px solid var(--line);
1609
+ border-radius: var(--radius);
1610
+ box-shadow: var(--shadow-1);
1611
+ }
1612
+ .stat-label { font-size: var(--text-sm); color: var(--ink-soft); }
1613
+ .stat-value {
1614
+ font-family: var(--mono);
1615
+ font-size: var(--text-2xl);
1616
+ font-weight: 500;
1617
+ line-height: 1.15;
1618
+ font-variant-numeric: tabular-nums;
1619
+ letter-spacing: -0.01em;
1620
+ }
1621
+ .stat-delta { font-size: var(--text-sm); color: var(--ink-soft); }
1622
+ .stat-delta[data-dir]::before { margin-right: var(--s1); }
1623
+ .stat-delta[data-dir='up']::before { content: '↑' / ''; }
1624
+ .stat-delta[data-dir='down']::before { content: '↓' / ''; }
1625
+ .stat-delta[data-tone='good'] { color: var(--success-ink); }
1626
+ .stat-delta[data-tone='bad'] { color: var(--danger-ink); }
1627
+ .stat-grid {
1628
+ display: grid;
1629
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
1630
+ gap: var(--s4);
1631
+ }
1632
+ }
1633
+
1634
+ /* ── Tabs (#63) ────────────────────────────────────────────────────────────
1635
+ <div class="tabs">
1636
+ <div class="tabs-list" role="tablist" aria-label="Trip">
1637
+ <button role="tab" id="t1" aria-selected="true" aria-controls="p1">Itinerary</button>
1638
+ <button role="tab" id="t2" aria-selected="false" aria-controls="p2" tabindex="-1">Bookings</button>
1639
+ </div>
1640
+ <div class="tabs-panel" role="tabpanel" id="p1" aria-labelledby="t1">…</div>
1641
+ <div class="tabs-panel" role="tabpanel" id="p2" aria-labelledby="t2" hidden>…</div>
1642
+ </div>
1643
+ Tabs switch views of one thing; navigation between pages is a nav, never
1644
+ tabs. The selected tab is underlined in cobalt. The consumer's script owns
1645
+ selection and arrow keys (contract on previews/tabs.html). */
1646
+ @layer brignano.components {
1647
+ .tabs-list {
1648
+ display: flex;
1649
+ gap: var(--s1);
1650
+ overflow-x: auto;
1651
+ scrollbar-width: none;
1652
+ /* Inset hairline, not a border: a border would push the tab's 2px
1653
+ underline past the scroll box, which clips it and scrolls by 1px. */
1654
+ box-shadow: inset 0 -1px 0 var(--line);
1655
+ }
1656
+ .tabs-list::-webkit-scrollbar { display: none; }
1657
+ .tabs-list > [role='tab'] {
1658
+ all: unset;
1659
+ box-sizing: border-box;
1660
+ flex: none;
1661
+ padding: var(--s2) var(--s3);
1662
+ font-size: var(--text-sm);
1663
+ font-weight: 500;
1664
+ color: var(--ink-soft);
1665
+ white-space: nowrap;
1666
+ cursor: pointer;
1667
+ border-bottom: 2px solid transparent;
1668
+ border-radius: var(--radius-sm) var(--radius-sm) 0 0;
1669
+ transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
1670
+ }
1671
+ .tabs-list > [role='tab']:hover { color: var(--ink); background: var(--surface-hover); }
1672
+ .tabs-list > [role='tab']:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
1673
+ .tabs-list > [role='tab'][aria-selected='true'] { color: var(--ink); border-bottom-color: var(--i); }
1674
+ .tabs-list > [role='tab'][aria-disabled='true'] { color: var(--i-disabled-ink); cursor: not-allowed; background: none; }
1675
+ .tabs-panel { padding-top: var(--s4); }
1676
+ .tabs-panel:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; border-radius: var(--radius-sm); }
1677
+ .tier-marketing .tabs-list > [role='tab'] { font-size: var(--text-base); padding: var(--s3) var(--s4); }
1678
+ @media (pointer: coarse) {
1679
+ .tabs-list > [role='tab'] { display: inline-flex; align-items: center; min-height: 44px; }
1680
+ }
1681
+ @media (prefers-reduced-motion: reduce) {
1682
+ .tabs-list > [role='tab'] { transition: none; }
1683
+ }
1684
+ }
1685
+
1686
+ /* ── Breadcrumb (#64) ──────────────────────────────────────────────────────
1687
+ <nav class="breadcrumb" aria-label="Breadcrumb"><ol>
1688
+ <li><a href="/">Home</a></li><li><a href="/blog">Blog</a></li>
1689
+ <li><a href="/blog/x" aria-current="page">This post</a></li>
1690
+ </ol></nav>
1691
+ Separators are drawn, not typed, so they aren't read aloud. On a phone the
1692
+ middle crumbs collapse to an ellipsis: first, parent and current stay. */
1693
+ @layer brignano.components {
1694
+ .breadcrumb ol {
1695
+ display: flex;
1696
+ flex-wrap: wrap;
1697
+ align-items: center;
1698
+ gap: var(--s1) var(--s2);
1699
+ margin: 0;
1700
+ padding: 0;
1701
+ list-style: none;
1702
+ font-size: var(--text-sm);
1703
+ color: var(--ink-soft);
1704
+ }
1705
+ .breadcrumb li { display: inline-flex; align-items: center; gap: var(--s2); min-width: 0; }
1706
+ .breadcrumb li + li::before { content: '/' / ''; color: var(--slate); }
1707
+ .breadcrumb a { color: var(--i-ink); text-decoration: none; border-radius: var(--radius-sm); }
1708
+ .breadcrumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
1709
+ .breadcrumb a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
1710
+ .breadcrumb [aria-current='page'] {
1711
+ color: var(--ink);
1712
+ pointer-events: none;
1713
+ overflow: hidden;
1714
+ text-overflow: ellipsis;
1715
+ white-space: nowrap;
1716
+ }
1717
+ @media (max-width: 480px) {
1718
+ .breadcrumb li:not(:first-child):not(:nth-last-child(-n + 2)) { display: none; }
1719
+ /* The parent crumb's separator stands in for the hidden ones. */
1720
+ .breadcrumb li:nth-last-child(2):not(:nth-child(2))::before { content: '/ … /' / ''; }
1721
+ }
1722
+ @media (pointer: coarse) {
1723
+ .breadcrumb ol { row-gap: 0; }
1724
+ .breadcrumb a:not([aria-current]) { display: inline-flex; align-items: center; min-height: 44px; }
1725
+ }
1726
+ }
1727
+
1728
+ /* ── Pagination (#64) ──────────────────────────────────────────────────────
1729
+ <nav class="pagination" aria-label="Pages">
1730
+ <a class="pagination-prev" href="?p=2">Previous</a>
1731
+ <ol class="pagination-pages">
1732
+ <li><a href="?p=1">1</a></li> <li><a href="?p=3" aria-current="page">3</a></li> …
1733
+ </ol>
1734
+ <span class="pagination-status">Page 3 of 9</span>
1735
+ <a class="pagination-next" href="?p=4">Next</a>
1736
+ </nav>
1737
+ Numbered pages are for tables; content lists use .load-more instead. When
1738
+ the nav itself is narrower than 34rem (a phone, a sidebar, a half-width
1739
+ column) the numbers hide and "Page 3 of 9" shows. A missing previous or next
1740
+ is a <span aria-disabled="true">, not a dead link. */
1741
+ @layer brignano.components {
1742
+ .pagination {
1743
+ container: pagination / inline-size;
1744
+ display: flex;
1745
+ align-items: center;
1746
+ justify-content: space-between;
1747
+ gap: var(--s2);
1748
+ font-size: var(--text-sm);
1749
+ }
1750
+ .pagination-pages { display: flex; gap: var(--s1); margin: 0; padding: 0; list-style: none; }
1751
+ .pagination-prev,
1752
+ .pagination-next,
1753
+ .pagination-pages a,
1754
+ .pagination-pages span {
1755
+ display: inline-flex;
1756
+ align-items: center;
1757
+ justify-content: center;
1758
+ min-width: 2.25rem;
1759
+ min-height: 2.25rem;
1760
+ padding: 0 var(--s3);
1761
+ color: var(--ink);
1762
+ text-decoration: none;
1763
+ border-radius: var(--radius-sm);
1764
+ font-variant-numeric: tabular-nums;
1765
+ }
1766
+ .pagination-pages span { color: var(--slate); padding: 0; }
1767
+ .pagination-prev:hover,
1768
+ .pagination-next:hover,
1769
+ .pagination-pages a:hover { background: var(--surface-hover); }
1770
+ .pagination-prev:focus-visible,
1771
+ .pagination-next:focus-visible,
1772
+ .pagination-pages a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
1773
+ .pagination-pages [aria-current='page'] { color: var(--on-i); background: var(--i); font-weight: 600; }
1774
+ .pagination-prev,
1775
+ .pagination-next { flex-shrink: 0; white-space: nowrap; }
1776
+ .pagination-prev::before { content: '←' / ''; margin-right: var(--s1); }
1777
+ .pagination-next::after { content: '→' / ''; margin-left: var(--s1); }
1778
+ .pagination [aria-disabled='true'] { color: var(--i-disabled-ink); pointer-events: none; }
1779
+ .pagination-status { display: none; color: var(--ink-soft); }
1780
+ @container pagination (max-width: 34rem) {
1781
+ .pagination-pages { display: none; }
1782
+ .pagination-status { display: block; }
1783
+ }
1784
+ @media (pointer: coarse) {
1785
+ .pagination-prev,
1786
+ .pagination-next,
1787
+ .pagination-pages a { min-height: 44px; min-width: 44px; }
1788
+ }
1789
+
1790
+ /* Load more: the default for content lists (posts, photos, activity). */
1791
+ .load-more { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s5) 0; }
1792
+ .load-more-count { font-size: var(--text-sm); color: var(--ink-soft); }
1793
+ .load-more > button,
1794
+ .load-more > a {
1795
+ all: unset;
1796
+ box-sizing: border-box;
1797
+ padding: var(--s2) var(--s4);
1798
+ font-size: var(--text-sm);
1799
+ font-weight: 500;
1800
+ color: var(--ink);
1801
+ background: var(--card);
1802
+ border: 1px solid var(--line-control);
1803
+ border-radius: var(--radius);
1804
+ cursor: pointer;
1805
+ }
1806
+ .load-more > button:hover,
1807
+ .load-more > a:hover { background: var(--surface-hover); }
1808
+ .load-more > button:focus-visible,
1809
+ .load-more > a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
1810
+ @media (pointer: coarse) {
1811
+ .load-more > button,
1812
+ .load-more > a { display: inline-flex; align-items: center; min-height: 44px; }
1813
+ }
1814
+ }
1815
+
1816
+ /* ── Disclosure and accordion (#65) ───────────────────────────────────────
1817
+ <details class="disclosure"><summary>Question</summary><p>Answer</p></details>
1818
+ <div class="accordion">
1819
+ <details class="disclosure" name="faq">…</details>
1820
+ <details class="disclosure" name="faq">…</details>
1821
+ </div>
1822
+ Native <details> only, no JS. A shared name="…" makes the group exclusive:
1823
+ opening one closes the rest. The height doesn't animate; only the chevron
1824
+ turns. */
1825
+ @layer brignano.components {
1826
+ .disclosure > summary {
1827
+ display: flex;
1828
+ align-items: center;
1829
+ justify-content: space-between;
1830
+ gap: var(--s3);
1831
+ padding: var(--s3);
1832
+ font-weight: 500;
1833
+ color: var(--ink);
1834
+ list-style: none;
1835
+ cursor: pointer;
1836
+ border-radius: var(--radius-sm);
1837
+ transition: background-color var(--dur-fast) var(--ease);
1838
+ }
1839
+ .disclosure > summary::-webkit-details-marker { display: none; }
1840
+ .disclosure > summary::after {
1841
+ content: '';
1842
+ flex: none;
1843
+ width: .5em;
1844
+ height: .5em;
1845
+ margin-right: .25em;
1846
+ border-right: 2px solid var(--ink-soft);
1847
+ border-bottom: 2px solid var(--ink-soft);
1848
+ transform: translateY(-25%) rotate(45deg);
1849
+ transition: transform var(--dur-fast) var(--ease);
1850
+ }
1851
+ .disclosure[open] > summary::after { transform: translateY(25%) rotate(-135deg); }
1852
+ .disclosure > summary:hover { background: var(--surface-hover); }
1853
+ .disclosure > summary:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
1854
+ .disclosure > :not(summary) { margin: 0; padding: 0 var(--s3) var(--s3); color: var(--ink-soft); }
1855
+
1856
+ .accordion { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
1857
+ .accordion > .disclosure + .disclosure { border-top: 1px solid var(--line); }
1858
+ .accordion > .disclosure > summary { border-radius: 0; }
1859
+
1860
+ .tier-marketing .disclosure > summary { font-size: var(--text-lg); padding: var(--s4) var(--s3); }
1861
+ @media (pointer: coarse) {
1862
+ .disclosure > summary { min-height: 44px; }
1863
+ }
1864
+ @media (prefers-reduced-motion: reduce) {
1865
+ .disclosure > summary,
1866
+ .disclosure > summary::after { transition: none; }
1867
+ }
1868
+ }
1869
+
1870
+ /* ── Avatar (#66) ─────────────────────────────────────────────────────────
1871
+ <span class="avatar"><img src="…" alt="Ana Ruiz"></span>
1872
+ <span class="avatar avatar-sm" role="img" aria-label="Ana Ruiz">AR</span>
1873
+ A circle. Initials are the fallback when there's no photo; the wrapper
1874
+ then carries the name for screen readers. */
1875
+ @layer brignano.components {
1876
+ .avatar {
1877
+ display: inline-flex;
1878
+ align-items: center;
1879
+ justify-content: center;
1880
+ flex: none;
1881
+ width: 2.5rem;
1882
+ height: 2.5rem;
1883
+ overflow: hidden;
1884
+ font-size: var(--text-sm);
1885
+ font-weight: 600;
1886
+ line-height: 1;
1887
+ color: var(--ink);
1888
+ background: var(--surface-active);
1889
+ border-radius: 50%;
1890
+ user-select: none;
1891
+ }
1892
+ .avatar > img { width: 100%; height: 100%; object-fit: cover; }
1893
+ .avatar-sm { width: 1.5rem; height: 1.5rem; font-size: var(--text-xs); }
1894
+ .avatar-lg { width: 4rem; height: 4rem; font-size: var(--text-lg); }
1895
+ }
1896
+
1897
+ /* ── Keycap, inline code, code block (#66) ─────────────────────────────────
1898
+ <kbd class="kbd">⌘</kbd> <kbd class="kbd">K</kbd> <code class="code">npm run check</code>
1899
+ <figure class="code-block">
1900
+ <figcaption class="code-block-header">
1901
+ <span class="code-block-file">deploy.sh</span>
1902
+ <button type="button" class="code-block-copy">Copy</button>
1903
+ </figcaption>
1904
+ <pre tabindex="0"><code>…</code></pre>
1905
+ </figure>
1906
+ The block scrolls sideways and never wraps; tabindex="0" lets keyboard
1907
+ users scroll it. Tokens are spans: .tok-keyword, .tok-string,
1908
+ .tok-comment; a highlighted line is <span class="line-highlight">. Your
1909
+ app owns the copy button's script. */
1910
+ @layer brignano.components {
1911
+ .kbd,
1912
+ .prose kbd {
1913
+ display: inline-block;
1914
+ min-width: 1.6em;
1915
+ padding: .1em .4em;
1916
+ font-family: var(--mono);
1917
+ font-size: .85em;
1918
+ line-height: 1.4;
1919
+ text-align: center;
1920
+ color: var(--ink);
1921
+ background: var(--card);
1922
+ border: 1px solid var(--line-control);
1923
+ border-bottom-width: 2px;
1924
+ border-radius: var(--radius-sm);
1925
+ }
1926
+ .code,
1927
+ .prose :not(pre) > code {
1928
+ padding: .1em .35em;
1929
+ font-family: var(--mono);
1930
+ font-size: .9em;
1931
+ color: var(--code-ink);
1932
+ background: var(--surface-hover);
1933
+ border-radius: var(--radius-sm);
1934
+ }
1935
+
1936
+ .code-block {
1937
+ margin: 0;
1938
+ overflow: hidden;
1939
+ color: var(--code-ink);
1940
+ background: var(--code-surface);
1941
+ border: 1px solid var(--line);
1942
+ border-radius: var(--radius);
1943
+ }
1944
+ .code-block-header {
1945
+ display: flex;
1946
+ align-items: center;
1947
+ justify-content: space-between;
1948
+ gap: var(--s3);
1949
+ padding: var(--s1) var(--s1) var(--s1) var(--s4);
1950
+ font-size: var(--text-xs);
1951
+ font-family: var(--mono);
1952
+ color: var(--ink-soft);
1953
+ border-bottom: 1px solid var(--line);
1954
+ }
1955
+ .code-block-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1956
+ .code-block-copy {
1957
+ all: unset;
1958
+ box-sizing: border-box;
1959
+ flex: none;
1960
+ padding: var(--s1) var(--s3);
1961
+ font-family: var(--sans);
1962
+ font-size: var(--text-xs);
1963
+ font-weight: 500;
1964
+ color: var(--ink-soft);
1965
+ cursor: pointer;
1966
+ border-radius: var(--radius-sm);
1967
+ }
1968
+ .code-block-copy:hover { color: var(--ink); background: var(--surface-hover); }
1969
+ .code-block-copy:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
1970
+ .code-block pre { margin: 0; }
1971
+ .code-block pre,
1972
+ .prose > pre {
1973
+ padding: var(--s4);
1974
+ overflow-x: auto;
1975
+ font-family: var(--mono);
1976
+ font-size: var(--text-sm);
1977
+ line-height: 1.6;
1978
+ tab-size: 2;
1979
+ }
1980
+ .code-block pre:focus-visible,
1981
+ .prose > pre:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
1982
+ .code-block code { font: inherit; }
1983
+ .tok-keyword { color: var(--code-keyword); }
1984
+ .tok-string { color: var(--code-string); }
1985
+ .tok-comment { color: var(--code-comment); font-style: italic; }
1986
+ /* The band reaches into the pre's padding with side shadows, not padding,
1987
+ so a box-sizing reset in the consuming site can't shorten it. */
1988
+ .line-highlight {
1989
+ display: inline-block;
1990
+ min-width: 100%;
1991
+ background: var(--code-highlight);
1992
+ box-shadow: calc(var(--s4) * -1) 0 0 var(--code-highlight), var(--s4) 0 0 var(--code-highlight);
1993
+ }
1994
+ /* Slate falls under 4.5:1 on the cobalt wash; comments step up to the
1995
+ string ink there and keep their italics. */
1996
+ .line-highlight .tok-comment { color: var(--code-string); }
1997
+ @media (pointer: coarse) {
1998
+ .code-block-copy { display: inline-flex; align-items: center; min-height: 44px; }
1999
+ }
2000
+ }
2001
+
2002
+ /* ── Blockquote and figure (#66) ───────────────────────────────────────────
2003
+ <blockquote class="blockquote"><p>…</p><cite>Ana Ruiz, ops lead</cite></blockquote>
2004
+ <figure class="figure"><img src="…" alt="…"><figcaption>…</figcaption></figure>
2005
+ The quote bar is a neutral rule, not cobalt: a quote isn't interactive. */
2006
+ @layer brignano.components {
2007
+ .blockquote {
2008
+ margin: 0;
2009
+ padding: 0 0 0 var(--s4);
2010
+ font-size: var(--text-lg);
2011
+ color: var(--ink);
2012
+ border-left: 3px solid var(--line-strong);
2013
+ }
2014
+ .blockquote > p { margin: 0 0 var(--s2); }
2015
+ .blockquote > cite { display: block; font-size: var(--text-sm); font-style: normal; color: var(--ink-soft); }
2016
+ .blockquote > cite::before { content: '— ' / ''; }
2017
+ .figure { margin: 0; }
2018
+ .figure > img,
2019
+ .figure > video { display: block; max-width: 100%; height: auto; border-radius: var(--radius); }
2020
+ .figure > figcaption { margin-top: var(--s2); font-size: var(--text-sm); color: var(--slate); }
2021
+ }
2022
+
2023
+ /* ── Prose (#67) ──────────────────────────────────────────────────────────
2024
+ <article class="prose">…plain HTML from Markdown…</article>
2025
+ Long-form text: blog posts, docs, legal pages. Styles the bare elements
2026
+ a Markdown renderer emits, reusing the code, quote, figure and table
2027
+ pieces above. Capped at the tier's --measure; spacing comes from --s*.
2028
+ Heading anchors: <h2 id="x">Title <a class="anchor" href="#x" aria-label="Link to Title"></a></h2>. */
2029
+ @layer brignano.components {
2030
+ .prose {
2031
+ max-width: var(--measure);
2032
+ font-size: var(--text-base);
2033
+ line-height: 1.7;
2034
+ color: var(--ink);
2035
+ overflow-wrap: break-word;
2036
+ }
2037
+ .prose > * { margin: 0; }
2038
+ .prose > * + * { margin-top: var(--s4); }
2039
+ .prose :where(h2, h3, h4) {
2040
+ font-weight: 600;
2041
+ line-height: 1.3;
2042
+ letter-spacing: -0.01em;
2043
+ scroll-margin-top: var(--s7);
2044
+ }
2045
+ .prose h2 { font-size: var(--text-xl); }
2046
+ .prose h3 { font-size: var(--text-lg); }
2047
+ .prose h4 { font-size: var(--text-base); }
2048
+ .prose > * + h2 { margin-top: var(--s7); }
2049
+ .prose > * + :where(h3, h4) { margin-top: var(--s6); }
2050
+ .prose > :where(h2, h3, h4) + * { margin-top: var(--s2); }
2051
+
2052
+ /* The # follows the heading text and shows on hover or focus; on
2053
+ devices without hover it always shows. */
2054
+ .prose .anchor {
2055
+ margin-left: var(--s2);
2056
+ font-weight: 400;
2057
+ color: var(--slate);
2058
+ text-decoration: none;
2059
+ opacity: 0;
2060
+ }
2061
+ .prose .anchor::before { content: '#'; }
2062
+ .prose :where(h2, h3, h4):hover > .anchor,
2063
+ .prose .anchor:focus-visible { opacity: 1; }
2064
+ .prose .anchor:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; border-radius: var(--radius-sm); }
2065
+ @media (hover: none) {
2066
+ .prose .anchor { opacity: 1; }
2067
+ }
2068
+ @media (pointer: coarse) {
2069
+ /* A 44px hit area without moving the heading text. */
2070
+ .prose .anchor { display: inline-block; min-width: 44px; padding: 12px; margin: -12px -12px -12px calc(var(--s2) - 12px); text-align: left; }
2071
+ }
2072
+
2073
+ .prose a:not(.anchor) { color: var(--i-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
2074
+ .prose a:not(.anchor):hover { color: var(--i-hover); text-decoration-thickness: 2px; }
2075
+ .prose a:not(.anchor):focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; border-radius: 2px; }
2076
+ .prose strong { font-weight: 600; }
2077
+
2078
+ .prose :where(ul, ol) { padding-left: var(--s5); }
2079
+ .prose li + li { margin-top: var(--s1); }
2080
+ .prose li > :where(ul, ol) { margin-top: var(--s1); }
2081
+ .prose li::marker { color: var(--slate); }
2082
+
2083
+ .prose hr { height: 0; margin-block: var(--s7); border: 0; border-top: 1px solid var(--line); }
2084
+
2085
+ /* Reused pieces, applied to bare elements. Inline code, kbd and the
2086
+ pre's type come from the #66 rules above, which list these selectors
2087
+ too; a bare pre adds the block's frame here. */
2088
+ .prose > pre {
2089
+ color: var(--code-ink);
2090
+ background: var(--code-surface);
2091
+ border: 1px solid var(--line);
2092
+ border-radius: var(--radius);
2093
+ }
2094
+ .prose pre code { font: inherit; }
2095
+ .prose > blockquote {
2096
+ padding-left: var(--s4);
2097
+ color: var(--ink-soft);
2098
+ border-left: 3px solid var(--line-strong);
2099
+ }
2100
+ .prose > blockquote > * { margin: 0; }
2101
+ .prose > blockquote > * + * { margin-top: var(--s2); }
2102
+ .prose > figure > :where(img, video) { display: block; max-width: 100%; height: auto; border-radius: var(--radius); }
2103
+ .prose > figure > figcaption { margin-top: var(--s2); font-size: var(--text-sm); color: var(--slate); }
2104
+ .prose img { max-width: 100%; height: auto; }
2105
+ .prose > p > img { border-radius: var(--radius); }
2106
+ .prose > :where(figure, pre, .table-wrap, .code-block) { margin-top: var(--s5); }
2107
+ .prose > :where(figure, pre, .table-wrap, .code-block) + * { margin-top: var(--s5); }
2108
+
2109
+ /* Footnotes, in the shape remark-gfm and markdown-it-footnote emit. */
2110
+ .prose sup { line-height: 0; }
2111
+ .prose :where(.footnotes, section[data-footnotes]) {
2112
+ margin-top: var(--s7);
2113
+ padding-top: var(--s4);
2114
+ font-size: var(--text-sm);
2115
+ color: var(--ink-soft);
2116
+ border-top: 1px solid var(--line);
2117
+ }
2118
+ .prose :is(.footnotes, section[data-footnotes]) h2 { font-size: var(--text-sm); color: var(--ink-soft); }
2119
+
2120
+ .tier-marketing .prose { line-height: 1.75; }
2121
+ .tier-marketing .prose h2 { font-size: var(--text-2xl); }
2122
+ .tier-marketing .prose h3 { font-size: var(--text-xl); }
2123
+ }
2124
+
2125
+ /* ── Gap modifiers (#53) ──────────────────────────────────────────────────
2126
+ Keep this block LAST in the file: equal specificity, so it wins by order
2127
+ over every component's own gap. */
2128
+ @layer brignano.components {
2129
+ .gap-2 { gap: var(--s2); }
2130
+ .gap-3 { gap: var(--s3); }
2131
+ .gap-4 { gap: var(--s4); }
2132
+ .gap-5 { gap: var(--s5); }
2133
+ .gap-6 { gap: var(--s6); }
2134
+ }