sisyo 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/LICENSE +16 -16
  2. package/README.md +177 -166
  3. package/bin/known-hashes.json +8 -1
  4. package/bin/sisyo.js +285 -285
  5. package/package.json +30 -30
  6. package/templates/.claude/rules/agents-and-tests.md +32 -24
  7. package/templates/.claude/rules/docs.md +39 -19
  8. package/templates/.claude/skills/fastapi-best-practices/ASYNC-PATTERNS.md +121 -121
  9. package/templates/.claude/skills/fastapi-best-practices/DATABASE.md +153 -153
  10. package/templates/.claude/skills/fastapi-best-practices/DEPENDENCIES.md +140 -140
  11. package/templates/.claude/skills/fastapi-best-practices/PROJECT-STRUCTURE.md +90 -90
  12. package/templates/.claude/skills/fastapi-best-practices/PYDANTIC-GUIDE.md +155 -155
  13. package/templates/.claude/skills/fastapi-best-practices/SKILL.md +123 -123
  14. package/templates/.claude/skills/g6-style/SKILL.md +125 -125
  15. package/templates/.claude/skills/g6-style/references/checks.md +58 -58
  16. package/templates/.claude/skills/g6-style/references/imagery.md +103 -103
  17. package/templates/.claude/skills/g6-style/references/motion.md +121 -121
  18. package/templates/.claude/skills/g6-style/references/sections.md +263 -263
  19. package/templates/.claude/skills/g6-style/references/tokens.md +197 -197
  20. package/templates/.claude/skills/hindsight/SKILL.md +175 -175
  21. package/templates/.claude/skills/hoang-auth/SKILL.md +188 -0
  22. package/templates/.claude/skills/html-docs/SKILL.md +207 -207
  23. package/templates/.claude/skills/i18n-multilang/SKILL.md +153 -153
  24. package/templates/.claude/skills/i18n-multilang/assets/languages.json +47 -47
  25. package/templates/.claude/skills/i18n-multilang/assets/plural-vectors.json +46 -46
  26. package/templates/.claude/skills/i18n-multilang/assets/project/README.md +17 -17
  27. package/templates/.claude/skills/i18n-multilang/assets/project/gitattributes.txt +6 -6
  28. package/templates/.claude/skills/i18n-multilang/assets/project/gitignore.txt +4 -4
  29. package/templates/.claude/skills/i18n-multilang/assets/project/glossary.json +6 -6
  30. package/templates/.claude/skills/i18n-multilang/assets/project/i18n.config.json +22 -22
  31. package/templates/.claude/skills/i18n-multilang/assets/project/locales/__source__/common.json +10 -10
  32. package/templates/.claude/skills/i18n-multilang/assets/project/notes/common.json +5 -5
  33. package/templates/.claude/skills/i18n-multilang/assets/project/style.md +20 -20
  34. package/templates/.claude/skills/i18n-multilang/references/format.md +100 -100
  35. package/templates/.claude/skills/i18n-multilang/references/languages.md +97 -97
  36. package/templates/.claude/skills/i18n-multilang/references/layout-and-versioning.md +256 -256
  37. package/templates/.claude/skills/i18n-multilang/references/numbers.md +161 -161
  38. package/templates/.claude/skills/i18n-multilang/references/platform-unity.md +142 -142
  39. package/templates/.claude/skills/i18n-multilang/references/platform-web.md +107 -107
  40. package/templates/.claude/skills/i18n-multilang/references/translation.md +143 -143
  41. package/templates/.claude/skills/i18n-multilang/references/voice.md +271 -271
  42. package/templates/.claude/skills/i18n-multilang/scripts/i18n.py +1041 -1041
  43. package/templates/.claude/skills/i18n-multilang/scripts/numwords.py +1013 -1013
  44. package/templates/.claude/skills/i18n-multilang/scripts/voice.py +478 -478
  45. package/templates/.claude/skills/neon-game-ui-ux-skill/COMPONENTS.md +490 -490
  46. package/templates/.claude/skills/neon-game-ui-ux-skill/GAMIFICATION.md +246 -246
  47. package/templates/.claude/skills/neon-game-ui-ux-skill/ICONS.md +249 -249
  48. package/templates/.claude/skills/neon-game-ui-ux-skill/LAYOUT-NAV.md +362 -362
  49. package/templates/.claude/skills/neon-game-ui-ux-skill/MOTION-A11Y.md +168 -168
  50. package/templates/.claude/skills/neon-game-ui-ux-skill/SKILL.md +137 -137
  51. package/templates/.claude/skills/neon-game-ui-ux-skill/TOKENS.md +323 -323
  52. package/templates/.claude/skills/react-page-oriented/SKILL.md +407 -407
  53. package/templates/.claude/skills/react-page-oriented/triggers.md +12 -12
  54. package/templates/.claude/skills/terraform-best-practices/SKILL.md +341 -341
  55. package/templates/.claude/skills/typesafe-jev/SKILL.md +148 -148
  56. package/templates/.claude/skills/vibe-docs/SKILL.md +139 -242
  57. package/templates/SISYO.md +39 -37
  58. package/templates/docs/99_progress/features.md +7 -7
  59. package/templates/docs/99_progress/handoff.md +19 -19
  60. package/templates/docs/99_progress/todo.md +15 -15
  61. package/templates/docs/MAP.md +26 -26
