picasso-skill 1.5.1 → 2.0.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 (44) hide show
  1. package/agents/picasso.md +14 -2
  2. package/checklists/pre-ship.md +83 -0
  3. package/commands/backlog.md +34 -0
  4. package/commands/variants.md +18 -0
  5. package/package.json +3 -1
  6. package/references/accessibility-wcag.md +245 -0
  7. package/references/anti-patterns.md +184 -0
  8. package/references/color-and-contrast.md +477 -0
  9. package/references/component-patterns.md +113 -0
  10. package/references/conversion-design.md +193 -0
  11. package/references/data-visualization.md +226 -0
  12. package/references/depth-and-elevation.md +211 -0
  13. package/references/design-system.md +176 -0
  14. package/references/generative-art.md +648 -0
  15. package/references/interaction-design.md +162 -0
  16. package/references/modern-css-performance.md +361 -0
  17. package/references/motion-and-animation.md +267 -0
  18. package/references/performance-optimization.md +746 -0
  19. package/references/react-patterns.md +318 -0
  20. package/references/responsive-design.md +452 -0
  21. package/references/sensory-design.md +369 -0
  22. package/references/spatial-design.md +176 -0
  23. package/references/style-presets.md +502 -0
  24. package/references/tools-catalog.md +103 -0
  25. package/references/typography.md +415 -0
  26. package/references/ux-psychology.md +235 -0
  27. package/references/ux-writing.md +513 -0
  28. package/skills/picasso/SKILL.md +58 -2
  29. package/skills/picasso/references/animation-performance.md +244 -0
  30. package/skills/picasso/references/brand-and-identity.md +136 -0
  31. package/skills/picasso/references/code-typography.md +222 -0
  32. package/skills/picasso/references/color-and-contrast.md +56 -2
  33. package/skills/picasso/references/dark-mode.md +199 -0
  34. package/skills/picasso/references/depth-and-elevation.md +211 -0
  35. package/skills/picasso/references/i18n-visual-patterns.md +177 -0
  36. package/skills/picasso/references/images-and-media.md +222 -0
  37. package/skills/picasso/references/loading-and-states.md +258 -0
  38. package/skills/picasso/references/micro-interactions.md +291 -0
  39. package/skills/picasso/references/motion-and-animation.md +9 -2
  40. package/skills/picasso/references/navigation-patterns.md +247 -0
  41. package/skills/picasso/references/style-presets.md +1 -1
  42. package/skills/picasso/references/tables-and-forms.md +227 -0
  43. package/skills/picasso/references/tools-catalog.md +103 -0
  44. package/skills/picasso/references/typography.md +45 -2
