@nexub/themes 3.0.0 → 3.1.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/src/core.css ADDED
@@ -0,0 +1,631 @@
1
+ /* @nexub/themes — core.css
2
+ Global resets, focus ring, body, scrollbar, reduced-motion, without the
3
+ fonts and the body backdrop. For apps that bring their own fonts (Next.js
4
+ next/font sets --font-family-sans and --font-family-display) and their own
5
+ page background. Most apps import base.css, which is core.css plus both.
6
+ Import it once at the root of your app before light.css or dark.css. */
7
+
8
+ @import '@nexub/tokens/css';
9
+ @import '@nexub/tokens/css/roles';
10
+
11
+ /* ─── Theme tokens beside the color roles ─────────────────────────────────
12
+ 3.0 removed the legacy semantic aliases (--color-success-500,
13
+ --color-text-info, …); use the roles. `npx nexub-migrate --write` moves old
14
+ code over. */
15
+ :root {
16
+ /* Focus ring follows the theme's ring tokens (the tokens default is a fixed
17
+ white/blue pair, wrong in dark mode and brand themes). */
18
+ --shadow-focus: 0 0 0 2px var(--color-ring-offset), 0 0 0 4px var(--color-ring-default);
19
+
20
+ /* Solid fills under white text. Fixed palette tones (they do NOT flip in dark
21
+ mode): tone 40 vs white is >= 4.5:1 by HCT construction; hover = tone 30.
22
+ Brand themes override accent. Phase 2 moves components to on-* roles. */
23
+ --color-fill-primary: var(--color-palette-primary-40);
24
+ --color-fill-primary-hover: var(--color-palette-primary-30);
25
+ --color-fill-info: var(--color-palette-info-40);
26
+ --color-fill-info-hover: var(--color-palette-info-30);
27
+ --color-fill-success: var(--color-palette-success-40);
28
+ --color-fill-success-hover: var(--color-palette-success-30);
29
+ --color-fill-warning: var(--color-palette-warning-40);
30
+ --color-fill-warning-hover: var(--color-palette-warning-30);
31
+ --color-fill-danger: var(--color-palette-error-40);
32
+ --color-fill-danger-hover: var(--color-palette-error-30);
33
+ --color-fill-leap: var(--color-palette-leap-40);
34
+ --color-fill-leap-hover: var(--color-palette-leap-30);
35
+ --color-fill-bookub: var(--color-palette-bookub-40);
36
+ --color-fill-bookub-hover: var(--color-palette-bookub-30);
37
+ --color-fill-payub: var(--color-palette-payub-40);
38
+ --color-fill-payub-hover: var(--color-palette-payub-30);
39
+ --color-fill-founderub: var(--color-palette-founderub-40);
40
+ --color-fill-founderub-hover: var(--color-palette-founderub-30);
41
+ --color-fill-accent: var(--color-fill-primary);
42
+ --color-fill-accent-hover: var(--color-fill-primary-hover);
43
+
44
+ /* scrim behind modal surfaces (Dialog, AlertDialog, Sheet/Drawer, CommandPalette) */
45
+ --color-overlay: rgb(0 0 0 / 0.5);
46
+
47
+ /* accent fallback — used without any brand theme applied (PKG-B03) */
48
+ --color-accent-500: var(--color-brand-primary-500);
49
+ --color-accent-600: var(--color-brand-primary-600);
50
+
51
+ /* brand tone shorthands — aliased from full token names (PKG-B02) */
52
+ --color-leap-50: var(--color-accent-leap-50);
53
+ --color-leap-100: var(--color-accent-leap-100);
54
+ --color-leap-600: var(--color-accent-leap-600);
55
+ --color-leap-700: var(--color-accent-leap-700);
56
+ --color-leap-bg: rgba(99, 102, 241, 0.10);
57
+ --color-leap-border: rgba(99, 102, 241, 0.25);
58
+
59
+ --color-bookub-50: var(--color-accent-bookub-50);
60
+ --color-bookub-100: var(--color-accent-bookub-100);
61
+ --color-bookub-600: var(--color-accent-bookub-600);
62
+ --color-bookub-700: var(--color-accent-bookub-700);
63
+ --color-bookub-bg: rgba(16, 185, 129, 0.10);
64
+ --color-bookub-border: rgba(16, 185, 129, 0.25);
65
+
66
+ --color-payub-50: var(--color-accent-payub-50);
67
+ --color-payub-100: var(--color-accent-payub-100);
68
+ --color-payub-600: var(--color-accent-payub-600);
69
+ --color-payub-700: var(--color-accent-payub-700);
70
+ --color-payub-bg: rgba(139, 92, 246, 0.10);
71
+ --color-payub-border: rgba(139, 92, 246, 0.25);
72
+
73
+ --color-founderub-50: var(--color-accent-founderub-50);
74
+ --color-founderub-100: var(--color-accent-founderub-100);
75
+ --color-founderub-600: var(--color-accent-founderub-600);
76
+ --color-founderub-700: var(--color-accent-founderub-700);
77
+ --color-founderub-bg: rgba(245, 158, 11, 0.10);
78
+ --color-founderub-border: rgba(245, 158, 11, 0.25);
79
+ }
80
+
81
+ *, *::before, *::after {
82
+ box-sizing: border-box;
83
+ border-color: var(--color-outline-variant);
84
+ }
85
+
86
+ html {
87
+ font-family: var(--font-family-sans);
88
+ /* 100%, not 16px: tokens are in rem (3.0) and follow the user's browser font size. */
89
+ font-size: 100%;
90
+ line-height: 1.6;
91
+ color: var(--color-on-surface);
92
+ background-color: var(--color-surface);
93
+ scroll-behavior: smooth;
94
+ -webkit-font-smoothing: antialiased;
95
+ -moz-osx-font-smoothing: grayscale;
96
+ text-size-adjust: 100%;
97
+ /* never fake bold/italic; Inter's optical sizes follow font-size */
98
+ font-synthesis: none;
99
+ font-optical-sizing: auto;
100
+ }
101
+
102
+ /* Form controls don't inherit fonts by default — without this, apps that
103
+ don't use Tailwind's preflight would render buttons/inputs in the system UI
104
+ font instead of Inter. */
105
+ button, input, select, textarea, optgroup {
106
+ font-family: inherit;
107
+ }
108
+
109
+ /* Pointer cursor on buttons. Tailwind v3's preflight set it; v4's doesn't, so
110
+ this keeps Nexub buttons the same on both. Zero specificity (:where), so any
111
+ cursor-* utility and v3's preflight still win. */
112
+ :where(button:not(:disabled), [role='button']:not(:disabled)) {
113
+ cursor: pointer;
114
+ }
115
+
116
+ body {
117
+ min-height: 100vh;
118
+ margin: 0;
119
+ }
120
+
121
+ /* Focus ring: one ring for everything. The outline follows border-radius, so
122
+ it hugs capsules and fields. Contrast >= 3:1 on every surface (ring = primary). */
123
+ :focus-visible {
124
+ outline: 3px solid var(--color-ring-default);
125
+ outline-offset: 2px;
126
+ }
127
+
128
+ @media (forced-colors: active) {
129
+ :focus-visible { outline-color: Highlight; }
130
+ }
131
+
132
+ /* Headings: brand display face, balanced wrapping */
133
+ h1, h2, h3, h4, h5, h6 {
134
+ margin: 0;
135
+ font-family: var(--font-family-display);
136
+ font-weight: var(--font-weight-bold);
137
+ line-height: 1.2;
138
+ color: var(--color-on-surface);
139
+ text-wrap: balance;
140
+ }
141
+
142
+ /* Paragraphs / lists */
143
+ p, ul, ol {
144
+ margin: 0;
145
+ }
146
+
147
+ p {
148
+ text-wrap: pretty;
149
+ }
150
+
151
+ /* Links */
152
+ a {
153
+ color: var(--color-primary);
154
+ text-decoration: underline;
155
+ text-underline-offset: 0.3em;
156
+ }
157
+
158
+ a:hover {
159
+ opacity: 0.8;
160
+ }
161
+
162
+ /* Images */
163
+ img, video, svg {
164
+ display: block;
165
+ max-width: 100%;
166
+ }
167
+
168
+ /* Code */
169
+ code, kbd, pre, samp {
170
+ font-family: var(--font-family-mono);
171
+ font-size: 0.875em;
172
+ }
173
+
174
+ /* Selection */
175
+ ::selection {
176
+ background-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
177
+ color: var(--color-on-surface);
178
+ }
179
+
180
+ /* Scrollbar (webkit) */
181
+ ::-webkit-scrollbar {
182
+ width: 8px;
183
+ height: 8px;
184
+ }
185
+
186
+ ::-webkit-scrollbar-track {
187
+ background: var(--color-surface-container-low);
188
+ }
189
+
190
+ ::-webkit-scrollbar-thumb {
191
+ background: var(--color-outline);
192
+ border-radius: var(--radius-full);
193
+ }
194
+
195
+ ::-webkit-scrollbar-thumb:hover {
196
+ background: var(--color-on-surface-muted);
197
+ }
198
+
199
+ /* Reduced motion */
200
+ /* Reduced motion: everything is instant, except the designed fallbacks
201
+ (nx-motion, nx-reveal), which keep their crossfade with no travel. */
202
+ @media (prefers-reduced-motion: reduce) {
203
+ *:not(.nx-motion, .nx-reveal), *::before, *::after {
204
+ animation-duration: 0.01ms !important;
205
+ animation-iteration-count: 1 !important;
206
+ transition-duration: 0.01ms !important;
207
+ scroll-behavior: auto !important;
208
+ }
209
+ }
210
+
211
+ /* ─── State layer (Calm Depth §4.2) ──────────────────────────────────────────
212
+ An overlay of the element's own text color (its on-* role) at the
213
+ --state-* opacity, so hover/focus/press read correctly on any fill, theme,
214
+ brand or glass. The ::before paints above the background, below content. */
215
+ .nx-state-layer { position: relative; isolation: isolate; }
216
+ .nx-state-layer::before {
217
+ content: '';
218
+ position: absolute;
219
+ inset: 0;
220
+ z-index: -1;
221
+ border-radius: inherit;
222
+ background: currentColor;
223
+ opacity: 0;
224
+ pointer-events: none;
225
+ transition: opacity var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing);
226
+ }
227
+ .nx-state-layer:hover::before { opacity: var(--state-hover); }
228
+ .nx-state-layer:focus-visible::before { opacity: var(--state-focus); }
229
+ .nx-state-layer:active::before { opacity: var(--state-pressed); }
230
+ .nx-state-layer:is(:disabled, [aria-disabled='true'], [data-disabled])::before { opacity: 0; }
231
+
232
+ /* Press feedback: a fast spatial spring, no ripple. */
233
+ .nx-press {
234
+ transition: transform var(--motion-spring-spatial-fast-duration) var(--motion-spring-spatial-fast-easing);
235
+ }
236
+ .nx-press:active:not(:disabled, [aria-disabled='true'], [data-disabled]) { transform: scale(0.97); }
237
+
238
+ /* ─── Enter / exit (overlays, menus, tooltips, toasts) ───────────────────────
239
+ Opacity rides the effects spring; position and scale ride the spatial
240
+ spring, so a little overshoot reads as physical without flashing.
241
+ Keyframes, not transitions: Radix keeps closing content mounted until its
242
+ exit animation ends. Standalone translate/scale compose with the
243
+ component's own transform (e.g. a centred dialog's -50% offsets).
244
+ Modifiers set where the layer comes from: --nx-x, --nx-y, --nx-scale. */
245
+ @keyframes nx-fade-in { from { opacity: 0; } }
246
+ @keyframes nx-fade-out { to { opacity: 0; } }
247
+ @keyframes nx-move-in { from { translate: var(--nx-x, 0) var(--nx-y, 0); scale: var(--nx-scale, 1); } }
248
+ @keyframes nx-move-out { to { translate: var(--nx-x, 0) var(--nx-y, 0); scale: var(--nx-scale, 1); } }
249
+
250
+ .nx-motion:is([data-state='open'], [data-state='delayed-open'], [data-state='instant-open'], [data-motion^='from-']) {
251
+ animation:
252
+ nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing),
253
+ nx-move-in var(--motion-spring-spatial-default-duration) var(--motion-spring-spatial-default-easing);
254
+ }
255
+ /* Exit is quicker than enter and never overshoots. */
256
+ .nx-motion:is([data-state='closed'], [data-motion^='to-']) {
257
+ animation:
258
+ nx-fade-out var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing) forwards,
259
+ nx-move-out var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing) forwards;
260
+ }
261
+
262
+ /* Floating layers grow from their trigger: a small scale plus a 4px nudge
263
+ away from the side they open on (Radix sets data-side). Components set
264
+ transform-origin to Radix's --radix-*-transform-origin. */
265
+ .nx-pop { --nx-scale: 0.96; }
266
+ .nx-pop[data-side='bottom'] { --nx-y: -4px; }
267
+ .nx-pop[data-side='top'] { --nx-y: 4px; }
268
+ .nx-pop[data-side='left'] { --nx-x: 4px; }
269
+ .nx-pop[data-side='right'] { --nx-x: -4px; }
270
+ /* Modal dialogs rise slightly as they scale in. */
271
+ .nx-dialog { --nx-scale: 0.96; --nx-y: 8px; }
272
+ /* NavigationMenu content slides in from the item's direction. */
273
+ .nx-motion:is([data-motion='from-start'], [data-motion='to-start']) { --nx-x: -24px; }
274
+ .nx-motion:is([data-motion='from-end'], [data-motion='to-end']) { --nx-x: 24px; }
275
+
276
+ /* Reduced motion: a designed fallback, not a cut. Keep the crossfade, drop
277
+ the travel and scale. */
278
+ @media (prefers-reduced-motion: reduce) {
279
+ .nx-motion { --nx-x: 0px !important; --nx-y: 0px !important; --nx-scale: 1 !important; }
280
+ }
281
+
282
+ /* Stagger: children of .nx-stagger rise in one after another (40ms apart, up
283
+ to the 12th; later ones arrive with the 12th). Set --nx-stagger to change
284
+ the step. Re-key the parent to replay. */
285
+ .nx-stagger > * {
286
+ --nx-y: 8px;
287
+ animation:
288
+ nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing) both,
289
+ nx-move-in var(--motion-spring-spatial-default-duration) var(--motion-spring-spatial-default-easing) both;
290
+ animation-delay: calc(var(--nx-i, 0) * var(--nx-stagger, 40ms));
291
+ }
292
+ .nx-stagger > :nth-child(2) { --nx-i: 1; }
293
+ .nx-stagger > :nth-child(3) { --nx-i: 2; }
294
+ .nx-stagger > :nth-child(4) { --nx-i: 3; }
295
+ .nx-stagger > :nth-child(5) { --nx-i: 4; }
296
+ .nx-stagger > :nth-child(6) { --nx-i: 5; }
297
+ .nx-stagger > :nth-child(7) { --nx-i: 6; }
298
+ .nx-stagger > :nth-child(8) { --nx-i: 7; }
299
+ .nx-stagger > :nth-child(9) { --nx-i: 8; }
300
+ .nx-stagger > :nth-child(10) { --nx-i: 9; }
301
+ .nx-stagger > :nth-child(11) { --nx-i: 10; }
302
+ .nx-stagger > :nth-child(n + 12) { --nx-i: 11; }
303
+
304
+ /* ListTransition items: grow in from zero height and fade in; exit collapses
305
+ and fades (quicker, no overshoot). Rows animate via grid-template-rows so
306
+ the item needs no measured height. */
307
+ .nx-list-item { display: grid; grid-template-rows: 1fr; }
308
+ .nx-list-item-inner { min-height: 0; overflow: hidden; }
309
+ @keyframes nx-rows-in { from { grid-template-rows: 0fr; } }
310
+ @keyframes nx-rows-out { to { grid-template-rows: 0fr; } }
311
+ .nx-list-item[data-state='enter'] {
312
+ animation:
313
+ nx-rows-in var(--motion-spring-spatial-default-duration) var(--motion-spring-spatial-default-easing),
314
+ nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
315
+ }
316
+ .nx-list-item[data-state='exit'] {
317
+ pointer-events: none;
318
+ animation:
319
+ nx-rows-out var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing) forwards,
320
+ nx-fade-out var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing) forwards;
321
+ }
322
+
323
+ /* SkeletonSwap: skeleton and content share one grid cell and crossfade. */
324
+ .nx-swap { display: grid; }
325
+ .nx-swap > * { grid-area: 1 / 1; min-width: 0; }
326
+ .nx-swap-in { animation: nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing) both; }
327
+ .nx-swap-out {
328
+ pointer-events: none;
329
+ animation: nx-fade-out var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing) forwards;
330
+ }
331
+
332
+ @media (prefers-reduced-motion: reduce) {
333
+ .nx-stagger > * { --nx-y: 0px; animation-delay: 0s; }
334
+ .nx-list-item[data-state='enter'] { animation: nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing); }
335
+ .nx-list-item[data-state='exit'] { animation: nx-fade-out var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing) forwards; }
336
+ }
337
+
338
+ /* ─── Cards: lift, press, sheen ──────────────────────────────────────────────
339
+ Lift: hover raises 2px on the spatial spring with elevation 1 → 2; leaving
340
+ settles faster on the effects spring (a transition uses the *destination*
341
+ state's timing). Press sinks to 0.99. Hover only where a real pointer
342
+ hovers, so touch never gets a stuck lift. */
343
+ .nx-lift {
344
+ transition:
345
+ translate var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing),
346
+ scale var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing),
347
+ box-shadow var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing);
348
+ }
349
+ @media (hover: hover) {
350
+ .nx-lift:hover {
351
+ translate: 0 -2px;
352
+ transition:
353
+ translate var(--motion-spring-spatial-default-duration) var(--motion-spring-spatial-default-easing),
354
+ scale var(--motion-spring-spatial-fast-duration) var(--motion-spring-spatial-fast-easing),
355
+ box-shadow var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
356
+ }
357
+ /* Glass keeps its own shadow (it carries the specular edge). */
358
+ .nx-lift:not([data-material='glass']):hover { box-shadow: var(--elevation-2); }
359
+ }
360
+ .nx-lift:active { translate: 0 0; scale: 0.99; }
361
+ @media (prefers-reduced-motion: reduce) {
362
+ .nx-lift:hover, .nx-lift:active { translate: none; scale: none; }
363
+ }
364
+
365
+ /* Sheen (opt-in): a soft light that follows the pointer across the surface,
366
+ plus a brighter rim where the pointer is nearest the edge. JS sets
367
+ --nx-mx/--nx-my through the CSSOM (CSP-safe); --nx-sheen fades it in.
368
+ Primary-tinted on light surfaces, white on dark and on glass. Off for touch
369
+ (no hover), reduced motion and reduced transparency. */
370
+ @property --nx-sheen { syntax: '<number>'; inherits: true; initial-value: 0; }
371
+ .nx-sheen {
372
+ position: relative;
373
+ --nx-sheen-tint: light-dark(var(--color-primary), #fff);
374
+ background-image: radial-gradient(
375
+ 28rem circle at var(--nx-mx, 50%) var(--nx-my, 0%),
376
+ color-mix(in srgb, var(--nx-sheen-tint) calc(var(--nx-sheen) * 9%), transparent),
377
+ transparent 70%
378
+ );
379
+ transition: --nx-sheen var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing);
380
+ }
381
+ .nx-sheen::after {
382
+ content: '';
383
+ position: absolute;
384
+ inset: -1px;
385
+ padding: 1px;
386
+ border-radius: inherit;
387
+ pointer-events: none;
388
+ background: radial-gradient(
389
+ 14rem circle at var(--nx-mx, 50%) var(--nx-my, 0%),
390
+ color-mix(in srgb, var(--nx-sheen-tint) calc(var(--nx-sheen) * 70%), transparent),
391
+ transparent 70%
392
+ );
393
+ -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
394
+ -webkit-mask-composite: xor;
395
+ mask-composite: exclude;
396
+ }
397
+ [data-material='glass'].nx-sheen { --nx-sheen-tint: #fff; }
398
+ /* On a sheen surface the light is the hover feedback; the grey state layer
399
+ would wash it out. Press still darkens. */
400
+ .nx-sheen.nx-state-layer:hover:not(:active)::before { opacity: 0; }
401
+ @media (hover: hover) and (prefers-reduced-motion: no-preference) {
402
+ .nx-sheen:hover {
403
+ --nx-sheen: 1;
404
+ transition: --nx-sheen var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
405
+ }
406
+ }
407
+ @media (prefers-reduced-transparency: reduce) {
408
+ .nx-sheen { background-image: none; }
409
+ .nx-sheen::after { display: none; }
410
+ }
411
+
412
+ /* ─── AI: thinking indicator ─────────────────────────────────────────────────
413
+ nx-morph: a small shape that breathes between a circle and a soft squircle
414
+ on the expressive spring. nx-shimmer: a decorative light sweep across label
415
+ text (the text stays in the DOM). Reduced motion: both static. */
416
+ @keyframes nx-morph {
417
+ from { border-radius: 50%; rotate: 0deg; }
418
+ to { border-radius: 38% 62% 38% 62% / 62% 38% 62% 38%; rotate: 90deg; }
419
+ }
420
+ @keyframes nx-shimmer {
421
+ from { background-position: 100% 0; }
422
+ to { background-position: -100% 0; }
423
+ }
424
+ @media (prefers-reduced-motion: no-preference) {
425
+ .nx-morph {
426
+ animation: nx-morph calc(var(--motion-spring-expressive-slow-duration) * 2)
427
+ var(--motion-spring-expressive-slow-easing) infinite alternate;
428
+ }
429
+ .nx-shimmer {
430
+ background-image: linear-gradient(90deg,
431
+ currentColor 0%, currentColor 40%, var(--color-on-surface) 50%, currentColor 60%, currentColor 100%);
432
+ background-size: 200% 100%;
433
+ -webkit-background-clip: text;
434
+ background-clip: text;
435
+ -webkit-text-fill-color: transparent;
436
+ /* A steady sweep: linear, not a spring (a spring would pulse each loop). */
437
+ animation: nx-shimmer 2s linear infinite;
438
+ }
439
+ }
440
+ @media (forced-colors: active) {
441
+ .nx-shimmer { background: none; -webkit-text-fill-color: currentColor; }
442
+ }
443
+
444
+ /* Streaming caret: a steady blink while text is arriving. */
445
+ @keyframes nx-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
446
+ .nx-caret { animation: nx-caret 1s steps(1, end) infinite; }
447
+ @media (prefers-reduced-motion: reduce) {
448
+ .nx-caret { animation: none; }
449
+ }
450
+
451
+ /* ─── Touch targets ─────────────────────────────────────────────────────────
452
+ Small controls keep their visual size but get an invisible 44×44 hit area
453
+ on touch screens (Apple HIG, WCAG 2.5.5). Uses ::after; the state layer
454
+ uses ::before. */
455
+ @media (pointer: coarse) {
456
+ .nx-hit { position: relative; }
457
+ .nx-hit::after {
458
+ content: '';
459
+ position: absolute;
460
+ left: 50%;
461
+ top: 50%;
462
+ width: max(100%, 44px);
463
+ height: max(100%, 44px);
464
+ translate: -50% -50%;
465
+ }
466
+ }
467
+
468
+ /* ─── Micro-moments ──────────────────────────────────────────────────────────
469
+ Reveal: content replacing a skeleton crossfades in (no travel). */
470
+ .nx-reveal {
471
+ animation: nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
472
+ }
473
+ /* Check draw: a checkmark path (pathLength="1") draws itself in. */
474
+ @keyframes nx-draw { from { stroke-dashoffset: 1; } }
475
+ .nx-check-draw {
476
+ stroke-dasharray: 1;
477
+ animation: nx-draw var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
478
+ }
479
+ @media (prefers-reduced-motion: reduce) {
480
+ .nx-check-draw { animation: none; }
481
+ }
482
+ /* Shake: a short horizontal "no" on the spatial-fast spring (async Button error). */
483
+ @keyframes nx-shake {
484
+ 0%, 100% { translate: 0; }
485
+ 20% { translate: -4px; }
486
+ 40% { translate: 4px; }
487
+ 60% { translate: -3px; }
488
+ 80% { translate: 2px; }
489
+ }
490
+ .nx-shake {
491
+ animation: nx-shake var(--motion-spring-spatial-fast-duration) var(--motion-spring-spatial-fast-easing);
492
+ }
493
+ @media (prefers-reduced-motion: reduce) {
494
+ .nx-shake { animation: none; }
495
+ }
496
+
497
+ /* ─── Density ────────────────────────────────────────────────────────────────
498
+ Compact shifts every control one step down the ladder (md 40 → 32px at a 16px root). */
499
+ [data-density='compact'] {
500
+ --size-control-xs: 1.25rem;
501
+ --size-control-sm: 1.5rem;
502
+ --size-control-md: 2rem;
503
+ --size-control-lg: 2.5rem;
504
+ --size-control-xl: 3rem;
505
+ }
506
+
507
+ /* Logo-scroll marquee keyframe (used by LogoWall) */
508
+ @keyframes logo-scroll {
509
+ from { transform: translateX(0); }
510
+ to { transform: translateX(-50%); }
511
+ }
512
+
513
+ /* ─── App header (@nexub/patterns AppHeader) ─────────────────────────────────
514
+ One height for the fixed top header everywhere. Offset layouts with
515
+ var(--app-header-height); AppHeader's own spacer already does in flow. */
516
+ :root { --app-header-height: 64px; }
517
+ /* condense: scroll-driven, no JS. The page spacer stays 64px; only the bar
518
+ tightens. Glass keeps its own shadow. */
519
+ @keyframes nx-condense { to { height: 52px; } }
520
+ @keyframes nx-condense-lift { to { height: 52px; box-shadow: var(--elevation-1); } }
521
+ @supports (animation-timeline: scroll()) {
522
+ [data-condense] {
523
+ animation: nx-condense-lift linear both;
524
+ animation-timeline: scroll(root);
525
+ animation-range: 0 64px;
526
+ }
527
+ [data-condense][data-material='glass'] { animation-name: nx-condense; }
528
+ }
529
+
530
+ /* ─── Scroll lock (Sheet scrollLock="class") ─────────────────────────────────
531
+ A CSP-safe page scroll lock: @nexub/react toggles these classes on <html>
532
+ instead of injecting a <style> tag. The gutter class keeps the scrollbar's
533
+ space so the page doesn't shift sideways. */
534
+ html.nexub-scroll-lock { overflow: hidden; }
535
+ html.nexub-scroll-lock.nexub-scroll-gutter { scrollbar-gutter: stable; }
536
+
537
+ /* ─── Nexub mark gradient stops (<NexubMark variant="color">, <Logo>) ───────
538
+ Classes instead of style= attributes, which a strict CSP blocks in
539
+ server-rendered HTML. */
540
+ /* nexub-mark-stops:start — generated by packages/brand/scripts/build-assets.mjs */
541
+ .nxm-s-1{stop-color:var(--color-brand-mark-1)}
542
+ .nxm-s-2{stop-color:var(--color-brand-mark-2)}
543
+ .nxm-s-3{stop-color:var(--color-brand-mark-3)}
544
+ .nxm-s-4{stop-color:var(--color-brand-mark-4)}
545
+ .nxm-s-5{stop-color:var(--color-brand-mark-5)}
546
+ .nxm-s-6{stop-color:var(--color-brand-mark-6)}
547
+ .nxm-s-7{stop-color:var(--color-brand-mark-7)}
548
+ .nxm-s-8{stop-color:var(--color-brand-mark-8)}
549
+ .nxm-s-9{stop-color:var(--color-brand-mark-9)}
550
+ .nxm-s-10{stop-color:var(--color-brand-mark-10)}
551
+ .nxm-s-11{stop-color:var(--color-brand-mark-11)}
552
+ .nxm-s-12{stop-color:var(--color-brand-mark-12)}
553
+ .nxm-s-13{stop-color:var(--color-brand-mark-13)}
554
+ .nxm-s-14{stop-color:var(--color-brand-mark-14)}
555
+ .nxm-s-15{stop-color:var(--color-brand-mark-15)}
556
+ .nxm-s-16{stop-color:var(--color-brand-mark-16)}
557
+ .nxm-s-17{stop-color:var(--color-brand-mark-17)}
558
+ .nxm-s-18{stop-color:var(--color-brand-mark-18)}
559
+ .nxm-s-19{stop-color:var(--color-brand-mark-19)}
560
+ .nxm-s-20{stop-color:var(--color-brand-mark-20)}
561
+ .nxm-s-21{stop-color:var(--color-brand-mark-21)}
562
+ .nxm-s-22{stop-color:var(--color-brand-mark-22)}
563
+ .nxm-s-23{stop-color:var(--color-brand-mark-23)}
564
+ .nxm-s-24{stop-color:var(--color-brand-mark-24)}
565
+ .nxm-s-25{stop-color:var(--color-brand-mark-25)}
566
+ .nxm-s-26{stop-color:var(--color-brand-mark-26)}
567
+ .nxm-s-27{stop-color:var(--color-brand-mark-27)}
568
+ .nxm-s-28{stop-color:var(--color-brand-mark-28)}
569
+ .nxm-s-29{stop-color:var(--color-brand-mark-29)}
570
+ .nxm-s-30{stop-color:var(--color-brand-mark-30)}
571
+ .nxm-s-31{stop-color:var(--color-brand-mark-31)}
572
+ .nxm-s-32{stop-color:var(--color-brand-mark-32)}
573
+ .nxm-s-33{stop-color:var(--color-brand-mark-33)}
574
+ .nxm-s-34{stop-color:var(--color-brand-mark-34)}
575
+ .nxm-s-35{stop-color:var(--color-brand-mark-35)}
576
+ .nxm-s-36{stop-color:var(--color-brand-mark-36)}
577
+ .nxm-s-37{stop-color:var(--color-brand-mark-37)}
578
+ .nxm-s-38{stop-color:var(--color-brand-mark-38)}
579
+ .nxm-s-39{stop-color:var(--color-brand-mark-39)}
580
+ .nxm-s-40{stop-color:var(--color-brand-mark-40)}
581
+ .nxm-s-41{stop-color:var(--color-brand-mark-41)}
582
+ .nxm-s-42{stop-color:var(--color-brand-mark-42)}
583
+ .nxm-s-43{stop-color:var(--color-brand-mark-43)}
584
+ .nxm-s-44{stop-color:var(--color-brand-mark-44)}
585
+ .nxm-s-45{stop-color:var(--color-brand-mark-45)}
586
+ .nxm-s-46{stop-color:var(--color-brand-mark-46)}
587
+ .nxm-s-47{stop-color:var(--color-brand-mark-47)}
588
+ .nxm-o-0{stop-opacity:0}
589
+ /* nexub-mark-stops:end */
590
+
591
+ /* ─── Radix ScrollArea / Select viewports ────────────────────────────────────
592
+ Radix renders these rules in a <style> tag, which a strict CSP blocks. The
593
+ same rules here keep the native scrollbar hidden either way. */
594
+ [data-radix-scroll-area-viewport],[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch}
595
+ [data-radix-scroll-area-viewport]::-webkit-scrollbar,[data-radix-select-viewport]::-webkit-scrollbar{display:none}
596
+
597
+ /* ─── Drawer / Sheet (vaul 1.1.2) ─────────────────────────────────────────────
598
+ vaul's own styles. vaul normally injects these in a <style> tag when
599
+ @nexub/react loads, which strict CSP pages block; @nexub/react strips that
600
+ and ships them here instead. Verbatim copy: the @nexub/react build fails if
601
+ it no longer matches vaul. One rule is left out: vaul's invalid
602
+ `[data-vaul-handle-hitarea]:{…}` media rule, which browsers ignore and strict
603
+ CSS parsers (lightningcss, Turbopack) reject. */
604
+ [data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
605
+ [data-state=closed]
606
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}
607
+
608
+ /* Drawer / Sheet on our springs. vaul's copy above stays verbatim (tsup checks
609
+ it); these override its .5s iOS curve. Enter rides spatial, exit is quicker
610
+ on effects and never overshoots. Placed after vaul's rules so ties win. */
611
+ .nx-drawer[data-vaul-drawer][data-vaul-snap-points='false'] {
612
+ animation-duration: var(--motion-spring-spatial-default-duration);
613
+ animation-timing-function: var(--motion-spring-spatial-default-easing);
614
+ }
615
+ .nx-drawer[data-vaul-drawer][data-vaul-snap-points='false'][data-state='closed'] {
616
+ animation-duration: var(--motion-spring-effects-default-duration);
617
+ animation-timing-function: var(--motion-spring-effects-default-easing);
618
+ }
619
+ .nx-drawer-overlay[data-vaul-overlay][data-vaul-snap-points='false'] {
620
+ animation-duration: var(--motion-spring-effects-default-duration);
621
+ animation-timing-function: var(--motion-spring-effects-default-easing);
622
+ }
623
+ .nx-drawer-overlay[data-vaul-overlay][data-state='closed'] {
624
+ animation-duration: var(--motion-spring-effects-fast-duration);
625
+ animation-timing-function: var(--motion-spring-effects-fast-easing);
626
+ }
627
+ /* Reduced motion: the panel fades instead of sliding. */
628
+ @media (prefers-reduced-motion: reduce) {
629
+ .nx-drawer[data-vaul-drawer][data-vaul-snap-points='false'][data-state='open'] { animation-name: fadeIn; }
630
+ .nx-drawer[data-vaul-drawer][data-vaul-snap-points='false'][data-state='closed'] { animation-name: fadeOut; }
631
+ }