sisyo 1.7.0 → 1.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.
Files changed (61) hide show
  1. package/LICENSE +16 -16
  2. package/README.md +167 -166
  3. package/bin/known-hashes.json +6 -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 +19 -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 +242 -242
  57. package/templates/SISYO.md +37 -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,323 +1,323 @@
1
- # Tokens
2
-
3
- Every value of the neon game UI: what it is, what it is for, and how it reaches the markup. The numbers on this page
4
- are the system; type them into the project's own token file, theme config and base stylesheet. Do not approximate
5
- them: the contrast figures in `MOTION-A11Y.md` were measured on exactly these values.
6
-
7
- Names used here (`--c-*`, `surface-*`, `ink-*`, `neon-*`, `.neon-card`, `ease-glide`, ...) are the names the other
8
- guides refer to. A project may rename them, but then it renames them everywhere.
9
-
10
- ## 1. How the layers fit
11
-
12
- ```
13
- token file --c-lime: 184 255 61 RGB CHANNELS, one set per theme
14
- Tailwind theme neon.lime = rgb(var(--c-lime) / <alpha-value>)
15
- markup bg-neon-lime/10 ring-neon-lime/50 text-neon-ink-lime
16
- tone scope .tone-lime { --tone: var(--c-lime); --tone-ink: var(--c-lime-ink) }
17
- component shadow-[0_0_16px_rgb(var(--tone)/.28)] text-[rgb(var(--tone-ink))]
18
- ```
19
-
20
- Three files carry it:
21
-
22
- 1. **A token stylesheet**: CSS custom properties under `:root, [data-theme='dark']` (the default) and a second block
23
- under `[data-theme='light']` that overrides only what differs. Each block also sets `color-scheme` (`dark` /
24
- `light`); the icon gradients depend on it (ICONS.md §2).
25
- 2. **The Tailwind theme** (`theme.extend`, Tailwind 3.4): colours mapped from the variables, plus fonts, sizes, radii,
26
- shadows, gradients, keyframes, animations and easings from the tables below.
27
- `darkMode: ['class', '[data-theme="dark"]']`.
28
- 3. **A base stylesheet**: imports the tokens, then `@tailwind base / components / utilities`, base element rules (§12),
29
- the component classes (§10), the tone scopes (§5) and the reduced-motion block (MOTION-A11Y.md §5).
30
-
31
- **Why channels, not hex.** `--c-lime: #B8FF3D` would make `bg-neon-lime/10` impossible: Tailwind builds
32
- `rgb(var(--c-lime) / 0.1)`, and that only parses when the variable holds `184 255 61`. The whole look is built from
33
- low-alpha tints of a few hues (a 10 % face, a 45 % ring, a 22 % glow), so alpha on every colour is a hard
34
- requirement. With hex, every tint becomes a new hard-coded colour and the light theme can no longer override it.
35
-
36
- **Why namespaced colour names.** `surface-*`, `ink-*`, `neon-*`, `neon-ink-*`, `line` never collide with Tailwind's
37
- `slate` / `indigo` palette. An existing project can adopt the theme one page at a time while old pages keep working.
38
-
39
- Mapping into Tailwind, in full (a helper `c = (name) => 'rgb(var(--c-' + name + ') / <alpha-value>)'`):
40
-
41
- | Tailwind colour | Keys → variable |
42
- |---|---|
43
- | `surface` | `void` → `--c-void`, `base` → `--c-base`, `1` → `--c-surface`, `2` → `--c-raised`, `3` → `--c-shade` |
44
- | `line` | `DEFAULT` → `--c-line`, `strong` → `--c-line-strong` |
45
- | `ink` | `title` → `--c-title`, `DEFAULT` → `--c-body`, `soft` → `--c-soft`, `muted` → `--c-muted`, `faint` → `--c-faint` |
46
- | `neon` | `lime aqua iris flare amber ember gold coral info` → `--c-<name>` |
47
- | `neon-ink` | the same nine → `--c-<name>-ink` |
48
- | `on-neon` | the literal `#05060A` (not a variable: it is the same in both themes) |
49
-
50
- ## 2. Surfaces and lines
51
-
52
- | Variable | Tailwind | Dark (channels) | Light (channels) | Use |
53
- |---|---|---|---|---|
54
- | `--c-void` | `surface-void` | `#05060A` (5 6 10) | `#EEF1F8` (238 241 248) | App backdrop (`body`), modal scrims (`bg-surface-void/80`) |
55
- | `--c-base` | `surface-base` | `#0A0C14` (10 12 20) | `#F4F6FB` (244 246 251) | Top bar, side rail, bottom bar (used at 70-85 % + blur) |
56
- | `--c-surface` | `surface-1` | `#10131D` (16 19 29) | `#FFFFFF` (255 255 255) | Cards, pills, sheets |
57
- | `--c-raised` | `surface-2` | `#161A27` (22 26 39) | `#ECEFF7` (236 239 247) | Hover, popovers, inputs, dark button discs, toasts |
58
- | `--c-shade` | `surface-3` | `#1E2334` (30 35 52) | `#E2E7F1` (226 231 241) | Progress tracks, pressed, selected segment, skeletons |
59
- | `--c-line` | `line` | `#262C40` (38 44 64) | `#D9DEEA` (217 222 234) | Hairline borders, dividers |
60
- | `--c-line-strong` | `line-strong` | `#353D57` (53 61 87) | `#BEC6D8` (190 198 216) | Hover borders, locked rings, scrollbar thumb |
61
-
62
- The dark ladder is a cool blue-black, never neutral grey: neon hues look dirty on grey and clean on blue-black. Each
63
- step is only a few lightness points above the previous one; depth comes from the 1 px top highlight in `shadow-edge`,
64
- not from big brightness jumps.
65
-
66
- ## 3. Ink (text)
67
-
68
- | Variable | Tailwind | Dark | Light | Contrast on a dark card | Use |
69
- |---|---|---|---|---|---|
70
- | `--c-title` | `text-ink-title` | `#F4F7FF` (244 247 255) | `#0B0E17` (11 14 23) | 17.3:1 | Headings, values, active labels |
71
- | `--c-body` | `text-ink` | `#D5DAE8` (213 218 232) | `#262C3D` (38 44 61) | 13.3:1 | Body text (the `body` default) |
72
- | `--c-soft` | `text-ink-soft` | `#A3ACC4` (163 172 196) | `#4A5268` (74 82 104) | 8.2:1 | Secondary text, inactive navigation |
73
- | `--c-muted` | `text-ink-muted` | `#8089A6` (128 137 166) | `#5E6781` (94 103 129) | 5.3:1 | Meta text, captions, uppercase labels. **The floor for anything that must be read** (>= 4.5:1 on every dark layer, 4.50 on `shade`) |
74
- | `--c-faint` | `text-ink-faint` | `#4D5573` (77 85 115) | `#A3AABB` (163 170 187) | 2.5:1 | Disabled and decorative only. Never for information |
75
-
76
- ## 4. Neon tones: one job per hue
77
-
78
- The neon value is **the same in both themes**; only its `-ink` variant changes.
79
-
80
- | Tone | `--c-<tone>` (both themes) | `--c-<tone>-ink` on light | Neon on a dark card | Default job |
81
- |---|---|---|---|---|
82
- | lime | `#B8FF3D` (184 255 61) | `#3D7A00` (61 122 0) | 15.4:1 | Primary: XP, progress, correct, selected, primary CTA |
83
- | aqua | `#3DF5D8` (61 245 216) | `#00786A` (0 120 106) | 13.5:1 | Links, keyboard focus, "known / safe" state, secondary currency |
84
- | iris | `#8B7BFF` (139 123 255) | `#5A45EE` (90 69 238) | 5.6:1 | Level; "the system is thinking" |
85
- | flare | `#FF4FD8` (255 79 216) | `#B8129A` (184 18 154) | 6.5:1 | New, rare; "the system is speaking" |
86
- | amber | `#FFB23E` (255 178 62) | `#965400` (150 84 0) | 10.3:1 | Quests, "in progress", warnings, streak at risk |
87
- | ember | `#FF6A2B` (255 106 43) | `#C2410C` (194 65 12) | 6.5:1 | Streak |
88
- | gold | `#FFD65A` (255 214 90) | `#8A6200` (138 98 0) | 13.3:1 | Trophies, mastered, claimable rewards |
89
- | coral | `#FF5C7A` (255 92 122) | `#CC1A40` (204 26 64) | 6.2:1 | Wrong, danger, destructive |
90
- | info | `#5AA8FF` (90 168 255) | `#005EC7` (0 94 199) | 7.5:1 | Informational (no tone scope; used directly) |
91
-
92
- On dark, every `-ink` variable is an alias: `--c-lime-ink: var(--c-lime)`. The light block replaces the nine `-ink`
93
- values with the dark stops above and leaves the neon values untouched.
94
-
95
- Two more plain variables: `--on-neon: #05060A` (text and icons on any neon fill) and `--comet-head` (the bright head
96
- of the XP fill: `#fff` on dark, `rgb(var(--c-lime-ink))` on light).
97
-
98
- Re-assign the jobs for another product (a fitness app might give ember to "calories"), but keep the rule: **a hue
99
- means one thing everywhere**. When lime is both "correct" and "decorative divider", the user stops reading colour as a
100
- signal and the interface degrades into a rainbow.
101
-
102
- ### The two colour families: `neon-*` and `neon-ink-*`
103
-
104
- - `neon-*` (`bg-neon-lime`, `ring-neon-lime/50`, `shadow-[..rgb(var(--c-lime)/.4)]`): **fills, rings, glows, tints**.
105
- - `neon-ink-*` (`text-neon-ink-lime`, `rgb(var(--c-lime-ink))`): **coloured text and thin strokes**. On dark it equals
106
- the neon; on light it is the dark stop (5.2-6.0:1 on white).
107
-
108
- Rule: *if it is a glyph or a line under 3 px that carries meaning, use `-ink`.* Neon lime text on a white card is
109
- 1.2:1, invisible. This is the most common way the light theme breaks. The same applies to progress-ring arcs (their
110
- gradient is built from `-ink` variables), the XP fill (`bg-comet` uses `--c-lime-ink`), gradient text
111
- (`bg-flare-ink bg-clip-text text-transparent`), the fill of thin progress bars, and icon gradients (each stop has a
112
- light value, ICONS.md §2).
113
-
114
- Text **on** a neon fill always uses `text-on-neon` (`#05060A`, 6.2-16.8:1). White on neon is 1.2-3.3:1 and fails.
115
- The only tolerated exception is white bold text >= 24 px on iris.
116
-
117
- ## 5. Tone scopes: passing a colour to a component
118
-
119
- ```css
120
- .tone-lime { --tone: var(--c-lime); --tone-ink: var(--c-lime-ink); }
121
- /* aqua, iris, flare, amber, ember, gold, coral: the same pattern */
122
- .tone-mono { --tone: var(--c-soft); --tone-ink: var(--c-body); }
123
- ```
124
-
125
- A component takes a `tone` prop (`lime | aqua | iris | flare | amber | ember | gold | coral | mono`), adds
126
- `` `tone-${tone}` `` to its root and writes its styles once against `--tone` / `--tone-ink`:
127
-
128
- ```tsx
129
- <div className={cn('neon-card neon-glow', `tone-${tone}`)}>
130
- <span className="bg-[rgb(var(--tone)/.10)] ring-1 ring-inset ring-[rgb(var(--tone)/.25)]" />
131
- <span className="text-[rgb(var(--tone-ink))]">days</span>
132
- </div>
133
- ```
134
-
135
- Non-obvious details:
136
-
137
- - The `.tone-*` rules sit **outside any `@layer`** in the base stylesheet. The class name is built at runtime, so
138
- Tailwind's content scan never sees the full string; inside `@layer components` the rules would be purged from the
139
- production CSS and every toned component would render colourless (while still looking right in development).
140
- - For the same reason never build other class names by interpolation (`` `bg-neon-${tone}` `` is purged). Use the tone
141
- scope + arbitrary values, or a lookup table of complete class strings.
142
- - The scope cascades: a card with `tone-gold` tints every `rgb(var(--tone))` inside it. Set the scope on the smallest
143
- element that needs it.
144
- - Use `var(--tone, var(--c-lime))` when a component must also work without a scope (the hover glow of a card).
145
-
146
- ## 6. Typography
147
-
148
- | Family | Tailwind | Stack | Weights loaded | Use |
149
- |---|---|---|---|---|
150
- | Display | `font-display` | `"Chakra Petch", "Be Vietnam Pro", sans-serif` | 500 600 700 | Headings (`h1`-`h3` get it from the base rules), **all numbers**, uppercase labels, round-button captions, the CTA, tags |
151
- | Text | `font-sans` | `"Be Vietnam Pro", Inter, system-ui, sans-serif` | 400 500 600 700 | UI text, paragraphs, form fields |
152
- | Reading | `font-read` | `Lexend, "Be Vietnam Pro", sans-serif` | 400 500 | Long passages the user reads for minutes: 18 px / 1.75, max 68ch |
153
- | Mono | `font-mono` | `"JetBrains Mono", ui-monospace, monospace` | 500 | Versions, tokens, gallery captions |
154
-
155
- Load the four families with one stylesheet link and `display=swap`, after `preconnect` hints to the font host. All
156
- four cover Vietnamese. If the product needs another script (Japanese, Korean, Arabic), replace **the text font** with
157
- one that covers it and keep Chakra Petch for digits and Latin labels only; a squared display font with fallback
158
- glyphs for half the characters looks broken.
159
-
160
- Scale used by the components:
161
-
162
- | Role | Classes |
163
- |---|---|
164
- | Stat value | `font-display text-3xl font-bold leading-none tabular-nums text-ink-title` |
165
- | Page / card title | `text-xl sm:text-2xl font-bold` (h2), `text-base font-semibold` (card header) |
166
- | Uppercase label | `font-display text-2xs font-semibold uppercase tracking-[.14em] text-ink-muted` |
167
- | Round button caption | `font-display text-xs font-semibold uppercase tracking-[.08em]` (the quest Claim keycap uses the same style in bold). Text buttons do **not** use it: COMPONENTS.md, NeonButton |
168
- | HUD number | `font-display text-[11px] font-semibold tracking-[.04em] tabular-nums` |
169
- | Body | `text-sm` / `text-[15px]`, line-height 1.5 |
170
- | Meta | `text-xs text-ink-muted` |
171
-
172
- Two sizes are added to Tailwind's scale: `text-2xs` = 0.625 rem (10 px) with line-height 0.875 rem, and `text-3xs` =
173
- 0.5625 rem (9 px) with line-height 0.75 rem (labels inside badges only).
174
-
175
- Numbers that change always carry `tabular-nums`, or the HUD jitters as digits change width.
176
-
177
- ## 7. Radii and shape
178
-
179
- | Shape | Value | Use |
180
- |---|---|---|
181
- | `rounded-full` | circle / pill | Round buttons, chips, pills, tracks, segmented control |
182
- | `rounded-xl` | 12 px | Small controls (`sm` buttons, icon tiles, toast action) |
183
- | `rounded-2xl` | 16 px | Buttons `md` / `lg`, navigation items, toasts |
184
- | `rounded-3xl` | 24 px | Cards (`.neon-card`), popovers |
185
- | `rounded-4xl` | 28 px (`1.75rem`, added to the theme) | Sheets, the login panel |
186
- | `.hex` | `clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%)` | Level badge, achievement medals, quest and empty-state tiles |
187
-
188
- The hexagon is pointy-top with width : height about 0.87: 28x32, 34x38, 40x44, 56x64, 140x160 px are the sizes in use.
189
-
190
- `clip-path` clips `box-shadow`, so a hexagon **glows with `filter: drop-shadow(...)` on a wrapper element**, and its
191
- **border is a second, smaller hexagon**: the outer hex is painted in the border colour, an inner `.hex` inset by
192
- 1.5 px is painted in the face colour.
193
-
194
- ## 8. Shadows and glows
195
-
196
- | Token | Value | Use |
197
- |---|---|---|
198
- | `shadow-edge` (`--shadow-edge`) | dark: `inset 0 1px 0 rgb(255 255 255/.06), 0 24px 60px rgb(0 0 0/.35)`; light: `inset 0 1px 0 rgb(255 255 255/.9), 0 1px 2px rgb(16 24 40/.06), 0 12px 32px rgb(16 24 40/.08)` | Every card and popover: top highlight + depth |
199
- | `shadow-glow-sm` | `0 0 10px rgb(lime/.25)` | Small lime tags |
200
- | `shadow-glow` | `0 0 18px rgb(lime/.40)` | XP fill, selected chip, XP chip |
201
- | `shadow-glow-lg` | `0 0 28px 2px rgb(lime/.40), 0 8px 30px rgb(lime/.25)` | Hero CTA only |
202
- | `shadow-glow-<tone>` | `0 0 18px rgb(tone/α)`: aqua .40, iris .45, flare .40, amber .45, ember .50, gold .45, coral .45 | The same glow in another tone |
203
- | `shadow-ring-lime` | `inset 0 0 0 1.5px rgb(lime/.85)` | Selected outline |
204
- | `shadow-keycap` | `inset 0 1px 0 rgb(255 255 255/.10), 0 4px 0 rgb(0 0 0/.45)` | Dark keycap button: a 4 px solid "depth" under it |
205
- | `shadow-keycap-lime` | `inset 0 1px 0 rgb(255 255 255/.6), 0 4px 0 #3F6E00, 0 0 22px rgb(lime/.45)` | Lime keycap: dark-lime depth + glow |
206
- | `shadow-pressed` | `inset 0 1px 0 rgb(255 255 255/.10), 0 1px 0 rgb(0 0 0/.45)` | Pressed keycap: depth collapses to 1 px while the face moves down 3 px |
207
-
208
- (`rgb(lime/α)` stands for `rgb(var(--c-lime) / α)`.)
209
-
210
- Neon ring recipe of the round button (`neon` variant; per tone, via the scope):
211
- `inset 0 0 0 1.5px rgb(var(--tone)/.75), 0 0 16px rgb(var(--tone)/.28), 0 4px 0 rgb(0 0 0/.45)`. A ring is an **inset
212
- box-shadow**, not a border: it does not change the element's size and it can share one `box-shadow` list with the glow
213
- and the depth, so all three transition together.
214
-
215
- Navigation items use the same technique with their own values and **no depth shadow** (they are flat, not keycaps):
216
- the rail item and the bottom-bar pill are given in LAYOUT-NAV.md §3 and §4.
217
-
218
- Glow budget: a glow is a **signal** (active, current, claimable, just rewarded). A screen at rest shows the glow of
219
- the active navigation item, the XP fill, the current step, and nothing else. Never put a glow on body text
220
- (`text-shadow` blurs glyph edges and lowers legibility) and never on every card.
221
-
222
- ## 9. Gradients (`backgroundImage`)
223
-
224
- | Class | Value | Use |
225
- |---|---|---|
226
- | `bg-flare` | `linear-gradient(120deg, lime 0%, aqua 38%, iris 72%, flare 100%)` | The brand spectrum: rare tier, brand marks |
227
- | `bg-flare-ink` | the same from the four `-ink` variables | Gradient **text** (`bg-clip-text text-transparent`), readable on light |
228
- | `bg-cta` | `linear-gradient(150deg, #E6FF9C 0%, lime 40%, aqua 100%)` | Primary CTA face; with `bg-[length:200%_200%] animate-flow` it drifts |
229
- | `bg-lime-face` | `linear-gradient(160deg, #E6FF9C, lime 55%, #7EE000)` | Lime keycap discs, "done" nodes |
230
- | `bg-iris` | `linear-gradient(135deg, iris, flare)` | Level badge |
231
- | `bg-ember` | `linear-gradient(180deg, #FFE27A, #FF9B3D 55%, #FF4D3D)` | Flame fills |
232
- | `bg-gold` | `linear-gradient(160deg, #FFF2B0, gold 50%, #E0A21F)` | Claim button, gold tier |
233
- | `bg-comet` | `linear-gradient(90deg, rgb(lime-ink/.15), rgb(lime-ink) 82%, var(--comet-head))` | XP fill: a tail that brightens to a white head (a lime-ink head on light, where a white head vanishes on the pale track) |
234
- | `bg-sheen` | `linear-gradient(118deg, transparent 30%, rgb(255 255 255/.14) 50%, transparent 70%)` | Skeleton and reward sheen, moved by `animate-shimmer` |
235
- | `bg-glass` | `linear-gradient(rgb(255 255 255/.03), rgb(255 255 255/.01))` | Card face (part of `.neon-card`) |
236
- | `bg-grid` | two 1 px `line` gradients, one `to right`, one `to bottom` (`rgb(line) 1px, transparent 1px`) | Backdrop grid, sized `48px 48px` |
237
- | `bg-backdrop` | `var(--neon-backdrop)` | The static "bokeh" lights below |
238
-
239
- `--neon-backdrop`, dark: three radial gradients, each fading to transparent at 70 %:
240
- `ellipse 80% 55% at 50% -8%` lime at 10 %, `600px 380px at 92% 12%` iris at 10 %, `520px 360px at 6% 88%` aqua at 7 %.
241
- Light: only the first one, lime at 18 %.
242
-
243
- Tier faces that are not theme tokens: bronze `linear-gradient(160deg, #E0A070, #9A5B2E)`, silver
244
- `linear-gradient(160deg, #E6ECF5, #9AA6BD)`.
245
-
246
- ## 10. Component classes (base stylesheet)
247
-
248
- | Class | Definition |
249
- |---|---|
250
- | `.neon-backdrop` | `pointer-events: none; position: fixed; inset: 0; z-index: -10; background: var(--neon-backdrop)`. Its `::after` covers it with `bg-grid` at `48px 48px`, opacity .3, masked by `linear-gradient(#000, transparent 70%)` so the grid fades out downwards. Render **once**, in the shell. It is a static gradient: no blur filter, no animation, so it costs nothing while scrolling |
251
- | `.neon-card` | `position: relative; border-radius: 24px; border: 1px solid line; background: surface-1 + bg-glass; box-shadow: shadow-edge` |
252
- | `.neon-glow` | Replaces the card's background image with `radial-gradient(240px 150px at 100% 0%, rgb(var(--tone)/.14), transparent 70%)` over the glass gradient: a tinted top-right corner. Needs a `.tone-*` scope |
253
- | `.neon-sweep` | A rotating spectral ring drawn 3 px outside the element. The element gets `position: relative; isolation: isolate`; its `::before` has `inset: -3px; padding: 3px; border-radius: inherit; pointer-events: none`, a `conic-gradient(from var(--neon-angle), lime, aqua, iris, rgb(lime/.15) 70%, lime)` background, and a two-layer mask (`linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)` composited with `exclude` / `-webkit-mask-composite: xor`) that leaves only the 3 px padding band visible. `animation: neon-spin 6s linear infinite`, whose only keyframe is `to { --neon-angle: 360deg }` |
254
- | `.hex` | The hexagon clip-path (§7) |
255
-
256
- `--neon-angle` must be registered, or the browser cannot interpolate it and the ring jumps instead of turning:
257
-
258
- ```css
259
- @property --neon-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
260
- ```
261
-
262
- The component classes go in `@layer components`; they are written out in markup, so Tailwind keeps them.
263
-
264
- ## 11. Motion tokens
265
-
266
- | Token | Value | Use |
267
- |---|---|---|
268
- | `ease-glide` / `--ease-glide` | `cubic-bezier(.22, 1, .36, 1)` | Everything that enters or moves |
269
- | `ease-pop` / `--ease-pop` | `cubic-bezier(.34, 1.56, .64, 1)` | Rewards only (overshoot) |
270
- | `--ease-std` | `cubic-bezier(.4, 0, .2, 1)` | Plain colour fades |
271
-
272
- `ease-glide` and `ease-pop` are added to Tailwind's `transitionTimingFunction`. Which easing and duration goes with
273
- which kind of change: `MOTION-A11Y.md` §1.
274
-
275
- | Animation class | Keyframes | Timing |
276
- |---|---|---|
277
- | `animate-glow-pulse` | opacity .5 ↔ 1, scale 1 ↔ 1.1 | 2.4 s ease-in-out infinite. Halo behind an active toggle or a claimable button: on a blurred sibling, never on the control |
278
- | `animate-float` | translateY 0 ↔ -4 px | 2.4 s ease-in-out infinite |
279
- | `animate-float-3` | the same keyframes | 2.4 s, **3 iterations**, then rest. "START" tag, at-risk flame |
280
- | `animate-shimmer` | translateX -120 % → 260 % | 2.2 s glide, infinite. Skeleton sheen, a reward waiting to be claimed |
281
- | `animate-shimmer-once` | the same keyframes | 1.6 s glide, delay .4 s, `both`, once. One sweep per XP change |
282
- | `animate-flow` | background-position `0% 0%` ↔ `100% 100%` | 5 s ease-in-out infinite. CTA gradient drift |
283
- | `animate-pop-in` | 0 %: opacity 0, scale .6 → 60 %: opacity 1, scale 1.08 → 100 %: scale 1 | .45 s `ease-pop`, `both`. Check marks, new badges, ready chest |
284
- | `animate-xp-burst` | 0 %: opacity 0, `translate(0,0) scale(.3)` → 15 %: opacity 1 → 100 %: opacity 0, `translate(var(--dx, 0px), var(--dy, -48px)) scale(1)` | .6 s glide, `forwards`. Burst dots; set `--dx` / `--dy` inline per dot |
285
- | `animate-iris-open` | opacity 0, `rotate(-60deg) scale(.4)` → opacity 1, `rotate(0) scale(1)` | .7 s glide, `both`. Level-up badge |
286
- | `animate-orb-breathe` | scale .97 ↔ 1.03, brightness 1 ↔ 1.15 | 4 s ease-in-out infinite. An idle "live" orb |
287
- | `animate-ripple` | scale .85 → 1.45, opacity .8 → 0 | 2.4 s glide, infinite. Rings around a live source (speaking, recording) |
288
-
289
- When each may run, and the loop budget: `MOTION-A11Y.md` §4.
290
-
291
- ## 12. Base element rules
292
-
293
- | Rule | Value | Why |
294
- |---|---|---|
295
- | Shell variables on `:root` | `--shell-top: calc(3.5rem + 1px)`; `--shell-bottom: calc(4rem + env(safe-area-inset-bottom))`, and `0px` from 1024 px | The heights of the sticky top bar and the fixed bottom bar; see LAYOUT-NAV.md §1 |
296
- | `html` | `-webkit-tap-highlight-color: transparent`; `text-size-adjust: 100%`; `scroll-padding-top: calc(var(--shell-top) + .5rem)`; `scroll-padding-bottom: calc(var(--shell-bottom) + var(--page-bar, 0px) + .5rem)` | Focus and anchor scrolling stop clear of the bars |
297
- | `body` | `min-height: 100vh` (`min-h-screen`), `bg-surface-void`, `font-sans`, `text-ink`, antialiased, line-height 1.5 | |
298
- | `h1, h2, h3` | `font-display`, `text-ink-title`, `text-wrap: balance` | |
299
- | `a` | `color: rgb(var(--c-aqua-ink))` | Aqua = links |
300
- | `:focus-visible` | `outline: 2px solid rgb(var(--c-aqua-ink)); outline-offset: 2px` | One focus colour everywhere |
301
- | `::selection` | background `rgb(var(--c-lime) / .3)`, colour `rgb(var(--c-title))` | |
302
- | Scrollbars | `scrollbar-width: thin`; `scrollbar-color: rgb(var(--c-line-strong)) transparent`; WebKit: 8 px, transparent track, `line-strong` thumb with a 2 px transparent border and 8 px radius, `muted` on hover | A default light scrollbar is a white stripe on the dark canvas |
303
-
304
- ### Theme switch without a flash
305
-
306
- - `<html lang data-theme="dark" class="dark">` in the static HTML; dark is the default.
307
- - An **inline script in `<head>`**, before any stylesheet or bundle: read `localStorage.theme` inside try/catch; if it
308
- is `light`, set `data-theme="light"`, remove the `dark` class and set the `theme-color` meta to `#EEF1F8`. Because
309
- it runs before first paint, a returning light-theme user never sees a dark frame.
310
- - Meta tags: `viewport` with `viewport-fit=cover` (safe-area insets), `theme-color` `#05060A`, `color-scheme`
311
- `dark light`.
312
- - At runtime the DOM attribute is the source of truth (COMPONENTS.md, hooks).
313
-
314
- ## 13. Changing the palette for another brand
315
-
316
- 1. Keep the structure: 7 surfaces, 5 inks, 8 tones + info, each tone with an `-ink`.
317
- 2. Pick the new primary and put it in lime's **role**. If the variable is renamed, rename it everywhere: the theme
318
- mapping, the base stylesheet, the icon gradient table, and the hard-coded keycap colours that belong to lime
319
- (`#3F6E00` depth, `#7EE000` and `#E6FF9C` face stops; gold's Claim button uses `#8A6200` as its depth).
320
- 3. For every tone compute contrast: the neon on `#10131D` >= 4.5:1 for text use; `--on-neon` on the neon >= 4.5:1; the
321
- `-ink` stop on `#FFFFFF` >= 4.5:1 and on the light `--c-raised` >= 4.5:1.
322
- 4. Update the icon gradients (3 stops per tone, a dark and a light colour each, plus the glow channels: ICONS.md §2).
323
- 5. Open the gallery page in both themes before touching any product page.
1
+ # Tokens
2
+
3
+ Every value of the neon game UI: what it is, what it is for, and how it reaches the markup. The numbers on this page
4
+ are the system; type them into the project's own token file, theme config and base stylesheet. Do not approximate
5
+ them: the contrast figures in `MOTION-A11Y.md` were measured on exactly these values.
6
+
7
+ Names used here (`--c-*`, `surface-*`, `ink-*`, `neon-*`, `.neon-card`, `ease-glide`, ...) are the names the other
8
+ guides refer to. A project may rename them, but then it renames them everywhere.
9
+
10
+ ## 1. How the layers fit
11
+
12
+ ```
13
+ token file --c-lime: 184 255 61 RGB CHANNELS, one set per theme
14
+ Tailwind theme neon.lime = rgb(var(--c-lime) / <alpha-value>)
15
+ markup bg-neon-lime/10 ring-neon-lime/50 text-neon-ink-lime
16
+ tone scope .tone-lime { --tone: var(--c-lime); --tone-ink: var(--c-lime-ink) }
17
+ component shadow-[0_0_16px_rgb(var(--tone)/.28)] text-[rgb(var(--tone-ink))]
18
+ ```
19
+
20
+ Three files carry it:
21
+
22
+ 1. **A token stylesheet**: CSS custom properties under `:root, [data-theme='dark']` (the default) and a second block
23
+ under `[data-theme='light']` that overrides only what differs. Each block also sets `color-scheme` (`dark` /
24
+ `light`); the icon gradients depend on it (ICONS.md §2).
25
+ 2. **The Tailwind theme** (`theme.extend`, Tailwind 3.4): colours mapped from the variables, plus fonts, sizes, radii,
26
+ shadows, gradients, keyframes, animations and easings from the tables below.
27
+ `darkMode: ['class', '[data-theme="dark"]']`.
28
+ 3. **A base stylesheet**: imports the tokens, then `@tailwind base / components / utilities`, base element rules (§12),
29
+ the component classes (§10), the tone scopes (§5) and the reduced-motion block (MOTION-A11Y.md §5).
30
+
31
+ **Why channels, not hex.** `--c-lime: #B8FF3D` would make `bg-neon-lime/10` impossible: Tailwind builds
32
+ `rgb(var(--c-lime) / 0.1)`, and that only parses when the variable holds `184 255 61`. The whole look is built from
33
+ low-alpha tints of a few hues (a 10 % face, a 45 % ring, a 22 % glow), so alpha on every colour is a hard
34
+ requirement. With hex, every tint becomes a new hard-coded colour and the light theme can no longer override it.
35
+
36
+ **Why namespaced colour names.** `surface-*`, `ink-*`, `neon-*`, `neon-ink-*`, `line` never collide with Tailwind's
37
+ `slate` / `indigo` palette. An existing project can adopt the theme one page at a time while old pages keep working.
38
+
39
+ Mapping into Tailwind, in full (a helper `c = (name) => 'rgb(var(--c-' + name + ') / <alpha-value>)'`):
40
+
41
+ | Tailwind colour | Keys → variable |
42
+ |---|---|
43
+ | `surface` | `void` → `--c-void`, `base` → `--c-base`, `1` → `--c-surface`, `2` → `--c-raised`, `3` → `--c-shade` |
44
+ | `line` | `DEFAULT` → `--c-line`, `strong` → `--c-line-strong` |
45
+ | `ink` | `title` → `--c-title`, `DEFAULT` → `--c-body`, `soft` → `--c-soft`, `muted` → `--c-muted`, `faint` → `--c-faint` |
46
+ | `neon` | `lime aqua iris flare amber ember gold coral info` → `--c-<name>` |
47
+ | `neon-ink` | the same nine → `--c-<name>-ink` |
48
+ | `on-neon` | the literal `#05060A` (not a variable: it is the same in both themes) |
49
+
50
+ ## 2. Surfaces and lines
51
+
52
+ | Variable | Tailwind | Dark (channels) | Light (channels) | Use |
53
+ |---|---|---|---|---|
54
+ | `--c-void` | `surface-void` | `#05060A` (5 6 10) | `#EEF1F8` (238 241 248) | App backdrop (`body`), modal scrims (`bg-surface-void/80`) |
55
+ | `--c-base` | `surface-base` | `#0A0C14` (10 12 20) | `#F4F6FB` (244 246 251) | Top bar, side rail, bottom bar (used at 70-85 % + blur) |
56
+ | `--c-surface` | `surface-1` | `#10131D` (16 19 29) | `#FFFFFF` (255 255 255) | Cards, pills, sheets |
57
+ | `--c-raised` | `surface-2` | `#161A27` (22 26 39) | `#ECEFF7` (236 239 247) | Hover, popovers, inputs, dark button discs, toasts |
58
+ | `--c-shade` | `surface-3` | `#1E2334` (30 35 52) | `#E2E7F1` (226 231 241) | Progress tracks, pressed, selected segment, skeletons |
59
+ | `--c-line` | `line` | `#262C40` (38 44 64) | `#D9DEEA` (217 222 234) | Hairline borders, dividers |
60
+ | `--c-line-strong` | `line-strong` | `#353D57` (53 61 87) | `#BEC6D8` (190 198 216) | Hover borders, locked rings, scrollbar thumb |
61
+
62
+ The dark ladder is a cool blue-black, never neutral grey: neon hues look dirty on grey and clean on blue-black. Each
63
+ step is only a few lightness points above the previous one; depth comes from the 1 px top highlight in `shadow-edge`,
64
+ not from big brightness jumps.
65
+
66
+ ## 3. Ink (text)
67
+
68
+ | Variable | Tailwind | Dark | Light | Contrast on a dark card | Use |
69
+ |---|---|---|---|---|---|
70
+ | `--c-title` | `text-ink-title` | `#F4F7FF` (244 247 255) | `#0B0E17` (11 14 23) | 17.3:1 | Headings, values, active labels |
71
+ | `--c-body` | `text-ink` | `#D5DAE8` (213 218 232) | `#262C3D` (38 44 61) | 13.3:1 | Body text (the `body` default) |
72
+ | `--c-soft` | `text-ink-soft` | `#A3ACC4` (163 172 196) | `#4A5268` (74 82 104) | 8.2:1 | Secondary text, inactive navigation |
73
+ | `--c-muted` | `text-ink-muted` | `#8089A6` (128 137 166) | `#5E6781` (94 103 129) | 5.3:1 | Meta text, captions, uppercase labels. **The floor for anything that must be read** (>= 4.5:1 on every dark layer, 4.50 on `shade`) |
74
+ | `--c-faint` | `text-ink-faint` | `#4D5573` (77 85 115) | `#A3AABB` (163 170 187) | 2.5:1 | Disabled and decorative only. Never for information |
75
+
76
+ ## 4. Neon tones: one job per hue
77
+
78
+ The neon value is **the same in both themes**; only its `-ink` variant changes.
79
+
80
+ | Tone | `--c-<tone>` (both themes) | `--c-<tone>-ink` on light | Neon on a dark card | Default job |
81
+ |---|---|---|---|---|
82
+ | lime | `#B8FF3D` (184 255 61) | `#3D7A00` (61 122 0) | 15.4:1 | Primary: XP, progress, correct, selected, primary CTA |
83
+ | aqua | `#3DF5D8` (61 245 216) | `#00786A` (0 120 106) | 13.5:1 | Links, keyboard focus, "known / safe" state, secondary currency |
84
+ | iris | `#8B7BFF` (139 123 255) | `#5A45EE` (90 69 238) | 5.6:1 | Level; "the system is thinking" |
85
+ | flare | `#FF4FD8` (255 79 216) | `#B8129A` (184 18 154) | 6.5:1 | New, rare; "the system is speaking" |
86
+ | amber | `#FFB23E` (255 178 62) | `#965400` (150 84 0) | 10.3:1 | Quests, "in progress", warnings, streak at risk |
87
+ | ember | `#FF6A2B` (255 106 43) | `#C2410C` (194 65 12) | 6.5:1 | Streak |
88
+ | gold | `#FFD65A` (255 214 90) | `#8A6200` (138 98 0) | 13.3:1 | Trophies, mastered, claimable rewards |
89
+ | coral | `#FF5C7A` (255 92 122) | `#CC1A40` (204 26 64) | 6.2:1 | Wrong, danger, destructive |
90
+ | info | `#5AA8FF` (90 168 255) | `#005EC7` (0 94 199) | 7.5:1 | Informational (no tone scope; used directly) |
91
+
92
+ On dark, every `-ink` variable is an alias: `--c-lime-ink: var(--c-lime)`. The light block replaces the nine `-ink`
93
+ values with the dark stops above and leaves the neon values untouched.
94
+
95
+ Two more plain variables: `--on-neon: #05060A` (text and icons on any neon fill) and `--comet-head` (the bright head
96
+ of the XP fill: `#fff` on dark, `rgb(var(--c-lime-ink))` on light).
97
+
98
+ Re-assign the jobs for another product (a fitness app might give ember to "calories"), but keep the rule: **a hue
99
+ means one thing everywhere**. When lime is both "correct" and "decorative divider", the user stops reading colour as a
100
+ signal and the interface degrades into a rainbow.
101
+
102
+ ### The two colour families: `neon-*` and `neon-ink-*`
103
+
104
+ - `neon-*` (`bg-neon-lime`, `ring-neon-lime/50`, `shadow-[..rgb(var(--c-lime)/.4)]`): **fills, rings, glows, tints**.
105
+ - `neon-ink-*` (`text-neon-ink-lime`, `rgb(var(--c-lime-ink))`): **coloured text and thin strokes**. On dark it equals
106
+ the neon; on light it is the dark stop (5.2-6.0:1 on white).
107
+
108
+ Rule: *if it is a glyph or a line under 3 px that carries meaning, use `-ink`.* Neon lime text on a white card is
109
+ 1.2:1, invisible. This is the most common way the light theme breaks. The same applies to progress-ring arcs (their
110
+ gradient is built from `-ink` variables), the XP fill (`bg-comet` uses `--c-lime-ink`), gradient text
111
+ (`bg-flare-ink bg-clip-text text-transparent`), the fill of thin progress bars, and icon gradients (each stop has a
112
+ light value, ICONS.md §2).
113
+
114
+ Text **on** a neon fill always uses `text-on-neon` (`#05060A`, 6.2-16.8:1). White on neon is 1.2-3.3:1 and fails.
115
+ The only tolerated exception is white bold text >= 24 px on iris.
116
+
117
+ ## 5. Tone scopes: passing a colour to a component
118
+
119
+ ```css
120
+ .tone-lime { --tone: var(--c-lime); --tone-ink: var(--c-lime-ink); }
121
+ /* aqua, iris, flare, amber, ember, gold, coral: the same pattern */
122
+ .tone-mono { --tone: var(--c-soft); --tone-ink: var(--c-body); }
123
+ ```
124
+
125
+ A component takes a `tone` prop (`lime | aqua | iris | flare | amber | ember | gold | coral | mono`), adds
126
+ `` `tone-${tone}` `` to its root and writes its styles once against `--tone` / `--tone-ink`:
127
+
128
+ ```tsx
129
+ <div className={cn('neon-card neon-glow', `tone-${tone}`)}>
130
+ <span className="bg-[rgb(var(--tone)/.10)] ring-1 ring-inset ring-[rgb(var(--tone)/.25)]" />
131
+ <span className="text-[rgb(var(--tone-ink))]">days</span>
132
+ </div>
133
+ ```
134
+
135
+ Non-obvious details:
136
+
137
+ - The `.tone-*` rules sit **outside any `@layer`** in the base stylesheet. The class name is built at runtime, so
138
+ Tailwind's content scan never sees the full string; inside `@layer components` the rules would be purged from the
139
+ production CSS and every toned component would render colourless (while still looking right in development).
140
+ - For the same reason never build other class names by interpolation (`` `bg-neon-${tone}` `` is purged). Use the tone
141
+ scope + arbitrary values, or a lookup table of complete class strings.
142
+ - The scope cascades: a card with `tone-gold` tints every `rgb(var(--tone))` inside it. Set the scope on the smallest
143
+ element that needs it.
144
+ - Use `var(--tone, var(--c-lime))` when a component must also work without a scope (the hover glow of a card).
145
+
146
+ ## 6. Typography
147
+
148
+ | Family | Tailwind | Stack | Weights loaded | Use |
149
+ |---|---|---|---|---|
150
+ | Display | `font-display` | `"Chakra Petch", "Be Vietnam Pro", sans-serif` | 500 600 700 | Headings (`h1`-`h3` get it from the base rules), **all numbers**, uppercase labels, round-button captions, the CTA, tags |
151
+ | Text | `font-sans` | `"Be Vietnam Pro", Inter, system-ui, sans-serif` | 400 500 600 700 | UI text, paragraphs, form fields |
152
+ | Reading | `font-read` | `Lexend, "Be Vietnam Pro", sans-serif` | 400 500 | Long passages the user reads for minutes: 18 px / 1.75, max 68ch |
153
+ | Mono | `font-mono` | `"JetBrains Mono", ui-monospace, monospace` | 500 | Versions, tokens, gallery captions |
154
+
155
+ Load the four families with one stylesheet link and `display=swap`, after `preconnect` hints to the font host. All
156
+ four cover Vietnamese. If the product needs another script (Japanese, Korean, Arabic), replace **the text font** with
157
+ one that covers it and keep Chakra Petch for digits and Latin labels only; a squared display font with fallback
158
+ glyphs for half the characters looks broken.
159
+
160
+ Scale used by the components:
161
+
162
+ | Role | Classes |
163
+ |---|---|
164
+ | Stat value | `font-display text-3xl font-bold leading-none tabular-nums text-ink-title` |
165
+ | Page / card title | `text-xl sm:text-2xl font-bold` (h2), `text-base font-semibold` (card header) |
166
+ | Uppercase label | `font-display text-2xs font-semibold uppercase tracking-[.14em] text-ink-muted` |
167
+ | Round button caption | `font-display text-xs font-semibold uppercase tracking-[.08em]` (the quest Claim keycap uses the same style in bold). Text buttons do **not** use it: COMPONENTS.md, NeonButton |
168
+ | HUD number | `font-display text-[11px] font-semibold tracking-[.04em] tabular-nums` |
169
+ | Body | `text-sm` / `text-[15px]`, line-height 1.5 |
170
+ | Meta | `text-xs text-ink-muted` |
171
+
172
+ Two sizes are added to Tailwind's scale: `text-2xs` = 0.625 rem (10 px) with line-height 0.875 rem, and `text-3xs` =
173
+ 0.5625 rem (9 px) with line-height 0.75 rem (labels inside badges only).
174
+
175
+ Numbers that change always carry `tabular-nums`, or the HUD jitters as digits change width.
176
+
177
+ ## 7. Radii and shape
178
+
179
+ | Shape | Value | Use |
180
+ |---|---|---|
181
+ | `rounded-full` | circle / pill | Round buttons, chips, pills, tracks, segmented control |
182
+ | `rounded-xl` | 12 px | Small controls (`sm` buttons, icon tiles, toast action) |
183
+ | `rounded-2xl` | 16 px | Buttons `md` / `lg`, navigation items, toasts |
184
+ | `rounded-3xl` | 24 px | Cards (`.neon-card`), popovers |
185
+ | `rounded-4xl` | 28 px (`1.75rem`, added to the theme) | Sheets, the login panel |
186
+ | `.hex` | `clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%)` | Level badge, achievement medals, quest and empty-state tiles |
187
+
188
+ The hexagon is pointy-top with width : height about 0.87: 28x32, 34x38, 40x44, 56x64, 140x160 px are the sizes in use.
189
+
190
+ `clip-path` clips `box-shadow`, so a hexagon **glows with `filter: drop-shadow(...)` on a wrapper element**, and its
191
+ **border is a second, smaller hexagon**: the outer hex is painted in the border colour, an inner `.hex` inset by
192
+ 1.5 px is painted in the face colour.
193
+
194
+ ## 8. Shadows and glows
195
+
196
+ | Token | Value | Use |
197
+ |---|---|---|
198
+ | `shadow-edge` (`--shadow-edge`) | dark: `inset 0 1px 0 rgb(255 255 255/.06), 0 24px 60px rgb(0 0 0/.35)`; light: `inset 0 1px 0 rgb(255 255 255/.9), 0 1px 2px rgb(16 24 40/.06), 0 12px 32px rgb(16 24 40/.08)` | Every card and popover: top highlight + depth |
199
+ | `shadow-glow-sm` | `0 0 10px rgb(lime/.25)` | Small lime tags |
200
+ | `shadow-glow` | `0 0 18px rgb(lime/.40)` | XP fill, selected chip, XP chip |
201
+ | `shadow-glow-lg` | `0 0 28px 2px rgb(lime/.40), 0 8px 30px rgb(lime/.25)` | Hero CTA only |
202
+ | `shadow-glow-<tone>` | `0 0 18px rgb(tone/α)`: aqua .40, iris .45, flare .40, amber .45, ember .50, gold .45, coral .45 | The same glow in another tone |
203
+ | `shadow-ring-lime` | `inset 0 0 0 1.5px rgb(lime/.85)` | Selected outline |
204
+ | `shadow-keycap` | `inset 0 1px 0 rgb(255 255 255/.10), 0 4px 0 rgb(0 0 0/.45)` | Dark keycap button: a 4 px solid "depth" under it |
205
+ | `shadow-keycap-lime` | `inset 0 1px 0 rgb(255 255 255/.6), 0 4px 0 #3F6E00, 0 0 22px rgb(lime/.45)` | Lime keycap: dark-lime depth + glow |
206
+ | `shadow-pressed` | `inset 0 1px 0 rgb(255 255 255/.10), 0 1px 0 rgb(0 0 0/.45)` | Pressed keycap: depth collapses to 1 px while the face moves down 3 px |
207
+
208
+ (`rgb(lime/α)` stands for `rgb(var(--c-lime) / α)`.)
209
+
210
+ Neon ring recipe of the round button (`neon` variant; per tone, via the scope):
211
+ `inset 0 0 0 1.5px rgb(var(--tone)/.75), 0 0 16px rgb(var(--tone)/.28), 0 4px 0 rgb(0 0 0/.45)`. A ring is an **inset
212
+ box-shadow**, not a border: it does not change the element's size and it can share one `box-shadow` list with the glow
213
+ and the depth, so all three transition together.
214
+
215
+ Navigation items use the same technique with their own values and **no depth shadow** (they are flat, not keycaps):
216
+ the rail item and the bottom-bar pill are given in LAYOUT-NAV.md §3 and §4.
217
+
218
+ Glow budget: a glow is a **signal** (active, current, claimable, just rewarded). A screen at rest shows the glow of
219
+ the active navigation item, the XP fill, the current step, and nothing else. Never put a glow on body text
220
+ (`text-shadow` blurs glyph edges and lowers legibility) and never on every card.
221
+
222
+ ## 9. Gradients (`backgroundImage`)
223
+
224
+ | Class | Value | Use |
225
+ |---|---|---|
226
+ | `bg-flare` | `linear-gradient(120deg, lime 0%, aqua 38%, iris 72%, flare 100%)` | The brand spectrum: rare tier, brand marks |
227
+ | `bg-flare-ink` | the same from the four `-ink` variables | Gradient **text** (`bg-clip-text text-transparent`), readable on light |
228
+ | `bg-cta` | `linear-gradient(150deg, #E6FF9C 0%, lime 40%, aqua 100%)` | Primary CTA face; with `bg-[length:200%_200%] animate-flow` it drifts |
229
+ | `bg-lime-face` | `linear-gradient(160deg, #E6FF9C, lime 55%, #7EE000)` | Lime keycap discs, "done" nodes |
230
+ | `bg-iris` | `linear-gradient(135deg, iris, flare)` | Level badge |
231
+ | `bg-ember` | `linear-gradient(180deg, #FFE27A, #FF9B3D 55%, #FF4D3D)` | Flame fills |
232
+ | `bg-gold` | `linear-gradient(160deg, #FFF2B0, gold 50%, #E0A21F)` | Claim button, gold tier |
233
+ | `bg-comet` | `linear-gradient(90deg, rgb(lime-ink/.15), rgb(lime-ink) 82%, var(--comet-head))` | XP fill: a tail that brightens to a white head (a lime-ink head on light, where a white head vanishes on the pale track) |
234
+ | `bg-sheen` | `linear-gradient(118deg, transparent 30%, rgb(255 255 255/.14) 50%, transparent 70%)` | Skeleton and reward sheen, moved by `animate-shimmer` |
235
+ | `bg-glass` | `linear-gradient(rgb(255 255 255/.03), rgb(255 255 255/.01))` | Card face (part of `.neon-card`) |
236
+ | `bg-grid` | two 1 px `line` gradients, one `to right`, one `to bottom` (`rgb(line) 1px, transparent 1px`) | Backdrop grid, sized `48px 48px` |
237
+ | `bg-backdrop` | `var(--neon-backdrop)` | The static "bokeh" lights below |
238
+
239
+ `--neon-backdrop`, dark: three radial gradients, each fading to transparent at 70 %:
240
+ `ellipse 80% 55% at 50% -8%` lime at 10 %, `600px 380px at 92% 12%` iris at 10 %, `520px 360px at 6% 88%` aqua at 7 %.
241
+ Light: only the first one, lime at 18 %.
242
+
243
+ Tier faces that are not theme tokens: bronze `linear-gradient(160deg, #E0A070, #9A5B2E)`, silver
244
+ `linear-gradient(160deg, #E6ECF5, #9AA6BD)`.
245
+
246
+ ## 10. Component classes (base stylesheet)
247
+
248
+ | Class | Definition |
249
+ |---|---|
250
+ | `.neon-backdrop` | `pointer-events: none; position: fixed; inset: 0; z-index: -10; background: var(--neon-backdrop)`. Its `::after` covers it with `bg-grid` at `48px 48px`, opacity .3, masked by `linear-gradient(#000, transparent 70%)` so the grid fades out downwards. Render **once**, in the shell. It is a static gradient: no blur filter, no animation, so it costs nothing while scrolling |
251
+ | `.neon-card` | `position: relative; border-radius: 24px; border: 1px solid line; background: surface-1 + bg-glass; box-shadow: shadow-edge` |
252
+ | `.neon-glow` | Replaces the card's background image with `radial-gradient(240px 150px at 100% 0%, rgb(var(--tone)/.14), transparent 70%)` over the glass gradient: a tinted top-right corner. Needs a `.tone-*` scope |
253
+ | `.neon-sweep` | A rotating spectral ring drawn 3 px outside the element. The element gets `position: relative; isolation: isolate`; its `::before` has `inset: -3px; padding: 3px; border-radius: inherit; pointer-events: none`, a `conic-gradient(from var(--neon-angle), lime, aqua, iris, rgb(lime/.15) 70%, lime)` background, and a two-layer mask (`linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)` composited with `exclude` / `-webkit-mask-composite: xor`) that leaves only the 3 px padding band visible. `animation: neon-spin 6s linear infinite`, whose only keyframe is `to { --neon-angle: 360deg }` |
254
+ | `.hex` | The hexagon clip-path (§7) |
255
+
256
+ `--neon-angle` must be registered, or the browser cannot interpolate it and the ring jumps instead of turning:
257
+
258
+ ```css
259
+ @property --neon-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
260
+ ```
261
+
262
+ The component classes go in `@layer components`; they are written out in markup, so Tailwind keeps them.
263
+
264
+ ## 11. Motion tokens
265
+
266
+ | Token | Value | Use |
267
+ |---|---|---|
268
+ | `ease-glide` / `--ease-glide` | `cubic-bezier(.22, 1, .36, 1)` | Everything that enters or moves |
269
+ | `ease-pop` / `--ease-pop` | `cubic-bezier(.34, 1.56, .64, 1)` | Rewards only (overshoot) |
270
+ | `--ease-std` | `cubic-bezier(.4, 0, .2, 1)` | Plain colour fades |
271
+
272
+ `ease-glide` and `ease-pop` are added to Tailwind's `transitionTimingFunction`. Which easing and duration goes with
273
+ which kind of change: `MOTION-A11Y.md` §1.
274
+
275
+ | Animation class | Keyframes | Timing |
276
+ |---|---|---|
277
+ | `animate-glow-pulse` | opacity .5 ↔ 1, scale 1 ↔ 1.1 | 2.4 s ease-in-out infinite. Halo behind an active toggle or a claimable button: on a blurred sibling, never on the control |
278
+ | `animate-float` | translateY 0 ↔ -4 px | 2.4 s ease-in-out infinite |
279
+ | `animate-float-3` | the same keyframes | 2.4 s, **3 iterations**, then rest. "START" tag, at-risk flame |
280
+ | `animate-shimmer` | translateX -120 % → 260 % | 2.2 s glide, infinite. Skeleton sheen, a reward waiting to be claimed |
281
+ | `animate-shimmer-once` | the same keyframes | 1.6 s glide, delay .4 s, `both`, once. One sweep per XP change |
282
+ | `animate-flow` | background-position `0% 0%` ↔ `100% 100%` | 5 s ease-in-out infinite. CTA gradient drift |
283
+ | `animate-pop-in` | 0 %: opacity 0, scale .6 → 60 %: opacity 1, scale 1.08 → 100 %: scale 1 | .45 s `ease-pop`, `both`. Check marks, new badges, ready chest |
284
+ | `animate-xp-burst` | 0 %: opacity 0, `translate(0,0) scale(.3)` → 15 %: opacity 1 → 100 %: opacity 0, `translate(var(--dx, 0px), var(--dy, -48px)) scale(1)` | .6 s glide, `forwards`. Burst dots; set `--dx` / `--dy` inline per dot |
285
+ | `animate-iris-open` | opacity 0, `rotate(-60deg) scale(.4)` → opacity 1, `rotate(0) scale(1)` | .7 s glide, `both`. Level-up badge |
286
+ | `animate-orb-breathe` | scale .97 ↔ 1.03, brightness 1 ↔ 1.15 | 4 s ease-in-out infinite. An idle "live" orb |
287
+ | `animate-ripple` | scale .85 → 1.45, opacity .8 → 0 | 2.4 s glide, infinite. Rings around a live source (speaking, recording) |
288
+
289
+ When each may run, and the loop budget: `MOTION-A11Y.md` §4.
290
+
291
+ ## 12. Base element rules
292
+
293
+ | Rule | Value | Why |
294
+ |---|---|---|
295
+ | Shell variables on `:root` | `--shell-top: calc(3.5rem + 1px)`; `--shell-bottom: calc(4rem + env(safe-area-inset-bottom))`, and `0px` from 1024 px | The heights of the sticky top bar and the fixed bottom bar; see LAYOUT-NAV.md §1 |
296
+ | `html` | `-webkit-tap-highlight-color: transparent`; `text-size-adjust: 100%`; `scroll-padding-top: calc(var(--shell-top) + .5rem)`; `scroll-padding-bottom: calc(var(--shell-bottom) + var(--page-bar, 0px) + .5rem)` | Focus and anchor scrolling stop clear of the bars |
297
+ | `body` | `min-height: 100vh` (`min-h-screen`), `bg-surface-void`, `font-sans`, `text-ink`, antialiased, line-height 1.5 | |
298
+ | `h1, h2, h3` | `font-display`, `text-ink-title`, `text-wrap: balance` | |
299
+ | `a` | `color: rgb(var(--c-aqua-ink))` | Aqua = links |
300
+ | `:focus-visible` | `outline: 2px solid rgb(var(--c-aqua-ink)); outline-offset: 2px` | One focus colour everywhere |
301
+ | `::selection` | background `rgb(var(--c-lime) / .3)`, colour `rgb(var(--c-title))` | |
302
+ | Scrollbars | `scrollbar-width: thin`; `scrollbar-color: rgb(var(--c-line-strong)) transparent`; WebKit: 8 px, transparent track, `line-strong` thumb with a 2 px transparent border and 8 px radius, `muted` on hover | A default light scrollbar is a white stripe on the dark canvas |
303
+
304
+ ### Theme switch without a flash
305
+
306
+ - `<html lang data-theme="dark" class="dark">` in the static HTML; dark is the default.
307
+ - An **inline script in `<head>`**, before any stylesheet or bundle: read `localStorage.theme` inside try/catch; if it
308
+ is `light`, set `data-theme="light"`, remove the `dark` class and set the `theme-color` meta to `#EEF1F8`. Because
309
+ it runs before first paint, a returning light-theme user never sees a dark frame.
310
+ - Meta tags: `viewport` with `viewport-fit=cover` (safe-area insets), `theme-color` `#05060A`, `color-scheme`
311
+ `dark light`.
312
+ - At runtime the DOM attribute is the source of truth (COMPONENTS.md, hooks).
313
+
314
+ ## 13. Changing the palette for another brand
315
+
316
+ 1. Keep the structure: 7 surfaces, 5 inks, 8 tones + info, each tone with an `-ink`.
317
+ 2. Pick the new primary and put it in lime's **role**. If the variable is renamed, rename it everywhere: the theme
318
+ mapping, the base stylesheet, the icon gradient table, and the hard-coded keycap colours that belong to lime
319
+ (`#3F6E00` depth, `#7EE000` and `#E6FF9C` face stops; gold's Claim button uses `#8A6200` as its depth).
320
+ 3. For every tone compute contrast: the neon on `#10131D` >= 4.5:1 for text use; `--on-neon` on the neon >= 4.5:1; the
321
+ `-ink` stop on `#FFFFFF` >= 4.5:1 and on the light `--c-raised` >= 4.5:1.
322
+ 4. Update the icon gradients (3 stops per tone, a dark and a light colour each, plus the glow channels: ICONS.md §2).
323
+ 5. Open the gallery page in both themes before touching any product page.