@@ -0,0 +1,193 @@
1
+ # Conversion Design & Landing Page Reference
2
+
3
+ ## 1. Landing Page Anatomy
4
+
5
+ ### Hero Section Variations
6
+
7
+ | Pattern | Best For | Key Spec |
8
+ |---------|----------|----------|
9
+ | **Split** (text left, visual right) | SaaS, B2B | 50/50 or 60/40 split; text column gets primary CTA |
10
+ | **Centered** (text stacked over image) | Brand launches, simple products | Max 600-700px text width; single focal CTA below headline |
11
+ | **Full-bleed media** (text overlay) | Lifestyle, hospitality, portfolios | 4.5:1 contrast on overlay text; darken overlay at 40-60% opacity |
12
+ | **Video background** | High-engagement storytelling | Auto-mute; < 5s to first frame; fallback static image required |
13
+
14
+ **Above-the-fold priorities (in order):** Value proposition headline, supporting subhead (1-2 sentences), primary CTA, trust signal (logo bar or stat).
15
+
16
+ Users form an opinion in **50 milliseconds**. Every extra 100KB in hero media increases bounce by ~1.8%.
17
+
18
+ ### CTA Design
19
+
20
+ - **Minimum size:** 44x44px (Apple/WCAG), 48x48px (Material).
21
+ - **Color:** 3:1+ contrast ratio against background; prominence matters more than specific color.
22
+ - **Placement:** Above fold in hero; repeat after mid-page value build; repeat near final content.
23
+ - **Copy:** First-person ("Start my free trial") outperforms second-person by 10-90%.
24
+ - **Repetition:** Single consistent CTA repeated 2-3 times, not multiple competing actions.
25
+
26
+ ### Social Proof Patterns
27
+
28
+ | Type | Effectiveness | Placement |
29
+ |------|--------------|-----------|
30
+ | Star ratings + reviews | 82% influence | Near pricing/CTA |
31
+ | Customer testimonials | 78% influence | After feature sections |
32
+ | Video testimonials | +34% conversion lift | Mid-page or dedicated section |
33
+ | Client logos | Trust signal | Directly below hero |
34
+ | User count / stats | Up to +43% conversion | Hero section or sub-hero |
35
+ | Security badges | Reduces abandonment | Near forms and payment |
36
+
37
+ ### Pricing Page Design
38
+
39
+ **3 tiers optimal** (center-stage effect). Structure per card:
40
+ 1. Tier name + "best for" one-liner
41
+ 2. Price with billing toggle (default annual; show savings as % AND dollar)
42
+ 3. Primary CTA button (below price, above features)
43
+ 4. 8-12 core features with checkmarks/values
44
+
45
+ **Highlight recommended tier:** Distinct background, "Most Popular" badge, border emphasis, or elevation. Produces 12-15% lift in mid-tier selection.
46
+
47
+ ---
48
+
49
+ ## 2. Conversion Psychology
50
+
51
+ ### Visual Hierarchy for Conversion
52
+
53
+ Follow the **F-pattern**: headline, key benefit, and CTA along the top-left-to-bottom path. **Z-pattern** for simpler pages: logo top-left, nav CTA top-right, content center diagonal, conversion CTA bottom-right.
54
+
55
+ ### Scarcity & Urgency (Ethical Only)
56
+ - Real-time inventory counts -- only truthful data.
57
+ - Time-limited offers with visible countdown -- only genuine deadlines.
58
+ - Social proof urgency ("42 people viewing") -- must reflect real data.
59
+
60
+ ### Trust Signals Hierarchy
61
+ 1. Security badges (SSL, payment logos) -- near checkout/forms.
62
+ 2. Money-back guarantees -- near CTA.
63
+ 3. Third-party reviews (G2, Trustpilot) -- 82% influence.
64
+ 4. Customer logos -- below hero.
65
+ 5. Certifications (SOC 2, GDPR, HIPAA) -- footer or trust section.
66
+
67
+ ### Friction Reduction
68
+ - Each additional form field reduces completion by 3-5%.
69
+ - Multi-step forms: 300% higher conversion on mobile vs single long form.
70
+ - Progress bars: +20-30% form completion when visible.
71
+ - Smart defaults: pre-fill known data; appropriate input types.
72
+ - Single-column layout mandatory on mobile.
73
+ - Inline validation on blur, not on submit.
74
+
75
+ ---
76
+
77
+ ## 3. Mobile Conversion Patterns
78
+
79
+ ### Sticky CTAs
80
+ - Position 100-150px from bottom viewport, above gesture areas.
81
+ - 10-20% conversion improvement on long pages.
82
+ - Must not cover critical content; include dismiss option.
83
+ - Pair with micro trust note: "No credit card required."
84
+
85
+ ### Thumb Zone Design
86
+ - **Primary actions:** Lower-center of screen (natural thumb reach).
87
+ - **Navigation:** Bottom bar with 3-5 destinations.
88
+ - **Avoid:** Top corners for frequent actions.
89
+ - **Tap targets:** Minimum 48px square with spacing.
90
+
91
+ ### Bottom Sheets & Swipe
92
+ - Bottom sheets for secondary actions, filters, confirmations.
93
+ - Swipe-to-dismiss for non-critical modals.
94
+ - Swipe actions on list items for quick operations.
95
+
96
+ ### One-Tap Actions
97
+ - Apple Pay / Google Pay for instant checkout.
98
+ - Social login to reduce signup friction.
99
+ - Quick-reply chips in notifications and chat.
100
+
101
+ ---
102
+
103
+ ## 4. Navigation & Information Architecture
104
+
105
+ ### Navigation by App Type
106
+
107
+ | App Type | Primary Pattern | Key Feature |
108
+ |----------|----------------|-------------|
109
+ | **SaaS** | Left sidebar + top bar | Collapsible sidebar; breadcrumbs for depth |
110
+ | **E-commerce** | Mega menu + category nav | Faceted filtering; persistent cart with count |
111
+ | **Content** | Top nav + hamburger (mobile) | Search-forward; reading progress indicator |
112
+ | **Social** | Bottom tab bar (mobile) | 3-5 tabs; notification badges; create center |
113
+
114
+ ### Search UX
115
+ - Autocomplete after 2-3 characters; limit to 5-7 results.
116
+ - Display recent searches on focus before typing.
117
+ - Surface top 3-5 filters inline; bottom sheet for advanced.
118
+ - No results: offer spelling corrections, related terms, category browsing.
119
+
120
+ ### Infinite Scroll vs Pagination
121
+
122
+ | Criterion | Pagination | Infinite Scroll | Load More |
123
+ |-----------|-----------|----------------|-----------|
124
+ | Content type | Structured data, tables | Discovery feeds, social | Catalogs, search |
125
+ | User intent | Find specific item | Browse/explore | Mixed |
126
+ | SEO need | High (unique URLs) | Low | Medium |
127
+ | Accessibility | Best | Worst | Good |
128
+ | Mobile performance | Good | Memory risk | Good |
129
+
130
+ ### Breadcrumbs
131
+ Use for hierarchies 3+ levels deep. Place below top nav, above page title. Truncate middle items on mobile with ellipsis.
132
+
133
+ ---
134
+
135
+ ## 5. Onboarding UX
136
+
137
+ ### Progressive Onboarding Framework
138
+
139
+ **Phase 1 -- Signup:** Ask only email + password (or social login). Defer profile details until after first value moment.
140
+
141
+ **Phase 2 -- First-run experience:** Welcome screen with 1-2 sentence value prop. 3-5 step setup wizard for essential configuration. Pre-populated sample data so the product feels alive.
142
+
143
+ **Phase 3 -- Feature discovery (ongoing):** Contextual tooltips triggered by user behavior, not on first load. Checklist widget showing setup progress (drives 70%+ completion). Celebrate milestones.
144
+
145
+ ### Tooltips vs Modals vs Coachmarks
146
+
147
+ | Pattern | Use When | Avoid When |
148
+ |---------|----------|------------|
149
+ | **Tooltips** | Explaining a single element | More than 1-2 on screen |
150
+ | **Modals** | Critical announcements, required input | Interrupting flow; never on first load for tours |
151
+ | **Coachmarks** | Introducing 3-5 key features in sequence | Users are mid-task; keep under 5 steps |
152
+ | **Hotspots** | Passive discovery of new features | Overuse trains users to ignore them |
153
+
154
+ ### Empty States
155
+ Every empty state needs: (1) Illustration/icon, (2) Brief explanation, (3) Primary action CTA, (4) Optional link to docs/help.
156
+
157
+ ---
158
+
159
+ ## 6. Email & Notification Design
160
+
161
+ ### Transactional Email Structure
162
+ Brand header, clear subject line, single-column body at 600px max width, primary action button (min 44px height, full-width mobile), minimal footer with unsubscribe.
163
+
164
+ ### Notification Hierarchy
165
+
166
+ | Level | Channel | Timing |
167
+ |-------|---------|--------|
168
+ | **Urgent** | Push + in-app + email | Immediate |
169
+ | **Informational** | In-app + email | Batched or near-real-time |
170
+ | **Promotional** | Email only | Scheduled; respect quiet hours |
171
+
172
+ ### Push Notification UX
173
+ - 40-50 character headline max.
174
+ - Deep-link to relevant screen, not app home.
175
+ - Limit to 3-5 per day.
176
+ - Implement quiet hours (default 10 PM - 8 AM local time).
177
+
178
+ ---
179
+
180
+ ## Quick Reference: Conversion Numbers
181
+
182
+ | Metric | Value |
183
+ |--------|-------|
184
+ | First impression time | 50ms |
185
+ | Mobile bounce if load > 3s | 53% |
186
+ | First-person CTA copy lift | 10-90% |
187
+ | Drop per extra form field | 3-5% |
188
+ | Progress bar completion boost | 20-30% |
189
+ | Multi-step form mobile lift | up to 300% |
190
+ | Video testimonial lift | +34% |
191
+ | Sticky mobile CTA lift | 10-20% |
192
+ | "Most Popular" badge lift | 12-15% |
193
+ | Per extra second load time | 7-10% drop |
@@ -0,0 +1,226 @@
1
+ # Data Visualization & Dashboard Design Reference
2
+
3
+ ## 1. Chart Selection Decision Matrix
4
+
5
+ Select charts by the **question your data answers**, not by what looks interesting.
6
+
7
+ | Purpose | Recommended Charts | Avoid |
8
+ |---|---|---|
9
+ | **Comparison** (categories vs values) | Bar (vertical/horizontal), Grouped bar, Lollipop | Pie (hard to compare slices) |
10
+ | **Trend over time** (time-series) | Line, Area, Sparkline | Bar (unless discrete intervals) |
11
+ | **Composition** (parts of a whole) | Stacked bar, Pie/Donut (<=6 slices), Treemap | Line chart |
12
+ | **Distribution** (spread/frequency) | Histogram, Box plot, Violin, Scatter | Pie chart |
13
+ | **Relationship** (two+ numeric vars) | Scatter, Bubble (3rd variable as size) | Bar chart |
14
+ | **Ranking** (ordered comparison) | Horizontal bar (sorted), Lollipop | Pie/Donut |
15
+ | **Flow/Conversion** (sequential stages) | Funnel, Sankey | Bar chart |
16
+ | **Performance vs target** (single KPI) | Gauge, Bullet chart | Pie chart |
17
+ | **Inline trend indicator** (compact) | Sparkline (word-sized) | Full chart |
18
+ | **Intensity/correlation** (two categorical axes) | Heatmap | 3D bar charts |
19
+
20
+ ### Quick Decision Flow
21
+
22
+ ```
23
+ What are you showing?
24
+ -> Change over time? -> Line (continuous) / Bar (discrete intervals)
25
+ -> Comparison? -> Bar (horizontal if labels are long)
26
+ -> Part of whole? -> Donut (<=6 cats) / Treemap (many) / Stacked bar (over time)
27
+ -> Relationship? -> Scatter / Bubble
28
+ -> Distribution? -> Histogram / Box plot
29
+ -> Single KPI? -> Big number card with sparkline
30
+ ```
31
+
32
+ ---
33
+
34
+ ## 2. Dashboard Design Patterns
35
+
36
+ ### Layout Patterns
37
+
38
+ **Overview + Detail (most common):** Top row = KPI summary cards. Middle = primary charts. Bottom = detailed tables or drill-down views.
39
+
40
+ **Drill-Down:** Start with high-level aggregates; clicking reveals progressively granular data. Use breadcrumbs for navigation context.
41
+
42
+ **Contextual/Filtered:** Global filter bar at top. All panels respond to the same filter state.
43
+
44
+ ### Grid System
45
+
46
+ Use a **12-column grid** with 16-24px gutters.
47
+
48
+ ```
49
+ | KPI | KPI | KPI | KPI | <- 3-col each (4 cards)
50
+ | Primary Chart | Secondary | <- 8-col + 4-col
51
+ | Data Table | <- 12-col full width
52
+ ```
53
+
54
+ ### KPI Card Anatomy
55
+
56
+ ```
57
+ +----------------------------------+
58
+ | Revenue +12.3% ^ | <- Label + trend indicator
59
+ | $1,234,567 | <- Primary metric (large)
60
+ | vs $1,098,000 target | <- Comparison context
61
+ | ________ sparkline | <- Trend line (last 30 days)
62
+ +----------------------------------+
63
+ ```
64
+
65
+ **Rules:**
66
+ - Always pair KPIs with context (target, prior period, benchmark).
67
+ - Semantic color only for status: green = on track, amber = warning, red = critical.
68
+ - Show "Last updated" timestamp on every dashboard.
69
+ - Limit to 4-8 KPI cards maximum per view.
70
+
71
+ ### Real-Time Data Display
72
+
73
+ - Visible "live" indicator or timestamp for data freshness.
74
+ - CSS transitions for value changes (fade or count-up animation).
75
+ - Avoid polling faster than ~5s minimum.
76
+
77
+ ---
78
+
79
+ ## 3. Color for Data
80
+
81
+ ### Sequential (low-to-high, single variable)
82
+ ```
83
+ Blues: #f7fbff -> #9ecae1 -> #08519c -> #08306b
84
+ Viridis: #fde725 -> #35b779 -> #31688e -> #440154
85
+ ```
86
+ Light = low, dark = high.
87
+
88
+ ### Diverging (two extremes with neutral midpoint)
89
+ ```
90
+ RdBu: #b2182b -> #f4a582 -> #f7f7f7 -> #92c5de -> #2166ac
91
+ PRGn: #762a83 -> #c2a5cf -> #f7f7f7 -> #a6dba0 -> #1b7837
92
+ ```
93
+ Use for deviation from center (profit/loss, above/below average).
94
+
95
+ ### Qualitative / Categorical (distinct groups)
96
+ ```
97
+ Tableau 10: #4e79a7 #f28e2c #e15759 #76b7b2 #59a14f #edc949 #af7aa1 #ff9da7 #9c755f #bab0ab
98
+ Okabe-Ito: #E69F00 #56B4E9 #009E73 #F0E442 #0072B2 #D55E00 #CC79A7 #000000
99
+ ```
100
+
101
+ ### OKLCH Programmatic Palettes
102
+
103
+ ```css
104
+ /* Sequential: same hue, vary lightness */
105
+ --color-1: oklch(0.95 0.03 250); /* lightest */
106
+ --color-2: oklch(0.75 0.08 250);
107
+ --color-3: oklch(0.55 0.13 250);
108
+ --color-4: oklch(0.35 0.15 250); /* darkest */
109
+
110
+ /* Qualitative: same lightness+chroma, rotate hue */
111
+ --cat-1: oklch(0.7 0.12 30); /* orange */
112
+ --cat-2: oklch(0.7 0.12 230); /* blue */
113
+ --cat-3: oklch(0.7 0.12 150); /* green */
114
+ --cat-4: oklch(0.7 0.12 330); /* pink */
115
+ ```
116
+
117
+ ### Colorblind-Safe Rules
118
+
119
+ 1. **Default to Okabe-Ito** for categorical data.
120
+ 2. **Never use red/green as the only differentiator.**
121
+ 3. **Use Viridis** for sequential scales.
122
+ 4. **Blue is the safest single hue.**
123
+ 5. **Supplement color with shape, pattern, or label** (WCAG 1.4.1).
124
+ 6. **Limit categorical colors to 6-8 max.**
125
+
126
+ ---
127
+
128
+ ## 4. Chart Accessibility
129
+
130
+ ### Text Alternatives (WCAG 1.1.1)
131
+
132
+ ```jsx
133
+ <figure>
134
+ <svg role="img" aria-labelledby="chart-title" aria-describedby="chart-desc">
135
+ <title id="chart-title">Quarterly Revenue</title>
136
+ <desc id="chart-desc">Bar chart showing revenue growth from $1.2M in Q1 to $1.5M in Q4.</desc>
137
+ </svg>
138
+ <details>
139
+ <summary>View data table</summary>
140
+ <table><!-- structured data as accessible fallback --></table>
141
+ </details>
142
+ </figure>
143
+ ```
144
+
145
+ ### Keyboard Navigation
146
+ - All interactive chart elements must be focusable.
147
+ - Arrow keys move between data points within a series.
148
+ - Enter/Space to activate (drill-down, tooltip).
149
+ - Escape to dismiss tooltips.
150
+
151
+ ### Visual Patterns for Colorblindness
152
+ Use SVG fill patterns alongside color so colorblind users and grayscale remain readable.
153
+
154
+ ---
155
+
156
+ ## 5. React Charting Libraries
157
+
158
+ | Library | Best For | Bundle Size | Learning Curve |
159
+ |---|---|---|---|
160
+ | **Recharts** | Standard dashboards, rapid prototyping | Light | Low |
161
+ | **Nivo** | Rich chart variety, theming, SSR | ~371KB/module | Moderate |
162
+ | **Victory** | Cross-platform (React + React Native) | ~1.16MB | Low |
163
+ | **visx** | Custom/brand-specific visualizations | ~12.3KB | High |
164
+ | **Chart.js** | Large datasets (up to 1M points) | 14-48KB | Low |
165
+ | **D3** | Full control, custom viz libraries | Varies | Very High |
166
+
167
+ ```
168
+ Need it fast with standard charts? -> Recharts
169
+ Need rich chart types + theming? -> Nivo
170
+ Need web + React Native? -> Victory
171
+ Need pixel-perfect custom viz? -> visx
172
+ Need to render 100K+ data points? -> Chart.js (Canvas)
173
+ Need full control? -> D3 directly
174
+ ```
175
+
176
+ ### Recharts Example
177
+
178
+ ```tsx
179
+ import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from 'recharts';
180
+
181
+ function RevenueChart({ data }) {
182
+ return (
183
+ <ResponsiveContainer width="100%" height={300}>
184
+ <BarChart data={data}>
185
+ <CartesianGrid strokeDasharray="3 3" stroke="#e0e0e0" />
186
+ <XAxis dataKey="month" />
187
+ <YAxis tickFormatter={(v) => `$${v / 1000}k`} />
188
+ <Tooltip formatter={(v) => [`$${v.toLocaleString()}`, 'Revenue']} />
189
+ <Bar dataKey="revenue" fill="#4e79a7" radius={[4, 4, 0, 0]} />
190
+ </BarChart>
191
+ </ResponsiveContainer>
192
+ );
193
+ }
194
+ ```
195
+
196
+ ---
197
+
198
+ ## 6. Data-Ink Ratio (Tufte Principles)
199
+
200
+ ### Core Rules
201
+ 1. **Above all else, show the data.**
202
+ 2. **Maximize data-ink ratio** = (ink used for data) / (total ink).
203
+ 3. **Erase non-data-ink** -- gridlines, borders, backgrounds that carry no information.
204
+ 4. **Erase redundant data-ink** -- if a label says "42%", you don't also need a gridline at 42.
205
+
206
+ ### Remove (Chartjunk)
207
+ 3D effects, gradient fills, heavy gridlines, decorative icons, redundant legends, box borders around charts, background colors (unless encoding data).
208
+
209
+ ### Add
210
+ Direct labels on bars/lines, annotations on key events, reference lines (target, average, benchmark).
211
+
212
+ ### Small Multiples
213
+ Instead of one cluttered multi-series chart, repeat the same simple chart for each category. Same axes, same scale, side by side.
214
+
215
+ ### Sparklines
216
+ Word-sized graphics embedded inline. No axes, no labels -- pure trend.
217
+
218
+ ```tsx
219
+ <ResponsiveContainer width={80} height={20}>
220
+ <LineChart data={trend}>
221
+ <Line type="monotone" dataKey="value" stroke="#4e79a7" dot={false} strokeWidth={1.5} />
222
+ </LineChart>
223
+ </ResponsiveContainer>
224
+ ```
225
+
226
+ Use in: KPI cards, table cells, inline with text.
@@ -0,0 +1,211 @@
1
+ # Depth and Elevation Reference
2
+
3
+ ## Table of Contents
4
+ 1. The Layering Technique
5
+ 2. Dual Shadow System
6
+ 3. Inset Shadows
7
+ 4. Gradient + Inner Shadow Combo
8
+ 5. Semantic Z-Index Scale
9
+ 6. Shadow Usage Guide
10
+ 7. Dark Mode Shadow Adjustments
11
+ 8. The "Remove Borders" Rule
12
+ 9. Hover Elevation Pattern
13
+ 10. Common Mistakes
14
+
15
+ ---
16
+
17
+ ## 1. The Layering Technique
18
+
19
+ The single highest-ROI technique for transforming flat UIs into ones that feel crafted. Three steps:
20
+
21
+ 1. **Create color layers.** Generate 3-4 shades of your base color by incrementing lightness in OKLCH:
22
+ ```css
23
+ --bg-deep: oklch(0.18 0.01 var(--hue)); /* page background (deepest) */
24
+ --bg-base: oklch(0.22 0.01 var(--hue)); /* card/section background */
25
+ --bg-raised: oklch(0.26 0.012 var(--hue)); /* elevated interactive elements */
26
+ --bg-highest: oklch(0.30 0.015 var(--hue)); /* selected/active states */
27
+ ```
28
+ In light mode, reverse the direction: the page is lightest, and elevated elements are slightly darker or lighter depending on the effect.
29
+
30
+ 2. **Layer elements.** Darker backgrounds feel recessed. Lighter surfaces feel elevated. Stack your components accordingly: page → section → card → interactive element.
31
+
32
+ 3. **Add dual shadows.** A light inset shadow on top combined with a dark shadow at the bottom creates realistic depth. See section 2 below.
33
+
34
+ ---
35
+
36
+ ## 2. Dual Shadow System
37
+
38
+ Combine a light inset highlight on the top edge with a dark drop shadow at the bottom. This simulates overhead light hitting a raised surface.
39
+
40
+ ```css
41
+ /* Small: subtle, most use cases (cards at rest, navbar, buttons) */
42
+ --shadow-sm:
43
+ inset 0 1px 0 0 oklch(1 0 0 / 0.05),
44
+ 0 1px 2px 0 oklch(0 0 0 / 0.15);
45
+
46
+ /* Medium: emphasis and hover states */
47
+ --shadow-md:
48
+ inset 0 1px 0 0 oklch(1 0 0 / 0.08),
49
+ 0 2px 8px -2px oklch(0 0 0 / 0.2);
50
+
51
+ /* Large: modals, popovers, focused cards */
52
+ --shadow-lg:
53
+ inset 0 1px 0 0 oklch(1 0 0 / 0.1),
54
+ 0 8px 24px -4px oklch(0 0 0 / 0.25);
55
+
56
+ /* Extra large: hero overlays, dramatic emphasis */
57
+ --shadow-xl:
58
+ 0 16px 48px -8px oklch(0 0 0 / 0.3),
59
+ 0 4px 12px -2px oklch(0 0 0 / 0.15);
60
+ ```
61
+
62
+ These values use OKLCH alpha for consistency with your color tokens. Adapt the hue to match your palette if desired (e.g., `oklch(0 0 0 / 0.15)` could become `oklch(0 0.01 var(--hue) / 0.15)` for tinted shadows).
63
+
64
+ ---
65
+
66
+ ## 3. Inset Shadows
67
+
68
+ For elements that should feel *recessed* into the surface (input fields, progress bars, table cells, code blocks):
69
+
70
+ ```css
71
+ .recessed {
72
+ box-shadow:
73
+ inset 0 2px 4px 0 oklch(0 0 0 / 0.15), /* dark shadow at top */
74
+ inset 0 -1px 0 0 oklch(1 0 0 / 0.05); /* subtle light at bottom */
75
+ }
76
+ ```
77
+
78
+ Inset shadows reverse the mental model: instead of floating above the surface, the element sits below it. Use this for:
79
+ - Text inputs (the field feels carved into the form)
80
+ - Progress bar tracks (the bar sits inside a groove)
81
+ - Recessed stat cards (metrics feel embedded, not floating)
82
+
83
+ ---
84
+
85
+ ## 4. Gradient + Inner Shadow Combo
86
+
87
+ Simulates directional light hitting a raised surface from above. Powerful for selected cards, active states, and CTAs:
88
+
89
+ ```css
90
+ .elevated-card {
91
+ background: linear-gradient(
92
+ to bottom,
93
+ oklch(0.28 0.015 var(--hue)), /* lighter at top (light source) */
94
+ oklch(0.24 0.01 var(--hue)) /* darker at bottom */
95
+ );
96
+ box-shadow:
97
+ inset 0 1px 0 0 oklch(1 0 0 / 0.08), /* highlight at top edge */
98
+ 0 2px 8px -2px oklch(0 0 0 / 0.2); /* shadow beneath */
99
+ }
100
+ ```
101
+
102
+ This combination makes elements feel physically present. Reserve it for the most important interactive elements on the page -- overuse dilutes the effect.
103
+
104
+ ---
105
+
106
+ ## 5. Semantic Z-Index Scale
107
+
108
+ Use named z-index values instead of magic numbers. This prevents z-index wars and makes the stacking context explicit:
109
+
110
+ ```css
111
+ --z-dropdown: 100;
112
+ --z-sticky: 200;
113
+ --z-fixed: 300;
114
+ --z-modal: 400;
115
+ --z-toast: 500;
116
+ --z-tooltip: 600;
117
+ ```
118
+
119
+ Rules:
120
+ - Never use bare numbers. Always reference the variable.
121
+ - Never go above 600 unless you have a documented reason.
122
+ - Modals need a backdrop at `--z-modal - 1` (399).
123
+ - Toasts should float above modals so errors are visible during dialogs.
124
+
125
+ ---
126
+
127
+ ## 6. Shadow Usage Guide
128
+
129
+ | Element | Shadow Level | Additional Treatment |
130
+ |---------|-------------|---------------------|
131
+ | Cards (default) | sm | -- |
132
+ | Cards (hover) | md | transition 150ms |
133
+ | Selected card | md + gradient | light inset top |
134
+ | Modal / dialog | xl | overlay backdrop |
135
+ | Dropdown menu | lg | -- |
136
+ | Navbar (sticky) | sm | only when scrolled |
137
+ | Input (focus) | -- | accent ring instead |
138
+ | Recessed element | inset | dark top + light bottom |
139
+ | Progress bar | inset sm | inside container |
140
+ | Buttons (default) | sm | -- |
141
+ | Buttons (active) | inset sm | press-in effect |
142
+ | Tooltip | md | -- |
143
+
144
+ Not every element needs a shadow. Use shadows to communicate interactive hierarchy: elements the user can act on float above static content.
145
+
146
+ ---
147
+
148
+ ## 7. Dark Mode Shadow Adjustments
149
+
150
+ Shadows are far less visible against dark backgrounds. Compensate with these techniques:
151
+
152
+ 1. **Increase shadow opacity** by 0.05-0.10 compared to light mode values
153
+ 2. **Add a subtle border** (1px `oklch(1 0 0 / 0.05)`) for edge definition where shadows alone are too faint
154
+ 3. **Use inner glow** instead of drop shadows for the "elevated" feeling on small elements
155
+ 4. **Higher surface = lighter background** -- in dark mode this is the primary depth cue, more important than shadows
156
+
157
+ ```css
158
+ [data-theme="dark"] {
159
+ --shadow-sm:
160
+ inset 0 1px 0 0 oklch(1 0 0 / 0.03),
161
+ 0 1px 3px 0 oklch(0 0 0 / 0.25);
162
+ --shadow-md:
163
+ inset 0 1px 0 0 oklch(1 0 0 / 0.05),
164
+ 0 3px 12px -3px oklch(0 0 0 / 0.35);
165
+ }
166
+ ```
167
+
168
+ ---
169
+
170
+ ## 8. The "Remove Borders" Rule
171
+
172
+ When you have established a clear color layering system (darker background → lighter card → lightest interactive element), borders on the lighter elements become redundant. The color contrast already creates visual separation. Remove them.
173
+
174
+ Keep borders only where:
175
+ - Color layering alone does not provide enough contrast (e.g., two surfaces with very similar lightness)
176
+ - You need to indicate a semantic boundary (form fields, table cells)
177
+ - The element is interactive and the border communicates state (focus, error)
178
+
179
+ This rule significantly reduces visual noise and makes the layering technique more effective.
180
+
181
+ ---
182
+
183
+ ## 9. Hover Elevation Pattern
184
+
185
+ ```css
186
+ .card {
187
+ box-shadow: var(--shadow-sm);
188
+ transition: box-shadow 150ms ease-out, transform 150ms ease-out;
189
+ }
190
+ .card:hover {
191
+ box-shadow: var(--shadow-md);
192
+ transform: translateY(-2px);
193
+ }
194
+ ```
195
+
196
+ Key constraints:
197
+ - Keep the translateY subtle: 1-3px maximum. Exaggerated lifts (5px+) feel cheap and dated.
198
+ - Always transition both shadow and transform together for a cohesive effect.
199
+ - On touch devices, this hover state should not apply (use `@media (hover: hover)`).
200
+
201
+ ---
202
+
203
+ ## 10. Common Mistakes
204
+
205
+ - Using the same `box-shadow` on every element (no hierarchy, everything looks the same)
206
+ - Shadow blur radius too large (20px+ on cards creates a fuzzy, unfocused look)
207
+ - Forgetting to adjust shadows for dark mode (invisible shadows destroy the depth system)
208
+ - Overusing shadows on flat, decorative elements that do not need elevation
209
+ - Using `filter: drop-shadow()` when `box-shadow` would suffice (drop-shadow does not support inset and renders differently)
210
+ - Relying solely on shadows for depth without the color layering foundation (shadows alone look stuck-on)
211
+ - Hard-coded z-index values like `z-index: 9999` (always use the semantic scale)