@@ -1,168 +1,168 @@
1
- # Motion and accessibility
2
-
3
- The style is loud by design (neon, glow, celebration). These rules are what keep it usable: every animation has a
4
- job and a budget, and every state is readable without colour, without motion and without a pointer. Token names
5
- are those of `TOKENS.md`.
6
-
7
- ## 1. Easing and duration
8
-
9
- | Use | Easing | Duration |
10
- |---|---|---|
11
- | Press | `ease-glide` `cubic-bezier(.22,1,.36,1)` | 120 ms |
12
- | Hover, focus, colour change | `ease-glide` | 180-200 ms |
13
- | Enter (popover, toast, sheet, menu item) | `ease-glide` | 160-280 ms |
14
- | Fill, slide, count-up (XP bar, ring, numbers) | `ease-glide` / cubic ease-out | 600-700 ms |
15
- | Celebration (pop-in, badge open, chip flight) | `ease-pop` `cubic-bezier(.34,1.56,.64,1)` for pops, `ease-glide` for flight | 450-700 ms |
16
- | Ambient loop | `ease-in-out` / linear | 2.4-6 s per cycle (rays: 20 s) |
17
-
18
- - `ease-pop` overshoots. It is reserved for **rewards** (a check appearing, a badge earned, a chest ready). On
19
- ordinary UI (menus, cards, navigation) overshoot reads as toy-like and tiring.
20
- - Exits are faster than entrances (about 160 ms) and never bounce.
21
- - With `motion/react`, pass the glide curve as `ease: [0.22, 1, 0.36, 1]`. Springs are used in two places only: the
22
- shared-layout pill of the segmented control (`bounce: 0.18, duration: 0.35`) and the dial menu's items flying out of the dial
23
- (`stiffness: 420, damping: 26`, 35 ms stagger), the one piece of navigation that is allowed a small overshoot.
24
-
25
- ## 2. What animates, and how
26
-
27
- Animate **only** `transform`, `opacity` and `background-position` (plus `stroke-dashoffset` on the ring and the
28
- registered `--neon-angle`). These stay off the layout path.
29
-
30
- | Want | Do | Do not |
31
- |---|---|---|
32
- | A bar filling | `translateX((ratio - 1) * 100%)` on a full-width fill inside an `overflow-hidden` track | animate `width` |
33
- | A glow appearing on hover | put the shadow on `::after`, animate its `opacity` | animate `box-shadow` on the card |
34
- | A pulsing halo | a blurred sibling element with `animate-glow-pulse` | pulse the control's own shadow or scale |
35
- | A key press | `translate-y-[3px]` + swap the depth shadow | animate `height` / `margin` |
36
- | A split bar changing | `flex-grow` transition (one cheap layout, 300 ms) | re-render with a new width each frame |
37
-
38
- Never use a global `* { transition: all }`: it animates layout properties, makes theme switching smear, and fights
39
- `motion/react`. Transitions are listed per property (`transition-[transform,box-shadow,background-color]`).
40
-
41
- ## 3. What never animates
42
-
43
- - Body text, headings, table rows, form fields (no entrance animation for content the user came to read).
44
- - Page transitions: a route change is instant; only the skeleton → content swap happens.
45
- - Layout: nothing moves other content when it animates.
46
- - Anything during typing or a timed task, except direct feedback to that input.
47
- - Focus rings: they appear instantly.
48
-
49
- ## 4. Loop budget
50
-
51
- Infinite animations are the main risk of this style.
52
-
53
- - **At most two ambient loops visible at once** (for example: the CTA gradient drift and the current step's sweep
54
- ring). A third loop makes the screen feel restless and costs battery.
55
- - Prefer finite variants: `animate-float-3` (three cycles, then rest), `animate-shimmer-once` (one sweep per value
56
- change). A loop is justified only while something **waits for the user** (a claimable reward, the current step,
57
- a live recording) or is loading.
58
- - One loop per component: the current path node has the sweep ring and a static halo, not both pulsing.
59
- - Loops stop when their reason ends (claimed → no shimmer). Do not leave a "new" pulse on something the user has
60
- already seen.
61
-
62
- ## 5. Reduced motion
63
-
64
- Three layers, all needed:
65
-
66
- 1. **CSS**, at the end of the base stylesheet, outside any layer:
67
-
68
- ```css
69
- @media (prefers-reduced-motion: reduce) {
70
- *, *::before, *::after {
71
- animation-duration: 1ms !important;
72
- animation-iteration-count: 1 !important;
73
- transition-duration: 1ms !important;
74
- scroll-behavior: auto !important;
75
- }
76
- }
77
- ```
78
-
79
- Durations are 1 ms rather than `none`, so end states still apply (a `forwards` animation lands on its last frame)
80
- and `animationend` / `transitionend` still fire.
81
- 2. **`<MotionConfig reducedMotion="user">`** at the root: `motion/react` drops transform and layout animations and
82
- keeps opacity.
83
- 3. **Component branches** where the motion carries meaning: the XP chip does not fly, it fades in above the source
84
- (`useReducedMotion()`); count-ups set the final number at once; the level-up badge appears without rotating;
85
- ambient pulses carry Tailwind's `motion-safe:` variant (`motion-safe:animate-glow-pulse`).
86
-
87
- Under reduced motion the user still gets **every state change**: colours, icons, text, toasts and the level-up
88
- dialog remain. Only travel, bounce and loops go.
89
-
90
- Offer an in-app "Calm mode" switch as well if the audience includes people who cannot change OS settings (shared or
91
- managed devices); it sets the same behaviour from a class on `<html>`.
92
-
93
- ## 6. Colour contrast
94
-
95
- Targets: WCAG 2.2 AA. Text 4.5:1 (large text >= 24 px or bold >= 18.66 px: 3:1); meaningful graphics, control
96
- boundaries and focus indicators 3:1.
97
-
98
- | Rule | Reason / number |
99
- |---|---|
100
- | Text on a neon fill is `text-on-neon` (`#05060A`) | 6.2-16.8:1. White on neon is 1.2-3.3:1 |
101
- | `ink-muted` is the lightest colour for text that must be read | 5.3:1 on a card, 4.5:1 on `shade`. `ink-faint` (2.5:1) is for disabled and decoration |
102
- | Coloured text uses `neon-ink-*` | Equals the neon on dark; 5.2-6.0:1 on white in the light theme, where raw neon is about 1.2:1 |
103
- | Coloured text is not placed on `surface-3` in the light theme | The ink stops were measured on white (5.2-6.0:1); on the light `shade` they drop below 4.5:1 |
104
- | Neon text on a 12 % tint of itself (chips) | iris 4.9, flare 5.6, coral 5.4: passes; do not raise the tint |
105
- | Ring and arc colours on light come from the `-ink` stops | A lime arc on a pale track disappears |
106
- | Disabled = `opacity-40 saturate-0` | Deliberately below contrast targets, and never the only cue: the control is also non-interactive and announced as disabled |
107
- | No glow on body text | `text-shadow` blurs glyph edges; glow is for shapes |
108
-
109
- Check both themes. The light theme is where neon designs fail: every review of a new page includes a light-theme
110
- pass on the gallery and on the page.
111
-
112
- ## 7. Colour is never the only signal
113
-
114
- | State | Colour | Plus |
115
- |---|---|---|
116
- | Correct / wrong | lime / coral | check / cross icon, text |
117
- | New / known / mastered | flare / aqua / gold | "NEW" tag / underline style / dot, and an `sr-only` suffix |
118
- | Streak done / at risk / lapsed | ember / amber / grey | glow / short float / dimmed flame, and the label text |
119
- | Quest active / complete / claimed | tone / gold / dimmed | reward chip / Claim button / "Claimed" + check |
120
- | Locked | grey | lock badge, `aria-disabled`, hint |
121
- | Active nav item | tone | a filled, ringed pill behind the icon (inactive tabs have none), `aria-current` (from the router's NavLink) |
122
- | Error | coral | warning icon, `role="alert"` text |
123
-
124
- ## 8. Targets and focus
125
-
126
- - **44x44 px minimum** for every interactive element (WCAG 2.5.8 asks 24; 44 is the touch-comfortable size this
127
- system uses). When the visual is smaller (36 px disc, 32 px chip, 36 px segmented option), extend the hit area
128
- with a pseudo-element: `relative after:absolute after:-inset-1 after:content-['']`. Neighbouring extended areas
129
- must not overlap.
130
- - **Focus ring**: global `:focus-visible { outline: 2px solid rgb(var(--c-aqua-ink)); outline-offset: 2px }`.
131
- Aqua is the focus colour everywhere (13.5:1 on dark; the ink stop on light); lime means selection, so the two are
132
- never confused.
133
- - Composite controls draw the ring on their visible part (`group-focus-visible:outline` on the round button's
134
- disc, on the switch's track) and suppress it on the wrapper.
135
- - Controls inside a clipped container use `focus-visible:outline-offset-0` (segmented options) or a negative
136
- offset (menu items) so the ring is not cut off.
137
- - Never `outline: none` without a replacement, and never rely on glow as the focus indicator.
138
- - **Focus is never hidden under the bars**: `scroll-padding-top/bottom` on `html` from `--shell-top` /
139
- `--shell-bottom` (WCAG 2.4.11).
140
- - **Focus management**: dialogs trap and restore focus (LAYOUT-NAV.md §6); when a control removes itself
141
- (Claim → Claimed, Delete), move focus to a stable neighbour or the section heading (`tabIndex={-1}`); a button that
142
- turns disabled while focused stays focusable with `aria-disabled` (`focusableWhenDisabled`, COMPONENTS.md).
143
- - **Keyboard**: radio groups and menus use arrow keys with roving `tabIndex`; Escape closes the top-most layer only;
144
- a "Skip to content" link is first in the tab order.
145
-
146
- ## 9. Screen readers
147
-
148
- - Icons are `aria-hidden` unless they are the only content; then the **control** has `aria-label`.
149
- - Composite HUD pieces are `role="img"` with a full sentence label ("12-day streak, done today"); their visible
150
- digits are `aria-hidden` to avoid double reading.
151
- - Progress: `role="progressbar"` with `aria-valuenow` and, where the raw number is not meaningful,
152
- `aria-valuetext` ("Level 7: 120 of 500 XP").
153
- - Animated numbers: an `sr-only` copy holds the final value; the animated one is `aria-hidden`.
154
- - Live regions are mounted before they receive text (toasts, XP announcements). Small XP gains are announced politely
155
- without a visual toast; errors are assertive.
156
- - Celebration overlays are `aria-hidden` and `pointer-events-none`; the level-up is a real dialog with a heading.
157
- - Loading: `aria-busy` on the region or button; skeletons are `aria-hidden`.
158
-
159
- ## 10. Review checklist for a new screen
160
-
161
- - [ ] 320 px wide: no horizontal scroll, labels fit, targets >= 44 px.
162
- - [ ] Light theme: every coloured text and line readable; no raw neon text.
163
- - [ ] Keyboard only: reach and operate everything; focus always visible; Escape closes layers in order.
164
- - [ ] Reduced motion on: nothing travels or loops; every state still shown.
165
- - [ ] Count the loops on screen at rest: two or fewer.
166
- - [ ] Count the glows at rest: each one marks something active, current, or waiting.
167
- - [ ] Each tone on the screen means what it means elsewhere.
168
- - [ ] Loading and error states exist and keep the layout's boxes.
1
+ # Motion and accessibility
2
+
3
+ The style is loud by design (neon, glow, celebration). These rules are what keep it usable: every animation has a
4
+ job and a budget, and every state is readable without colour, without motion and without a pointer. Token names
5
+ are those of `TOKENS.md`.
6
+
7
+ ## 1. Easing and duration
8
+
9
+ | Use | Easing | Duration |
10
+ |---|---|---|
11
+ | Press | `ease-glide` `cubic-bezier(.22,1,.36,1)` | 120 ms |
12
+ | Hover, focus, colour change | `ease-glide` | 180-200 ms |
13
+ | Enter (popover, toast, sheet, menu item) | `ease-glide` | 160-280 ms |
14
+ | Fill, slide, count-up (XP bar, ring, numbers) | `ease-glide` / cubic ease-out | 600-700 ms |
15
+ | Celebration (pop-in, badge open, chip flight) | `ease-pop` `cubic-bezier(.34,1.56,.64,1)` for pops, `ease-glide` for flight | 450-700 ms |
16
+ | Ambient loop | `ease-in-out` / linear | 2.4-6 s per cycle (rays: 20 s) |
17
+
18
+ - `ease-pop` overshoots. It is reserved for **rewards** (a check appearing, a badge earned, a chest ready). On
19
+ ordinary UI (menus, cards, navigation) overshoot reads as toy-like and tiring.
20
+ - Exits are faster than entrances (about 160 ms) and never bounce.
21
+ - With `motion/react`, pass the glide curve as `ease: [0.22, 1, 0.36, 1]`. Springs are used in two places only: the
22
+ shared-layout pill of the segmented control (`bounce: 0.18, duration: 0.35`) and the dial menu's items flying out of the dial
23
+ (`stiffness: 420, damping: 26`, 35 ms stagger), the one piece of navigation that is allowed a small overshoot.
24
+
25
+ ## 2. What animates, and how
26
+
27
+ Animate **only** `transform`, `opacity` and `background-position` (plus `stroke-dashoffset` on the ring and the
28
+ registered `--neon-angle`). These stay off the layout path.
29
+
30
+ | Want | Do | Do not |
31
+ |---|---|---|
32
+ | A bar filling | `translateX((ratio - 1) * 100%)` on a full-width fill inside an `overflow-hidden` track | animate `width` |
33
+ | A glow appearing on hover | put the shadow on `::after`, animate its `opacity` | animate `box-shadow` on the card |
34
+ | A pulsing halo | a blurred sibling element with `animate-glow-pulse` | pulse the control's own shadow or scale |
35
+ | A key press | `translate-y-[3px]` + swap the depth shadow | animate `height` / `margin` |
36
+ | A split bar changing | `flex-grow` transition (one cheap layout, 300 ms) | re-render with a new width each frame |
37
+
38
+ Never use a global `* { transition: all }`: it animates layout properties, makes theme switching smear, and fights
39
+ `motion/react`. Transitions are listed per property (`transition-[transform,box-shadow,background-color]`).
40
+
41
+ ## 3. What never animates
42
+
43
+ - Body text, headings, table rows, form fields (no entrance animation for content the user came to read).
44
+ - Page transitions: a route change is instant; only the skeleton → content swap happens.
45
+ - Layout: nothing moves other content when it animates.
46
+ - Anything during typing or a timed task, except direct feedback to that input.
47
+ - Focus rings: they appear instantly.
48
+
49
+ ## 4. Loop budget
50
+
51
+ Infinite animations are the main risk of this style.
52
+
53
+ - **At most two ambient loops visible at once** (for example: the CTA gradient drift and the current step's sweep
54
+ ring). A third loop makes the screen feel restless and costs battery.
55
+ - Prefer finite variants: `animate-float-3` (three cycles, then rest), `animate-shimmer-once` (one sweep per value
56
+ change). A loop is justified only while something **waits for the user** (a claimable reward, the current step,
57
+ a live recording) or is loading.
58
+ - One loop per component: the current path node has the sweep ring and a static halo, not both pulsing.
59
+ - Loops stop when their reason ends (claimed → no shimmer). Do not leave a "new" pulse on something the user has
60
+ already seen.
61
+
62
+ ## 5. Reduced motion
63
+
64
+ Three layers, all needed:
65
+
66
+ 1. **CSS**, at the end of the base stylesheet, outside any layer:
67
+
68
+ ```css
69
+ @media (prefers-reduced-motion: reduce) {
70
+ *, *::before, *::after {
71
+ animation-duration: 1ms !important;
72
+ animation-iteration-count: 1 !important;
73
+ transition-duration: 1ms !important;
74
+ scroll-behavior: auto !important;
75
+ }
76
+ }
77
+ ```
78
+
79
+ Durations are 1 ms rather than `none`, so end states still apply (a `forwards` animation lands on its last frame)
80
+ and `animationend` / `transitionend` still fire.
81
+ 2. **`<MotionConfig reducedMotion="user">`** at the root: `motion/react` drops transform and layout animations and
82
+ keeps opacity.
83
+ 3. **Component branches** where the motion carries meaning: the XP chip does not fly, it fades in above the source
84
+ (`useReducedMotion()`); count-ups set the final number at once; the level-up badge appears without rotating;
85
+ ambient pulses carry Tailwind's `motion-safe:` variant (`motion-safe:animate-glow-pulse`).
86
+
87
+ Under reduced motion the user still gets **every state change**: colours, icons, text, toasts and the level-up
88
+ dialog remain. Only travel, bounce and loops go.
89
+
90
+ Offer an in-app "Calm mode" switch as well if the audience includes people who cannot change OS settings (shared or
91
+ managed devices); it sets the same behaviour from a class on `<html>`.
92
+
93
+ ## 6. Colour contrast
94
+
95
+ Targets: WCAG 2.2 AA. Text 4.5:1 (large text >= 24 px or bold >= 18.66 px: 3:1); meaningful graphics, control
96
+ boundaries and focus indicators 3:1.
97
+
98
+ | Rule | Reason / number |
99
+ |---|---|
100
+ | Text on a neon fill is `text-on-neon` (`#05060A`) | 6.2-16.8:1. White on neon is 1.2-3.3:1 |
101
+ | `ink-muted` is the lightest colour for text that must be read | 5.3:1 on a card, 4.5:1 on `shade`. `ink-faint` (2.5:1) is for disabled and decoration |
102
+ | Coloured text uses `neon-ink-*` | Equals the neon on dark; 5.2-6.0:1 on white in the light theme, where raw neon is about 1.2:1 |
103
+ | Coloured text is not placed on `surface-3` in the light theme | The ink stops were measured on white (5.2-6.0:1); on the light `shade` they drop below 4.5:1 |
104
+ | Neon text on a 12 % tint of itself (chips) | iris 4.9, flare 5.6, coral 5.4: passes; do not raise the tint |
105
+ | Ring and arc colours on light come from the `-ink` stops | A lime arc on a pale track disappears |
106
+ | Disabled = `opacity-40 saturate-0` | Deliberately below contrast targets, and never the only cue: the control is also non-interactive and announced as disabled |
107
+ | No glow on body text | `text-shadow` blurs glyph edges; glow is for shapes |
108
+
109
+ Check both themes. The light theme is where neon designs fail: every review of a new page includes a light-theme
110
+ pass on the gallery and on the page.
111
+
112
+ ## 7. Colour is never the only signal
113
+
114
+ | State | Colour | Plus |
115
+ |---|---|---|
116
+ | Correct / wrong | lime / coral | check / cross icon, text |
117
+ | New / known / mastered | flare / aqua / gold | "NEW" tag / underline style / dot, and an `sr-only` suffix |
118
+ | Streak done / at risk / lapsed | ember / amber / grey | glow / short float / dimmed flame, and the label text |
119
+ | Quest active / complete / claimed | tone / gold / dimmed | reward chip / Claim button / "Claimed" + check |
120
+ | Locked | grey | lock badge, `aria-disabled`, hint |
121
+ | Active nav item | tone | a filled, ringed pill behind the icon (inactive tabs have none), `aria-current` (from the router's NavLink) |
122
+ | Error | coral | warning icon, `role="alert"` text |
123
+
124
+ ## 8. Targets and focus
125
+
126
+ - **44x44 px minimum** for every interactive element (WCAG 2.5.8 asks 24; 44 is the touch-comfortable size this
127
+ system uses). When the visual is smaller (36 px disc, 32 px chip, 36 px segmented option), extend the hit area
128
+ with a pseudo-element: `relative after:absolute after:-inset-1 after:content-['']`. Neighbouring extended areas
129
+ must not overlap.
130
+ - **Focus ring**: global `:focus-visible { outline: 2px solid rgb(var(--c-aqua-ink)); outline-offset: 2px }`.
131
+ Aqua is the focus colour everywhere (13.5:1 on dark; the ink stop on light); lime means selection, so the two are
132
+ never confused.
133
+ - Composite controls draw the ring on their visible part (`group-focus-visible:outline` on the round button's
134
+ disc, on the switch's track) and suppress it on the wrapper.
135
+ - Controls inside a clipped container use `focus-visible:outline-offset-0` (segmented options) or a negative
136
+ offset (menu items) so the ring is not cut off.
137
+ - Never `outline: none` without a replacement, and never rely on glow as the focus indicator.
138
+ - **Focus is never hidden under the bars**: `scroll-padding-top/bottom` on `html` from `--shell-top` /
139
+ `--shell-bottom` (WCAG 2.4.11).
140
+ - **Focus management**: dialogs trap and restore focus (LAYOUT-NAV.md §6); when a control removes itself
141
+ (Claim → Claimed, Delete), move focus to a stable neighbour or the section heading (`tabIndex={-1}`); a button that
142
+ turns disabled while focused stays focusable with `aria-disabled` (`focusableWhenDisabled`, COMPONENTS.md).
143
+ - **Keyboard**: radio groups and menus use arrow keys with roving `tabIndex`; Escape closes the top-most layer only;
144
+ a "Skip to content" link is first in the tab order.
145
+
146
+ ## 9. Screen readers
147
+
148
+ - Icons are `aria-hidden` unless they are the only content; then the **control** has `aria-label`.
149
+ - Composite HUD pieces are `role="img"` with a full sentence label ("12-day streak, done today"); their visible
150
+ digits are `aria-hidden` to avoid double reading.
151
+ - Progress: `role="progressbar"` with `aria-valuenow` and, where the raw number is not meaningful,
152
+ `aria-valuetext` ("Level 7: 120 of 500 XP").
153
+ - Animated numbers: an `sr-only` copy holds the final value; the animated one is `aria-hidden`.
154
+ - Live regions are mounted before they receive text (toasts, XP announcements). Small XP gains are announced politely
155
+ without a visual toast; errors are assertive.
156
+ - Celebration overlays are `aria-hidden` and `pointer-events-none`; the level-up is a real dialog with a heading.
157
+ - Loading: `aria-busy` on the region or button; skeletons are `aria-hidden`.
158
+
159
+ ## 10. Review checklist for a new screen
160
+
161
+ - [ ] 320 px wide: no horizontal scroll, labels fit, targets >= 44 px.
162
+ - [ ] Light theme: every coloured text and line readable; no raw neon text.
163
+ - [ ] Keyboard only: reach and operate everything; focus always visible; Escape closes layers in order.
164
+ - [ ] Reduced motion on: nothing travels or loops; every state still shown.
165
+ - [ ] Count the loops on screen at rest: two or fewer.
166
+ - [ ] Count the glows at rest: each one marks something active, current, or waiting.
167
+ - [ ] Each tone on the screen means what it means elsewhere.
168
+ - [ ] Loading and error states exist and keep the layout's boxes.