palace-ui 0.0.0-stage → 0.10.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/SPEC.md ADDED
@@ -0,0 +1,743 @@
1
+ # Palace UI — Design Specification
2
+
3
+ > AI-first design spec. When building UIs for projects that use Palace UI,
4
+ > follow this document exactly. Include `palace.css` and write HTML using
5
+ > these classes. Do not invent new patterns — use what's here.
6
+
7
+ ## Philosophy
8
+
9
+ - **Retro-technical.** Hard edges (border-radius: 0 everywhere), thick 2px borders, chunky offset box-shadows. Gradients on text, thin decorative stripes (≤3px), and narrow fixed bars (e.g. sticky CTAs) only — never on large surfaces or card backgrounds.
10
+ - **Three-color accent system.** Hot pink `#ff2d9b`, electric purple `#5b4cff`, cyan `#00e5ff`. These rotate across card lists and provide visual rhythm.
11
+ - **Snappy interactions.** All transitions are `0.1s`. Hovers lift elements up-left and cast a hard shadow down-right. Fast, mechanical feedback.
12
+ - **Uppercase everything.** All headings, labels, buttons, and status text are `text-transform: uppercase` with tracked letter-spacing. Body text is the exception.
13
+ - **Dark on light.** `#0a0a0a` text on `#f0f0f0` background. Cards are white `#fff`. Code blocks invert to dark `#0a0a0a` backgrounds.
14
+ - **No border radius.** Ever. `border-radius: 0` is the rule, not the exception.
15
+ - **Content-width containers.** Max-width `640px` for main content, `420px` for auth/narrow forms.
16
+
17
+ ## Setup
18
+
19
+ ### Fonts
20
+
21
+ palace-ui ships Space Grotesk and JetBrains Mono as woff2 files in `fonts/`
22
+ (SIL Open Font License 1.1) and loads them from `palace.css` itself. Do not add
23
+ Google Fonts links: they send every visitor's IP address to Google, which German
24
+ courts have held to violate the GDPR without consent. Keep `fonts/` next to
25
+ `palace.css` when serving.
26
+
27
+ ### Stylesheet
28
+
29
+ ```html
30
+ <link rel="stylesheet" href="/vendor/palace-ui/palace.css">
31
+ ```
32
+
33
+ Or if consuming via npm with a build tool:
34
+
35
+ ```css
36
+ @import 'palace-ui/palace.css';
37
+ ```
38
+
39
+ ## Token Reference
40
+
41
+ ### Colors
42
+
43
+ | Token | Value | Usage |
44
+ |---|---|---|
45
+ | `--p-accent-1` | `#ff2d9b` | Primary action, CTA buttons, first card in rotation |
46
+ | `--p-accent-2` | `#5b4cff` | Secondary action, links, input focus, second card |
47
+ | `--p-accent-3` | `#00e5ff` | Tertiary accent, navbar user, code highlights, third card |
48
+ | `--p-text` | `#0a0a0a` | Body text, borders |
49
+ | `--p-text-secondary` | `#444` | Body copy in cards, descriptions |
50
+ | `--p-text-muted` | `#666` | Subtitles, labels |
51
+ | `--p-text-faint` | `#6b6b6b` | Table headers, brand labels, meta text |
52
+ | `--p-bg` | `#f0f0f0` | Page background |
53
+ | `--p-surface` | `#fff` | Card/container backgrounds |
54
+ | `--p-surface-inset` | `#f7f7f7` | Inset/recessed surfaces |
55
+ | `--p-dark` | `#0a0a0a` | Dark backgrounds (navbar, code, hover fills) |
56
+ | `--p-error` | `#ff4444` | Error states, danger zones |
57
+ | `--p-success` | `#00ff88` | Success states |
58
+ | `--p-warning` | `#ffcc00` | Warning states |
59
+ | `--p-info` | `var(--p-accent-3)` | Informational states (semantic alias for cyan) |
60
+ | `--p-overlay` | `rgba(10, 10, 10, 0.7)` | Overlay/backdrop for dialogs |
61
+ | `--p-hover-bg` | `#e8e8e8` | Subtle hover background for rows/lists |
62
+ | `--p-code-bg` | `#1a1a2e` | Inline code background on dark surfaces |
63
+ | `--p-code-highlight` | `#00ff88` | Highlighted code text (values, keys) |
64
+
65
+ ### Typography
66
+
67
+ | Token | Value |
68
+ |---|---|
69
+ | `--p-font` | `'Space Grotesk', system-ui, sans-serif` |
70
+ | `--p-font-mono` | `'JetBrains Mono', monospace` |
71
+
72
+ ### Spacing
73
+
74
+ | Token | Value | Usage |
75
+ |---|---|---|
76
+ | `--p-space-xs` | `4px` | Tight gaps |
77
+ | `--p-space-sm` | `8px` | Button gaps, small margins |
78
+ | `--p-space-md` | `16px` | Card margins, standard padding |
79
+ | `--p-space-lg` | `24px` | Card padding, section spacing |
80
+ | `--p-space-xl` | `32px` | Intermediate section gaps |
81
+ | `--p-space-2xl` | `48px` | Hero padding, major section gaps |
82
+
83
+ ### Spacing Rules
84
+
85
+ Three mechanisms for spacing, each with a clear use case:
86
+
87
+ 1. **`margin-bottom`** — spacing between sibling elements. All vertical inter-element spacing uses `margin-bottom` only (single-direction margins). Elements push the next sibling down; never pull themselves away with `margin-top`. This keeps spacing predictable, portable, and avoids margin-collapsing surprises.
88
+
89
+ 2. **`gap`** — spacing inside flex/grid containers. Preferred when the parent is `display: flex` or `display: grid`. No margin needed on children.
90
+
91
+ 3. **`.stack-*`** — spacing between children of a non-flex/grid container. Apply to the parent; children get uniform vertical spacing via the owl selector (`> * + *`). Available sizes: `stack-xs` (4px), `stack-sm` (8px), `stack-md` (16px), `stack-lg` (24px), `stack-xl` (32px), `stack-2xl` (48px).
92
+
93
+ **Never** use `padding` to create distance between sibling elements — padding is for internal space within an element.
94
+
95
+ **Exceptions:** dividers (`.divider`, `.divider-danger`, `.gradient-stripe`) use top+bottom margin because they are structural separators by nature. Tight optical adjustments inside components (e.g. `.stat-label` 2px nudge) are exempt.
96
+
97
+ ### Layout
98
+
99
+ | Token | Value |
100
+ |---|---|
101
+ | `--p-container-width` | `640px` |
102
+ | `--p-container-narrow` | `420px` |
103
+ | `--p-navbar-height` | `52px` |
104
+
105
+ ## Component Catalog
106
+
107
+ ### Page Shell
108
+
109
+ Every page follows this structure:
110
+
111
+ ```html
112
+ <!DOCTYPE html>
113
+ <html lang="en">
114
+ <head>
115
+ <meta charset="utf-8">
116
+ <meta name="viewport" content="width=device-width, initial-scale=1">
117
+ <title>Page Title</title>
118
+ <!-- palace (keep fonts/ next to palace.css) -->
119
+ <link rel="stylesheet" href="/vendor/palace-ui/palace.css">
120
+ </head>
121
+ <body>
122
+ <!-- optional navbar -->
123
+ <!-- content -->
124
+ </body>
125
+ </html>
126
+ ```
127
+
128
+ ### Navbar
129
+
130
+ ```html
131
+ <nav class="navbar">
132
+ <a href="/" class="navbar-brand">App Name</a>
133
+ <div class="navbar-right">
134
+ <span class="navbar-user">Username</span>
135
+ <button class="btn btn-sm">Log Out</button>
136
+ </div>
137
+ </nav>
138
+ ```
139
+
140
+ With an icon beside the brand name (`.navbar-brand` uses `inline-flex` layout with `gap: 10px`; images/SVGs are auto-sized to 24×24):
141
+
142
+ ```html
143
+ <nav class="navbar">
144
+ <a href="/" class="navbar-brand">
145
+ <img src="/icons/app-icon.svg" alt="">
146
+ <span>App Name</span>
147
+ </a>
148
+ <div class="navbar-right">
149
+ <span class="navbar-user">Username</span>
150
+ <button class="btn btn-sm">Log Out</button>
151
+ </div>
152
+ </nav>
153
+ ```
154
+
155
+ Light variant for pages that need a white navbar:
156
+
157
+ ```html
158
+ <nav class="navbar navbar-light">
159
+ <a href="/" class="navbar-brand">App Name</a>
160
+ <div class="navbar-right">
161
+ <span class="navbar-user">Username</span>
162
+ <button class="btn btn-sm">Log Out</button>
163
+ </div>
164
+ </nav>
165
+ ```
166
+
167
+ ### Page Header
168
+
169
+ Standard spacing for non-hero pages (after navbar). Provides `48px` top padding and consistent gaps between h1, subtitle, and content.
170
+
171
+ ```html
172
+ <div class="container page-header">
173
+ <h1>Page Title</h1>
174
+ <p class="subtitle">Helpful subtitle</p>
175
+ <!-- content -->
176
+ </div>
177
+ ```
178
+
179
+ Combines with any container class:
180
+
181
+ ```html
182
+ <div class="container-narrow page-header">
183
+ <h1>Narrow Page</h1>
184
+ <p class="subtitle">For auth forms</p>
185
+ <!-- content -->
186
+ </div>
187
+ ```
188
+
189
+ Spacing: `48px` top padding, `8px` below h1, `32px` below `.subtitle`. Do **not** use on landing/hero pages (those use custom hero spacing).
190
+
191
+ ### Hero Section (Landing Pages)
192
+
193
+ ```html
194
+ <div class="container" style="padding-top: 80px; padding-bottom: 48px;">
195
+ <p class="brand">App Name</p>
196
+ <h1 class="h1-hero">Main Headline Here</h1>
197
+ <p class="tagline">
198
+ A sentence or two explaining what this does. Keep it short.
199
+ </p>
200
+ <div style="display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px;">
201
+ <a href="/signup" class="cta cta-primary">Sign Up</a>
202
+ <a href="/login" class="cta cta-secondary">Log In</a>
203
+ </div>
204
+ </div>
205
+ ```
206
+
207
+ When the app has a visual mark/icon, use `.brand-lockup` instead of a standalone `.brand`:
208
+
209
+ ```html
210
+ <div class="container" style="padding-top: 80px; padding-bottom: 48px;">
211
+ <div class="brand-lockup" style="margin-bottom: 32px;">
212
+ <img src="/icons/app-icon.svg" alt="">
213
+ <div>
214
+ <p class="brand" style="font-size: 17px; letter-spacing: 3px;">App Name</p>
215
+ <p class="subtitle">Short descriptor</p>
216
+ </div>
217
+ </div>
218
+ <h1 class="h1-hero">Main Headline Here</h1>
219
+ <!-- ... -->
220
+ </div>
221
+ ```
222
+
223
+ ### Brand Lockup
224
+
225
+ Icon beside app name and descriptor, forming a single cohesive block. The icon scales to match the combined text height.
226
+
227
+ ```html
228
+ <div class="brand-lockup">
229
+ <img src="/icons/app-icon.svg" alt="">
230
+ <div>
231
+ <p class="brand">App Name</p>
232
+ <p class="subtitle">Short descriptor</p>
233
+ </div>
234
+ </div>
235
+ ```
236
+
237
+ Use in hero sections and landing pages where the app has a visual mark. The `.brand` and `.subtitle` classes handle typography; `.brand-lockup` handles layout only.
238
+
239
+ ### Card List (3-Color Rotation)
240
+
241
+ When you have a list of cards, the accent color auto-rotates via `nth-child`:
242
+
243
+ ```html
244
+ <div class="container">
245
+ <div class="card">
246
+ <h2>First Card</h2>
247
+ <p>Description goes here. Color will be accent-1 (pink).</p>
248
+ </div>
249
+ <div class="card">
250
+ <h2>Second Card</h2>
251
+ <p>This one gets accent-2 (purple).</p>
252
+ </div>
253
+ <div class="card">
254
+ <h2>Third Card</h2>
255
+ <p>This one gets accent-3 (cyan).</p>
256
+ </div>
257
+ </div>
258
+ ```
259
+
260
+ For explicit accent control (e.g. server-rendered cards), use the `--accent` custom property:
261
+
262
+ ```html
263
+ <div class="card" style="--accent: var(--p-accent-2)">
264
+ <h2>Specific Accent</h2>
265
+ </div>
266
+ ```
267
+
268
+ ### Static Card
269
+
270
+ For cards used as form containers or static content that should not lift on hover:
271
+
272
+ ```html
273
+ <div class="card-static">
274
+ <label for="name">Name</label>
275
+ <input type="text" id="name" placeholder="Enter your name">
276
+ </div>
277
+ ```
278
+
279
+ Use `.card-static` instead of `.card` when the card is a container (e.g. auth forms, settings panels) rather than a clickable list item.
280
+
281
+ ### Buttons
282
+
283
+ Size modifiers compose with any color variant:
284
+
285
+ ```html
286
+ <!-- Size modifiers -->
287
+ <button class="btn btn-sm btn-primary">Small Primary</button>
288
+ <button class="btn btn-primary">Medium Primary</button>
289
+ <button class="btn btn-lg btn-primary">Large Primary</button>
290
+
291
+ <!-- Primary (hot pink) — main actions -->
292
+ <button class="btn btn-primary">Create</button>
293
+
294
+ <!-- Secondary (purple) — secondary actions -->
295
+ <button class="btn btn-secondary">Copy</button>
296
+
297
+ <!-- Outline (transparent) — tertiary actions -->
298
+ <button class="btn btn-outline">View Details</button>
299
+
300
+ <!-- Danger (red) — destructive inline actions -->
301
+ <button class="btn btn-sm btn-danger">Revoke</button>
302
+
303
+ <!-- Danger full-width — destructive section actions -->
304
+ <button class="btn btn-danger btn-block">Delete My Account</button>
305
+
306
+ <!-- CTA (larger) — hero sections. `.cta` is a semantic alias for `.btn-lg` -->
307
+ <a href="/signup" class="cta cta-primary">Sign Up</a>
308
+ <a href="/login" class="cta cta-secondary">Log In</a>
309
+
310
+ <!-- Disabled (any button) -->
311
+ <button class="btn btn-primary" disabled>Processing...</button>
312
+ ```
313
+
314
+ ### Forms
315
+
316
+ ```html
317
+ <div class="card">
318
+ <label for="name">Your Name</label>
319
+ <input type="text" id="name" placeholder="Enter your name" style="margin-bottom: 16px;">
320
+ <button class="btn-primary" style="width: 100%;">Submit</button>
321
+ </div>
322
+ ```
323
+
324
+ Inline form (input + button side by side):
325
+
326
+ ```html
327
+ <div style="display: flex; gap: 8px;">
328
+ <input type="text" placeholder="Label" style="flex: 1;">
329
+ <button class="btn-primary">Create</button>
330
+ </div>
331
+ ```
332
+
333
+ ### Status Messages
334
+
335
+ ```html
336
+ <!-- Success — use role="status" for polite announcements -->
337
+ <div class="status status-success" role="status">Account created successfully</div>
338
+
339
+ <!-- Error — use role="alert" for urgent announcements -->
340
+ <div class="status status-error" role="alert">Something went wrong</div>
341
+
342
+ <!-- Warning — use role="alert" for urgent announcements -->
343
+ <div class="status status-warning" role="alert">Your session will expire soon</div>
344
+
345
+ <!-- Info — use role="status" for polite announcements -->
346
+ <div class="status status-info" role="status">New features are available</div>
347
+
348
+ <!-- Neutral (base, no color variant) -->
349
+ <div class="status">Neutral message</div>
350
+ ```
351
+
352
+ Use `role="alert"` for error and warning messages (assertive — interrupts the user). Use `role="status"` for success and info messages (polite — announced at the next opportunity). Omit the role for neutral/static messages that don't need to be announced.
353
+
354
+ Show/hide with JavaScript:
355
+ ```js
356
+ function showStatus(el, msg, type) {
357
+ el.textContent = msg;
358
+ el.className = 'status status-' + type; // 'success', 'error', 'warning', 'info'
359
+ el.style.display = 'block';
360
+ }
361
+ ```
362
+
363
+ ### Tables
364
+
365
+ ```html
366
+ <table>
367
+ <thead>
368
+ <tr>
369
+ <th>Name</th>
370
+ <th>Value</th>
371
+ <th>Date</th>
372
+ </tr>
373
+ </thead>
374
+ <tbody>
375
+ <tr>
376
+ <td>Compression</td>
377
+ <td style="font-weight: 600;">12 clicks</td>
378
+ <td>Mar 1, 2026</td>
379
+ </tr>
380
+ </tbody>
381
+ </table>
382
+ ```
383
+
384
+ ### Code Blocks
385
+
386
+ Standard code block:
387
+ ```html
388
+ <pre>const config = {
389
+ server: "https://example.com"
390
+ };</pre>
391
+ ```
392
+
393
+ Dark reveal panel (for secrets, API keys, terminal output):
394
+ ```html
395
+ <div class="code-reveal">
396
+ <p class="eyebrow" style="color: var(--p-accent-3); margin-bottom: 10px;">
397
+ Copy this — you won't see it again
398
+ </p>
399
+ <code>sk_live_abc123def456</code>
400
+ <div style="display: flex; gap: 8px; margin-top: 12px;">
401
+ <button class="btn-secondary">Copy</button>
402
+ </div>
403
+ </div>
404
+ ```
405
+
406
+ ### Tags & Badges
407
+
408
+ ```html
409
+ <!-- Tag (bordered, light background) -->
410
+ <span class="tag">Volume Spacer</span>
411
+
412
+ <!-- Badge (dark background, white text) -->
413
+ <span class="badge">clicks</span>
414
+ ```
415
+
416
+ ### Steps (Numbered Instructions)
417
+
418
+ ```html
419
+ <div class="steps">
420
+ <div class="step">
421
+ <span class="step-num">1</span>
422
+ <p><strong>Create an account</strong> with a passkey</p>
423
+ </div>
424
+ <div class="step">
425
+ <span class="step-num">2</span>
426
+ <p><strong>Get an API key</strong> and paste the config</p>
427
+ </div>
428
+ <div class="step">
429
+ <span class="step-num">3</span>
430
+ <p><strong>Go.</strong> Start using the tools</p>
431
+ </div>
432
+ </div>
433
+ ```
434
+
435
+ ### Stack Spacing
436
+
437
+ Uniform vertical spacing between direct children. Apply to the parent element.
438
+
439
+ ```html
440
+ <div class="stack-md">
441
+ <p>First item</p>
442
+ <p>16px gap</p>
443
+ <p>16px gap</p>
444
+ </div>
445
+ ```
446
+
447
+ Available: `stack-xs` (4px) · `stack-sm` (8px) · `stack-md` (16px) · `stack-lg` (24px) · `stack-xl` (32px) · `stack-2xl` (48px)
448
+
449
+ For flex/grid parents, prefer `gap` instead. `.stack-*` is for flow-layout contexts where children are block-level elements stacked vertically.
450
+
451
+ ### Dividers
452
+
453
+ ```html
454
+ <!-- Standard dashed divider -->
455
+ <hr class="divider">
456
+
457
+ <!-- Danger divider (above danger zones) -->
458
+ <hr class="divider-danger">
459
+ ```
460
+
461
+ ### Danger Zone
462
+
463
+ ```html
464
+ <hr class="divider-danger">
465
+ <div class="danger-zone">
466
+ <h2>Danger Zone</h2>
467
+ <p>This will permanently delete your account. This cannot be undone.</p>
468
+ <button class="btn btn-danger btn-block">Delete My Account</button>
469
+ </div>
470
+ ```
471
+
472
+ ### Footer
473
+
474
+ ```html
475
+ <div class="container">
476
+ <div class="footer">
477
+ Built with care. <a href="/">Home</a>
478
+ </div>
479
+ </div>
480
+ ```
481
+
482
+ ### Empty States
483
+
484
+ ```html
485
+ <p class="empty">No items yet</p>
486
+ ```
487
+
488
+ ### Gradient Stripe
489
+
490
+ A thin (3px) animated gradient divider. Uses the 3-accent gradient with a shifting `background-position`.
491
+
492
+ ```html
493
+ <hr class="gradient-stripe">
494
+ ```
495
+
496
+ Use between header and content, or between major sections as a vibrant alternative to `.divider`.
497
+
498
+ ### Stat Callout
499
+
500
+ Oversized number with a small label below. Picks up the card's `--accent` color automatically.
501
+
502
+ ```html
503
+ <div>
504
+ <div class="stat">180mm</div>
505
+ <div class="stat-label">Travel</div>
506
+ </div>
507
+ ```
508
+
509
+ Group multiple stats in a flex row with `.stat-row`:
510
+
511
+ ```html
512
+ <div class="stat-row">
513
+ <div>
514
+ <div class="stat">180mm</div>
515
+ <div class="stat-label">Travel</div>
516
+ </div>
517
+ <div>
518
+ <div class="stat">20%</div>
519
+ <div class="stat-label">Sag</div>
520
+ </div>
521
+ </div>
522
+ ```
523
+
524
+ ### Sticker Tags
525
+
526
+ Filled accent-colored tags with slight rotation for a sticker-board feel. Use instead of `.tag` when you want more visual pop.
527
+
528
+ ```html
529
+ <span class="tag-sticker">Volume Spacer</span>
530
+ <span class="tag-sticker">Custom Tune</span>
531
+ <span class="tag-sticker">Bleed Kit</span>
532
+ ```
533
+
534
+ Rotation alternates automatically via `nth-child`. Tags pick up `--accent` from their parent card.
535
+
536
+ ### Entrance Animation
537
+
538
+ Fade-up entrance for staggered card lists. Apply `.fade-up` and set `animation-delay` per element.
539
+
540
+ ```html
541
+ <div class="card fade-up" style="animation-delay: 0s">...</div>
542
+ <div class="card fade-up" style="animation-delay: 0.1s">...</div>
543
+ <div class="card fade-up" style="animation-delay: 0.2s">...</div>
544
+ ```
545
+
546
+ Uses `animation-fill-mode: both` so elements stay hidden until their delay fires.
547
+
548
+ ### Watermark Background
549
+
550
+ Fixed-position SVG watermarks for visual texture. Non-interactive (`pointer-events: none`), very low opacity.
551
+
552
+ ```html
553
+ <div class="watermarks">
554
+ <svg style="top: 10%; left: -5%;"><!-- SVG content --></svg>
555
+ <svg style="top: 50%; right: -5%;"><!-- SVG content --></svg>
556
+ </div>
557
+ ```
558
+
559
+ ### Lists
560
+
561
+ Lists inside `.container` or `.container-narrow` are automatically styled with proper padding and markers:
562
+
563
+ ```html
564
+ <div class="container">
565
+ <ul>
566
+ <li>Unordered list item</li>
567
+ <li>Another item</li>
568
+ </ul>
569
+ <ol>
570
+ <li>Ordered list item</li>
571
+ <li>Another item</li>
572
+ </ol>
573
+ </div>
574
+ ```
575
+
576
+ ### Dialog
577
+
578
+ A native `<dialog>` styled as a card: border, purple offset shadow, overlay backdrop. Actions go in a `<menu>`; its buttons share the width equally.
579
+
580
+ ```html
581
+ <dialog>
582
+ <h2>Title</h2>
583
+ <p class="subtitle">Supporting line</p>
584
+ <p>Body text.</p>
585
+ <menu>
586
+ <li><button class="btn">Cancel</button></li>
587
+ <li><button class="btn btn-primary">Confirm</button></li>
588
+ </menu>
589
+ </dialog>
590
+ ```
591
+
592
+ ### Kbd
593
+
594
+ Inline keyboard key: bordered, uppercase mono, with a small pink offset shadow.
595
+
596
+ ```html
597
+ <kbd>Ctrl</kbd> + <kbd>Z</kbd>
598
+ ```
599
+
600
+ ## Accessibility
601
+
602
+ ### Focus Visible
603
+
604
+ All interactive elements (buttons, links, inputs) have `:focus-visible` styles with a `2px` outline in accent-2 (purple) and `2px` offset. Buttons also get a lift + shadow on focus.
605
+
606
+ ### Reduced Motion
607
+
608
+ The system respects `prefers-reduced-motion: reduce`. When enabled, all animations and transitions are effectively disabled (duration set to `0.01ms`).
609
+
610
+ ### Contrast
611
+
612
+ - Third-card headings (cyan rotation) use dark text (`--p-text`) instead of cyan for accessible contrast on white
613
+ - `--p-text-faint` is `#6b6b6b` (4.5:1 contrast ratio on `#f0f0f0`)
614
+
615
+ ## Icon Style
616
+
617
+ When creating SVG icons for palace-ui projects:
618
+
619
+ - Use **stroke-based** icons (not filled)
620
+ - `stroke-linecap: square` and `stroke-linejoin: miter` (matches the hard-edge aesthetic)
621
+ - `stroke-width: 2` (matches `--p-border-width`)
622
+ - Color with `currentColor` so icons inherit text color
623
+
624
+ ## Layout Patterns
625
+
626
+ ### Auth Pages (Login, Register)
627
+
628
+ Use `container-narrow page-header` (420px). No navbar. Centered with top padding.
629
+
630
+ ```html
631
+ <body>
632
+ <div class="container-narrow page-header">
633
+ <p class="brand">App Name</p>
634
+ <h1>Page Title</h1>
635
+ <p class="subtitle">Helpful subtitle</p>
636
+ <div class="card">
637
+ <!-- form contents -->
638
+ </div>
639
+ <p style="margin-top: 20px; text-align: center; font-size: 13px; color: var(--p-text-muted);">
640
+ Already in? <a href="/login">Log in</a>
641
+ </p>
642
+ </div>
643
+ </body>
644
+ ```
645
+
646
+ ### Dashboard Pages
647
+
648
+ Navbar + container with `page-header`. Use `divider` between major sections.
649
+
650
+ ```html
651
+ <body>
652
+ <nav class="navbar">...</nav>
653
+ <div class="container page-header">
654
+ <h1>Dashboard</h1>
655
+ <p class="subtitle">Manage your stuff</p>
656
+ <!-- content sections -->
657
+ <hr class="divider">
658
+ <!-- more sections -->
659
+ <hr class="divider-danger">
660
+ <div class="danger-zone">...</div>
661
+ </div>
662
+ </body>
663
+ ```
664
+
665
+ ### Landing/Public Pages
666
+
667
+ Full container, no navbar. Hero section, then card list, then footer.
668
+
669
+ ```html
670
+ <body>
671
+ <div class="container" style="padding-top: 80px; padding-bottom: 48px;">
672
+ <!-- hero -->
673
+ </div>
674
+ <div class="container" style="padding-bottom: 20px;">
675
+ <!-- card list -->
676
+ </div>
677
+ <div class="container">
678
+ <div class="footer">...</div>
679
+ </div>
680
+ </body>
681
+ ```
682
+
683
+ ## Interaction Rules
684
+
685
+ 1. **Hover = lift + shadow.** Elements move `translate(-1px, -1px)` or `translate(-2px, -2px)` and cast a hard shadow in the opposite direction. Shadow color matches the element's accent.
686
+ 2. **Focus = border-color + shadow.** Input focus changes border to accent-2 (purple) and adds a `3px 3px 0` shadow. Number inputs focus to accent-1 (pink).
687
+ 3. **Disabled = flat gray.** `#ddd` background, `#999` text, `#ccc` border. No transform, no shadow, `cursor: not-allowed`.
688
+ 4. **Transitions are 0.1s.** Never slower. The UI should feel mechanical and responsive.
689
+ 5. **Links underline with border-bottom**, not `text-decoration`. Hover swaps from accent-2 (purple) to accent-1 (pink).
690
+ 6. **`@keyframes` ≠ transitions.** The 0.1s rule applies to hover/focus transitions. Entrance animations (`@keyframes`) and infinite loops (gradient-shift) use their own appropriate durations.
691
+ 7. **Gradient stripes** are decorative (≤3px). They use the 3-accent gradient with animated `background-position`. This is not a "gradient surface."
692
+
693
+ ## Color Usage Rules
694
+
695
+ - **accent-1 (pink):** Primary buttons, first card in a list, CTA buttons, link hover color
696
+ - **accent-2 (purple):** Secondary buttons, links, input focus borders, second card
697
+ - **accent-3 (cyan):** Navbar user name, code highlights, key reveal borders, third card
698
+ - **Never mix** accent colors in a single element (except the gradient on h1 text)
699
+ - **The 3-color rotation** applies to any list of sibling cards: 1=pink, 2=purple, 3=cyan, 4=pink...
700
+ - **Error is always `#ff4444`**, success is always `#00ff88`, warning is `#ffcc00`, info is `#00e5ff`. Status colors are not accent colors.
701
+
702
+ ## Do's and Don'ts
703
+
704
+ ### Do
705
+ - Use uppercase for headings, labels, buttons, badges, and status messages
706
+ - Use the 3-color card rotation for any list of cards
707
+ - Keep `border-radius: 0` everywhere
708
+ - Use `2px solid` borders on cards, buttons, inputs
709
+ - Use hard shadows (`Npx Npx 0 color`) — never blurred shadows
710
+ - Use `font-weight: 700` for headings and buttons
711
+ - Use `letter-spacing` on all uppercase text (0.5px to 2px)
712
+ - Keep containers at 640px max width
713
+ - Use dashed borders for dividers (`2px dashed #ccc`)
714
+
715
+ ### Don't
716
+ - Add border-radius to anything
717
+ - Use `box-shadow` with blur (the third value must always be `0`)
718
+ - Use gradients on large surfaces or card backgrounds (allowed on: text, decorative stripes ≤3px, narrow fixed bars)
719
+ - Use colors outside the token system
720
+ - Use `text-decoration: underline` for links (use `border-bottom` instead)
721
+ - Use hover/focus transitions slower than `0.1s` (keyframe animations are exempt)
722
+ - Put body text in uppercase (only headings, labels, buttons)
723
+ - Use more than 640px for content width
724
+ - Create soft/subtle hover effects — make them obvious
725
+
726
+ ## Responsive Breakpoint
727
+
728
+ Single breakpoint at `480px`:
729
+
730
+ ```css
731
+ @media (max-width: 480px) {
732
+ /* h1 shrinks, container gets tighter padding, cards lose some padding */
733
+ }
734
+ ```
735
+
736
+ Palace CSS handles h1, container, and card adjustments automatically. For page-specific adjustments:
737
+
738
+ ```css
739
+ @media (max-width: 480px) {
740
+ .hero { padding: 48px 16px 32px; }
741
+ .cta-row { flex-direction: column; }
742
+ }
743
+ ```