Skip to content

The design language that makes your AI harness better at design.

JavaScript

Fill in all sub-skill reference files with non-obvious design guidance

Paul Bakaus3d9f4ae5df88
diff --git a/biome.json b/biome.json
index 701261b50..679d53768 100644
--- a/biome.json
+++ b/biome.json
@@ -8,3 +8,4 @@
}
+
diff --git a/dist/claude-code/.claude/skills/frontend-design/SKILL.md b/dist/claude-code/.claude/skills/frontend-design/SKILL.md
index 7a0e469be..5b4f244b2 100644
--- a/dist/claude-code/.claude/skills/frontend-design/SKILL.md
+++ b/dist/claude-code/.claude/skills/frontend-design/SKILL.md
@@ -57,7 +57,7 @@ Focus on intentional, distinctive design choices:
**Space**: Use a spacing scale (4, 8, 12, 16, 24, 32, 48, 64, 96). Create visual rhythm through varied spacing. Let content breathe. Break the grid intentionally.
-**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity. Stagger reveals for orchestrated page loads.
+**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity with smooth ease-out curves (quart, quint, expo). Stagger reveals for orchestrated page loads.
**Interaction**: Design clear focus indicators. Make touch targets 44×44px minimum. Provide immediate feedback. Write specific, helpful error messages.
@@ -67,11 +67,13 @@ Focus on intentional, distinctive design choices:
These patterns create generic "AI slop" aesthetics:
-**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, wrapping everything in rounded cards, decorative shadows without purpose.
+**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, pure grays without color tint, wrapping everything in rounded cards, decorative shadows without purpose.
-**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards.
+**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards, redundant copy (headers restating intros, repeated explanations).
-**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors.
+**Motion Mistakes**: Bounce and elastic easing (dated and tacky), animating layout properties, durations over 500ms for feedback, animation without purpose.
+
+**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors, gray text on colored backgrounds.
**Accessibility Violations**: Color-only meaning, ignoring prefers-reduced-motion, failing WCAG contrast, creating keyboard traps.
diff --git a/dist/claude-code/.claude/skills/frontend-design/reference/color-and-contrast.md b/dist/claude-code/.claude/skills/frontend-design/reference/color-and-contrast.md
index 736740d7d..90e20e247 100644
--- a/dist/claude-code/.claude/skills/frontend-design/reference/color-and-contrast.md
+++ b/dist/claude-code/.claude/skills/frontend-design/reference/color-and-contrast.md
@@ -21,75 +21,185 @@ Then build a color system that is:
- Flexible enough for theming and variations
- Aesthetically cohesive and on-brand
-## Color Theory Fundamentals
+## Color Spaces: Use OKLCH
-### Color Harmony & Relationships
+**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
-[TO BE DEVELOPED: Complementary, analogous, triadic, split-complementary, monochromatic schemes, color wheel navigation]
+```css
+/* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */
+--color-primary: oklch(60% 0.15 250); /* Blue */
+--color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */
+--color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */
+```
-### Color Psychology & Meaning
+**Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish. A light blue at 85% lightness needs ~0.08 chroma, not the 0.15 of your base color.
-[TO BE DEVELOPED: Emotional associations, cultural considerations, industry conventions, semantic color choices]
+## Building Functional Palettes
-### Color Properties
+### The Tinted Neutral Trap
-[TO BE DEVELOPED: Hue, saturation, lightness/brightness, HSL vs RGB vs LCH, perceptual uniformity]
+**Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals:
-## Building Functional Palettes
+```css
+/* Dead grays */
+--gray-100: oklch(95% 0 0); /* No personality */
+--gray-900: oklch(15% 0 0);
+
+/* Warm-tinted grays (add brand warmth) */
+--gray-100: oklch(95% 0.01 60); /* Hint of warmth */
+--gray-900: oklch(15% 0.01 60);
+
+/* Cool-tinted grays (tech, professional) */
+--gray-100: oklch(95% 0.01 250); /* Hint of blue */
+--gray-900: oklch(15% 0.01 250);
+```
+
+The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI.
### Palette Structure
-[TO BE DEVELOPED: Primary/secondary/tertiary, neutral scales (9-11 steps), semantic colors, state colors]
+A complete system needs:
-### Generating Color Scales
+| Role | Purpose | Example |
+|------|---------|---------|
+| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
+| **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
+| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
+| **Surface** | Cards, modals, overlays | 2-3 elevation levels |
-[TO BE DEVELOPED: Lightness curves, saturation shifts, hue rotation, perceptual uniformity, algorithmic generation]
+**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
-### The Dominant Color Principle
+### The 60-30-10 Rule (Applied Correctly)
-[TO BE DEVELOPED: 60-30-10 rule, accent color strategy, visual weight distribution, avoiding rainbow vomit]
+This rule is about **visual weight**, not pixel count:
+
+- **60%**: Neutral backgrounds, white space, base surfaces
+- **30%**: Secondary colors—text, borders, inactive states
+- **10%**: Accent—CTAs, highlights, focus states
+
+The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power.
## Contrast & Accessibility
-### WCAG Compliance
+### WCAG Requirements
+
+| Content Type | AA Minimum | AAA Target |
+|--------------|------------|------------|
+| Body text | 4.5:1 | 7:1 |
+| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
+| UI components, icons | 3:1 | 4.5:1 |
+| Non-essential decorations | None | None |
+
+**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG.
+
+### Dangerous Color Combinations
+
+These commonly fail contrast or cause readability issues:
+
+- Light gray text on white (the #1 accessibility fail)
+- **Gray text on any colored background**—gray looks washed out and dead on color. Use a tinted version of the background color instead, or transparency
+- Red text on green background (or vice versa)—8% of men can't distinguish these
+- Blue text on red background (vibrates visually)
+- Yellow text on white (almost always fails)
+- Thin light text on images (unpredictable contrast)
+
+### Never Use Pure Gray or Pure Black
+
+Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. They look uncanny and lifeless.
+
+```css
+/* Dead and artificial */
+--gray: oklch(50% 0 0);
+--black: oklch(0% 0 0);
+
+/* Natural and warm */
+--gray: oklch(50% 0.01 60); /* Warm gray */
+--black: oklch(12% 0.01 250); /* Very dark blue-gray */
+```
+
+Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted.
+
+### Testing
+
+Don't trust your eyes. Use tools:
-[TO BE DEVELOPED: AA vs AAA standards, text contrast ratios (4.5:1 / 7:1), UI component contrast (3:1), large text exceptions]
+- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
+- Browser DevTools → Rendering → Emulate vision deficiencies
+- [Polypane](https://polypane.app/) for real-time testing
-### Testing & Tools
+## Theming: Light & Dark Mode
-[TO BE DEVELOPED: Contrast checkers, automated testing, color blindness simulation, tools for verification]
+### Dark Mode Is Not Inverted Light Mode
-### Accessible Color Combinations
+You can't just swap colors. Dark mode requires different design decisions:
-[TO BE DEVELOPED: Which combinations work, which don't, safe pairings, dangerous pairings, contrast matrices]
+| Light Mode | Dark Mode |
+|------------|-----------|
+| Shadows for depth | Lighter surfaces for depth (no shadows) |
+| Dark text on light | Light text on dark (reduce font weight) |
+| Vibrant accents | Desaturate accents slightly |
+| White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
-## Theming Architecture
+```css
+/* Dark mode depth via surface color, not shadow */
+:root[data-theme="dark"] {
+ --surface-1: oklch(15% 0.01 250);
+ --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */
+ --surface-3: oklch(25% 0.01 250);
-### Light & Dark Mode
+ /* Reduce text weight slightly */
+ --body-weight: 350; /* Instead of 400 */
+}
+```
-[TO BE DEVELOPED: Independent palettes vs inverted, neutral strategies, shadows in dark mode, image handling]
+### Token Hierarchy
-### CSS Custom Properties
+Use two layers of abstraction:
-[TO BE DEVELOPED: Token hierarchy (primitive → semantic → component), naming conventions, theme switching]
+```css
+/* Layer 1: Primitive tokens (rarely use directly) */
+--blue-500: oklch(55% 0.2 250);
+--blue-600: oklch(45% 0.2 250);
-### Multi-Theme Systems
+/* Layer 2: Semantic tokens (use these) */
+--color-primary: var(--blue-500);
+--color-primary-hover: var(--blue-600);
+--color-text: var(--gray-900);
+--color-text-muted: var(--gray-600);
+--color-border: var(--gray-200);
+--color-surface: var(--white);
+```
-[TO BE DEVELOPED: Brand themes, user preference themes, contextual themes, theme inheritance]
+**For dark mode, only redefine the semantic layer:**
-## Advanced Color Techniques
+```css
+:root[data-theme="dark"] {
+ --color-primary: var(--blue-400); /* Lighter in dark mode */
+ --color-text: var(--gray-100);
+ --color-surface: var(--gray-900);
+}
+```
-### Gradients & Effects
+## Alpha Is A Design Smell
-[TO BE DEVELOPED: Mesh gradients, color stops, blend modes, gradient generation, overlay techniques]
+If you're using lots of transparency (rgba, hsla), your palette is probably incomplete. Alpha creates:
+- Unpredictable contrast (depends on what's behind it)
+- Performance overhead (compositing)
+- Inconsistency across contexts
-### Transparency & Alpha
+**Instead**: Define explicit overlay colors:
-[TO BE DEVELOPED: Alpha channels, overlay strategies, transparency scales, backdrop effects]
+```css
+/* Bad: unpredictable */
+--overlay: rgba(0, 0, 0, 0.5);
-### Dynamic Color
+/* Good: explicit colors for each context */
+--overlay-on-light: oklch(40% 0 0);
+--overlay-on-dark: oklch(70% 0 0);
+--overlay-on-image: oklch(20% 0 0 / 60%); /* Alpha only when necessary */
+```
-[TO BE DEVELOPED: State-based color changes, hover darkening/lightening, interactive color feedback]
+The exception: Focus rings and interactive states where you need to see through to the element beneath.
---
diff --git a/dist/claude-code/.claude/skills/frontend-design/reference/interaction-design.md b/dist/claude-code/.claude/skills/frontend-design/reference/interaction-design.md
index da67ab32d..a6cbbe014 100644
--- a/dist/claude-code/.claude/skills/frontend-design/reference/interaction-design.md
+++ b/dist/claude-code/.claude/skills/frontend-design/reference/interaction-design.md
@@ -21,115 +21,240 @@ Then implement interactions that are:
- Forgiving with error prevention and recovery
- Responsive with immediate feedback and state changes
-## Interaction States
+## The Eight Interactive States
-### Core States
+Every interactive element needs these states designed:
-[TO BE DEVELOPED: Default, hover, focus, active, disabled, loading, error, success - visual treatment for each]
+| State | When | Visual Treatment |
+|-------|------|------------------|
+| **Default** | At rest | Base styling |
+| **Hover** | Pointer over (not touch) | Subtle lift, color shift |
+| **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
+| **Active** | Being pressed | Pressed in, darker |
+| **Disabled** | Not interactive | Reduced opacity, no pointer |
+| **Loading** | Processing | Spinner, skeleton |
+| **Error** | Invalid state | Red border, icon, message |
+| **Success** | Completed | Green check, confirmation |
-### State Transitions
+**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states.
-[TO BE DEVELOPED: Smooth state changes, animation between states, maintaining context, preserving user intent]
+## Focus Rings: Do Them Right
-### Loading & Progress States
+**Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users:
-[TO BE DEVELOPED: Skeleton screens, spinners, progress bars, optimistic updates, what to show while waiting]
+```css
+/* Hide focus ring for mouse/touch */
+button:focus {
+ outline: none;
+}
-## Affordances & Feedback
+/* Show focus ring for keyboard */
+button:focus-visible {
+ outline: 2px solid var(--color-accent);
+ outline-offset: 2px;
+}
+```
-### Visual Affordances
+**Focus ring design**:
+- High contrast (3:1 minimum against adjacent colors)
+- 2-3px thick
+- Offset from element (not inside it)
+- Consistent across all interactive elements
-[TO BE DEVELOPED: Signaling interactivity, button appearance, link styling, cursor changes, touch target highlighting]
+## Form Design: The Non-Obvious
-### Immediate Feedback
+### Don't Use Placeholders as Labels
-[TO BE DEVELOPED: Click/tap acknowledgment, hover feedback, focus indication, "something is happening" signals]
+Placeholders disappear when you type. Users forget what the field was for. Screen readers may not announce them.
-### Haptic & Sound Feedback
+```html
+<!-- Bad -->
+<input placeholder="Email address">
-[TO BE DEVELOPED: Vibration patterns, sound cues, cross-modal feedback, when to use non-visual feedback]
+<!-- Good -->
+<label for="email">Email address</label>
+<input id="email" type="email" placeholder="[email protected]">
+```
-## Form Design & Input Patterns
+Use placeholders only for examples or format hints, never as the primary label.
-### Form Layout & Structure
+### Validate on Blur, Not on Input
-[TO BE DEVELOPED: Single column vs multi-column, label placement, field grouping, visual hierarchy in forms]
+Real-time validation (validating every keystroke) is annoying. Users can't finish typing before seeing errors.
-### Input Field Design
+```javascript
+// Bad: fires on every keystroke
+input.addEventListener('input', validate);
-[TO BE DEVELOPED: Field sizing, placeholder usage (anti-pattern), helper text, character limits, input masking]
+// Good: fires when user leaves field
+input.addEventListener('blur', validate);
-### Validation Patterns
+// Exception: password strength (show progress while typing)
+passwordInput.addEventListener('input', showStrength);
+```
-[TO BE DEVELOPED: Inline vs on-submit, real-time validation, error message writing, success confirmation, required field indication]
+### Error Message Placement
-### Complex Input Types
+Place errors **below** the field (users scan top-down), not above. Keep messages close to the field—not in a summary at the top unless also repeated inline.
-[TO BE DEVELOPED: File upload UX, date pickers, time selection, rich text editing, multi-select, autocomplete, search]
+```html
+<label for="email">Email</label>
+<input id="email" type="email" aria-describedby="email-error">
+<span id="email-error" class="error">Please enter a valid email</span>
+```
-### Progressive Disclosure in Forms
+The `aria-describedby` connects the error to the input for screen readers.
-[TO BE DEVELOPED: Conditional fields, wizards/multi-step forms, accordions, showing complexity gradually]
+## Loading States: Optimistic Updates
-### Form Error Handling
+**Show success immediately, handle failure gracefully.** Users perceive the app as faster.
-[TO BE DEVELOPED: Error prevention (constraints, masks), clear error messages, error recovery, field-level vs form-level errors]
+```javascript
+// Optimistic update pattern
+async function toggleLike() {
+ // 1. Update UI immediately
+ setLiked(true);
-## Touch & Pointer Interactions
+ try {
+ // 2. Send request
+ await api.like(postId);
+ } catch {
+ // 3. Rollback on failure
+ setLiked(false);
+ showToast('Like failed. Please try again.');
+ }
+}
+```
-### Touch Targets
+**When to use**: Low-stakes actions (likes, follows, small edits). **Not for**: Payments, destructive actions, critical data changes.
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge reach areas on mobile]
+### Skeleton Screens > Spinners
-### Touch vs Pointer Patterns
+Spinners say "something is happening" but give no sense of what or how long. Skeletons preview the content shape:
-[TO BE DEVELOPED: Hover states on touch (problems), tap feedback, long press, swipe gestures, pinch-to-zoom]
+```css
+.skeleton {
+ background: linear-gradient(
+ 90deg,
+ var(--gray-200) 25%,
+ var(--gray-100) 50%,
+ var(--gray-200) 75%
+ );
+ background-size: 200% 100%;
+ animation: shimmer 1.5s infinite;
+}
-### Gesture Design
+@keyframes shimmer {
+ 0% { background-position: 200% 0; }
+ 100% { background-position: -200% 0; }
+}
+```
-[TO BE DEVELOPED: Swipe to delete, pull to refresh, drag to reorder, custom gestures, gesture discoverability]
+## Modals: The Inert Approach
-## Keyboard Navigation
+Focus trapping in modals used to require complex JavaScript. Now use the `inert` attribute:
-### Focus Management
+```html
+<!-- When modal is open -->
+<main inert>
+ <!-- Content behind modal can't be focused or clicked -->
+</main>
+<dialog open>
+ <h2>Modal Title</h2>
+ <!-- Focus stays inside modal -->
+</dialog>
+```
-[TO BE DEVELOPED: Focus rings (never remove without replacement), logical tab order, skip links, focus trapping in modals]
+Or use the native `<dialog>` element:
-### Keyboard Shortcuts
+```javascript
+const dialog = document.querySelector('dialog');
+dialog.showModal(); // Opens with focus trap, closes on Escape
+```
-[TO BE DEVELOPED: Common shortcuts, discoverability, avoiding conflicts, command palettes, keyboard-first workflows]
+## The Popover API
-### Accessible Interaction Patterns
+For tooltips, dropdowns, and non-modal overlays, use native popovers:
-[TO BE DEVELOPED: ARIA roles for custom controls, managing focus in dynamic content, screen reader announcements]
+```html
+<button popovertarget="menu">Open menu</button>
+<div id="menu" popover>
+ <button>Option 1</button>
+ <button>Option 2</button>
+</div>
+```
-## Navigation Patterns
+**Benefits**: Light-dismiss (click outside closes), proper stacking, no z-index wars, accessible by default.
-### Menu & Navigation Design
+## Destructive Actions: Undo > Confirm
-[TO BE DEVELOPED: Mega menus, hamburger menus, breadcrumbs, tabs, pagination, infinite scroll vs load more]
+Confirmation dialogs are friction. Users click through them mindlessly. **Undo is better**:
-### Modal & Dialog Patterns
+```javascript
+async function deleteItem(id) {
+ // 1. Remove from UI immediately
+ hideItem(id);
-[TO BE DEVELOPED: Modal entry/exit, focus management, escape to close, backdrop click behavior, sheet patterns]
+ // 2. Show undo toast
+ const toast = showToast('Item deleted', {
+ action: { label: 'Undo', onClick: () => restoreItem(id) },
+ duration: 5000
+ });
-### Command & Context Menus
+ // 3. Actually delete after toast expires
+ toast.onClose(() => api.delete(id));
+}
+```
+
+**When to still use confirmation**: Irreversible actions (account deletion), high-cost actions (large purchases), batch operations on many items.
+
+## Keyboard Navigation Patterns
+
+### Roving Tabindex
+
+For component groups (tabs, menu items, radio groups), one item is tabbable; arrow keys move within:
+
+```html
+<div role="tablist">
+ <button role="tab" tabindex="0">Tab 1</button>
+ <button role="tab" tabindex="-1">Tab 2</button>
+ <button role="tab" tabindex="-1">Tab 3</button>
+</div>
+```
-[TO BE DEVELOPED: Right-click menus, command palettes, dropdown menus, action sheets]
+Arrow keys move `tabindex="0"` between items. Tab moves to the next component entirely.
-## Error Prevention & Recovery
+### Skip Links
-### Constraints & Guards
+For keyboard users, provide a skip link to jump past navigation:
-[TO BE DEVELOPED: Input constraints, disabled states, confirmation dialogs for destructive actions, undo mechanisms]
+```html
+<a href="#main-content" class="skip-link">Skip to main content</a>
+<nav>...</nav>
+<main id="main-content">...</main>
+```
+
+```css
+.skip-link {
+ position: absolute;
+ left: -9999px;
+}
+.skip-link:focus {
+ left: 0;
+ z-index: 9999;
+ /* Visible styling */
+}
+```
-### Error Messages
+## Gesture Discoverability
-[TO BE DEVELOPED: Clear language, actionable guidance, positive framing, where to show errors, when to show errors]
+Swipe-to-delete and similar gestures are invisible. Hint at their existence:
-### Undo & Redo
+- **Partially reveal**: Show delete button peeking from edge
+- **Onboarding**: Coach marks on first use
+- **Alternative**: Always provide a visible fallback (menu with "Delete")
-[TO BE DEVELOPED: Undo patterns, toast notifications with undo, versioning, draft auto-save]
+Don't rely on gestures as the only way to perform actions.
---
diff --git a/dist/claude-code/.claude/skills/frontend-design/reference/motion-design.md b/dist/claude-code/.claude/skills/frontend-design/reference/motion-design.md
index be3683c03..23f738668 100644
--- a/dist/claude-code/.claude/skills/frontend-design/reference/motion-design.md
+++ b/dist/claude-code/.claude/skills/frontend-design/reference/motion-design.md
@@ -21,75 +21,193 @@ Then implement motion that is:
- Accessible with reduced motion alternatives
- Choreographed with thoughtful timing and sequencing
-## Classic Animation Principles
+## Duration: The 100/300/500 Rule
+
+Timing matters more than easing. These durations feel right for most UI:
+
+| Duration | Use Case | Examples |
+|----------|----------|----------|
+| **100-150ms** | Instant feedback | Button press, toggle, color change |
+| **200-300ms** | State changes | Menu open, tooltip, hover states |
+| **300-500ms** | Layout changes | Accordion, modal, drawer |
+| **500-800ms** | Entrance animations | Page load, hero reveals |
-### Disney's 12 Principles (Web Context)
+**Exit animations are faster than entrances.** Users want to see what's leaving—quickly. Use ~75% of the enter duration:
+```css
+.modal {
+ --enter: 400ms;
+ --exit: 300ms;
+}
+```
+
+## Easing: Pick the Right Curve
+
+**Don't use `ease`.** It's a compromise that's rarely optimal. Instead:
+
+| Curve | Use For | CSS |
+|-------|---------|-----|
+| **ease-out** | Elements entering | `cubic-bezier(0.16, 1, 0.3, 1)` |
+| **ease-in** | Elements leaving | `cubic-bezier(0.7, 0, 0.84, 0)` |
+| **ease-in-out** | State toggles (there → back) | `cubic-bezier(0.65, 0, 0.35, 1)` |
+
+**For micro-interactions, use exponential curves**—they feel natural because they mimic real physics (friction, deceleration):
+
+```css
+/* Quart out - smooth, refined (recommended default) */
+--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
+
+/* Quint out - slightly more dramatic */
+--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
+
+/* Expo out - snappy, confident */
+--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
+```
+
+**Avoid bounce and elastic curves.** They were trendy in 2015 but now feel tacky and amateurish. Real objects don't bounce when they stop—they decelerate smoothly. Overshoot effects draw attention to the animation itself rather than the content.
+
+## The Only Two Properties You Should Animate
-[TO BE DEVELOPED: Squash and stretch, anticipation, staging, follow-through, ease-in/ease-out, arcs, secondary action, timing, exaggeration, solid drawing, appeal - adapted for UI]
+**transform** and **opacity**. That's it. Everything else causes layout recalculation or repaints:
-### Timing & Duration
+```css
+/* Good: GPU-accelerated, smooth */
+.slide-in {
+ transform: translateX(0);
+ opacity: 1;
+ transition: transform 300ms ease-out, opacity 300ms ease-out;
+}
+.slide-in.hidden {
+ transform: translateX(20px);
+ opacity: 0;
+}
+
+/* Bad: triggers layout, janky */
+.slide-in {
+ left: 0; /* Layout thrashing */
+ height: 100%; /* Expensive */
+}
+```
-[TO BE DEVELOPED: Micro-interactions (100-300ms), transitions (300-500ms), complex animations (500-1000ms), duration by distance, perceived speed]
+**Exceptions**: Sometimes you must animate `height` for accordions. Use `max-height` with a value larger than content, or better yet, use CSS Grid's `grid-template-rows: 0fr → 1fr` trick.
-### Easing & Curves
+## Staggered Animations
-[TO BE DEVELOPED: Linear vs eased, ease-out (enter), ease-in (exit), ease-in-out (full cycle), custom cubic-bezier, spring physics]
-
-## Types of UI Animation
-
-### Micro-interactions
-
-[TO BE DEVELOPED: Button feedback, hover states, toggle switches, like buttons, form validation feedback, loading indicators]
-
-### Page Transitions
-
-[TO BE DEVELOPED: Route transitions, modal entry/exit, drawer animations, cross-fade, slide, zoom patterns]
-
-### State Transitions
-
-[TO BE DEVELOPED: Loading → success → error flows, expand/collapse, show/hide, enable/disable state changes]
-
-### Scrolling & Parallax
-
-[TO BE DEVELOPED: Scroll-triggered animations, reveal on scroll, parallax layers, scroll-linked effects, intersection observer]
-
-## Choreography & Sequencing
-
-### Staggered Animations
-
-[TO BE DEVELOPED: animation-delay patterns, sequential reveals, cascade effects, list item staggering]
-
-### Orchestrated Page Loads
-
-[TO BE DEVELOPED: Entry choreography, hero → content → details, creating narrative through sequence, attention management]
-
-### Exit Choreography
-
-[TO BE DEVELOPED: Reverse sequences, intentional exit timing, maintaining spatial relationships during exit]
-
-## Technical Implementation
-
-### CSS-Only Animation
-
-[TO BE DEVELOPED: @keyframes, animation properties, transitions, transform, pseudo-element animations, hardware acceleration]
-
-### JavaScript Animation
-
-[TO BE DEVELOPED: Web Animations API, requestAnimationFrame, animation libraries (GSAP, Framer Motion, Motion One)]
-
-### Performance Optimization
-
-[TO BE DEVELOPED: GPU acceleration (transform, opacity only), will-change, avoiding layout thrashing, reducing paint, FPS monitoring]
-
-## Motion Design Systems
-
-### Motion Tokens
-
-[TO BE DEVELOPED: Duration scales, easing tokens, named animations, consistent motion vocabulary]
-
-### Reduced Motion
-
-[TO BE DEVELOPED: prefers-reduced-motion, graceful degradation, essential vs decorative animation, crossfade alternatives]
+Staggering creates rhythm and direction. The formula:
+
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+}
+
+/* Stagger each item by 50ms */
+.list-item:nth-child(1) { animation-delay: 0ms; }
+.list-item:nth-child(2) { animation-delay: 50ms; }
+.list-item:nth-child(3) { animation-delay: 100ms; }
+/* ... */
+```
+
+**Better approach with CSS custom property:**
+
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+ animation-delay: calc(var(--i, 0) * 50ms);
+}
+```
+```html
+<li class="list-item" style="--i: 0">First</li>
+<li class="list-item" style="--i: 1">Second</li>
+<li class="list-item" style="--i: 2">Third</li>
+```
+
+**Key insight**: Cap the total stagger time. 10 items at 50ms = 500ms before the last item appears. If you have 50 items, reduce to 20ms per item or cap at ~10 staggered items.
+
+## Reduced Motion
+
+This is not optional. Vestibular disorders affect ~35% of adults over 40.
+
+```css
+/* Define animations normally */
+.card {
+ animation: slide-up 500ms ease-out;
+}
+
+/* Provide alternative for reduced motion */
+@media (prefers-reduced-motion: reduce) {
+ .card {
+ animation: fade-in 200ms ease-out; /* Crossfade instead of motion */
+ }
+}
+
+/* Or disable entirely */
+@media (prefers-reduced-motion: reduce) {
+ *, *::before, *::after {
+ animation-duration: 0.01ms !important;
+ transition-duration: 0.01ms !important;
+ }
+}
+```
+
+**What to preserve**: Functional animations like progress bars, loading spinners (slowed down), and focus indicators should still work—just without spatial movement.
+
+## Performance: Avoid These Mistakes
+
+### Don't Use will-change Preemptively
+
+```css
+/* Bad: wastes GPU memory */
+.card { will-change: transform; }
+
+/* Good: only when animation is imminent */
+.card:hover { will-change: transform; }
+.card.animating { will-change: transform; }
+```
+
+`will-change` forces the browser to create a compositing layer. Used everywhere = memory bloat.
+
+### Don't Animate During Scroll
+
+Scroll-linked animations (parallax, reveal) are expensive. If you must:
+
+```javascript
+// Use Intersection Observer, not scroll events
+const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('visible');
+ observer.unobserve(entry.target); // Animate once, then stop observing
+ }
+ });
+}, { threshold: 0.2 });
+```
+
+### Don't Fight the Main Thread
+
+Heavy JavaScript animations block rendering. For complex choreography, use the Web Animations API or a library like Motion One that schedules efficiently.
+
+## Motion Tokens
+
+Create a system for consistency:
+
+```css
+:root {
+ /* Durations */
+ --duration-instant: 100ms;
+ --duration-fast: 200ms;
+ --duration-normal: 300ms;
+ --duration-slow: 500ms;
+
+ /* Easings */
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
+ --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
+ --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
+
+ /* Common patterns */
+ --transition-fade: opacity var(--duration-fast) var(--ease-out);
+ --transition-slide: transform var(--duration-normal) var(--ease-out);
+ --transition-all: var(--duration-normal) var(--ease-out);
+}
+```
---
diff --git a/dist/claude-code/.claude/skills/frontend-design/reference/responsive-design.md b/dist/claude-code/.claude/skills/frontend-design/reference/responsive-design.md
index 0a4515829..c78563b7b 100644
--- a/dist/claude-code/.claude/skills/frontend-design/reference/responsive-design.md
+++ b/dist/claude-code/.claude/skills/frontend-design/reference/responsive-design.md
@@ -23,119 +23,237 @@ Then build responsive systems that are:
- Performant on constrained devices
- Contextually appropriate
-## Mobile-First Methodology
+## Mobile-First: Write It Right
-### Why Mobile-First
+Start with base styles for mobile, then layer complexity:
-[TO BE DEVELOPED: Progressive enhancement, performance benefits, forces priority decisions, mobile usage dominance]
+```css
+/* Base: mobile */
+.nav {
+ display: flex;
+ flex-direction: column;
+}
-### Mobile-First Implementation
+/* Enhancement: tablet and up */
+@media (min-width: 768px) {
+ .nav {
+ flex-direction: row;
+ }
+}
+```
-[TO BE DEVELOPED: Start with mobile styles, add complexity with min-width media queries, content-first approach]
+**The mistake**: Writing desktop-first (max-width queries) means mobile loads desktop styles first, then overrides. Wasteful and error-prone.
-## Breakpoint Strategies
+## Breakpoints: Content-Driven, Not Device-Driven
-### Choosing Breakpoints
+**Don't chase device sizes.** iPhones change, Android varies wildly, tablets overlap with laptops. Instead, let content tell you where to break:
-[TO BE DEVELOPED: Content-driven vs device-driven, common breakpoint values, in-between states, avoiding too many breakpoints]
+1. Start narrow
+2. Stretch the viewport until the design breaks
+3. Add a breakpoint there
-### Breakpoint Architecture
+Common content-driven breakpoints (as starting points):
-[TO BE DEVELOPED: Named breakpoints, breakpoint tokens, consistent usage across codebase]
+```css
+:root {
+ --bp-sm: 640px; /* Larger phones, small content changes */
+ --bp-md: 768px; /* Tablets, significant reflow */
+ --bp-lg: 1024px; /* Laptops, multi-column */
+ --bp-xl: 1280px; /* Desktops, max content width */
+}
+```
-## Fluid & Adaptive Design
+**Three breakpoints usually suffice.** If you have more than five, you're probably over-engineering.
-### Fluid Typography
+## Fluid Design: The Clamp Formula
-[TO BE DEVELOPED: clamp(), viewport units, fluid type scales, maintaining readability]
+`clamp(min, preferred, max)` creates fluid values without media queries.
-### Fluid Spacing
-
-[TO BE DEVELOPED: Responsive spacing scales, container-relative spacing, clamp() for margins/padding]
-
-### Fluid Layouts
-
-[TO BE DEVELOPED: CSS Grid auto-fit/auto-fill, flexible columns, aspect-ratio, fluid containers]
-
-### Container Queries
-
-[TO BE DEVELOPED: Component-level responsiveness, when to use vs media queries, polyfills]
-
-## Layout Adaptation Patterns
-
-### Navigation Patterns
-
-[TO BE DEVELOPED: Mobile hamburger/drawer, tablet side panel, desktop persistent nav, bottom nav bars]
-
-### Content Reflow
+### The Formula
-[TO BE DEVELOPED: Single column → multi-column, stacking orders, priority content first]
+```css
+/* Font size: 16px min, scales with viewport, 24px max */
+font-size: clamp(1rem, 0.5rem + 2vw, 1.5rem);
+```
-### Component Adaptation
+**How to calculate the preferred value**: The middle value determines the scaling rate. Higher vw coefficient = faster scaling:
-[TO BE DEVELOPED: Tabs → accordion, horizontal → vertical, show/hide patterns, progressive disclosure]
+- `1vw` = gentle scaling
+- `2-3vw` = moderate scaling
+- `4vw+` = aggressive scaling
-## Touch vs Pointer Optimization
+Add a rem offset to shift the baseline: `0.5rem + 2vw` ensures it doesn't collapse to 0 on small screens.
-### Touch Target Sizing
-
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge cases]
-
-### Touch-Specific Interactions
-
-[TO BE DEVELOPED: Swipe gestures, pull-to-refresh, long press, avoiding hover-dependent patterns]
-
-### Hybrid Devices
-
-[TO BE DEVELOPED: Supporting both touch and pointer, feature detection, adaptive interfaces]
-
-## Viewport & Screen Considerations
-
-### Viewport Meta Tag
-
-[TO BE DEVELOPED: Proper viewport configuration, zoom control, initial scale]
+### Fluid Spacing
-### Safe Areas
+```css
+:root {
+ --space-lg: clamp(2rem, 1rem + 3vw, 4rem);
+ --container-padding: clamp(1rem, 5vw, 4rem);
+}
+```
+
+This creates breathing room that naturally expands on larger screens.
+
+## Detect Input Method, Not Just Screen Size
+
+**Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard—use pointer and hover queries:
+
+```css
+/* Fine pointer (mouse, trackpad) */
+@media (pointer: fine) {
+ .button { padding: 8px 16px; }
+}
+
+/* Coarse pointer (touch, stylus) */
+@media (pointer: coarse) {
+ .button { padding: 12px 20px; } /* Larger touch target */
+}
+
+/* Device supports hover */
+@media (hover: hover) {
+ .card:hover { transform: translateY(-2px); }
+}
+
+/* Device doesn't support hover (touch) */
+@media (hover: none) {
+ .card { /* No hover state - use active instead */ }
+}
+```
+
+**Critical**: Don't rely on hover for functionality. Touch users can't hover.
+
+## Safe Areas: Handle the Notch
+
+Modern phones have notches, rounded corners, and home indicators. Use `env()`:
+
+```css
+body {
+ padding-top: env(safe-area-inset-top);
+ padding-bottom: env(safe-area-inset-bottom);
+ padding-left: env(safe-area-inset-left);
+ padding-right: env(safe-area-inset-right);
+}
+
+/* With fallback */
+.footer {
+ padding-bottom: max(1rem, env(safe-area-inset-bottom));
+}
+```
+
+**Enable viewport-fit** in your meta tag:
+```html
+<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
+```
+
+## Responsive Images: Get It Right
+
+### srcset with Width Descriptors
+
+```html
+<img
+ src="hero-800.jpg"
+ srcset="
+ hero-400.jpg 400w,
+ hero-800.jpg 800w,
+ hero-1200.jpg 1200w
+ "
+ sizes="(max-width: 768px) 100vw, 50vw"
+ alt="Hero image"
+>
+```
+
+**How it works**:
+- `srcset` lists available images with their actual widths (`w` descriptors)
+- `sizes` tells the browser how wide the image will display
+- Browser picks the best file based on viewport width AND device pixel ratio
+
+### Picture Element for Art Direction
+
+When you need different crops/compositions (not just resolutions):
+
+```html
+<picture>
+ <source media="(min-width: 768px)" srcset="wide.jpg">
+ <source media="(max-width: 767px)" srcset="tall.jpg">
+ <img src="fallback.jpg" alt="...">
+</picture>
+```
-[TO BE DEVELOPED: iPhone notch, rounded corners, system UI insets, padding for safe areas]
+## Layout Adaptation Patterns
-### Orientation Handling
+### Navigation: The Three-Stage Pattern
-[TO BE DEVELOPED: Portrait vs landscape, orientation-specific layouts, testing both orientations]
+```css
+/* Mobile: hamburger icon + drawer */
+.nav-menu { display: none; }
+.nav-toggle { display: block; }
-### High-DPI Screens
+/* Tablet: horizontal but compact */
+@media (min-width: 768px) {
+ .nav-menu { display: flex; }
+ .nav-toggle { display: none; }
+}
-[TO BE DEVELOPED: Retina images, 2x/3x assets, SVG for icons, responsive images]
+/* Desktop: full navigation with labels */
+@media (min-width: 1024px) {
+ .nav-item-label { display: inline; }
+}
+```
-## Responsive Images & Media
+### Table to Cards
-### Responsive Images
+Tables work on desktop, fail on mobile. Transform:
-[TO BE DEVELOPED: srcset, sizes, picture element, art direction, lazy loading]
+```css
+@media (max-width: 768px) {
+ table, thead, tbody, th, td, tr {
+ display: block;
+ }
-### Video Adaptation
+ thead { display: none; } /* Hide headers */
-[TO BE DEVELOPED: Responsive video embeds, bandwidth considerations, poster images]
+ tr {
+ margin-bottom: 1rem;
+ border: 1px solid var(--border);
+ padding: 1rem;
+ }
-## Performance on Mobile
+ td::before {
+ content: attr(data-label); /* Add labels via data attribute */
+ font-weight: 600;
+ display: block;
+ }
+}
+```
-### Mobile Performance Budget
+### Progressive Disclosure
-[TO BE DEVELOPED: Constrained CPU/memory, slow connections, battery concerns]
+Not everything needs to show on mobile:
-### Loading Strategies
+```css
+/* Show summary on mobile */
+.details-content { display: none; }
-[TO BE DEVELOPED: Critical path optimization, lazy loading, code splitting for mobile]
+@media (min-width: 768px) {
+ /* Expand on desktop */
+ .details-content { display: block; }
+}
+```
-## Testing Strategies
+Combine with `<details>/<summary>` for interactive expansion on mobile.
-### Device Testing
+## Testing: Don't Trust DevTools Alone
-[TO BE DEVELOPED: Real device testing, browser DevTools, emulators, viewport testing]
+DevTools device emulation is useful for layout but misses:
-### Testing Checklist
+- Actual touch interactions
+- Real CPU/memory constraints
+- Network latency patterns
+- Font rendering differences
+- Browser chrome/keyboard appearances
-[TO BE DEVELOPED: Different viewports, orientations, input methods, connection speeds]
+**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
---
diff --git a/dist/claude-code/.claude/skills/frontend-design/reference/spatial-design.md b/dist/claude-code/.claude/skills/frontend-design/reference/spatial-design.md
index a8745966c..4dfe26d24 100644
--- a/dist/claude-code/.claude/skills/frontend-design/reference/spatial-design.md
+++ b/dist/claude-code/.claude/skills/frontend-design/reference/spatial-design.md
@@ -21,93 +21,266 @@ Then build layout systems that are:
- Responsive and adaptive across viewports
- Compositionally strong with clear focal points
-## Classic Composition Principles
-
-### Visual Hierarchy Fundamentals
-
-[TO BE DEVELOPED: Size, weight, color, position, contrast as hierarchy tools, Gestalt principles (proximity, similarity, closure)]
-
-### Balance & Symmetry
-
-[TO BE DEVELOPED: Symmetrical vs asymmetrical balance, visual weight calculation, creating tension and resolution]
-
-### The Rule of Thirds & Golden Ratio
-
-[TO BE DEVELOPED: Classic composition grids, golden ratio applications, when to follow vs break rules]
-
-### Focal Points & Eye Movement
-
-[TO BE DEVELOPED: Creating focal points, directing eye flow, Z/F/circular patterns, intentional disruption]
-
## Spacing Systems
-### Spacing Scales
-
-[TO BE DEVELOPED: 4pt/8pt systems, modular scales, mathematical progressions (linear, exponential, Fibonacci)]
-
-### Vertical Rhythm
-
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, spacing ratios, rhythm across components]
-
-### Micro vs Macro Space
-
-[TO BE DEVELOPED: Component-internal spacing, between-component spacing, section spacing, page-level breathing room]
-
-### Spacing Token Architecture
-
-[TO BE DEVELOPED: Primitive spacing tokens, semantic spacing (component gaps, section padding), contextual spacing]
-
-## Grid Systems & Layout Patterns
-
-### Grid Fundamentals
-
-[TO BE DEVELOPED: Column grids, modular grids, baseline grids, grid anatomy (columns, gutters, margins)]
-
-### Classic Layout Patterns
-
-[TO BE DEVELOPED: Sidebar layouts, holy grail, card grids, masonry, magazine layouts, asymmetric layouts]
+### Use 4pt Base, Not 8pt
+
+8pt systems are too coarse. **4pt gives you the granularity you actually need:**
+
+```css
+:root {
+ --space-1: 4px; /* 0.25rem - tight */
+ --space-2: 8px; /* 0.5rem */
+ --space-3: 12px; /* 0.75rem */
+ --space-4: 16px; /* 1rem - base */
+ --space-6: 24px; /* 1.5rem */
+ --space-8: 32px; /* 2rem */
+ --space-12: 48px; /* 3rem */
+ --space-16: 64px; /* 4rem */
+ --space-24: 96px; /* 6rem - section gaps */
+}
+```
+
+**The insight**: You'll frequently need 12px (between 8 and 16). An 8pt-only system forces awkward choices.
+
+### Name Tokens by Relationship, Not Value
+
+```css
+/* Bad: tied to pixels */
+--spacing-8: 8px;
+--spacing-16: 16px;
+
+/* Better: semantic */
+--space-xs: 4px; /* Tight inline gaps */
+--space-sm: 8px; /* Between related elements */
+--space-md: 16px; /* Component padding */
+--space-lg: 24px; /* Between components */
+--space-xl: 48px; /* Section padding */
+--space-2xl: 96px; /* Section margins */
+```
+
+### Gap Over Margin
+
+**Stop using margins for spacing between siblings.** Use `gap`:
+
+```css
+/* Old way: margins create double-spacing bugs */
+.card { margin-bottom: 16px; }
+.card:last-child { margin-bottom: 0; } /* Cleanup hack */
+
+/* Modern way: gap just works */
+.card-list {
+ display: flex;
+ flex-direction: column;
+ gap: 16px; /* Automatic, no cleanup needed */
+}
+```
+
+Gap works in Flexbox and Grid. It's cleaner, more intentional, and eliminates margin collapse headaches.
+
+## Grid Systems
+
+### The Self-Adjusting Grid
+
+This pattern creates responsive grids without breakpoints:
+
+```css
+.grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ gap: var(--space-lg);
+}
+```
+
+**How it works**: Columns are at least 280px. As many as fit per row. Leftovers stretch. No media queries needed.
+
+**Variation for exact counts:**
+```css
+/* Always 3 columns on desktop, stack on mobile */
+.grid-3 {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
+ gap: var(--space-lg);
+}
+```
+
+### Grid Area Naming
+
+For complex layouts, named areas are clearer than line numbers:
+
+```css
+.page {
+ display: grid;
+ grid-template-areas:
+ "header header"
+ "sidebar main"
+ "footer footer";
+ grid-template-columns: 280px 1fr;
+ grid-template-rows: auto 1fr auto;
+}
+
+.header { grid-area: header; }
+.sidebar { grid-area: sidebar; }
+.main { grid-area: main; }
+.footer { grid-area: footer; }
+```
+
+At mobile breakpoints, redefine the areas:
+```css
+@media (max-width: 768px) {
+ .page {
+ grid-template-areas:
+ "header"
+ "main"
+ "sidebar"
+ "footer";
+ grid-template-columns: 1fr;
+ }
+}
+```
-### Modern CSS Layout
+## Visual Hierarchy
-[TO BE DEVELOPED: CSS Grid (explicit placement, auto-placement, grid areas), Flexbox (direction, alignment, distribution), Container Queries]
+### The Squint Test
-## Creating Visual Hierarchy
+Blur your eyes (or screenshot and blur). Can you still identify:
+- The most important element?
+- The second most important?
+- Clear groupings?
+
+If everything looks the same weight blurred, you have a hierarchy problem.
+
+### Hierarchy Through Multiple Dimensions
+
+Don't rely on size alone. Combine:
-### Hierarchy Through Scale
+| Tool | Strong Hierarchy | Weak Hierarchy |
+|------|------------------|----------------|
+| **Size** | 3:1 ratio or more | <2:1 ratio |
+| **Weight** | Bold vs Regular | Medium vs Regular |
+| **Color** | High contrast | Similar tones |
+| **Position** | Top/left (primary) | Bottom/right |
+| **Space** | Surrounded by white space | Crowded |
+
+**The best hierarchy uses 2-3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
+
+### Cards Are Not Required
+
+Cards (bordered/shadowed containers) are overused. You don't need a card to create visual grouping—spacing and alignment do this naturally.
+
+**Use cards when**:
+- Content is truly distinct and actionable (a product, a post, a task)
+- Items need to be visually comparable in a grid
+- Content needs clear boundaries for interaction (hover, click)
-[TO BE DEVELOPED: Size relationships, proportional scaling, meaningful jumps vs gradual progression]
+**Don't use cards for**:
+- General layout structure (use spacing instead)
+- Single items (a lone card looks arbitrary)
+- Nesting—**never put cards inside cards**. If you need hierarchy within a card, use spacing, typography, and subtle dividers instead
+
+```css
+/* Bad: card in a card */
+.outer-card > .inner-card { /* Noisy and confusing */ }
+
+/* Good: hierarchy without nesting */
+.card > .card-section { border-top: 1px solid var(--border); }
+```
+
+## Container Queries
+
+Viewport queries are for page layouts. **Container queries are for components**:
+
+```css
+.card-container {
+ container-type: inline-size;
+}
+
+.card {
+ display: grid;
+ gap: var(--space-md);
+}
+
+/* Card layout changes based on its container, not viewport */
+@container (min-width: 400px) {
+ .card {
+ grid-template-columns: 120px 1fr;
+ }
+}
+```
+
+**Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands—automatically, without viewport hacks.
+
+## Optical Adjustments
+
+### Text Doesn't Align
+
+A paragraph set to `margin-left: 0` looks indented because letterforms have internal whitespace. Fix with negative margin or padding:
-### Hierarchy Through Weight & Color
+```css
+.heading {
+ margin-left: -0.05em; /* Pull left to optically align */
+}
+```
-[TO BE DEVELOPED: Visual weight calculation, using color for emphasis, combining multiple hierarchy tools]
+### Icons Need Optical Centering
-### Hierarchy Through Position
+A geometrically centered icon often looks off-center. Play icons need to shift right, left-arrows need to shift left:
-[TO BE DEVELOPED: Placement importance, reading order, visual flow direction, breaking the grid for emphasis]
+```css
+.play-button svg {
+ transform: translateX(2px); /* Optical center */
+}
+```
-## Responsive Spatial Design
+### Touch Targets vs Visual Size
-### Breakpoint Strategy
+Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
-[TO BE DEVELOPED: Mobile-first vs desktop-first, breakpoint values, in-between states, content-driven breakpoints]
+```css
+.icon-button {
+ width: 24px; /* Visual size */
+ height: 24px;
+ position: relative;
+}
-### Layout Adaptation
+.icon-button::before {
+ content: '';
+ position: absolute;
+ inset: -10px; /* Expand tap target to 44px */
+}
+```
-[TO BE DEVELOPED: Reflow patterns, navigation transformation, content prioritization, progressive disclosure]
+## Depth & Elevation
-### Fluid Spacing & Layout
+### Semantic Z-Index
-[TO BE DEVELOPED: clamp() for spacing, viewport units, fluid grids, container-relative spacing]
+Don't use arbitrary numbers. Create a scale:
-## Depth & Layering
+```css
+:root {
+ --z-dropdown: 100;
+ --z-sticky: 200;
+ --z-modal-backdrop: 300;
+ --z-modal: 400;
+ --z-toast: 500;
+ --z-tooltip: 600;
+}
+```
-### Creating Depth
+### Shadow Scale for Elevation
-[TO BE DEVELOPED: Layering, shadows, elevation systems, z-index scales, parallax effects]
+Shadows indicate elevation. Create a consistent scale:
-### Overlap & Intersection
+```css
+:root {
+ --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); /* Subtle lift */
+ --shadow-md: 0 4px 6px rgba(0,0,0,0.07); /* Cards */
+ --shadow-lg: 0 10px 15px rgba(0,0,0,0.1); /* Dropdowns */
+ --shadow-xl: 0 20px 25px rgba(0,0,0,0.15); /* Modals */
+}
+```
-[TO BE DEVELOPED: Intentional overlap, breaking containers, elements that cross boundaries]
+**Key insight**: Shadows should be subtle. If you can clearly see the shadow, it's probably too strong.
---
diff --git a/dist/claude-code/.claude/skills/frontend-design/reference/typography.md b/dist/claude-code/.claude/skills/frontend-design/reference/typography.md
index eefffc474..9874ab641 100644
--- a/dist/claude-code/.claude/skills/frontend-design/reference/typography.md
+++ b/dist/claude-code/.claude/skills/frontend-design/reference/typography.md
@@ -23,59 +23,207 @@ Then build or refine a typography system that is:
## Classic Typography Principles
-### Vertical Rhythm & Baseline Grids
+### Vertical Rhythm
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, maintaining rhythm across components]
+The non-obvious insight: your line-height should be the base unit for ALL vertical spacing in your design. If body text has `line-height: 1.5` on `16px` type (= 24px), then spacing values should be multiples of 24px: 24, 48, 72, etc.
+
+This creates subconscious harmony. Text and space feel "right" together because they share a mathematical foundation.
+
+```css
+:root {
+ --baseline: 1.5rem; /* 24px if root is 16px */
+ --space-1: var(--baseline); /* 24px */
+ --space-2: calc(var(--baseline) * 2); /* 48px */
+ --space-half: calc(var(--baseline) / 2); /* 12px */
+}
+```
### Modular Scale & Hierarchy
-[TO BE DEVELOPED: Scale ratios, establishing hierarchy through size/weight/spacing, visual balance]
+The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
+
+**Use fewer sizes with more contrast.** A 5-size system covers most needs:
+
+| Role | Typical Ratio | Use Case |
+|------|---------------|----------|
+| xs | 0.75rem | Captions, legal |
+| sm | 0.875rem | Secondary UI, metadata |
+| base | 1rem | Body text |
+| lg | 1.25-1.5rem | Subheadings, lead text |
+| xl+ | 2-4rem | Headlines, hero text |
+
+Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
### Readability & Measure
-[TO BE DEVELOPED: Line length (45-75 CPL), line height ratios, paragraph spacing, optimal reading conditions]
+Line length (measure) guidelines are well-known (45-75 characters), but the implementation detail matters:
+
+```css
+/* Use ch units for true character-based measure */
+.prose { max-width: 65ch; }
+
+/* Line-height scales inversely with line length */
+.narrow-column { max-width: 45ch; line-height: 1.4; }
+.wide-column { max-width: 75ch; line-height: 1.6; }
+```
+
+**Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05-0.1 to your normal line-height.
## Font Selection & Pairing
### Choosing Distinctive Fonts
-[TO BE DEVELOPED: Avoiding generic choices, character in typefaces, matching tone to content, Google Fonts alternatives]
+**Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal—but if you want distinctive design, look elsewhere.
+
+**Better Google Fonts alternatives**:
+- Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
+- Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
+- Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
+- For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
+
+**System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider this for apps where performance > personality.
### Pairing Principles
-[TO BE DEVELOPED: Contrast-based pairing, display + body, serif + sans, mono + geometric, variable fonts]
+**The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces. Only add a second font when you need genuine contrast (e.g., display headlines + body serif).
+
+When pairing, contrast on multiple axes:
+- Serif + Sans (structure contrast)
+- Geometric + Humanist (personality contrast)
+- Condensed display + Wide body (proportion contrast)
+
+**Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
### Web Font Loading
-[TO BE DEVELOPED: FOUT/FOIT strategies, font-display, subsetting, variable fonts, preloading]
+The layout shift problem: fonts load late, text reflows, and users see content jump. Here's the fix:
+
+```css
+/* 1. Use font-display: swap for visibility */
+@font-face {
+ font-family: 'CustomFont';
+ src: url('font.woff2') format('woff2');
+ font-display: swap;
+}
+
+/* 2. Match fallback metrics to minimize shift */
+@font-face {
+ font-family: 'CustomFont-Fallback';
+ src: local('Arial');
+ size-adjust: 105%; /* Scale to match x-height */
+ ascent-override: 90%; /* Match ascender height */
+ descent-override: 20%; /* Match descender depth */
+ line-gap-override: 10%; /* Match line spacing */
+}
+
+body {
+ font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
+}
+```
+
+Tools like [Fontaine](https://github.com/unjs/fontaine) calculate these overrides automatically.
## Modern Web Typography
-### Fluid & Responsive Type
+### Fluid Type
-[TO BE DEVELOPED: clamp(), viewport units, container query typography, breakpoint-based scales]
+Fluid typography eliminates breakpoint jumps. The formula:
-### Advanced Features
+```css
+/* font-size: clamp(min, preferred, max) */
+h1 { font-size: clamp(2rem, 5vw + 1rem, 4rem); }
+```
-[TO BE DEVELOPED: OpenType features, ligatures, font-feature-settings, kerning, number styles]
+The `5vw + 1rem` creates smooth scaling. Adjust the vw coefficient for faster/slower scaling.
-### Performance Optimization
+**When NOT to use fluid type**:
+- Button text, labels, UI elements (should be consistent, not fluid)
+- Very short text (scaling makes less sense)
+- When you need precise control at specific breakpoints
-[TO BE DEVELOPED: Font loading strategies, subsetting, variable fonts vs static, hosting decisions]
+### OpenType Features
-## Typography System Architecture
+Most developers don't know these exist. Use them for polish:
-### Token Structure
+```css
+/* Tabular numbers for data alignment */
+.data-table { font-variant-numeric: tabular-nums; }
-[TO BE DEVELOPED: Font stacks, size scales, weight scales, line heights, letter spacing]
+/* Proper fractions */
+.recipe-amount { font-variant-numeric: diagonal-fractions; }
-### Implementation
+/* Small caps for abbreviations */
+abbr { font-variant-caps: all-small-caps; }
-[TO BE DEVELOPED: CSS custom properties, utility classes, semantic vs primitive tokens]
+/* Disable ligatures in code */
+code { font-variant-ligatures: none; }
+
+/* Enable kerning (usually on by default, but be explicit) */
+body { font-kerning: normal; }
+```
+
+Check what features your font supports at [Wakamai Fondue](https://wakamaifondue.com/).
+
+## Typography System Architecture
+
+### Token Structure
+
+**Name tokens semantically, not by value**:
+
+```css
+/* Bad: tied to implementation */
+--font-size-16: 1rem;
+--font-size-24: 1.5rem;
+
+/* Good: tied to purpose */
+--font-size-body: 1rem;
+--font-size-heading: 1.5rem;
+```
+
+A complete token set:
+
+```css
+:root {
+ /* Font stacks */
+ --font-sans: 'CustomSans', system-ui, sans-serif;
+ --font-serif: 'CustomSerif', Georgia, serif;
+ --font-mono: 'JetBrains Mono', ui-monospace, monospace;
+
+ /* Size scale (semantic) */
+ --text-xs: 0.75rem;
+ --text-sm: 0.875rem;
+ --text-base: 1rem;
+ --text-lg: 1.25rem;
+ --text-xl: 1.5rem;
+ --text-2xl: 2rem;
+ --text-3xl: 3rem;
+
+ /* Weight */
+ --font-normal: 400;
+ --font-medium: 500;
+ --font-semibold: 600;
+ --font-bold: 700;
+
+ /* Line height */
+ --leading-tight: 1.25;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.75;
+
+ /* Letter spacing */
+ --tracking-tight: -0.02em;
+ --tracking-normal: 0;
+ --tracking-wide: 0.05em;
+}
+```
## Accessibility Considerations
-[TO BE DEVELOPED: Text scaling, contrast ratios, font sizes, dyslexia-friendly choices]
+Beyond contrast ratios (which are well-documented), consider:
+
+- **Never disable zoom**: `user-scalable=no` breaks accessibility. If your layout breaks at 200% zoom, fix the layout.
+- **Use rem/em for font sizes**: This respects user browser settings. Never `px` for body text.
+- **Minimum 16px body text**: Smaller than this strains eyes and fails WCAG on mobile.
+- **Adequate touch targets**: Text links need padding or line-height that creates 44px+ tap targets.
---
diff --git a/dist/claude-code/.claude/skills/frontend-design/reference/ux-writing.md b/dist/claude-code/.claude/skills/frontend-design/reference/ux-writing.md
index 0966e455c..b2e833e73 100644
--- a/dist/claude-code/.claude/skills/frontend-design/reference/ux-writing.md
+++ b/dist/claude-code/.claude/skills/frontend-design/reference/ux-writing.md
@@ -22,163 +22,263 @@ Then write copy that is:
- Human and empathetic
- Consistent in terminology and tone
-## Fundamental Principles
+## The Button Label Problem
-### Clarity Over Cleverness
+**Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
-[TO BE DEVELOPED: Plain language, avoid jargon, specific over vague, "Save changes" not "OK"]
+| Bad | Good | Why |
+|-----|------|-----|
+| OK | Save changes | Says what will happen |
+| Submit | Create account | Outcome-focused |
+| Yes | Delete message | Confirms the action |
+| Cancel | Keep editing | Clarifies what "cancel" means |
+| Click here | Download PDF | Describes the destination |
-### Concise But Complete
+**For destructive actions**, name the destruction:
+- "Delete" not "Remove" (delete is permanent, remove implies recoverable)
+- "Delete 5 items" not "Delete selected" (show the count)
-[TO BE DEVELOPED: Remove unnecessary words, but include essential information, balance brevity with clarity]
+## Error Messages: The Formula
-### Active Voice
+Every error message should answer three questions:
-[TO BE DEVELOPED: "We saved your changes" not "Your changes have been saved", action-oriented language]
+1. **What happened?** (Clearly state the problem)
+2. **Why?** (If not obvious)
+3. **How to fix it?** (Specific action)
-### User-Focused Language
+```
+Bad: "Invalid input"
-[TO BE DEVELOPED: "Your" not "The", focus on user benefits, user's mental model]
+Good: "Email address isn't valid. Please include an @ symbol."
-### Consistency
+Bad: "Request failed"
-[TO BE DEVELOPED: Use same terms throughout, don't vary for variety, build terminology glossary]
+Good: "We couldn't save your changes. Check your internet connection and try again."
+```
-## Voice & Tone
+### Error Message Templates
-### Establishing Brand Voice
+| Situation | Template |
+|-----------|----------|
+| **Format error** | "[Field] needs to be [format]. Example: [example]" |
+| **Missing required** | "Please enter [what's missing]" |
+| **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
+| **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
+| **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
-[TO BE DEVELOPED: Personality dimensions, voice guidelines, voice vs tone distinction]
+### Don't Blame the User
-### Adapting Tone to Context
+```
+Bad: "You entered an invalid date"
+Good: "Please enter a date in MM/DD/YYYY format"
-[TO BE DEVELOPED: Success = celebratory, Error = empathetic, Loading = reassuring, matching emotional moment]
+Bad: "Your password is too weak"
+Good: "Add at least one number or symbol to strengthen your password"
+```
-### Voice Across Cultures
+## Empty States Are Opportunities
-[TO BE DEVELOPED: Cultural sensitivity, humor translation, formality levels, global considerations]
+An empty list isn't a dead end—it's an onboarding moment.
-## Microcopy Excellence
+```
+Bad: "No items"
-### Button & CTA Copy
+Good: "No projects yet
+ Projects help you organize your work. Create your first one to get started.
+ [+ Create project]"
+```
-[TO BE DEVELOPED: Specific actions ("Create account" not "Submit"), verb + noun structure, outcome-oriented]
+**Empty state formula**:
+1. Acknowledge the emptiness (briefly)
+2. Explain the value of filling it
+3. Provide a clear action
-### Labels & Instructions
+## Voice vs Tone
-[TO BE DEVELOPED: Clear, specific labels, instructions before fields, showing format with examples]
+**Voice** is your brand's personality—consistent everywhere.
+**Tone** adapts to the moment.
-### Placeholder Text
+| Moment | Tone Shift |
+|--------|------------|
+| Success | Celebratory, brief: "Done! Your changes are live." |
+| Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
+| Loading | Reassuring: "Saving your work..." |
+| Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
-[TO BE DEVELOPED: When to use (rarely), never as labels, examples not instructions]
+**Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
-### Tooltips & Help Text
-
-[TO BE DEVELOPED: Adding value beyond label, answering implicit questions, brevity with links to details]
+## Writing for Accessibility
-## Error Messages & Validation
+### Link Text
-### Error Message Principles
+Screen readers can navigate by links. Vague links fail:
-[TO BE DEVELOPED: Explain what happened, suggest fix, don't blame user, provide examples, link to help]
+```html
+<!-- Bad: meaningless without context -->
+<a href="...">Click here</a>
+<a href="...">Learn more</a>
-### Validation Feedback
+<!-- Good: standalone meaning -->
+<a href="...">View pricing plans</a>
+<a href="...">Learn more about data export</a>
+```
-[TO BE DEVELOPED: Inline validation, timing (on blur vs on submit), success states, clear requirements]
+### Alt Text
-### Error Message Patterns
+Describe the **information**, not the image:
-[TO BE DEVELOPED: Format errors, permission errors, network errors, system errors, 404s]
+```html
+<!-- Bad: describes image -->
+<img alt="Chart" src="revenue.png">
-## Forms & Inputs
+<!-- Good: describes information -->
+<img alt="Revenue increased 40% in Q4" src="revenue.png">
-### Form Labels
+<!-- Decorative images get empty alt -->
+<img alt="" src="decorative-wave.png">
+```
-[TO BE DEVELOPED: Descriptive labels, required field indication, why you're asking (when not obvious)]
+### Button Context
-### Help Text
+Buttons need context, especially icons:
-[TO BE DEVELOPED: Format guidance, why you need this information, examples, constraints]
+```html
+<!-- Bad: no context -->
+<button>×</button>
-### Confirmation Dialogs
+<!-- Good: screen reader context -->
+<button aria-label="Close dialog">×</button>
+```
-[TO BE DEVELOPED: Specific about action, explain consequences, clear button labels, don't overuse]
+## Writing for Translation
-## System Messages
+### Plan for Expansion
-### Success Messages
+German text is ~30% longer than English. Allocate space:
-[TO BE DEVELOPED: Confirm what happened, what happens next, celebrate appropriately, be brief]
+| Language | Expansion |
+|----------|-----------|
+| German | +30% |
+| French | +20% |
+| Finnish | +30-40% |
+| Chinese | -30% (fewer chars, but same width) |
-### Loading States
+### Translation-Friendly Patterns
-[TO BE DEVELOPED: What's happening, time expectations, progress indication, personality in waiting]
+```
+Bad: "You have 3 new messages" (number inside sentence)
+Good: "New messages: 3" (number separate)
-### Empty States
+Bad: "Welcome back, {name}!" (word order varies by language)
+Good: "{greeting_message}" (full sentence as one string)
-[TO BE DEVELOPED: Explain why empty, value of filling it, clear CTA, welcoming not dead-end]
+Bad: "5 mins ago" (abbrev doesn't translate)
+Good: "5 minutes ago" (full word)
+```
-## Navigation & Wayfinding
+### Give Translators Context
-### Navigation Labels
+```json
+{
+ "delete_confirm": {
+ "message": "Delete {item}?",
+ "context": "Confirmation dialog when deleting a file or folder. {item} is the name of the item being deleted."
+ }
+}
+```
-[TO BE DEVELOPED: Specific and descriptive, user language not internal terms, clear information scent]
+## Consistency: The Terminology Problem
-### Breadcrumbs & Headers
+Pick one term and stick with it:
-[TO BE DEVELOPED: Clear location indication, hierarchical clarity, shortened for mobile]
+| Inconsistent | Consistent |
+|--------------|------------|
+| Delete / Remove / Trash | Delete |
+| Settings / Preferences / Options | Settings |
+| Sign in / Log in / Enter | Sign in |
+| Create / Add / New | Create |
-### Search & Filters
+Build a terminology glossary and enforce it. Variety creates confusion.
-[TO BE DEVELOPED: Clear search placeholders, filter labels, no results messaging]
+## Avoid Redundant Copy
-## Content Hierarchy & Structure
+Saying the same thing twice wastes space and dilutes impact.
-### Scannable Writing
+**Common redundancies**:
+- Section header + intro paragraph saying the same thing
+- Page title + section title with same/similar text
+- CTA button + surrounding text repeating the action
+- Outro that restates the intro
-[TO BE DEVELOPED: Short paragraphs, bullet points, clear headings, front-load important info]
+```
+Bad: "Settings"
+ "Here you can adjust your settings and preferences."
+ [Settings form]
+ "Save your settings to apply changes."
-### Progressive Disclosure
+Good: "Settings"
+ [Settings form]
+ [Save]
+```
-[TO BE DEVELOPED: Essential info first, details on demand, expandable sections, learn more links]
+**The rule**: If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
-## Writing for Accessibility
+## Loading States
-### Screen Reader Considerations
+Tell users what's happening:
-[TO BE DEVELOPED: ARIA labels, alt text writing, link text clarity, button labels]
+```
+Bad: "Loading..."
+Good: "Saving your draft..."
-### Plain Language
+Bad: [spinner]
+Good: "Searching 1,247 documents..."
-[TO BE DEVELOPED: Reading level considerations, avoid jargon, explain technical terms]
+Bad: "Please wait"
+Good: "Preparing your download... This usually takes 30 seconds."
+```
-### Text Alternatives
+For long waits, show progress or set expectations.
-[TO BE DEVELOPED: Transcripts for audio/video, alt text for images, descriptions for complex UI]
+## Confirmation Dialogs: Use Sparingly
-## Internationalization (i18n)
+**Most confirmation dialogs are design failures.** If an action is dangerous enough to confirm, consider:
+- Undo instead of confirm
+- Making the action less destructive
+- Showing consequences before the action
-### Writing for Translation
+When you must confirm:
-[TO BE DEVELOPED: Avoid idioms, complete sentences, context for translators, text expansion space]
+```
+Bad: "Are you sure?"
+ [Yes] [No]
-### Cultural Adaptation
+Good: "Delete 'Project Alpha'?
+ This will permanently delete the project and all its files.
+ [Delete project] [Keep project]"
+```
-[TO BE DEVELOPED: Cultural sensitivity, date/time formats, address formats, name formats]
+Name the action, explain consequences, use specific button labels.
-## Content Patterns by Type
+## Form Instructions
-### Onboarding Copy
+### Format Hints
-[TO BE DEVELOPED: Welcome messages, getting started, first-time guidance, value proposition]
+Show don't tell:
-### Settings & Preferences
+```
+Bad: "Enter date in MMDDYYYY format"
+Good: "Date of birth" + placeholder="04/15/1990"
+```
-[TO BE DEVELOPED: Clear option descriptions, impact explanation, defaults indication]
+### Why Are You Asking?
-### Notifications
+For non-obvious fields, explain:
-[TO BE DEVELOPED: Scannable, actionable, appropriate urgency, notification fatigue prevention]
+```html
+<label>Phone number (optional)</label>
+<span class="help">We'll only use this to contact you about your order.</span>
+```
---
diff --git a/dist/codex/AGENTS.frontend-design.md b/dist/codex/AGENTS.frontend-design.md
index e07e95864..2c3a61e72 100644
--- a/dist/codex/AGENTS.frontend-design.md
+++ b/dist/codex/AGENTS.frontend-design.md
@@ -51,7 +51,7 @@ Focus on intentional, distinctive design choices:
**Space**: Use a spacing scale (4, 8, 12, 16, 24, 32, 48, 64, 96). Create visual rhythm through varied spacing. Let content breathe. Break the grid intentionally.
-**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity. Stagger reveals for orchestrated page loads.
+**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity with smooth ease-out curves (quart, quint, expo). Stagger reveals for orchestrated page loads.
**Interaction**: Design clear focus indicators. Make touch targets 44×44px minimum. Provide immediate feedback. Write specific, helpful error messages.
@@ -61,11 +61,13 @@ Focus on intentional, distinctive design choices:
These patterns create generic "AI slop" aesthetics:
-**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, wrapping everything in rounded cards, decorative shadows without purpose.
+**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, pure grays without color tint, wrapping everything in rounded cards, decorative shadows without purpose.
-**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards.
+**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards, redundant copy (headers restating intros, repeated explanations).
-**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors.
+**Motion Mistakes**: Bounce and elastic easing (dated and tacky), animating layout properties, durations over 500ms for feedback, animation without purpose.
+
+**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors, gray text on colored backgrounds.
**Accessibility Violations**: Color-only meaning, ignoring prefers-reduced-motion, failing WCAG contrast, creating keyboard traps.
@@ -142,163 +144,263 @@ Then write copy that is:
- Human and empathetic
- Consistent in terminology and tone
-## Fundamental Principles
+## The Button Label Problem
-### Clarity Over Cleverness
+**Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
-[TO BE DEVELOPED: Plain language, avoid jargon, specific over vague, "Save changes" not "OK"]
+| Bad | Good | Why |
+|-----|------|-----|
+| OK | Save changes | Says what will happen |
+| Submit | Create account | Outcome-focused |
+| Yes | Delete message | Confirms the action |
+| Cancel | Keep editing | Clarifies what "cancel" means |
+| Click here | Download PDF | Describes the destination |
-### Concise But Complete
+**For destructive actions**, name the destruction:
+- "Delete" not "Remove" (delete is permanent, remove implies recoverable)
+- "Delete 5 items" not "Delete selected" (show the count)
-[TO BE DEVELOPED: Remove unnecessary words, but include essential information, balance brevity with clarity]
+## Error Messages: The Formula
-### Active Voice
+Every error message should answer three questions:
-[TO BE DEVELOPED: "We saved your changes" not "Your changes have been saved", action-oriented language]
+1. **What happened?** (Clearly state the problem)
+2. **Why?** (If not obvious)
+3. **How to fix it?** (Specific action)
-### User-Focused Language
+```
+Bad: "Invalid input"
-[TO BE DEVELOPED: "Your" not "The", focus on user benefits, user's mental model]
+Good: "Email address isn't valid. Please include an @ symbol."
-### Consistency
+Bad: "Request failed"
-[TO BE DEVELOPED: Use same terms throughout, don't vary for variety, build terminology glossary]
+Good: "We couldn't save your changes. Check your internet connection and try again."
+```
-## Voice & Tone
+### Error Message Templates
-### Establishing Brand Voice
+| Situation | Template |
+|-----------|----------|
+| **Format error** | "[Field] needs to be [format]. Example: [example]" |
+| **Missing required** | "Please enter [what's missing]" |
+| **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
+| **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
+| **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
-[TO BE DEVELOPED: Personality dimensions, voice guidelines, voice vs tone distinction]
+### Don't Blame the User
-### Adapting Tone to Context
+```
+Bad: "You entered an invalid date"
+Good: "Please enter a date in MM/DD/YYYY format"
-[TO BE DEVELOPED: Success = celebratory, Error = empathetic, Loading = reassuring, matching emotional moment]
+Bad: "Your password is too weak"
+Good: "Add at least one number or symbol to strengthen your password"
+```
-### Voice Across Cultures
+## Empty States Are Opportunities
-[TO BE DEVELOPED: Cultural sensitivity, humor translation, formality levels, global considerations]
+An empty list isn't a dead end—it's an onboarding moment.
-## Microcopy Excellence
+```
+Bad: "No items"
-### Button & CTA Copy
+Good: "No projects yet
+ Projects help you organize your work. Create your first one to get started.
+ [+ Create project]"
+```
-[TO BE DEVELOPED: Specific actions ("Create account" not "Submit"), verb + noun structure, outcome-oriented]
+**Empty state formula**:
+1. Acknowledge the emptiness (briefly)
+2. Explain the value of filling it
+3. Provide a clear action
-### Labels & Instructions
+## Voice vs Tone
-[TO BE DEVELOPED: Clear, specific labels, instructions before fields, showing format with examples]
+**Voice** is your brand's personality—consistent everywhere.
+**Tone** adapts to the moment.
-### Placeholder Text
+| Moment | Tone Shift |
+|--------|------------|
+| Success | Celebratory, brief: "Done! Your changes are live." |
+| Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
+| Loading | Reassuring: "Saving your work..." |
+| Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
-[TO BE DEVELOPED: When to use (rarely), never as labels, examples not instructions]
+**Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
-### Tooltips & Help Text
+## Writing for Accessibility
-[TO BE DEVELOPED: Adding value beyond label, answering implicit questions, brevity with links to details]
+### Link Text
-## Error Messages & Validation
+Screen readers can navigate by links. Vague links fail:
-### Error Message Principles
+```html
+<!-- Bad: meaningless without context -->
+<a href="...">Click here</a>
+<a href="...">Learn more</a>
-[TO BE DEVELOPED: Explain what happened, suggest fix, don't blame user, provide examples, link to help]
+<!-- Good: standalone meaning -->
+<a href="...">View pricing plans</a>
+<a href="...">Learn more about data export</a>
+```
-### Validation Feedback
+### Alt Text
-[TO BE DEVELOPED: Inline validation, timing (on blur vs on submit), success states, clear requirements]
+Describe the **information**, not the image:
-### Error Message Patterns
+```html
+<!-- Bad: describes image -->
+<img alt="Chart" src="revenue.png">
-[TO BE DEVELOPED: Format errors, permission errors, network errors, system errors, 404s]
+<!-- Good: describes information -->
+<img alt="Revenue increased 40% in Q4" src="revenue.png">
-## Forms & Inputs
+<!-- Decorative images get empty alt -->
+<img alt="" src="decorative-wave.png">
+```
-### Form Labels
+### Button Context
-[TO BE DEVELOPED: Descriptive labels, required field indication, why you're asking (when not obvious)]
+Buttons need context, especially icons:
-### Help Text
+```html
+<!-- Bad: no context -->
+<button>×</button>
-[TO BE DEVELOPED: Format guidance, why you need this information, examples, constraints]
+<!-- Good: screen reader context -->
+<button aria-label="Close dialog">×</button>
+```
-### Confirmation Dialogs
+## Writing for Translation
-[TO BE DEVELOPED: Specific about action, explain consequences, clear button labels, don't overuse]
+### Plan for Expansion
-## System Messages
+German text is ~30% longer than English. Allocate space:
-### Success Messages
+| Language | Expansion |
+|----------|-----------|
+| German | +30% |
+| French | +20% |
+| Finnish | +30-40% |
+| Chinese | -30% (fewer chars, but same width) |
-[TO BE DEVELOPED: Confirm what happened, what happens next, celebrate appropriately, be brief]
+### Translation-Friendly Patterns
-### Loading States
+```
+Bad: "You have 3 new messages" (number inside sentence)
+Good: "New messages: 3" (number separate)
-[TO BE DEVELOPED: What's happening, time expectations, progress indication, personality in waiting]
+Bad: "Welcome back, {name}!" (word order varies by language)
+Good: "{greeting_message}" (full sentence as one string)
-### Empty States
+Bad: "5 mins ago" (abbrev doesn't translate)
+Good: "5 minutes ago" (full word)
+```
-[TO BE DEVELOPED: Explain why empty, value of filling it, clear CTA, welcoming not dead-end]
+### Give Translators Context
-## Navigation & Wayfinding
+```json
+{
+ "delete_confirm": {
+ "message": "Delete {item}?",
+ "context": "Confirmation dialog when deleting a file or folder. {item} is the name of the item being deleted."
+ }
+}
+```
-### Navigation Labels
+## Consistency: The Terminology Problem
-[TO BE DEVELOPED: Specific and descriptive, user language not internal terms, clear information scent]
+Pick one term and stick with it:
-### Breadcrumbs & Headers
+| Inconsistent | Consistent |
+|--------------|------------|
+| Delete / Remove / Trash | Delete |
+| Settings / Preferences / Options | Settings |
+| Sign in / Log in / Enter | Sign in |
+| Create / Add / New | Create |
-[TO BE DEVELOPED: Clear location indication, hierarchical clarity, shortened for mobile]
+Build a terminology glossary and enforce it. Variety creates confusion.
-### Search & Filters
+## Avoid Redundant Copy
-[TO BE DEVELOPED: Clear search placeholders, filter labels, no results messaging]
+Saying the same thing twice wastes space and dilutes impact.
-## Content Hierarchy & Structure
+**Common redundancies**:
+- Section header + intro paragraph saying the same thing
+- Page title + section title with same/similar text
+- CTA button + surrounding text repeating the action
+- Outro that restates the intro
-### Scannable Writing
+```
+Bad: "Settings"
+ "Here you can adjust your settings and preferences."
+ [Settings form]
+ "Save your settings to apply changes."
-[TO BE DEVELOPED: Short paragraphs, bullet points, clear headings, front-load important info]
+Good: "Settings"
+ [Settings form]
+ [Save]
+```
-### Progressive Disclosure
+**The rule**: If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
-[TO BE DEVELOPED: Essential info first, details on demand, expandable sections, learn more links]
+## Loading States
-## Writing for Accessibility
+Tell users what's happening:
-### Screen Reader Considerations
+```
+Bad: "Loading..."
+Good: "Saving your draft..."
-[TO BE DEVELOPED: ARIA labels, alt text writing, link text clarity, button labels]
+Bad: [spinner]
+Good: "Searching 1,247 documents..."
-### Plain Language
+Bad: "Please wait"
+Good: "Preparing your download... This usually takes 30 seconds."
+```
-[TO BE DEVELOPED: Reading level considerations, avoid jargon, explain technical terms]
+For long waits, show progress or set expectations.
-### Text Alternatives
+## Confirmation Dialogs: Use Sparingly
-[TO BE DEVELOPED: Transcripts for audio/video, alt text for images, descriptions for complex UI]
+**Most confirmation dialogs are design failures.** If an action is dangerous enough to confirm, consider:
+- Undo instead of confirm
+- Making the action less destructive
+- Showing consequences before the action
-## Internationalization (i18n)
+When you must confirm:
-### Writing for Translation
+```
+Bad: "Are you sure?"
+ [Yes] [No]
-[TO BE DEVELOPED: Avoid idioms, complete sentences, context for translators, text expansion space]
+Good: "Delete 'Project Alpha'?
+ This will permanently delete the project and all its files.
+ [Delete project] [Keep project]"
+```
-### Cultural Adaptation
+Name the action, explain consequences, use specific button labels.
-[TO BE DEVELOPED: Cultural sensitivity, date/time formats, address formats, name formats]
+## Form Instructions
-## Content Patterns by Type
+### Format Hints
-### Onboarding Copy
+Show don't tell:
-[TO BE DEVELOPED: Welcome messages, getting started, first-time guidance, value proposition]
+```
+Bad: "Enter date in MMDDYYYY format"
+Good: "Date of birth" + placeholder="04/15/1990"
+```
-### Settings & Preferences
+### Why Are You Asking?
-[TO BE DEVELOPED: Clear option descriptions, impact explanation, defaults indication]
+For non-obvious fields, explain:
-### Notifications
-
-[TO BE DEVELOPED: Scannable, actionable, appropriate urgency, notification fatigue prevention]
+```html
+<label>Phone number (optional)</label>
+<span class="help">We'll only use this to contact you about your order.</span>
+```
---
@@ -346,93 +448,266 @@ Then build layout systems that are:
- Responsive and adaptive across viewports
- Compositionally strong with clear focal points
-## Classic Composition Principles
-
-### Visual Hierarchy Fundamentals
-
-[TO BE DEVELOPED: Size, weight, color, position, contrast as hierarchy tools, Gestalt principles (proximity, similarity, closure)]
-
-### Balance & Symmetry
-
-[TO BE DEVELOPED: Symmetrical vs asymmetrical balance, visual weight calculation, creating tension and resolution]
-
-### The Rule of Thirds & Golden Ratio
-
-[TO BE DEVELOPED: Classic composition grids, golden ratio applications, when to follow vs break rules]
-
-### Focal Points & Eye Movement
-
-[TO BE DEVELOPED: Creating focal points, directing eye flow, Z/F/circular patterns, intentional disruption]
-
## Spacing Systems
-### Spacing Scales
+### Use 4pt Base, Not 8pt
+
+8pt systems are too coarse. **4pt gives you the granularity you actually need:**
+
+```css
+:root {
+ --space-1: 4px; /* 0.25rem - tight */
+ --space-2: 8px; /* 0.5rem */
+ --space-3: 12px; /* 0.75rem */
+ --space-4: 16px; /* 1rem - base */
+ --space-6: 24px; /* 1.5rem */
+ --space-8: 32px; /* 2rem */
+ --space-12: 48px; /* 3rem */
+ --space-16: 64px; /* 4rem */
+ --space-24: 96px; /* 6rem - section gaps */
+}
+```
+
+**The insight**: You'll frequently need 12px (between 8 and 16). An 8pt-only system forces awkward choices.
+
+### Name Tokens by Relationship, Not Value
+
+```css
+/* Bad: tied to pixels */
+--spacing-8: 8px;
+--spacing-16: 16px;
+
+/* Better: semantic */
+--space-xs: 4px; /* Tight inline gaps */
+--space-sm: 8px; /* Between related elements */
+--space-md: 16px; /* Component padding */
+--space-lg: 24px; /* Between components */
+--space-xl: 48px; /* Section padding */
+--space-2xl: 96px; /* Section margins */
+```
+
+### Gap Over Margin
+
+**Stop using margins for spacing between siblings.** Use `gap`:
+
+```css
+/* Old way: margins create double-spacing bugs */
+.card { margin-bottom: 16px; }
+.card:last-child { margin-bottom: 0; } /* Cleanup hack */
+
+/* Modern way: gap just works */
+.card-list {
+ display: flex;
+ flex-direction: column;
+ gap: 16px; /* Automatic, no cleanup needed */
+}
+```
+
+Gap works in Flexbox and Grid. It's cleaner, more intentional, and eliminates margin collapse headaches.
+
+## Grid Systems
+
+### The Self-Adjusting Grid
+
+This pattern creates responsive grids without breakpoints:
+
+```css
+.grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ gap: var(--space-lg);
+}
+```
+
+**How it works**: Columns are at least 280px. As many as fit per row. Leftovers stretch. No media queries needed.
+
+**Variation for exact counts:**
+```css
+/* Always 3 columns on desktop, stack on mobile */
+.grid-3 {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
+ gap: var(--space-lg);
+}
+```
+
+### Grid Area Naming
+
+For complex layouts, named areas are clearer than line numbers:
+
+```css
+.page {
+ display: grid;
+ grid-template-areas:
+ "header header"
+ "sidebar main"
+ "footer footer";
+ grid-template-columns: 280px 1fr;
+ grid-template-rows: auto 1fr auto;
+}
+
+.header { grid-area: header; }
+.sidebar { grid-area: sidebar; }
+.main { grid-area: main; }
+.footer { grid-area: footer; }
+```
+
+At mobile breakpoints, redefine the areas:
+```css
+@media (max-width: 768px) {
+ .page {
+ grid-template-areas:
+ "header"
+ "main"
+ "sidebar"
+ "footer";
+ grid-template-columns: 1fr;
+ }
+}
+```
-[TO BE DEVELOPED: 4pt/8pt systems, modular scales, mathematical progressions (linear, exponential, Fibonacci)]
+## Visual Hierarchy
-### Vertical Rhythm
-
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, spacing ratios, rhythm across components]
-
-### Micro vs Macro Space
-
-[TO BE DEVELOPED: Component-internal spacing, between-component spacing, section spacing, page-level breathing room]
-
-### Spacing Token Architecture
-
-[TO BE DEVELOPED: Primitive spacing tokens, semantic spacing (component gaps, section padding), contextual spacing]
-
-## Grid Systems & Layout Patterns
+### The Squint Test
-### Grid Fundamentals
+Blur your eyes (or screenshot and blur). Can you still identify:
+- The most important element?
+- The second most important?
+- Clear groupings?
+
+If everything looks the same weight blurred, you have a hierarchy problem.
+
+### Hierarchy Through Multiple Dimensions
+
+Don't rely on size alone. Combine:
-[TO BE DEVELOPED: Column grids, modular grids, baseline grids, grid anatomy (columns, gutters, margins)]
+| Tool | Strong Hierarchy | Weak Hierarchy |
+|------|------------------|----------------|
+| **Size** | 3:1 ratio or more | <2:1 ratio |
+| **Weight** | Bold vs Regular | Medium vs Regular |
+| **Color** | High contrast | Similar tones |
+| **Position** | Top/left (primary) | Bottom/right |
+| **Space** | Surrounded by white space | Crowded |
+
+**The best hierarchy uses 2-3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
+
+### Cards Are Not Required
+
+Cards (bordered/shadowed containers) are overused. You don't need a card to create visual grouping—spacing and alignment do this naturally.
+
+**Use cards when**:
+- Content is truly distinct and actionable (a product, a post, a task)
+- Items need to be visually comparable in a grid
+- Content needs clear boundaries for interaction (hover, click)
-### Classic Layout Patterns
+**Don't use cards for**:
+- General layout structure (use spacing instead)
+- Single items (a lone card looks arbitrary)
+- Nesting—**never put cards inside cards**. If you need hierarchy within a card, use spacing, typography, and subtle dividers instead
+
+```css
+/* Bad: card in a card */
+.outer-card > .inner-card { /* Noisy and confusing */ }
+
+/* Good: hierarchy without nesting */
+.card > .card-section { border-top: 1px solid var(--border); }
+```
+
+## Container Queries
+
+Viewport queries are for page layouts. **Container queries are for components**:
+
+```css
+.card-container {
+ container-type: inline-size;
+}
+
+.card {
+ display: grid;
+ gap: var(--space-md);
+}
-[TO BE DEVELOPED: Sidebar layouts, holy grail, card grids, masonry, magazine layouts, asymmetric layouts]
+/* Card layout changes based on its container, not viewport */
+@container (min-width: 400px) {
+ .card {
+ grid-template-columns: 120px 1fr;
+ }
+}
+```
-### Modern CSS Layout
+**Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands—automatically, without viewport hacks.
+
+## Optical Adjustments
-[TO BE DEVELOPED: CSS Grid (explicit placement, auto-placement, grid areas), Flexbox (direction, alignment, distribution), Container Queries]
+### Text Doesn't Align
-## Creating Visual Hierarchy
+A paragraph set to `margin-left: 0` looks indented because letterforms have internal whitespace. Fix with negative margin or padding:
-### Hierarchy Through Scale
+```css
+.heading {
+ margin-left: -0.05em; /* Pull left to optically align */
+}
+```
-[TO BE DEVELOPED: Size relationships, proportional scaling, meaningful jumps vs gradual progression]
+### Icons Need Optical Centering
-### Hierarchy Through Weight & Color
+A geometrically centered icon often looks off-center. Play icons need to shift right, left-arrows need to shift left:
-[TO BE DEVELOPED: Visual weight calculation, using color for emphasis, combining multiple hierarchy tools]
+```css
+.play-button svg {
+ transform: translateX(2px); /* Optical center */
+}
+```
-### Hierarchy Through Position
+### Touch Targets vs Visual Size
-[TO BE DEVELOPED: Placement importance, reading order, visual flow direction, breaking the grid for emphasis]
+Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
-## Responsive Spatial Design
+```css
+.icon-button {
+ width: 24px; /* Visual size */
+ height: 24px;
+ position: relative;
+}
-### Breakpoint Strategy
+.icon-button::before {
+ content: '';
+ position: absolute;
+ inset: -10px; /* Expand tap target to 44px */
+}
+```
-[TO BE DEVELOPED: Mobile-first vs desktop-first, breakpoint values, in-between states, content-driven breakpoints]
+## Depth & Elevation
-### Layout Adaptation
+### Semantic Z-Index
-[TO BE DEVELOPED: Reflow patterns, navigation transformation, content prioritization, progressive disclosure]
+Don't use arbitrary numbers. Create a scale:
-### Fluid Spacing & Layout
+```css
+:root {
+ --z-dropdown: 100;
+ --z-sticky: 200;
+ --z-modal-backdrop: 300;
+ --z-modal: 400;
+ --z-toast: 500;
+ --z-tooltip: 600;
+}
+```
-[TO BE DEVELOPED: clamp() for spacing, viewport units, fluid grids, container-relative spacing]
+### Shadow Scale for Elevation
-## Depth & Layering
+Shadows indicate elevation. Create a consistent scale:
-### Creating Depth
+```css
+:root {
+ --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); /* Subtle lift */
+ --shadow-md: 0 4px 6px rgba(0,0,0,0.07); /* Cards */
+ --shadow-lg: 0 10px 15px rgba(0,0,0,0.1); /* Dropdowns */
+ --shadow-xl: 0 20px 25px rgba(0,0,0,0.15); /* Modals */
+}
+```
-[TO BE DEVELOPED: Layering, shadows, elevation systems, z-index scales, parallax effects]
-
-### Overlap & Intersection
-
-[TO BE DEVELOPED: Intentional overlap, breaking containers, elements that cross boundaries]
+**Key insight**: Shadows should be subtle. If you can clearly see the shadow, it's probably too strong.
---
@@ -476,75 +751,193 @@ Then implement motion that is:
- Accessible with reduced motion alternatives
- Choreographed with thoughtful timing and sequencing
-## Classic Animation Principles
-
-### Disney's 12 Principles (Web Context)
-
-[TO BE DEVELOPED: Squash and stretch, anticipation, staging, follow-through, ease-in/ease-out, arcs, secondary action, timing, exaggeration, solid drawing, appeal - adapted for UI]
-
-### Timing & Duration
-
-[TO BE DEVELOPED: Micro-interactions (100-300ms), transitions (300-500ms), complex animations (500-1000ms), duration by distance, perceived speed]
-
-### Easing & Curves
+## Duration: The 100/300/500 Rule
-[TO BE DEVELOPED: Linear vs eased, ease-out (enter), ease-in (exit), ease-in-out (full cycle), custom cubic-bezier, spring physics]
+Timing matters more than easing. These durations feel right for most UI:
-## Types of UI Animation
+| Duration | Use Case | Examples |
+|----------|----------|----------|
+| **100-150ms** | Instant feedback | Button press, toggle, color change |
+| **200-300ms** | State changes | Menu open, tooltip, hover states |
+| **300-500ms** | Layout changes | Accordion, modal, drawer |
+| **500-800ms** | Entrance animations | Page load, hero reveals |
-### Micro-interactions
+**Exit animations are faster than entrances.** Users want to see what's leaving—quickly. Use ~75% of the enter duration:
+```css
+.modal {
+ --enter: 400ms;
+ --exit: 300ms;
+}
+```
+
+## Easing: Pick the Right Curve
+
+**Don't use `ease`.** It's a compromise that's rarely optimal. Instead:
+
+| Curve | Use For | CSS |
+|-------|---------|-----|
+| **ease-out** | Elements entering | `cubic-bezier(0.16, 1, 0.3, 1)` |
+| **ease-in** | Elements leaving | `cubic-bezier(0.7, 0, 0.84, 0)` |
+| **ease-in-out** | State toggles (there → back) | `cubic-bezier(0.65, 0, 0.35, 1)` |
+
+**For micro-interactions, use exponential curves**—they feel natural because they mimic real physics (friction, deceleration):
+
+```css
+/* Quart out - smooth, refined (recommended default) */
+--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
+
+/* Quint out - slightly more dramatic */
+--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
-[TO BE DEVELOPED: Button feedback, hover states, toggle switches, like buttons, form validation feedback, loading indicators]
+/* Expo out - snappy, confident */
+--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
+```
-### Page Transitions
+**Avoid bounce and elastic curves.** They were trendy in 2015 but now feel tacky and amateurish. Real objects don't bounce when they stop—they decelerate smoothly. Overshoot effects draw attention to the animation itself rather than the content.
-[TO BE DEVELOPED: Route transitions, modal entry/exit, drawer animations, cross-fade, slide, zoom patterns]
+## The Only Two Properties You Should Animate
-### State Transitions
+**transform** and **opacity**. That's it. Everything else causes layout recalculation or repaints:
-[TO BE DEVELOPED: Loading → success → error flows, expand/collapse, show/hide, enable/disable state changes]
+```css
+/* Good: GPU-accelerated, smooth */
+.slide-in {
+ transform: translateX(0);
+ opacity: 1;
+ transition: transform 300ms ease-out, opacity 300ms ease-out;
+}
+.slide-in.hidden {
+ transform: translateX(20px);
+ opacity: 0;
+}
+
+/* Bad: triggers layout, janky */
+.slide-in {
+ left: 0; /* Layout thrashing */
+ height: 100%; /* Expensive */
+}
+```
-### Scrolling & Parallax
+**Exceptions**: Sometimes you must animate `height` for accordions. Use `max-height` with a value larger than content, or better yet, use CSS Grid's `grid-template-rows: 0fr → 1fr` trick.
-[TO BE DEVELOPED: Scroll-triggered animations, reveal on scroll, parallax layers, scroll-linked effects, intersection observer]
+## Staggered Animations
-## Choreography & Sequencing
+Staggering creates rhythm and direction. The formula:
-### Staggered Animations
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+}
-[TO BE DEVELOPED: animation-delay patterns, sequential reveals, cascade effects, list item staggering]
+/* Stagger each item by 50ms */
+.list-item:nth-child(1) { animation-delay: 0ms; }
+.list-item:nth-child(2) { animation-delay: 50ms; }
+.list-item:nth-child(3) { animation-delay: 100ms; }
+/* ... */
+```
+
+**Better approach with CSS custom property:**
+
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+ animation-delay: calc(var(--i, 0) * 50ms);
+}
+```
+```html
+<li class="list-item" style="--i: 0">First</li>
+<li class="list-item" style="--i: 1">Second</li>
+<li class="list-item" style="--i: 2">Third</li>
+```
+
+**Key insight**: Cap the total stagger time. 10 items at 50ms = 500ms before the last item appears. If you have 50 items, reduce to 20ms per item or cap at ~10 staggered items.
+
+## Reduced Motion
+
+This is not optional. Vestibular disorders affect ~35% of adults over 40.
+
+```css
+/* Define animations normally */
+.card {
+ animation: slide-up 500ms ease-out;
+}
+
+/* Provide alternative for reduced motion */
+@media (prefers-reduced-motion: reduce) {
+ .card {
+ animation: fade-in 200ms ease-out; /* Crossfade instead of motion */
+ }
+}
-### Orchestrated Page Loads
+/* Or disable entirely */
+@media (prefers-reduced-motion: reduce) {
+ *, *::before, *::after {
+ animation-duration: 0.01ms !important;
+ transition-duration: 0.01ms !important;
+ }
+}
+```
+
+**What to preserve**: Functional animations like progress bars, loading spinners (slowed down), and focus indicators should still work—just without spatial movement.
+
+## Performance: Avoid These Mistakes
+
+### Don't Use will-change Preemptively
+
+```css
+/* Bad: wastes GPU memory */
+.card { will-change: transform; }
+
+/* Good: only when animation is imminent */
+.card:hover { will-change: transform; }
+.card.animating { will-change: transform; }
+```
+
+`will-change` forces the browser to create a compositing layer. Used everywhere = memory bloat.
+
+### Don't Animate During Scroll
+
+Scroll-linked animations (parallax, reveal) are expensive. If you must:
+
+```javascript
+// Use Intersection Observer, not scroll events
+const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('visible');
+ observer.unobserve(entry.target); // Animate once, then stop observing
+ }
+ });
+}, { threshold: 0.2 });
+```
+
+### Don't Fight the Main Thread
+
+Heavy JavaScript animations block rendering. For complex choreography, use the Web Animations API or a library like Motion One that schedules efficiently.
+
+## Motion Tokens
-[TO BE DEVELOPED: Entry choreography, hero → content → details, creating narrative through sequence, attention management]
-
-### Exit Choreography
-
-[TO BE DEVELOPED: Reverse sequences, intentional exit timing, maintaining spatial relationships during exit]
-
-## Technical Implementation
-
-### CSS-Only Animation
-
-[TO BE DEVELOPED: @keyframes, animation properties, transitions, transform, pseudo-element animations, hardware acceleration]
-
-### JavaScript Animation
-
-[TO BE DEVELOPED: Web Animations API, requestAnimationFrame, animation libraries (GSAP, Framer Motion, Motion One)]
-
-### Performance Optimization
-
-[TO BE DEVELOPED: GPU acceleration (transform, opacity only), will-change, avoiding layout thrashing, reducing paint, FPS monitoring]
-
-## Motion Design Systems
-
-### Motion Tokens
-
-[TO BE DEVELOPED: Duration scales, easing tokens, named animations, consistent motion vocabulary]
-
-### Reduced Motion
-
-[TO BE DEVELOPED: prefers-reduced-motion, graceful degradation, essential vs decorative animation, crossfade alternatives]
+Create a system for consistency:
+
+```css
+:root {
+ /* Durations */
+ --duration-instant: 100ms;
+ --duration-fast: 200ms;
+ --duration-normal: 300ms;
+ --duration-slow: 500ms;
+
+ /* Easings */
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
+ --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
+ --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
+
+ /* Common patterns */
+ --transition-fade: opacity var(--duration-fast) var(--ease-out);
+ --transition-slide: transform var(--duration-normal) var(--ease-out);
+ --transition-all: var(--duration-normal) var(--ease-out);
+}
+```
---
@@ -591,59 +984,207 @@ Then build or refine a typography system that is:
## Classic Typography Principles
-### Vertical Rhythm & Baseline Grids
+### Vertical Rhythm
+
+The non-obvious insight: your line-height should be the base unit for ALL vertical spacing in your design. If body text has `line-height: 1.5` on `16px` type (= 24px), then spacing values should be multiples of 24px: 24, 48, 72, etc.
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, maintaining rhythm across components]
+This creates subconscious harmony. Text and space feel "right" together because they share a mathematical foundation.
+
+```css
+:root {
+ --baseline: 1.5rem; /* 24px if root is 16px */
+ --space-1: var(--baseline); /* 24px */
+ --space-2: calc(var(--baseline) * 2); /* 48px */
+ --space-half: calc(var(--baseline) / 2); /* 12px */
+}
+```
### Modular Scale & Hierarchy
-[TO BE DEVELOPED: Scale ratios, establishing hierarchy through size/weight/spacing, visual balance]
+The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
+
+**Use fewer sizes with more contrast.** A 5-size system covers most needs:
+
+| Role | Typical Ratio | Use Case |
+|------|---------------|----------|
+| xs | 0.75rem | Captions, legal |
+| sm | 0.875rem | Secondary UI, metadata |
+| base | 1rem | Body text |
+| lg | 1.25-1.5rem | Subheadings, lead text |
+| xl+ | 2-4rem | Headlines, hero text |
+
+Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
### Readability & Measure
-[TO BE DEVELOPED: Line length (45-75 CPL), line height ratios, paragraph spacing, optimal reading conditions]
+Line length (measure) guidelines are well-known (45-75 characters), but the implementation detail matters:
+
+```css
+/* Use ch units for true character-based measure */
+.prose { max-width: 65ch; }
+
+/* Line-height scales inversely with line length */
+.narrow-column { max-width: 45ch; line-height: 1.4; }
+.wide-column { max-width: 75ch; line-height: 1.6; }
+```
+
+**Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05-0.1 to your normal line-height.
## Font Selection & Pairing
### Choosing Distinctive Fonts
-[TO BE DEVELOPED: Avoiding generic choices, character in typefaces, matching tone to content, Google Fonts alternatives]
+**Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal—but if you want distinctive design, look elsewhere.
+
+**Better Google Fonts alternatives**:
+- Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
+- Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
+- Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
+- For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
+
+**System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider this for apps where performance > personality.
### Pairing Principles
-[TO BE DEVELOPED: Contrast-based pairing, display + body, serif + sans, mono + geometric, variable fonts]
+**The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces. Only add a second font when you need genuine contrast (e.g., display headlines + body serif).
+
+When pairing, contrast on multiple axes:
+- Serif + Sans (structure contrast)
+- Geometric + Humanist (personality contrast)
+- Condensed display + Wide body (proportion contrast)
+
+**Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
### Web Font Loading
-[TO BE DEVELOPED: FOUT/FOIT strategies, font-display, subsetting, variable fonts, preloading]
+The layout shift problem: fonts load late, text reflows, and users see content jump. Here's the fix:
+
+```css
+/* 1. Use font-display: swap for visibility */
+@font-face {
+ font-family: 'CustomFont';
+ src: url('font.woff2') format('woff2');
+ font-display: swap;
+}
+
+/* 2. Match fallback metrics to minimize shift */
+@font-face {
+ font-family: 'CustomFont-Fallback';
+ src: local('Arial');
+ size-adjust: 105%; /* Scale to match x-height */
+ ascent-override: 90%; /* Match ascender height */
+ descent-override: 20%; /* Match descender depth */
+ line-gap-override: 10%; /* Match line spacing */
+}
+
+body {
+ font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
+}
+```
+
+Tools like [Fontaine](https://github.com/unjs/fontaine) calculate these overrides automatically.
## Modern Web Typography
-### Fluid & Responsive Type
+### Fluid Type
-[TO BE DEVELOPED: clamp(), viewport units, container query typography, breakpoint-based scales]
+Fluid typography eliminates breakpoint jumps. The formula:
-### Advanced Features
+```css
+/* font-size: clamp(min, preferred, max) */
+h1 { font-size: clamp(2rem, 5vw + 1rem, 4rem); }
+```
-[TO BE DEVELOPED: OpenType features, ligatures, font-feature-settings, kerning, number styles]
+The `5vw + 1rem` creates smooth scaling. Adjust the vw coefficient for faster/slower scaling.
-### Performance Optimization
+**When NOT to use fluid type**:
+- Button text, labels, UI elements (should be consistent, not fluid)
+- Very short text (scaling makes less sense)
+- When you need precise control at specific breakpoints
-[TO BE DEVELOPED: Font loading strategies, subsetting, variable fonts vs static, hosting decisions]
+### OpenType Features
-## Typography System Architecture
+Most developers don't know these exist. Use them for polish:
-### Token Structure
+```css
+/* Tabular numbers for data alignment */
+.data-table { font-variant-numeric: tabular-nums; }
+
+/* Proper fractions */
+.recipe-amount { font-variant-numeric: diagonal-fractions; }
+
+/* Small caps for abbreviations */
+abbr { font-variant-caps: all-small-caps; }
+
+/* Disable ligatures in code */
+code { font-variant-ligatures: none; }
+
+/* Enable kerning (usually on by default, but be explicit) */
+body { font-kerning: normal; }
+```
+
+Check what features your font supports at [Wakamai Fondue](https://wakamaifondue.com/).
-[TO BE DEVELOPED: Font stacks, size scales, weight scales, line heights, letter spacing]
+## Typography System Architecture
-### Implementation
+### Token Structure
-[TO BE DEVELOPED: CSS custom properties, utility classes, semantic vs primitive tokens]
+**Name tokens semantically, not by value**:
+
+```css
+/* Bad: tied to implementation */
+--font-size-16: 1rem;
+--font-size-24: 1.5rem;
+
+/* Good: tied to purpose */
+--font-size-body: 1rem;
+--font-size-heading: 1.5rem;
+```
+
+A complete token set:
+
+```css
+:root {
+ /* Font stacks */
+ --font-sans: 'CustomSans', system-ui, sans-serif;
+ --font-serif: 'CustomSerif', Georgia, serif;
+ --font-mono: 'JetBrains Mono', ui-monospace, monospace;
+
+ /* Size scale (semantic) */
+ --text-xs: 0.75rem;
+ --text-sm: 0.875rem;
+ --text-base: 1rem;
+ --text-lg: 1.25rem;
+ --text-xl: 1.5rem;
+ --text-2xl: 2rem;
+ --text-3xl: 3rem;
+
+ /* Weight */
+ --font-normal: 400;
+ --font-medium: 500;
+ --font-semibold: 600;
+ --font-bold: 700;
+
+ /* Line height */
+ --leading-tight: 1.25;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.75;
+
+ /* Letter spacing */
+ --tracking-tight: -0.02em;
+ --tracking-normal: 0;
+ --tracking-wide: 0.05em;
+}
+```
## Accessibility Considerations
-[TO BE DEVELOPED: Text scaling, contrast ratios, font sizes, dyslexia-friendly choices]
+Beyond contrast ratios (which are well-documented), consider:
+
+- **Never disable zoom**: `user-scalable=no` breaks accessibility. If your layout breaks at 200% zoom, fix the layout.
+- **Use rem/em for font sizes**: This respects user browser settings. Never `px` for body text.
+- **Minimum 16px body text**: Smaller than this strains eyes and fails WCAG on mobile.
+- **Adequate touch targets**: Text links need padding or line-height that creates 44px+ tap targets.
---
@@ -687,115 +1228,240 @@ Then implement interactions that are:
- Forgiving with error prevention and recovery
- Responsive with immediate feedback and state changes
-## Interaction States
+## The Eight Interactive States
+
+Every interactive element needs these states designed:
-### Core States
+| State | When | Visual Treatment |
+|-------|------|------------------|
+| **Default** | At rest | Base styling |
+| **Hover** | Pointer over (not touch) | Subtle lift, color shift |
+| **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
+| **Active** | Being pressed | Pressed in, darker |
+| **Disabled** | Not interactive | Reduced opacity, no pointer |
+| **Loading** | Processing | Spinner, skeleton |
+| **Error** | Invalid state | Red border, icon, message |
+| **Success** | Completed | Green check, confirmation |
-[TO BE DEVELOPED: Default, hover, focus, active, disabled, loading, error, success - visual treatment for each]
+**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states.
-### State Transitions
+## Focus Rings: Do Them Right
-[TO BE DEVELOPED: Smooth state changes, animation between states, maintaining context, preserving user intent]
+**Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users:
-### Loading & Progress States
+```css
+/* Hide focus ring for mouse/touch */
+button:focus {
+ outline: none;
+}
-[TO BE DEVELOPED: Skeleton screens, spinners, progress bars, optimistic updates, what to show while waiting]
+/* Show focus ring for keyboard */
+button:focus-visible {
+ outline: 2px solid var(--color-accent);
+ outline-offset: 2px;
+}
+```
-## Affordances & Feedback
+**Focus ring design**:
+- High contrast (3:1 minimum against adjacent colors)
+- 2-3px thick
+- Offset from element (not inside it)
+- Consistent across all interactive elements
-### Visual Affordances
+## Form Design: The Non-Obvious
-[TO BE DEVELOPED: Signaling interactivity, button appearance, link styling, cursor changes, touch target highlighting]
+### Don't Use Placeholders as Labels
-### Immediate Feedback
+Placeholders disappear when you type. Users forget what the field was for. Screen readers may not announce them.
-[TO BE DEVELOPED: Click/tap acknowledgment, hover feedback, focus indication, "something is happening" signals]
+```html
+<!-- Bad -->
+<input placeholder="Email address">
-### Haptic & Sound Feedback
+<!-- Good -->
+<label for="email">Email address</label>
+<input id="email" type="email" placeholder="[email protected]">
+```
-[TO BE DEVELOPED: Vibration patterns, sound cues, cross-modal feedback, when to use non-visual feedback]
+Use placeholders only for examples or format hints, never as the primary label.
-## Form Design & Input Patterns
+### Validate on Blur, Not on Input
-### Form Layout & Structure
+Real-time validation (validating every keystroke) is annoying. Users can't finish typing before seeing errors.
-[TO BE DEVELOPED: Single column vs multi-column, label placement, field grouping, visual hierarchy in forms]
+```javascript
+// Bad: fires on every keystroke
+input.addEventListener('input', validate);
-### Input Field Design
+// Good: fires when user leaves field
+input.addEventListener('blur', validate);
-[TO BE DEVELOPED: Field sizing, placeholder usage (anti-pattern), helper text, character limits, input masking]
+// Exception: password strength (show progress while typing)
+passwordInput.addEventListener('input', showStrength);
+```
-### Validation Patterns
+### Error Message Placement
-[TO BE DEVELOPED: Inline vs on-submit, real-time validation, error message writing, success confirmation, required field indication]
+Place errors **below** the field (users scan top-down), not above. Keep messages close to the field—not in a summary at the top unless also repeated inline.
-### Complex Input Types
+```html
+<label for="email">Email</label>
+<input id="email" type="email" aria-describedby="email-error">
+<span id="email-error" class="error">Please enter a valid email</span>
+```
-[TO BE DEVELOPED: File upload UX, date pickers, time selection, rich text editing, multi-select, autocomplete, search]
+The `aria-describedby` connects the error to the input for screen readers.
-### Progressive Disclosure in Forms
+## Loading States: Optimistic Updates
-[TO BE DEVELOPED: Conditional fields, wizards/multi-step forms, accordions, showing complexity gradually]
+**Show success immediately, handle failure gracefully.** Users perceive the app as faster.
-### Form Error Handling
+```javascript
+// Optimistic update pattern
+async function toggleLike() {
+ // 1. Update UI immediately
+ setLiked(true);
-[TO BE DEVELOPED: Error prevention (constraints, masks), clear error messages, error recovery, field-level vs form-level errors]
+ try {
+ // 2. Send request
+ await api.like(postId);
+ } catch {
+ // 3. Rollback on failure
+ setLiked(false);
+ showToast('Like failed. Please try again.');
+ }
+}
+```
-## Touch & Pointer Interactions
+**When to use**: Low-stakes actions (likes, follows, small edits). **Not for**: Payments, destructive actions, critical data changes.
-### Touch Targets
+### Skeleton Screens > Spinners
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge reach areas on mobile]
+Spinners say "something is happening" but give no sense of what or how long. Skeletons preview the content shape:
-### Touch vs Pointer Patterns
+```css
+.skeleton {
+ background: linear-gradient(
+ 90deg,
+ var(--gray-200) 25%,
+ var(--gray-100) 50%,
+ var(--gray-200) 75%
+ );
+ background-size: 200% 100%;
+ animation: shimmer 1.5s infinite;
+}
-[TO BE DEVELOPED: Hover states on touch (problems), tap feedback, long press, swipe gestures, pinch-to-zoom]
+@keyframes shimmer {
+ 0% { background-position: 200% 0; }
+ 100% { background-position: -200% 0; }
+}
+```
-### Gesture Design
+## Modals: The Inert Approach
-[TO BE DEVELOPED: Swipe to delete, pull to refresh, drag to reorder, custom gestures, gesture discoverability]
+Focus trapping in modals used to require complex JavaScript. Now use the `inert` attribute:
-## Keyboard Navigation
+```html
+<!-- When modal is open -->
+<main inert>
+ <!-- Content behind modal can't be focused or clicked -->
+</main>
+<dialog open>
+ <h2>Modal Title</h2>
+ <!-- Focus stays inside modal -->
+</dialog>
+```
-### Focus Management
+Or use the native `<dialog>` element:
-[TO BE DEVELOPED: Focus rings (never remove without replacement), logical tab order, skip links, focus trapping in modals]
+```javascript
+const dialog = document.querySelector('dialog');
+dialog.showModal(); // Opens with focus trap, closes on Escape
+```
-### Keyboard Shortcuts
+## The Popover API
-[TO BE DEVELOPED: Common shortcuts, discoverability, avoiding conflicts, command palettes, keyboard-first workflows]
+For tooltips, dropdowns, and non-modal overlays, use native popovers:
-### Accessible Interaction Patterns
+```html
+<button popovertarget="menu">Open menu</button>
+<div id="menu" popover>
+ <button>Option 1</button>
+ <button>Option 2</button>
+</div>
+```
-[TO BE DEVELOPED: ARIA roles for custom controls, managing focus in dynamic content, screen reader announcements]
+**Benefits**: Light-dismiss (click outside closes), proper stacking, no z-index wars, accessible by default.
-## Navigation Patterns
+## Destructive Actions: Undo > Confirm
-### Menu & Navigation Design
+Confirmation dialogs are friction. Users click through them mindlessly. **Undo is better**:
-[TO BE DEVELOPED: Mega menus, hamburger menus, breadcrumbs, tabs, pagination, infinite scroll vs load more]
+```javascript
+async function deleteItem(id) {
+ // 1. Remove from UI immediately
+ hideItem(id);
-### Modal & Dialog Patterns
+ // 2. Show undo toast
+ const toast = showToast('Item deleted', {
+ action: { label: 'Undo', onClick: () => restoreItem(id) },
+ duration: 5000
+ });
-[TO BE DEVELOPED: Modal entry/exit, focus management, escape to close, backdrop click behavior, sheet patterns]
+ // 3. Actually delete after toast expires
+ toast.onClose(() => api.delete(id));
+}
+```
-### Command & Context Menus
+**When to still use confirmation**: Irreversible actions (account deletion), high-cost actions (large purchases), batch operations on many items.
+
+## Keyboard Navigation Patterns
+
+### Roving Tabindex
+
+For component groups (tabs, menu items, radio groups), one item is tabbable; arrow keys move within:
-[TO BE DEVELOPED: Right-click menus, command palettes, dropdown menus, action sheets]
+```html
+<div role="tablist">
+ <button role="tab" tabindex="0">Tab 1</button>
+ <button role="tab" tabindex="-1">Tab 2</button>
+ <button role="tab" tabindex="-1">Tab 3</button>
+</div>
+```
-## Error Prevention & Recovery
+Arrow keys move `tabindex="0"` between items. Tab moves to the next component entirely.
-### Constraints & Guards
+### Skip Links
-[TO BE DEVELOPED: Input constraints, disabled states, confirmation dialogs for destructive actions, undo mechanisms]
+For keyboard users, provide a skip link to jump past navigation:
-### Error Messages
+```html
+<a href="#main-content" class="skip-link">Skip to main content</a>
+<nav>...</nav>
+<main id="main-content">...</main>
+```
-[TO BE DEVELOPED: Clear language, actionable guidance, positive framing, where to show errors, when to show errors]
+```css
+.skip-link {
+ position: absolute;
+ left: -9999px;
+}
+.skip-link:focus {
+ left: 0;
+ z-index: 9999;
+ /* Visible styling */
+}
+```
-### Undo & Redo
+## Gesture Discoverability
-[TO BE DEVELOPED: Undo patterns, toast notifications with undo, versioning, draft auto-save]
+Swipe-to-delete and similar gestures are invisible. Hint at their existence:
+
+- **Partially reveal**: Show delete button peeking from edge
+- **Onboarding**: Coach marks on first use
+- **Alternative**: Always provide a visible fallback (menu with "Delete")
+
+Don't rely on gestures as the only way to perform actions.
---
@@ -841,75 +1507,185 @@ Then build a color system that is:
- Flexible enough for theming and variations
- Aesthetically cohesive and on-brand
-## Color Theory Fundamentals
+## Color Spaces: Use OKLCH
-### Color Harmony & Relationships
+**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
-[TO BE DEVELOPED: Complementary, analogous, triadic, split-complementary, monochromatic schemes, color wheel navigation]
+```css
+/* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */
+--color-primary: oklch(60% 0.15 250); /* Blue */
+--color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */
+--color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */
+```
-### Color Psychology & Meaning
+**Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish. A light blue at 85% lightness needs ~0.08 chroma, not the 0.15 of your base color.
-[TO BE DEVELOPED: Emotional associations, cultural considerations, industry conventions, semantic color choices]
+## Building Functional Palettes
-### Color Properties
+### The Tinted Neutral Trap
-[TO BE DEVELOPED: Hue, saturation, lightness/brightness, HSL vs RGB vs LCH, perceptual uniformity]
+**Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals:
-## Building Functional Palettes
+```css
+/* Dead grays */
+--gray-100: oklch(95% 0 0); /* No personality */
+--gray-900: oklch(15% 0 0);
+
+/* Warm-tinted grays (add brand warmth) */
+--gray-100: oklch(95% 0.01 60); /* Hint of warmth */
+--gray-900: oklch(15% 0.01 60);
+
+/* Cool-tinted grays (tech, professional) */
+--gray-100: oklch(95% 0.01 250); /* Hint of blue */
+--gray-900: oklch(15% 0.01 250);
+```
+
+The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI.
### Palette Structure
-[TO BE DEVELOPED: Primary/secondary/tertiary, neutral scales (9-11 steps), semantic colors, state colors]
+A complete system needs:
-### Generating Color Scales
+| Role | Purpose | Example |
+|------|---------|---------|
+| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
+| **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
+| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
+| **Surface** | Cards, modals, overlays | 2-3 elevation levels |
-[TO BE DEVELOPED: Lightness curves, saturation shifts, hue rotation, perceptual uniformity, algorithmic generation]
+**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
-### The Dominant Color Principle
+### The 60-30-10 Rule (Applied Correctly)
-[TO BE DEVELOPED: 60-30-10 rule, accent color strategy, visual weight distribution, avoiding rainbow vomit]
+This rule is about **visual weight**, not pixel count:
+
+- **60%**: Neutral backgrounds, white space, base surfaces
+- **30%**: Secondary colors—text, borders, inactive states
+- **10%**: Accent—CTAs, highlights, focus states
+
+The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power.
## Contrast & Accessibility
-### WCAG Compliance
+### WCAG Requirements
+
+| Content Type | AA Minimum | AAA Target |
+|--------------|------------|------------|
+| Body text | 4.5:1 | 7:1 |
+| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
+| UI components, icons | 3:1 | 4.5:1 |
+| Non-essential decorations | None | None |
+
+**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG.
+
+### Dangerous Color Combinations
+
+These commonly fail contrast or cause readability issues:
+
+- Light gray text on white (the #1 accessibility fail)
+- **Gray text on any colored background**—gray looks washed out and dead on color. Use a tinted version of the background color instead, or transparency
+- Red text on green background (or vice versa)—8% of men can't distinguish these
+- Blue text on red background (vibrates visually)
+- Yellow text on white (almost always fails)
+- Thin light text on images (unpredictable contrast)
+
+### Never Use Pure Gray or Pure Black
+
+Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. They look uncanny and lifeless.
-[TO BE DEVELOPED: AA vs AAA standards, text contrast ratios (4.5:1 / 7:1), UI component contrast (3:1), large text exceptions]
+```css
+/* Dead and artificial */
+--gray: oklch(50% 0 0);
+--black: oklch(0% 0 0);
-### Testing & Tools
+/* Natural and warm */
+--gray: oklch(50% 0.01 60); /* Warm gray */
+--black: oklch(12% 0.01 250); /* Very dark blue-gray */
+```
-[TO BE DEVELOPED: Contrast checkers, automated testing, color blindness simulation, tools for verification]
+Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted.
-### Accessible Color Combinations
+### Testing
-[TO BE DEVELOPED: Which combinations work, which don't, safe pairings, dangerous pairings, contrast matrices]
+Don't trust your eyes. Use tools:
-## Theming Architecture
+- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
+- Browser DevTools → Rendering → Emulate vision deficiencies
+- [Polypane](https://polypane.app/) for real-time testing
-### Light & Dark Mode
+## Theming: Light & Dark Mode
-[TO BE DEVELOPED: Independent palettes vs inverted, neutral strategies, shadows in dark mode, image handling]
+### Dark Mode Is Not Inverted Light Mode
-### CSS Custom Properties
+You can't just swap colors. Dark mode requires different design decisions:
-[TO BE DEVELOPED: Token hierarchy (primitive → semantic → component), naming conventions, theme switching]
+| Light Mode | Dark Mode |
+|------------|-----------|
+| Shadows for depth | Lighter surfaces for depth (no shadows) |
+| Dark text on light | Light text on dark (reduce font weight) |
+| Vibrant accents | Desaturate accents slightly |
+| White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
-### Multi-Theme Systems
+```css
+/* Dark mode depth via surface color, not shadow */
+:root[data-theme="dark"] {
+ --surface-1: oklch(15% 0.01 250);
+ --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */
+ --surface-3: oklch(25% 0.01 250);
-[TO BE DEVELOPED: Brand themes, user preference themes, contextual themes, theme inheritance]
+ /* Reduce text weight slightly */
+ --body-weight: 350; /* Instead of 400 */
+}
+```
-## Advanced Color Techniques
+### Token Hierarchy
-### Gradients & Effects
+Use two layers of abstraction:
-[TO BE DEVELOPED: Mesh gradients, color stops, blend modes, gradient generation, overlay techniques]
+```css
+/* Layer 1: Primitive tokens (rarely use directly) */
+--blue-500: oklch(55% 0.2 250);
+--blue-600: oklch(45% 0.2 250);
-### Transparency & Alpha
+/* Layer 2: Semantic tokens (use these) */
+--color-primary: var(--blue-500);
+--color-primary-hover: var(--blue-600);
+--color-text: var(--gray-900);
+--color-text-muted: var(--gray-600);
+--color-border: var(--gray-200);
+--color-surface: var(--white);
+```
-[TO BE DEVELOPED: Alpha channels, overlay strategies, transparency scales, backdrop effects]
+**For dark mode, only redefine the semantic layer:**
-### Dynamic Color
+```css
+:root[data-theme="dark"] {
+ --color-primary: var(--blue-400); /* Lighter in dark mode */
+ --color-text: var(--gray-100);
+ --color-surface: var(--gray-900);
+}
+```
-[TO BE DEVELOPED: State-based color changes, hover darkening/lightening, interactive color feedback]
+## Alpha Is A Design Smell
+
+If you're using lots of transparency (rgba, hsla), your palette is probably incomplete. Alpha creates:
+- Unpredictable contrast (depends on what's behind it)
+- Performance overhead (compositing)
+- Inconsistency across contexts
+
+**Instead**: Define explicit overlay colors:
+
+```css
+/* Bad: unpredictable */
+--overlay: rgba(0, 0, 0, 0.5);
+
+/* Good: explicit colors for each context */
+--overlay-on-light: oklch(40% 0 0);
+--overlay-on-dark: oklch(70% 0 0);
+--overlay-on-image: oklch(20% 0 0 / 60%); /* Alpha only when necessary */
+```
+
+The exception: Focus rings and interactive states where you need to see through to the element beneath.
---
@@ -955,119 +1731,237 @@ Then build responsive systems that are:
- Performant on constrained devices
- Contextually appropriate
-## Mobile-First Methodology
-
-### Why Mobile-First
-
-[TO BE DEVELOPED: Progressive enhancement, performance benefits, forces priority decisions, mobile usage dominance]
+## Mobile-First: Write It Right
-### Mobile-First Implementation
+Start with base styles for mobile, then layer complexity:
-[TO BE DEVELOPED: Start with mobile styles, add complexity with min-width media queries, content-first approach]
+```css
+/* Base: mobile */
+.nav {
+ display: flex;
+ flex-direction: column;
+}
-## Breakpoint Strategies
+/* Enhancement: tablet and up */
+@media (min-width: 768px) {
+ .nav {
+ flex-direction: row;
+ }
+}
+```
-### Choosing Breakpoints
+**The mistake**: Writing desktop-first (max-width queries) means mobile loads desktop styles first, then overrides. Wasteful and error-prone.
-[TO BE DEVELOPED: Content-driven vs device-driven, common breakpoint values, in-between states, avoiding too many breakpoints]
+## Breakpoints: Content-Driven, Not Device-Driven
-### Breakpoint Architecture
+**Don't chase device sizes.** iPhones change, Android varies wildly, tablets overlap with laptops. Instead, let content tell you where to break:
-[TO BE DEVELOPED: Named breakpoints, breakpoint tokens, consistent usage across codebase]
+1. Start narrow
+2. Stretch the viewport until the design breaks
+3. Add a breakpoint there
-## Fluid & Adaptive Design
+Common content-driven breakpoints (as starting points):
-### Fluid Typography
+```css
+:root {
+ --bp-sm: 640px; /* Larger phones, small content changes */
+ --bp-md: 768px; /* Tablets, significant reflow */
+ --bp-lg: 1024px; /* Laptops, multi-column */
+ --bp-xl: 1280px; /* Desktops, max content width */
+}
+```
-[TO BE DEVELOPED: clamp(), viewport units, fluid type scales, maintaining readability]
+**Three breakpoints usually suffice.** If you have more than five, you're probably over-engineering.
-### Fluid Spacing
-
-[TO BE DEVELOPED: Responsive spacing scales, container-relative spacing, clamp() for margins/padding]
-
-### Fluid Layouts
-
-[TO BE DEVELOPED: CSS Grid auto-fit/auto-fill, flexible columns, aspect-ratio, fluid containers]
+## Fluid Design: The Clamp Formula
-### Container Queries
-
-[TO BE DEVELOPED: Component-level responsiveness, when to use vs media queries, polyfills]
-
-## Layout Adaptation Patterns
+`clamp(min, preferred, max)` creates fluid values without media queries.
-### Navigation Patterns
+### The Formula
-[TO BE DEVELOPED: Mobile hamburger/drawer, tablet side panel, desktop persistent nav, bottom nav bars]
+```css
+/* Font size: 16px min, scales with viewport, 24px max */
+font-size: clamp(1rem, 0.5rem + 2vw, 1.5rem);
+```
-### Content Reflow
+**How to calculate the preferred value**: The middle value determines the scaling rate. Higher vw coefficient = faster scaling:
-[TO BE DEVELOPED: Single column → multi-column, stacking orders, priority content first]
+- `1vw` = gentle scaling
+- `2-3vw` = moderate scaling
+- `4vw+` = aggressive scaling
-### Component Adaptation
+Add a rem offset to shift the baseline: `0.5rem + 2vw` ensures it doesn't collapse to 0 on small screens.
-[TO BE DEVELOPED: Tabs → accordion, horizontal → vertical, show/hide patterns, progressive disclosure]
-
-## Touch vs Pointer Optimization
-
-### Touch Target Sizing
-
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge cases]
-
-### Touch-Specific Interactions
-
-[TO BE DEVELOPED: Swipe gestures, pull-to-refresh, long press, avoiding hover-dependent patterns]
-
-### Hybrid Devices
-
-[TO BE DEVELOPED: Supporting both touch and pointer, feature detection, adaptive interfaces]
-
-## Viewport & Screen Considerations
-
-### Viewport Meta Tag
-
-[TO BE DEVELOPED: Proper viewport configuration, zoom control, initial scale]
+### Fluid Spacing
-### Safe Areas
+```css
+:root {
+ --space-lg: clamp(2rem, 1rem + 3vw, 4rem);
+ --container-padding: clamp(1rem, 5vw, 4rem);
+}
+```
+
+This creates breathing room that naturally expands on larger screens.
+
+## Detect Input Method, Not Just Screen Size
+
+**Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard—use pointer and hover queries:
+
+```css
+/* Fine pointer (mouse, trackpad) */
+@media (pointer: fine) {
+ .button { padding: 8px 16px; }
+}
+
+/* Coarse pointer (touch, stylus) */
+@media (pointer: coarse) {
+ .button { padding: 12px 20px; } /* Larger touch target */
+}
+
+/* Device supports hover */
+@media (hover: hover) {
+ .card:hover { transform: translateY(-2px); }
+}
+
+/* Device doesn't support hover (touch) */
+@media (hover: none) {
+ .card { /* No hover state - use active instead */ }
+}
+```
+
+**Critical**: Don't rely on hover for functionality. Touch users can't hover.
+
+## Safe Areas: Handle the Notch
+
+Modern phones have notches, rounded corners, and home indicators. Use `env()`:
+
+```css
+body {
+ padding-top: env(safe-area-inset-top);
+ padding-bottom: env(safe-area-inset-bottom);
+ padding-left: env(safe-area-inset-left);
+ padding-right: env(safe-area-inset-right);
+}
+
+/* With fallback */
+.footer {
+ padding-bottom: max(1rem, env(safe-area-inset-bottom));
+}
+```
+
+**Enable viewport-fit** in your meta tag:
+```html
+<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
+```
+
+## Responsive Images: Get It Right
+
+### srcset with Width Descriptors
+
+```html
+<img
+ src="hero-800.jpg"
+ srcset="
+ hero-400.jpg 400w,
+ hero-800.jpg 800w,
+ hero-1200.jpg 1200w
+ "
+ sizes="(max-width: 768px) 100vw, 50vw"
+ alt="Hero image"
+>
+```
+
+**How it works**:
+- `srcset` lists available images with their actual widths (`w` descriptors)
+- `sizes` tells the browser how wide the image will display
+- Browser picks the best file based on viewport width AND device pixel ratio
+
+### Picture Element for Art Direction
+
+When you need different crops/compositions (not just resolutions):
+
+```html
+<picture>
+ <source media="(min-width: 768px)" srcset="wide.jpg">
+ <source media="(max-width: 767px)" srcset="tall.jpg">
+ <img src="fallback.jpg" alt="...">
+</picture>
+```
-[TO BE DEVELOPED: iPhone notch, rounded corners, system UI insets, padding for safe areas]
+## Layout Adaptation Patterns
-### Orientation Handling
+### Navigation: The Three-Stage Pattern
-[TO BE DEVELOPED: Portrait vs landscape, orientation-specific layouts, testing both orientations]
+```css
+/* Mobile: hamburger icon + drawer */
+.nav-menu { display: none; }
+.nav-toggle { display: block; }
-### High-DPI Screens
+/* Tablet: horizontal but compact */
+@media (min-width: 768px) {
+ .nav-menu { display: flex; }
+ .nav-toggle { display: none; }
+}
-[TO BE DEVELOPED: Retina images, 2x/3x assets, SVG for icons, responsive images]
+/* Desktop: full navigation with labels */
+@media (min-width: 1024px) {
+ .nav-item-label { display: inline; }
+}
+```
-## Responsive Images & Media
+### Table to Cards
-### Responsive Images
+Tables work on desktop, fail on mobile. Transform:
-[TO BE DEVELOPED: srcset, sizes, picture element, art direction, lazy loading]
+```css
+@media (max-width: 768px) {
+ table, thead, tbody, th, td, tr {
+ display: block;
+ }
-### Video Adaptation
+ thead { display: none; } /* Hide headers */
-[TO BE DEVELOPED: Responsive video embeds, bandwidth considerations, poster images]
+ tr {
+ margin-bottom: 1rem;
+ border: 1px solid var(--border);
+ padding: 1rem;
+ }
-## Performance on Mobile
+ td::before {
+ content: attr(data-label); /* Add labels via data attribute */
+ font-weight: 600;
+ display: block;
+ }
+}
+```
-### Mobile Performance Budget
+### Progressive Disclosure
-[TO BE DEVELOPED: Constrained CPU/memory, slow connections, battery concerns]
+Not everything needs to show on mobile:
-### Loading Strategies
+```css
+/* Show summary on mobile */
+.details-content { display: none; }
-[TO BE DEVELOPED: Critical path optimization, lazy loading, code splitting for mobile]
+@media (min-width: 768px) {
+ /* Expand on desktop */
+ .details-content { display: block; }
+}
+```
-## Testing Strategies
+Combine with `<details>/<summary>` for interactive expansion on mobile.
-### Device Testing
+## Testing: Don't Trust DevTools Alone
-[TO BE DEVELOPED: Real device testing, browser DevTools, emulators, viewport testing]
+DevTools device emulation is useful for layout but misses:
-### Testing Checklist
+- Actual touch interactions
+- Real CPU/memory constraints
+- Network latency patterns
+- Font rendering differences
+- Browser chrome/keyboard appearances
-[TO BE DEVELOPED: Different viewports, orientations, input methods, connection speeds]
+**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
---
diff --git a/dist/cursor/.cursor/rules/frontend-design.md b/dist/cursor/.cursor/rules/frontend-design.md
index e07e95864..2c3a61e72 100644
--- a/dist/cursor/.cursor/rules/frontend-design.md
+++ b/dist/cursor/.cursor/rules/frontend-design.md
@@ -51,7 +51,7 @@ Focus on intentional, distinctive design choices:
**Space**: Use a spacing scale (4, 8, 12, 16, 24, 32, 48, 64, 96). Create visual rhythm through varied spacing. Let content breathe. Break the grid intentionally.
-**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity. Stagger reveals for orchestrated page loads.
+**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity with smooth ease-out curves (quart, quint, expo). Stagger reveals for orchestrated page loads.
**Interaction**: Design clear focus indicators. Make touch targets 44×44px minimum. Provide immediate feedback. Write specific, helpful error messages.
@@ -61,11 +61,13 @@ Focus on intentional, distinctive design choices:
These patterns create generic "AI slop" aesthetics:
-**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, wrapping everything in rounded cards, decorative shadows without purpose.
+**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, pure grays without color tint, wrapping everything in rounded cards, decorative shadows without purpose.
-**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards.
+**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards, redundant copy (headers restating intros, repeated explanations).
-**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors.
+**Motion Mistakes**: Bounce and elastic easing (dated and tacky), animating layout properties, durations over 500ms for feedback, animation without purpose.
+
+**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors, gray text on colored backgrounds.
**Accessibility Violations**: Color-only meaning, ignoring prefers-reduced-motion, failing WCAG contrast, creating keyboard traps.
@@ -142,163 +144,263 @@ Then write copy that is:
- Human and empathetic
- Consistent in terminology and tone
-## Fundamental Principles
+## The Button Label Problem
-### Clarity Over Cleverness
+**Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
-[TO BE DEVELOPED: Plain language, avoid jargon, specific over vague, "Save changes" not "OK"]
+| Bad | Good | Why |
+|-----|------|-----|
+| OK | Save changes | Says what will happen |
+| Submit | Create account | Outcome-focused |
+| Yes | Delete message | Confirms the action |
+| Cancel | Keep editing | Clarifies what "cancel" means |
+| Click here | Download PDF | Describes the destination |
-### Concise But Complete
+**For destructive actions**, name the destruction:
+- "Delete" not "Remove" (delete is permanent, remove implies recoverable)
+- "Delete 5 items" not "Delete selected" (show the count)
-[TO BE DEVELOPED: Remove unnecessary words, but include essential information, balance brevity with clarity]
+## Error Messages: The Formula
-### Active Voice
+Every error message should answer three questions:
-[TO BE DEVELOPED: "We saved your changes" not "Your changes have been saved", action-oriented language]
+1. **What happened?** (Clearly state the problem)
+2. **Why?** (If not obvious)
+3. **How to fix it?** (Specific action)
-### User-Focused Language
+```
+Bad: "Invalid input"
-[TO BE DEVELOPED: "Your" not "The", focus on user benefits, user's mental model]
+Good: "Email address isn't valid. Please include an @ symbol."
-### Consistency
+Bad: "Request failed"
-[TO BE DEVELOPED: Use same terms throughout, don't vary for variety, build terminology glossary]
+Good: "We couldn't save your changes. Check your internet connection and try again."
+```
-## Voice & Tone
+### Error Message Templates
-### Establishing Brand Voice
+| Situation | Template |
+|-----------|----------|
+| **Format error** | "[Field] needs to be [format]. Example: [example]" |
+| **Missing required** | "Please enter [what's missing]" |
+| **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
+| **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
+| **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
-[TO BE DEVELOPED: Personality dimensions, voice guidelines, voice vs tone distinction]
+### Don't Blame the User
-### Adapting Tone to Context
+```
+Bad: "You entered an invalid date"
+Good: "Please enter a date in MM/DD/YYYY format"
-[TO BE DEVELOPED: Success = celebratory, Error = empathetic, Loading = reassuring, matching emotional moment]
+Bad: "Your password is too weak"
+Good: "Add at least one number or symbol to strengthen your password"
+```
-### Voice Across Cultures
+## Empty States Are Opportunities
-[TO BE DEVELOPED: Cultural sensitivity, humor translation, formality levels, global considerations]
+An empty list isn't a dead end—it's an onboarding moment.
-## Microcopy Excellence
+```
+Bad: "No items"
-### Button & CTA Copy
+Good: "No projects yet
+ Projects help you organize your work. Create your first one to get started.
+ [+ Create project]"
+```
-[TO BE DEVELOPED: Specific actions ("Create account" not "Submit"), verb + noun structure, outcome-oriented]
+**Empty state formula**:
+1. Acknowledge the emptiness (briefly)
+2. Explain the value of filling it
+3. Provide a clear action
-### Labels & Instructions
+## Voice vs Tone
-[TO BE DEVELOPED: Clear, specific labels, instructions before fields, showing format with examples]
+**Voice** is your brand's personality—consistent everywhere.
+**Tone** adapts to the moment.
-### Placeholder Text
+| Moment | Tone Shift |
+|--------|------------|
+| Success | Celebratory, brief: "Done! Your changes are live." |
+| Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
+| Loading | Reassuring: "Saving your work..." |
+| Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
-[TO BE DEVELOPED: When to use (rarely), never as labels, examples not instructions]
+**Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
-### Tooltips & Help Text
+## Writing for Accessibility
-[TO BE DEVELOPED: Adding value beyond label, answering implicit questions, brevity with links to details]
+### Link Text
-## Error Messages & Validation
+Screen readers can navigate by links. Vague links fail:
-### Error Message Principles
+```html
+<!-- Bad: meaningless without context -->
+<a href="...">Click here</a>
+<a href="...">Learn more</a>
-[TO BE DEVELOPED: Explain what happened, suggest fix, don't blame user, provide examples, link to help]
+<!-- Good: standalone meaning -->
+<a href="...">View pricing plans</a>
+<a href="...">Learn more about data export</a>
+```
-### Validation Feedback
+### Alt Text
-[TO BE DEVELOPED: Inline validation, timing (on blur vs on submit), success states, clear requirements]
+Describe the **information**, not the image:
-### Error Message Patterns
+```html
+<!-- Bad: describes image -->
+<img alt="Chart" src="revenue.png">
-[TO BE DEVELOPED: Format errors, permission errors, network errors, system errors, 404s]
+<!-- Good: describes information -->
+<img alt="Revenue increased 40% in Q4" src="revenue.png">
-## Forms & Inputs
+<!-- Decorative images get empty alt -->
+<img alt="" src="decorative-wave.png">
+```
-### Form Labels
+### Button Context
-[TO BE DEVELOPED: Descriptive labels, required field indication, why you're asking (when not obvious)]
+Buttons need context, especially icons:
-### Help Text
+```html
+<!-- Bad: no context -->
+<button>×</button>
-[TO BE DEVELOPED: Format guidance, why you need this information, examples, constraints]
+<!-- Good: screen reader context -->
+<button aria-label="Close dialog">×</button>
+```
-### Confirmation Dialogs
+## Writing for Translation
-[TO BE DEVELOPED: Specific about action, explain consequences, clear button labels, don't overuse]
+### Plan for Expansion
-## System Messages
+German text is ~30% longer than English. Allocate space:
-### Success Messages
+| Language | Expansion |
+|----------|-----------|
+| German | +30% |
+| French | +20% |
+| Finnish | +30-40% |
+| Chinese | -30% (fewer chars, but same width) |
-[TO BE DEVELOPED: Confirm what happened, what happens next, celebrate appropriately, be brief]
+### Translation-Friendly Patterns
-### Loading States
+```
+Bad: "You have 3 new messages" (number inside sentence)
+Good: "New messages: 3" (number separate)
-[TO BE DEVELOPED: What's happening, time expectations, progress indication, personality in waiting]
+Bad: "Welcome back, {name}!" (word order varies by language)
+Good: "{greeting_message}" (full sentence as one string)
-### Empty States
+Bad: "5 mins ago" (abbrev doesn't translate)
+Good: "5 minutes ago" (full word)
+```
-[TO BE DEVELOPED: Explain why empty, value of filling it, clear CTA, welcoming not dead-end]
+### Give Translators Context
-## Navigation & Wayfinding
+```json
+{
+ "delete_confirm": {
+ "message": "Delete {item}?",
+ "context": "Confirmation dialog when deleting a file or folder. {item} is the name of the item being deleted."
+ }
+}
+```
-### Navigation Labels
+## Consistency: The Terminology Problem
-[TO BE DEVELOPED: Specific and descriptive, user language not internal terms, clear information scent]
+Pick one term and stick with it:
-### Breadcrumbs & Headers
+| Inconsistent | Consistent |
+|--------------|------------|
+| Delete / Remove / Trash | Delete |
+| Settings / Preferences / Options | Settings |
+| Sign in / Log in / Enter | Sign in |
+| Create / Add / New | Create |
-[TO BE DEVELOPED: Clear location indication, hierarchical clarity, shortened for mobile]
+Build a terminology glossary and enforce it. Variety creates confusion.
-### Search & Filters
+## Avoid Redundant Copy
-[TO BE DEVELOPED: Clear search placeholders, filter labels, no results messaging]
+Saying the same thing twice wastes space and dilutes impact.
-## Content Hierarchy & Structure
+**Common redundancies**:
+- Section header + intro paragraph saying the same thing
+- Page title + section title with same/similar text
+- CTA button + surrounding text repeating the action
+- Outro that restates the intro
-### Scannable Writing
+```
+Bad: "Settings"
+ "Here you can adjust your settings and preferences."
+ [Settings form]
+ "Save your settings to apply changes."
-[TO BE DEVELOPED: Short paragraphs, bullet points, clear headings, front-load important info]
+Good: "Settings"
+ [Settings form]
+ [Save]
+```
-### Progressive Disclosure
+**The rule**: If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
-[TO BE DEVELOPED: Essential info first, details on demand, expandable sections, learn more links]
+## Loading States
-## Writing for Accessibility
+Tell users what's happening:
-### Screen Reader Considerations
+```
+Bad: "Loading..."
+Good: "Saving your draft..."
-[TO BE DEVELOPED: ARIA labels, alt text writing, link text clarity, button labels]
+Bad: [spinner]
+Good: "Searching 1,247 documents..."
-### Plain Language
+Bad: "Please wait"
+Good: "Preparing your download... This usually takes 30 seconds."
+```
-[TO BE DEVELOPED: Reading level considerations, avoid jargon, explain technical terms]
+For long waits, show progress or set expectations.
-### Text Alternatives
+## Confirmation Dialogs: Use Sparingly
-[TO BE DEVELOPED: Transcripts for audio/video, alt text for images, descriptions for complex UI]
+**Most confirmation dialogs are design failures.** If an action is dangerous enough to confirm, consider:
+- Undo instead of confirm
+- Making the action less destructive
+- Showing consequences before the action
-## Internationalization (i18n)
+When you must confirm:
-### Writing for Translation
+```
+Bad: "Are you sure?"
+ [Yes] [No]
-[TO BE DEVELOPED: Avoid idioms, complete sentences, context for translators, text expansion space]
+Good: "Delete 'Project Alpha'?
+ This will permanently delete the project and all its files.
+ [Delete project] [Keep project]"
+```
-### Cultural Adaptation
+Name the action, explain consequences, use specific button labels.
-[TO BE DEVELOPED: Cultural sensitivity, date/time formats, address formats, name formats]
+## Form Instructions
-## Content Patterns by Type
+### Format Hints
-### Onboarding Copy
+Show don't tell:
-[TO BE DEVELOPED: Welcome messages, getting started, first-time guidance, value proposition]
+```
+Bad: "Enter date in MMDDYYYY format"
+Good: "Date of birth" + placeholder="04/15/1990"
+```
-### Settings & Preferences
+### Why Are You Asking?
-[TO BE DEVELOPED: Clear option descriptions, impact explanation, defaults indication]
+For non-obvious fields, explain:
-### Notifications
-
-[TO BE DEVELOPED: Scannable, actionable, appropriate urgency, notification fatigue prevention]
+```html
+<label>Phone number (optional)</label>
+<span class="help">We'll only use this to contact you about your order.</span>
+```
---
@@ -346,93 +448,266 @@ Then build layout systems that are:
- Responsive and adaptive across viewports
- Compositionally strong with clear focal points
-## Classic Composition Principles
-
-### Visual Hierarchy Fundamentals
-
-[TO BE DEVELOPED: Size, weight, color, position, contrast as hierarchy tools, Gestalt principles (proximity, similarity, closure)]
-
-### Balance & Symmetry
-
-[TO BE DEVELOPED: Symmetrical vs asymmetrical balance, visual weight calculation, creating tension and resolution]
-
-### The Rule of Thirds & Golden Ratio
-
-[TO BE DEVELOPED: Classic composition grids, golden ratio applications, when to follow vs break rules]
-
-### Focal Points & Eye Movement
-
-[TO BE DEVELOPED: Creating focal points, directing eye flow, Z/F/circular patterns, intentional disruption]
-
## Spacing Systems
-### Spacing Scales
+### Use 4pt Base, Not 8pt
+
+8pt systems are too coarse. **4pt gives you the granularity you actually need:**
+
+```css
+:root {
+ --space-1: 4px; /* 0.25rem - tight */
+ --space-2: 8px; /* 0.5rem */
+ --space-3: 12px; /* 0.75rem */
+ --space-4: 16px; /* 1rem - base */
+ --space-6: 24px; /* 1.5rem */
+ --space-8: 32px; /* 2rem */
+ --space-12: 48px; /* 3rem */
+ --space-16: 64px; /* 4rem */
+ --space-24: 96px; /* 6rem - section gaps */
+}
+```
+
+**The insight**: You'll frequently need 12px (between 8 and 16). An 8pt-only system forces awkward choices.
+
+### Name Tokens by Relationship, Not Value
+
+```css
+/* Bad: tied to pixels */
+--spacing-8: 8px;
+--spacing-16: 16px;
+
+/* Better: semantic */
+--space-xs: 4px; /* Tight inline gaps */
+--space-sm: 8px; /* Between related elements */
+--space-md: 16px; /* Component padding */
+--space-lg: 24px; /* Between components */
+--space-xl: 48px; /* Section padding */
+--space-2xl: 96px; /* Section margins */
+```
+
+### Gap Over Margin
+
+**Stop using margins for spacing between siblings.** Use `gap`:
+
+```css
+/* Old way: margins create double-spacing bugs */
+.card { margin-bottom: 16px; }
+.card:last-child { margin-bottom: 0; } /* Cleanup hack */
+
+/* Modern way: gap just works */
+.card-list {
+ display: flex;
+ flex-direction: column;
+ gap: 16px; /* Automatic, no cleanup needed */
+}
+```
+
+Gap works in Flexbox and Grid. It's cleaner, more intentional, and eliminates margin collapse headaches.
+
+## Grid Systems
+
+### The Self-Adjusting Grid
+
+This pattern creates responsive grids without breakpoints:
+
+```css
+.grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ gap: var(--space-lg);
+}
+```
+
+**How it works**: Columns are at least 280px. As many as fit per row. Leftovers stretch. No media queries needed.
+
+**Variation for exact counts:**
+```css
+/* Always 3 columns on desktop, stack on mobile */
+.grid-3 {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
+ gap: var(--space-lg);
+}
+```
+
+### Grid Area Naming
+
+For complex layouts, named areas are clearer than line numbers:
+
+```css
+.page {
+ display: grid;
+ grid-template-areas:
+ "header header"
+ "sidebar main"
+ "footer footer";
+ grid-template-columns: 280px 1fr;
+ grid-template-rows: auto 1fr auto;
+}
+
+.header { grid-area: header; }
+.sidebar { grid-area: sidebar; }
+.main { grid-area: main; }
+.footer { grid-area: footer; }
+```
+
+At mobile breakpoints, redefine the areas:
+```css
+@media (max-width: 768px) {
+ .page {
+ grid-template-areas:
+ "header"
+ "main"
+ "sidebar"
+ "footer";
+ grid-template-columns: 1fr;
+ }
+}
+```
-[TO BE DEVELOPED: 4pt/8pt systems, modular scales, mathematical progressions (linear, exponential, Fibonacci)]
+## Visual Hierarchy
-### Vertical Rhythm
-
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, spacing ratios, rhythm across components]
-
-### Micro vs Macro Space
-
-[TO BE DEVELOPED: Component-internal spacing, between-component spacing, section spacing, page-level breathing room]
-
-### Spacing Token Architecture
-
-[TO BE DEVELOPED: Primitive spacing tokens, semantic spacing (component gaps, section padding), contextual spacing]
-
-## Grid Systems & Layout Patterns
+### The Squint Test
-### Grid Fundamentals
+Blur your eyes (or screenshot and blur). Can you still identify:
+- The most important element?
+- The second most important?
+- Clear groupings?
+
+If everything looks the same weight blurred, you have a hierarchy problem.
+
+### Hierarchy Through Multiple Dimensions
+
+Don't rely on size alone. Combine:
-[TO BE DEVELOPED: Column grids, modular grids, baseline grids, grid anatomy (columns, gutters, margins)]
+| Tool | Strong Hierarchy | Weak Hierarchy |
+|------|------------------|----------------|
+| **Size** | 3:1 ratio or more | <2:1 ratio |
+| **Weight** | Bold vs Regular | Medium vs Regular |
+| **Color** | High contrast | Similar tones |
+| **Position** | Top/left (primary) | Bottom/right |
+| **Space** | Surrounded by white space | Crowded |
+
+**The best hierarchy uses 2-3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
+
+### Cards Are Not Required
+
+Cards (bordered/shadowed containers) are overused. You don't need a card to create visual grouping—spacing and alignment do this naturally.
+
+**Use cards when**:
+- Content is truly distinct and actionable (a product, a post, a task)
+- Items need to be visually comparable in a grid
+- Content needs clear boundaries for interaction (hover, click)
-### Classic Layout Patterns
+**Don't use cards for**:
+- General layout structure (use spacing instead)
+- Single items (a lone card looks arbitrary)
+- Nesting—**never put cards inside cards**. If you need hierarchy within a card, use spacing, typography, and subtle dividers instead
+
+```css
+/* Bad: card in a card */
+.outer-card > .inner-card { /* Noisy and confusing */ }
+
+/* Good: hierarchy without nesting */
+.card > .card-section { border-top: 1px solid var(--border); }
+```
+
+## Container Queries
+
+Viewport queries are for page layouts. **Container queries are for components**:
+
+```css
+.card-container {
+ container-type: inline-size;
+}
+
+.card {
+ display: grid;
+ gap: var(--space-md);
+}
-[TO BE DEVELOPED: Sidebar layouts, holy grail, card grids, masonry, magazine layouts, asymmetric layouts]
+/* Card layout changes based on its container, not viewport */
+@container (min-width: 400px) {
+ .card {
+ grid-template-columns: 120px 1fr;
+ }
+}
+```
-### Modern CSS Layout
+**Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands—automatically, without viewport hacks.
+
+## Optical Adjustments
-[TO BE DEVELOPED: CSS Grid (explicit placement, auto-placement, grid areas), Flexbox (direction, alignment, distribution), Container Queries]
+### Text Doesn't Align
-## Creating Visual Hierarchy
+A paragraph set to `margin-left: 0` looks indented because letterforms have internal whitespace. Fix with negative margin or padding:
-### Hierarchy Through Scale
+```css
+.heading {
+ margin-left: -0.05em; /* Pull left to optically align */
+}
+```
-[TO BE DEVELOPED: Size relationships, proportional scaling, meaningful jumps vs gradual progression]
+### Icons Need Optical Centering
-### Hierarchy Through Weight & Color
+A geometrically centered icon often looks off-center. Play icons need to shift right, left-arrows need to shift left:
-[TO BE DEVELOPED: Visual weight calculation, using color for emphasis, combining multiple hierarchy tools]
+```css
+.play-button svg {
+ transform: translateX(2px); /* Optical center */
+}
+```
-### Hierarchy Through Position
+### Touch Targets vs Visual Size
-[TO BE DEVELOPED: Placement importance, reading order, visual flow direction, breaking the grid for emphasis]
+Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
-## Responsive Spatial Design
+```css
+.icon-button {
+ width: 24px; /* Visual size */
+ height: 24px;
+ position: relative;
+}
-### Breakpoint Strategy
+.icon-button::before {
+ content: '';
+ position: absolute;
+ inset: -10px; /* Expand tap target to 44px */
+}
+```
-[TO BE DEVELOPED: Mobile-first vs desktop-first, breakpoint values, in-between states, content-driven breakpoints]
+## Depth & Elevation
-### Layout Adaptation
+### Semantic Z-Index
-[TO BE DEVELOPED: Reflow patterns, navigation transformation, content prioritization, progressive disclosure]
+Don't use arbitrary numbers. Create a scale:
-### Fluid Spacing & Layout
+```css
+:root {
+ --z-dropdown: 100;
+ --z-sticky: 200;
+ --z-modal-backdrop: 300;
+ --z-modal: 400;
+ --z-toast: 500;
+ --z-tooltip: 600;
+}
+```
-[TO BE DEVELOPED: clamp() for spacing, viewport units, fluid grids, container-relative spacing]
+### Shadow Scale for Elevation
-## Depth & Layering
+Shadows indicate elevation. Create a consistent scale:
-### Creating Depth
+```css
+:root {
+ --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); /* Subtle lift */
+ --shadow-md: 0 4px 6px rgba(0,0,0,0.07); /* Cards */
+ --shadow-lg: 0 10px 15px rgba(0,0,0,0.1); /* Dropdowns */
+ --shadow-xl: 0 20px 25px rgba(0,0,0,0.15); /* Modals */
+}
+```
-[TO BE DEVELOPED: Layering, shadows, elevation systems, z-index scales, parallax effects]
-
-### Overlap & Intersection
-
-[TO BE DEVELOPED: Intentional overlap, breaking containers, elements that cross boundaries]
+**Key insight**: Shadows should be subtle. If you can clearly see the shadow, it's probably too strong.
---
@@ -476,75 +751,193 @@ Then implement motion that is:
- Accessible with reduced motion alternatives
- Choreographed with thoughtful timing and sequencing
-## Classic Animation Principles
-
-### Disney's 12 Principles (Web Context)
-
-[TO BE DEVELOPED: Squash and stretch, anticipation, staging, follow-through, ease-in/ease-out, arcs, secondary action, timing, exaggeration, solid drawing, appeal - adapted for UI]
-
-### Timing & Duration
-
-[TO BE DEVELOPED: Micro-interactions (100-300ms), transitions (300-500ms), complex animations (500-1000ms), duration by distance, perceived speed]
-
-### Easing & Curves
+## Duration: The 100/300/500 Rule
-[TO BE DEVELOPED: Linear vs eased, ease-out (enter), ease-in (exit), ease-in-out (full cycle), custom cubic-bezier, spring physics]
+Timing matters more than easing. These durations feel right for most UI:
-## Types of UI Animation
+| Duration | Use Case | Examples |
+|----------|----------|----------|
+| **100-150ms** | Instant feedback | Button press, toggle, color change |
+| **200-300ms** | State changes | Menu open, tooltip, hover states |
+| **300-500ms** | Layout changes | Accordion, modal, drawer |
+| **500-800ms** | Entrance animations | Page load, hero reveals |
-### Micro-interactions
+**Exit animations are faster than entrances.** Users want to see what's leaving—quickly. Use ~75% of the enter duration:
+```css
+.modal {
+ --enter: 400ms;
+ --exit: 300ms;
+}
+```
+
+## Easing: Pick the Right Curve
+
+**Don't use `ease`.** It's a compromise that's rarely optimal. Instead:
+
+| Curve | Use For | CSS |
+|-------|---------|-----|
+| **ease-out** | Elements entering | `cubic-bezier(0.16, 1, 0.3, 1)` |
+| **ease-in** | Elements leaving | `cubic-bezier(0.7, 0, 0.84, 0)` |
+| **ease-in-out** | State toggles (there → back) | `cubic-bezier(0.65, 0, 0.35, 1)` |
+
+**For micro-interactions, use exponential curves**—they feel natural because they mimic real physics (friction, deceleration):
+
+```css
+/* Quart out - smooth, refined (recommended default) */
+--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
+
+/* Quint out - slightly more dramatic */
+--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
-[TO BE DEVELOPED: Button feedback, hover states, toggle switches, like buttons, form validation feedback, loading indicators]
+/* Expo out - snappy, confident */
+--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
+```
-### Page Transitions
+**Avoid bounce and elastic curves.** They were trendy in 2015 but now feel tacky and amateurish. Real objects don't bounce when they stop—they decelerate smoothly. Overshoot effects draw attention to the animation itself rather than the content.
-[TO BE DEVELOPED: Route transitions, modal entry/exit, drawer animations, cross-fade, slide, zoom patterns]
+## The Only Two Properties You Should Animate
-### State Transitions
+**transform** and **opacity**. That's it. Everything else causes layout recalculation or repaints:
-[TO BE DEVELOPED: Loading → success → error flows, expand/collapse, show/hide, enable/disable state changes]
+```css
+/* Good: GPU-accelerated, smooth */
+.slide-in {
+ transform: translateX(0);
+ opacity: 1;
+ transition: transform 300ms ease-out, opacity 300ms ease-out;
+}
+.slide-in.hidden {
+ transform: translateX(20px);
+ opacity: 0;
+}
+
+/* Bad: triggers layout, janky */
+.slide-in {
+ left: 0; /* Layout thrashing */
+ height: 100%; /* Expensive */
+}
+```
-### Scrolling & Parallax
+**Exceptions**: Sometimes you must animate `height` for accordions. Use `max-height` with a value larger than content, or better yet, use CSS Grid's `grid-template-rows: 0fr → 1fr` trick.
-[TO BE DEVELOPED: Scroll-triggered animations, reveal on scroll, parallax layers, scroll-linked effects, intersection observer]
+## Staggered Animations
-## Choreography & Sequencing
+Staggering creates rhythm and direction. The formula:
-### Staggered Animations
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+}
-[TO BE DEVELOPED: animation-delay patterns, sequential reveals, cascade effects, list item staggering]
+/* Stagger each item by 50ms */
+.list-item:nth-child(1) { animation-delay: 0ms; }
+.list-item:nth-child(2) { animation-delay: 50ms; }
+.list-item:nth-child(3) { animation-delay: 100ms; }
+/* ... */
+```
+
+**Better approach with CSS custom property:**
+
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+ animation-delay: calc(var(--i, 0) * 50ms);
+}
+```
+```html
+<li class="list-item" style="--i: 0">First</li>
+<li class="list-item" style="--i: 1">Second</li>
+<li class="list-item" style="--i: 2">Third</li>
+```
+
+**Key insight**: Cap the total stagger time. 10 items at 50ms = 500ms before the last item appears. If you have 50 items, reduce to 20ms per item or cap at ~10 staggered items.
+
+## Reduced Motion
+
+This is not optional. Vestibular disorders affect ~35% of adults over 40.
+
+```css
+/* Define animations normally */
+.card {
+ animation: slide-up 500ms ease-out;
+}
+
+/* Provide alternative for reduced motion */
+@media (prefers-reduced-motion: reduce) {
+ .card {
+ animation: fade-in 200ms ease-out; /* Crossfade instead of motion */
+ }
+}
-### Orchestrated Page Loads
+/* Or disable entirely */
+@media (prefers-reduced-motion: reduce) {
+ *, *::before, *::after {
+ animation-duration: 0.01ms !important;
+ transition-duration: 0.01ms !important;
+ }
+}
+```
+
+**What to preserve**: Functional animations like progress bars, loading spinners (slowed down), and focus indicators should still work—just without spatial movement.
+
+## Performance: Avoid These Mistakes
+
+### Don't Use will-change Preemptively
+
+```css
+/* Bad: wastes GPU memory */
+.card { will-change: transform; }
+
+/* Good: only when animation is imminent */
+.card:hover { will-change: transform; }
+.card.animating { will-change: transform; }
+```
+
+`will-change` forces the browser to create a compositing layer. Used everywhere = memory bloat.
+
+### Don't Animate During Scroll
+
+Scroll-linked animations (parallax, reveal) are expensive. If you must:
+
+```javascript
+// Use Intersection Observer, not scroll events
+const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('visible');
+ observer.unobserve(entry.target); // Animate once, then stop observing
+ }
+ });
+}, { threshold: 0.2 });
+```
+
+### Don't Fight the Main Thread
+
+Heavy JavaScript animations block rendering. For complex choreography, use the Web Animations API or a library like Motion One that schedules efficiently.
+
+## Motion Tokens
-[TO BE DEVELOPED: Entry choreography, hero → content → details, creating narrative through sequence, attention management]
-
-### Exit Choreography
-
-[TO BE DEVELOPED: Reverse sequences, intentional exit timing, maintaining spatial relationships during exit]
-
-## Technical Implementation
-
-### CSS-Only Animation
-
-[TO BE DEVELOPED: @keyframes, animation properties, transitions, transform, pseudo-element animations, hardware acceleration]
-
-### JavaScript Animation
-
-[TO BE DEVELOPED: Web Animations API, requestAnimationFrame, animation libraries (GSAP, Framer Motion, Motion One)]
-
-### Performance Optimization
-
-[TO BE DEVELOPED: GPU acceleration (transform, opacity only), will-change, avoiding layout thrashing, reducing paint, FPS monitoring]
-
-## Motion Design Systems
-
-### Motion Tokens
-
-[TO BE DEVELOPED: Duration scales, easing tokens, named animations, consistent motion vocabulary]
-
-### Reduced Motion
-
-[TO BE DEVELOPED: prefers-reduced-motion, graceful degradation, essential vs decorative animation, crossfade alternatives]
+Create a system for consistency:
+
+```css
+:root {
+ /* Durations */
+ --duration-instant: 100ms;
+ --duration-fast: 200ms;
+ --duration-normal: 300ms;
+ --duration-slow: 500ms;
+
+ /* Easings */
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
+ --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
+ --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
+
+ /* Common patterns */
+ --transition-fade: opacity var(--duration-fast) var(--ease-out);
+ --transition-slide: transform var(--duration-normal) var(--ease-out);
+ --transition-all: var(--duration-normal) var(--ease-out);
+}
+```
---
@@ -591,59 +984,207 @@ Then build or refine a typography system that is:
## Classic Typography Principles
-### Vertical Rhythm & Baseline Grids
+### Vertical Rhythm
+
+The non-obvious insight: your line-height should be the base unit for ALL vertical spacing in your design. If body text has `line-height: 1.5` on `16px` type (= 24px), then spacing values should be multiples of 24px: 24, 48, 72, etc.
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, maintaining rhythm across components]
+This creates subconscious harmony. Text and space feel "right" together because they share a mathematical foundation.
+
+```css
+:root {
+ --baseline: 1.5rem; /* 24px if root is 16px */
+ --space-1: var(--baseline); /* 24px */
+ --space-2: calc(var(--baseline) * 2); /* 48px */
+ --space-half: calc(var(--baseline) / 2); /* 12px */
+}
+```
### Modular Scale & Hierarchy
-[TO BE DEVELOPED: Scale ratios, establishing hierarchy through size/weight/spacing, visual balance]
+The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
+
+**Use fewer sizes with more contrast.** A 5-size system covers most needs:
+
+| Role | Typical Ratio | Use Case |
+|------|---------------|----------|
+| xs | 0.75rem | Captions, legal |
+| sm | 0.875rem | Secondary UI, metadata |
+| base | 1rem | Body text |
+| lg | 1.25-1.5rem | Subheadings, lead text |
+| xl+ | 2-4rem | Headlines, hero text |
+
+Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
### Readability & Measure
-[TO BE DEVELOPED: Line length (45-75 CPL), line height ratios, paragraph spacing, optimal reading conditions]
+Line length (measure) guidelines are well-known (45-75 characters), but the implementation detail matters:
+
+```css
+/* Use ch units for true character-based measure */
+.prose { max-width: 65ch; }
+
+/* Line-height scales inversely with line length */
+.narrow-column { max-width: 45ch; line-height: 1.4; }
+.wide-column { max-width: 75ch; line-height: 1.6; }
+```
+
+**Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05-0.1 to your normal line-height.
## Font Selection & Pairing
### Choosing Distinctive Fonts
-[TO BE DEVELOPED: Avoiding generic choices, character in typefaces, matching tone to content, Google Fonts alternatives]
+**Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal—but if you want distinctive design, look elsewhere.
+
+**Better Google Fonts alternatives**:
+- Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
+- Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
+- Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
+- For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
+
+**System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider this for apps where performance > personality.
### Pairing Principles
-[TO BE DEVELOPED: Contrast-based pairing, display + body, serif + sans, mono + geometric, variable fonts]
+**The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces. Only add a second font when you need genuine contrast (e.g., display headlines + body serif).
+
+When pairing, contrast on multiple axes:
+- Serif + Sans (structure contrast)
+- Geometric + Humanist (personality contrast)
+- Condensed display + Wide body (proportion contrast)
+
+**Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
### Web Font Loading
-[TO BE DEVELOPED: FOUT/FOIT strategies, font-display, subsetting, variable fonts, preloading]
+The layout shift problem: fonts load late, text reflows, and users see content jump. Here's the fix:
+
+```css
+/* 1. Use font-display: swap for visibility */
+@font-face {
+ font-family: 'CustomFont';
+ src: url('font.woff2') format('woff2');
+ font-display: swap;
+}
+
+/* 2. Match fallback metrics to minimize shift */
+@font-face {
+ font-family: 'CustomFont-Fallback';
+ src: local('Arial');
+ size-adjust: 105%; /* Scale to match x-height */
+ ascent-override: 90%; /* Match ascender height */
+ descent-override: 20%; /* Match descender depth */
+ line-gap-override: 10%; /* Match line spacing */
+}
+
+body {
+ font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
+}
+```
+
+Tools like [Fontaine](https://github.com/unjs/fontaine) calculate these overrides automatically.
## Modern Web Typography
-### Fluid & Responsive Type
+### Fluid Type
-[TO BE DEVELOPED: clamp(), viewport units, container query typography, breakpoint-based scales]
+Fluid typography eliminates breakpoint jumps. The formula:
-### Advanced Features
+```css
+/* font-size: clamp(min, preferred, max) */
+h1 { font-size: clamp(2rem, 5vw + 1rem, 4rem); }
+```
-[TO BE DEVELOPED: OpenType features, ligatures, font-feature-settings, kerning, number styles]
+The `5vw + 1rem` creates smooth scaling. Adjust the vw coefficient for faster/slower scaling.
-### Performance Optimization
+**When NOT to use fluid type**:
+- Button text, labels, UI elements (should be consistent, not fluid)
+- Very short text (scaling makes less sense)
+- When you need precise control at specific breakpoints
-[TO BE DEVELOPED: Font loading strategies, subsetting, variable fonts vs static, hosting decisions]
+### OpenType Features
-## Typography System Architecture
+Most developers don't know these exist. Use them for polish:
-### Token Structure
+```css
+/* Tabular numbers for data alignment */
+.data-table { font-variant-numeric: tabular-nums; }
+
+/* Proper fractions */
+.recipe-amount { font-variant-numeric: diagonal-fractions; }
+
+/* Small caps for abbreviations */
+abbr { font-variant-caps: all-small-caps; }
+
+/* Disable ligatures in code */
+code { font-variant-ligatures: none; }
+
+/* Enable kerning (usually on by default, but be explicit) */
+body { font-kerning: normal; }
+```
+
+Check what features your font supports at [Wakamai Fondue](https://wakamaifondue.com/).
-[TO BE DEVELOPED: Font stacks, size scales, weight scales, line heights, letter spacing]
+## Typography System Architecture
-### Implementation
+### Token Structure
-[TO BE DEVELOPED: CSS custom properties, utility classes, semantic vs primitive tokens]
+**Name tokens semantically, not by value**:
+
+```css
+/* Bad: tied to implementation */
+--font-size-16: 1rem;
+--font-size-24: 1.5rem;
+
+/* Good: tied to purpose */
+--font-size-body: 1rem;
+--font-size-heading: 1.5rem;
+```
+
+A complete token set:
+
+```css
+:root {
+ /* Font stacks */
+ --font-sans: 'CustomSans', system-ui, sans-serif;
+ --font-serif: 'CustomSerif', Georgia, serif;
+ --font-mono: 'JetBrains Mono', ui-monospace, monospace;
+
+ /* Size scale (semantic) */
+ --text-xs: 0.75rem;
+ --text-sm: 0.875rem;
+ --text-base: 1rem;
+ --text-lg: 1.25rem;
+ --text-xl: 1.5rem;
+ --text-2xl: 2rem;
+ --text-3xl: 3rem;
+
+ /* Weight */
+ --font-normal: 400;
+ --font-medium: 500;
+ --font-semibold: 600;
+ --font-bold: 700;
+
+ /* Line height */
+ --leading-tight: 1.25;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.75;
+
+ /* Letter spacing */
+ --tracking-tight: -0.02em;
+ --tracking-normal: 0;
+ --tracking-wide: 0.05em;
+}
+```
## Accessibility Considerations
-[TO BE DEVELOPED: Text scaling, contrast ratios, font sizes, dyslexia-friendly choices]
+Beyond contrast ratios (which are well-documented), consider:
+
+- **Never disable zoom**: `user-scalable=no` breaks accessibility. If your layout breaks at 200% zoom, fix the layout.
+- **Use rem/em for font sizes**: This respects user browser settings. Never `px` for body text.
+- **Minimum 16px body text**: Smaller than this strains eyes and fails WCAG on mobile.
+- **Adequate touch targets**: Text links need padding or line-height that creates 44px+ tap targets.
---
@@ -687,115 +1228,240 @@ Then implement interactions that are:
- Forgiving with error prevention and recovery
- Responsive with immediate feedback and state changes
-## Interaction States
+## The Eight Interactive States
+
+Every interactive element needs these states designed:
-### Core States
+| State | When | Visual Treatment |
+|-------|------|------------------|
+| **Default** | At rest | Base styling |
+| **Hover** | Pointer over (not touch) | Subtle lift, color shift |
+| **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
+| **Active** | Being pressed | Pressed in, darker |
+| **Disabled** | Not interactive | Reduced opacity, no pointer |
+| **Loading** | Processing | Spinner, skeleton |
+| **Error** | Invalid state | Red border, icon, message |
+| **Success** | Completed | Green check, confirmation |
-[TO BE DEVELOPED: Default, hover, focus, active, disabled, loading, error, success - visual treatment for each]
+**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states.
-### State Transitions
+## Focus Rings: Do Them Right
-[TO BE DEVELOPED: Smooth state changes, animation between states, maintaining context, preserving user intent]
+**Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users:
-### Loading & Progress States
+```css
+/* Hide focus ring for mouse/touch */
+button:focus {
+ outline: none;
+}
-[TO BE DEVELOPED: Skeleton screens, spinners, progress bars, optimistic updates, what to show while waiting]
+/* Show focus ring for keyboard */
+button:focus-visible {
+ outline: 2px solid var(--color-accent);
+ outline-offset: 2px;
+}
+```
-## Affordances & Feedback
+**Focus ring design**:
+- High contrast (3:1 minimum against adjacent colors)
+- 2-3px thick
+- Offset from element (not inside it)
+- Consistent across all interactive elements
-### Visual Affordances
+## Form Design: The Non-Obvious
-[TO BE DEVELOPED: Signaling interactivity, button appearance, link styling, cursor changes, touch target highlighting]
+### Don't Use Placeholders as Labels
-### Immediate Feedback
+Placeholders disappear when you type. Users forget what the field was for. Screen readers may not announce them.
-[TO BE DEVELOPED: Click/tap acknowledgment, hover feedback, focus indication, "something is happening" signals]
+```html
+<!-- Bad -->
+<input placeholder="Email address">
-### Haptic & Sound Feedback
+<!-- Good -->
+<label for="email">Email address</label>
+<input id="email" type="email" placeholder="[email protected]">
+```
-[TO BE DEVELOPED: Vibration patterns, sound cues, cross-modal feedback, when to use non-visual feedback]
+Use placeholders only for examples or format hints, never as the primary label.
-## Form Design & Input Patterns
+### Validate on Blur, Not on Input
-### Form Layout & Structure
+Real-time validation (validating every keystroke) is annoying. Users can't finish typing before seeing errors.
-[TO BE DEVELOPED: Single column vs multi-column, label placement, field grouping, visual hierarchy in forms]
+```javascript
+// Bad: fires on every keystroke
+input.addEventListener('input', validate);
-### Input Field Design
+// Good: fires when user leaves field
+input.addEventListener('blur', validate);
-[TO BE DEVELOPED: Field sizing, placeholder usage (anti-pattern), helper text, character limits, input masking]
+// Exception: password strength (show progress while typing)
+passwordInput.addEventListener('input', showStrength);
+```
-### Validation Patterns
+### Error Message Placement
-[TO BE DEVELOPED: Inline vs on-submit, real-time validation, error message writing, success confirmation, required field indication]
+Place errors **below** the field (users scan top-down), not above. Keep messages close to the field—not in a summary at the top unless also repeated inline.
-### Complex Input Types
+```html
+<label for="email">Email</label>
+<input id="email" type="email" aria-describedby="email-error">
+<span id="email-error" class="error">Please enter a valid email</span>
+```
-[TO BE DEVELOPED: File upload UX, date pickers, time selection, rich text editing, multi-select, autocomplete, search]
+The `aria-describedby` connects the error to the input for screen readers.
-### Progressive Disclosure in Forms
+## Loading States: Optimistic Updates
-[TO BE DEVELOPED: Conditional fields, wizards/multi-step forms, accordions, showing complexity gradually]
+**Show success immediately, handle failure gracefully.** Users perceive the app as faster.
-### Form Error Handling
+```javascript
+// Optimistic update pattern
+async function toggleLike() {
+ // 1. Update UI immediately
+ setLiked(true);
-[TO BE DEVELOPED: Error prevention (constraints, masks), clear error messages, error recovery, field-level vs form-level errors]
+ try {
+ // 2. Send request
+ await api.like(postId);
+ } catch {
+ // 3. Rollback on failure
+ setLiked(false);
+ showToast('Like failed. Please try again.');
+ }
+}
+```
-## Touch & Pointer Interactions
+**When to use**: Low-stakes actions (likes, follows, small edits). **Not for**: Payments, destructive actions, critical data changes.
-### Touch Targets
+### Skeleton Screens > Spinners
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge reach areas on mobile]
+Spinners say "something is happening" but give no sense of what or how long. Skeletons preview the content shape:
-### Touch vs Pointer Patterns
+```css
+.skeleton {
+ background: linear-gradient(
+ 90deg,
+ var(--gray-200) 25%,
+ var(--gray-100) 50%,
+ var(--gray-200) 75%
+ );
+ background-size: 200% 100%;
+ animation: shimmer 1.5s infinite;
+}
-[TO BE DEVELOPED: Hover states on touch (problems), tap feedback, long press, swipe gestures, pinch-to-zoom]
+@keyframes shimmer {
+ 0% { background-position: 200% 0; }
+ 100% { background-position: -200% 0; }
+}
+```
-### Gesture Design
+## Modals: The Inert Approach
-[TO BE DEVELOPED: Swipe to delete, pull to refresh, drag to reorder, custom gestures, gesture discoverability]
+Focus trapping in modals used to require complex JavaScript. Now use the `inert` attribute:
-## Keyboard Navigation
+```html
+<!-- When modal is open -->
+<main inert>
+ <!-- Content behind modal can't be focused or clicked -->
+</main>
+<dialog open>
+ <h2>Modal Title</h2>
+ <!-- Focus stays inside modal -->
+</dialog>
+```
-### Focus Management
+Or use the native `<dialog>` element:
-[TO BE DEVELOPED: Focus rings (never remove without replacement), logical tab order, skip links, focus trapping in modals]
+```javascript
+const dialog = document.querySelector('dialog');
+dialog.showModal(); // Opens with focus trap, closes on Escape
+```
-### Keyboard Shortcuts
+## The Popover API
-[TO BE DEVELOPED: Common shortcuts, discoverability, avoiding conflicts, command palettes, keyboard-first workflows]
+For tooltips, dropdowns, and non-modal overlays, use native popovers:
-### Accessible Interaction Patterns
+```html
+<button popovertarget="menu">Open menu</button>
+<div id="menu" popover>
+ <button>Option 1</button>
+ <button>Option 2</button>
+</div>
+```
-[TO BE DEVELOPED: ARIA roles for custom controls, managing focus in dynamic content, screen reader announcements]
+**Benefits**: Light-dismiss (click outside closes), proper stacking, no z-index wars, accessible by default.
-## Navigation Patterns
+## Destructive Actions: Undo > Confirm
-### Menu & Navigation Design
+Confirmation dialogs are friction. Users click through them mindlessly. **Undo is better**:
-[TO BE DEVELOPED: Mega menus, hamburger menus, breadcrumbs, tabs, pagination, infinite scroll vs load more]
+```javascript
+async function deleteItem(id) {
+ // 1. Remove from UI immediately
+ hideItem(id);
-### Modal & Dialog Patterns
+ // 2. Show undo toast
+ const toast = showToast('Item deleted', {
+ action: { label: 'Undo', onClick: () => restoreItem(id) },
+ duration: 5000
+ });
-[TO BE DEVELOPED: Modal entry/exit, focus management, escape to close, backdrop click behavior, sheet patterns]
+ // 3. Actually delete after toast expires
+ toast.onClose(() => api.delete(id));
+}
+```
-### Command & Context Menus
+**When to still use confirmation**: Irreversible actions (account deletion), high-cost actions (large purchases), batch operations on many items.
+
+## Keyboard Navigation Patterns
+
+### Roving Tabindex
+
+For component groups (tabs, menu items, radio groups), one item is tabbable; arrow keys move within:
-[TO BE DEVELOPED: Right-click menus, command palettes, dropdown menus, action sheets]
+```html
+<div role="tablist">
+ <button role="tab" tabindex="0">Tab 1</button>
+ <button role="tab" tabindex="-1">Tab 2</button>
+ <button role="tab" tabindex="-1">Tab 3</button>
+</div>
+```
-## Error Prevention & Recovery
+Arrow keys move `tabindex="0"` between items. Tab moves to the next component entirely.
-### Constraints & Guards
+### Skip Links
-[TO BE DEVELOPED: Input constraints, disabled states, confirmation dialogs for destructive actions, undo mechanisms]
+For keyboard users, provide a skip link to jump past navigation:
-### Error Messages
+```html
+<a href="#main-content" class="skip-link">Skip to main content</a>
+<nav>...</nav>
+<main id="main-content">...</main>
+```
-[TO BE DEVELOPED: Clear language, actionable guidance, positive framing, where to show errors, when to show errors]
+```css
+.skip-link {
+ position: absolute;
+ left: -9999px;
+}
+.skip-link:focus {
+ left: 0;
+ z-index: 9999;
+ /* Visible styling */
+}
+```
-### Undo & Redo
+## Gesture Discoverability
-[TO BE DEVELOPED: Undo patterns, toast notifications with undo, versioning, draft auto-save]
+Swipe-to-delete and similar gestures are invisible. Hint at their existence:
+
+- **Partially reveal**: Show delete button peeking from edge
+- **Onboarding**: Coach marks on first use
+- **Alternative**: Always provide a visible fallback (menu with "Delete")
+
+Don't rely on gestures as the only way to perform actions.
---
@@ -841,75 +1507,185 @@ Then build a color system that is:
- Flexible enough for theming and variations
- Aesthetically cohesive and on-brand
-## Color Theory Fundamentals
+## Color Spaces: Use OKLCH
-### Color Harmony & Relationships
+**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
-[TO BE DEVELOPED: Complementary, analogous, triadic, split-complementary, monochromatic schemes, color wheel navigation]
+```css
+/* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */
+--color-primary: oklch(60% 0.15 250); /* Blue */
+--color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */
+--color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */
+```
-### Color Psychology & Meaning
+**Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish. A light blue at 85% lightness needs ~0.08 chroma, not the 0.15 of your base color.
-[TO BE DEVELOPED: Emotional associations, cultural considerations, industry conventions, semantic color choices]
+## Building Functional Palettes
-### Color Properties
+### The Tinted Neutral Trap
-[TO BE DEVELOPED: Hue, saturation, lightness/brightness, HSL vs RGB vs LCH, perceptual uniformity]
+**Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals:
-## Building Functional Palettes
+```css
+/* Dead grays */
+--gray-100: oklch(95% 0 0); /* No personality */
+--gray-900: oklch(15% 0 0);
+
+/* Warm-tinted grays (add brand warmth) */
+--gray-100: oklch(95% 0.01 60); /* Hint of warmth */
+--gray-900: oklch(15% 0.01 60);
+
+/* Cool-tinted grays (tech, professional) */
+--gray-100: oklch(95% 0.01 250); /* Hint of blue */
+--gray-900: oklch(15% 0.01 250);
+```
+
+The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI.
### Palette Structure
-[TO BE DEVELOPED: Primary/secondary/tertiary, neutral scales (9-11 steps), semantic colors, state colors]
+A complete system needs:
-### Generating Color Scales
+| Role | Purpose | Example |
+|------|---------|---------|
+| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
+| **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
+| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
+| **Surface** | Cards, modals, overlays | 2-3 elevation levels |
-[TO BE DEVELOPED: Lightness curves, saturation shifts, hue rotation, perceptual uniformity, algorithmic generation]
+**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
-### The Dominant Color Principle
+### The 60-30-10 Rule (Applied Correctly)
-[TO BE DEVELOPED: 60-30-10 rule, accent color strategy, visual weight distribution, avoiding rainbow vomit]
+This rule is about **visual weight**, not pixel count:
+
+- **60%**: Neutral backgrounds, white space, base surfaces
+- **30%**: Secondary colors—text, borders, inactive states
+- **10%**: Accent—CTAs, highlights, focus states
+
+The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power.
## Contrast & Accessibility
-### WCAG Compliance
+### WCAG Requirements
+
+| Content Type | AA Minimum | AAA Target |
+|--------------|------------|------------|
+| Body text | 4.5:1 | 7:1 |
+| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
+| UI components, icons | 3:1 | 4.5:1 |
+| Non-essential decorations | None | None |
+
+**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG.
+
+### Dangerous Color Combinations
+
+These commonly fail contrast or cause readability issues:
+
+- Light gray text on white (the #1 accessibility fail)
+- **Gray text on any colored background**—gray looks washed out and dead on color. Use a tinted version of the background color instead, or transparency
+- Red text on green background (or vice versa)—8% of men can't distinguish these
+- Blue text on red background (vibrates visually)
+- Yellow text on white (almost always fails)
+- Thin light text on images (unpredictable contrast)
+
+### Never Use Pure Gray or Pure Black
+
+Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. They look uncanny and lifeless.
-[TO BE DEVELOPED: AA vs AAA standards, text contrast ratios (4.5:1 / 7:1), UI component contrast (3:1), large text exceptions]
+```css
+/* Dead and artificial */
+--gray: oklch(50% 0 0);
+--black: oklch(0% 0 0);
-### Testing & Tools
+/* Natural and warm */
+--gray: oklch(50% 0.01 60); /* Warm gray */
+--black: oklch(12% 0.01 250); /* Very dark blue-gray */
+```
-[TO BE DEVELOPED: Contrast checkers, automated testing, color blindness simulation, tools for verification]
+Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted.
-### Accessible Color Combinations
+### Testing
-[TO BE DEVELOPED: Which combinations work, which don't, safe pairings, dangerous pairings, contrast matrices]
+Don't trust your eyes. Use tools:
-## Theming Architecture
+- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
+- Browser DevTools → Rendering → Emulate vision deficiencies
+- [Polypane](https://polypane.app/) for real-time testing
-### Light & Dark Mode
+## Theming: Light & Dark Mode
-[TO BE DEVELOPED: Independent palettes vs inverted, neutral strategies, shadows in dark mode, image handling]
+### Dark Mode Is Not Inverted Light Mode
-### CSS Custom Properties
+You can't just swap colors. Dark mode requires different design decisions:
-[TO BE DEVELOPED: Token hierarchy (primitive → semantic → component), naming conventions, theme switching]
+| Light Mode | Dark Mode |
+|------------|-----------|
+| Shadows for depth | Lighter surfaces for depth (no shadows) |
+| Dark text on light | Light text on dark (reduce font weight) |
+| Vibrant accents | Desaturate accents slightly |
+| White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
-### Multi-Theme Systems
+```css
+/* Dark mode depth via surface color, not shadow */
+:root[data-theme="dark"] {
+ --surface-1: oklch(15% 0.01 250);
+ --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */
+ --surface-3: oklch(25% 0.01 250);
-[TO BE DEVELOPED: Brand themes, user preference themes, contextual themes, theme inheritance]
+ /* Reduce text weight slightly */
+ --body-weight: 350; /* Instead of 400 */
+}
+```
-## Advanced Color Techniques
+### Token Hierarchy
-### Gradients & Effects
+Use two layers of abstraction:
-[TO BE DEVELOPED: Mesh gradients, color stops, blend modes, gradient generation, overlay techniques]
+```css
+/* Layer 1: Primitive tokens (rarely use directly) */
+--blue-500: oklch(55% 0.2 250);
+--blue-600: oklch(45% 0.2 250);
-### Transparency & Alpha
+/* Layer 2: Semantic tokens (use these) */
+--color-primary: var(--blue-500);
+--color-primary-hover: var(--blue-600);
+--color-text: var(--gray-900);
+--color-text-muted: var(--gray-600);
+--color-border: var(--gray-200);
+--color-surface: var(--white);
+```
-[TO BE DEVELOPED: Alpha channels, overlay strategies, transparency scales, backdrop effects]
+**For dark mode, only redefine the semantic layer:**
-### Dynamic Color
+```css
+:root[data-theme="dark"] {
+ --color-primary: var(--blue-400); /* Lighter in dark mode */
+ --color-text: var(--gray-100);
+ --color-surface: var(--gray-900);
+}
+```
-[TO BE DEVELOPED: State-based color changes, hover darkening/lightening, interactive color feedback]
+## Alpha Is A Design Smell
+
+If you're using lots of transparency (rgba, hsla), your palette is probably incomplete. Alpha creates:
+- Unpredictable contrast (depends on what's behind it)
+- Performance overhead (compositing)
+- Inconsistency across contexts
+
+**Instead**: Define explicit overlay colors:
+
+```css
+/* Bad: unpredictable */
+--overlay: rgba(0, 0, 0, 0.5);
+
+/* Good: explicit colors for each context */
+--overlay-on-light: oklch(40% 0 0);
+--overlay-on-dark: oklch(70% 0 0);
+--overlay-on-image: oklch(20% 0 0 / 60%); /* Alpha only when necessary */
+```
+
+The exception: Focus rings and interactive states where you need to see through to the element beneath.
---
@@ -955,119 +1731,237 @@ Then build responsive systems that are:
- Performant on constrained devices
- Contextually appropriate
-## Mobile-First Methodology
-
-### Why Mobile-First
-
-[TO BE DEVELOPED: Progressive enhancement, performance benefits, forces priority decisions, mobile usage dominance]
+## Mobile-First: Write It Right
-### Mobile-First Implementation
+Start with base styles for mobile, then layer complexity:
-[TO BE DEVELOPED: Start with mobile styles, add complexity with min-width media queries, content-first approach]
+```css
+/* Base: mobile */
+.nav {
+ display: flex;
+ flex-direction: column;
+}
-## Breakpoint Strategies
+/* Enhancement: tablet and up */
+@media (min-width: 768px) {
+ .nav {
+ flex-direction: row;
+ }
+}
+```
-### Choosing Breakpoints
+**The mistake**: Writing desktop-first (max-width queries) means mobile loads desktop styles first, then overrides. Wasteful and error-prone.
-[TO BE DEVELOPED: Content-driven vs device-driven, common breakpoint values, in-between states, avoiding too many breakpoints]
+## Breakpoints: Content-Driven, Not Device-Driven
-### Breakpoint Architecture
+**Don't chase device sizes.** iPhones change, Android varies wildly, tablets overlap with laptops. Instead, let content tell you where to break:
-[TO BE DEVELOPED: Named breakpoints, breakpoint tokens, consistent usage across codebase]
+1. Start narrow
+2. Stretch the viewport until the design breaks
+3. Add a breakpoint there
-## Fluid & Adaptive Design
+Common content-driven breakpoints (as starting points):
-### Fluid Typography
+```css
+:root {
+ --bp-sm: 640px; /* Larger phones, small content changes */
+ --bp-md: 768px; /* Tablets, significant reflow */
+ --bp-lg: 1024px; /* Laptops, multi-column */
+ --bp-xl: 1280px; /* Desktops, max content width */
+}
+```
-[TO BE DEVELOPED: clamp(), viewport units, fluid type scales, maintaining readability]
+**Three breakpoints usually suffice.** If you have more than five, you're probably over-engineering.
-### Fluid Spacing
-
-[TO BE DEVELOPED: Responsive spacing scales, container-relative spacing, clamp() for margins/padding]
-
-### Fluid Layouts
-
-[TO BE DEVELOPED: CSS Grid auto-fit/auto-fill, flexible columns, aspect-ratio, fluid containers]
+## Fluid Design: The Clamp Formula
-### Container Queries
-
-[TO BE DEVELOPED: Component-level responsiveness, when to use vs media queries, polyfills]
-
-## Layout Adaptation Patterns
+`clamp(min, preferred, max)` creates fluid values without media queries.
-### Navigation Patterns
+### The Formula
-[TO BE DEVELOPED: Mobile hamburger/drawer, tablet side panel, desktop persistent nav, bottom nav bars]
+```css
+/* Font size: 16px min, scales with viewport, 24px max */
+font-size: clamp(1rem, 0.5rem + 2vw, 1.5rem);
+```
-### Content Reflow
+**How to calculate the preferred value**: The middle value determines the scaling rate. Higher vw coefficient = faster scaling:
-[TO BE DEVELOPED: Single column → multi-column, stacking orders, priority content first]
+- `1vw` = gentle scaling
+- `2-3vw` = moderate scaling
+- `4vw+` = aggressive scaling
-### Component Adaptation
+Add a rem offset to shift the baseline: `0.5rem + 2vw` ensures it doesn't collapse to 0 on small screens.
-[TO BE DEVELOPED: Tabs → accordion, horizontal → vertical, show/hide patterns, progressive disclosure]
-
-## Touch vs Pointer Optimization
-
-### Touch Target Sizing
-
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge cases]
-
-### Touch-Specific Interactions
-
-[TO BE DEVELOPED: Swipe gestures, pull-to-refresh, long press, avoiding hover-dependent patterns]
-
-### Hybrid Devices
-
-[TO BE DEVELOPED: Supporting both touch and pointer, feature detection, adaptive interfaces]
-
-## Viewport & Screen Considerations
-
-### Viewport Meta Tag
-
-[TO BE DEVELOPED: Proper viewport configuration, zoom control, initial scale]
+### Fluid Spacing
-### Safe Areas
+```css
+:root {
+ --space-lg: clamp(2rem, 1rem + 3vw, 4rem);
+ --container-padding: clamp(1rem, 5vw, 4rem);
+}
+```
+
+This creates breathing room that naturally expands on larger screens.
+
+## Detect Input Method, Not Just Screen Size
+
+**Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard—use pointer and hover queries:
+
+```css
+/* Fine pointer (mouse, trackpad) */
+@media (pointer: fine) {
+ .button { padding: 8px 16px; }
+}
+
+/* Coarse pointer (touch, stylus) */
+@media (pointer: coarse) {
+ .button { padding: 12px 20px; } /* Larger touch target */
+}
+
+/* Device supports hover */
+@media (hover: hover) {
+ .card:hover { transform: translateY(-2px); }
+}
+
+/* Device doesn't support hover (touch) */
+@media (hover: none) {
+ .card { /* No hover state - use active instead */ }
+}
+```
+
+**Critical**: Don't rely on hover for functionality. Touch users can't hover.
+
+## Safe Areas: Handle the Notch
+
+Modern phones have notches, rounded corners, and home indicators. Use `env()`:
+
+```css
+body {
+ padding-top: env(safe-area-inset-top);
+ padding-bottom: env(safe-area-inset-bottom);
+ padding-left: env(safe-area-inset-left);
+ padding-right: env(safe-area-inset-right);
+}
+
+/* With fallback */
+.footer {
+ padding-bottom: max(1rem, env(safe-area-inset-bottom));
+}
+```
+
+**Enable viewport-fit** in your meta tag:
+```html
+<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
+```
+
+## Responsive Images: Get It Right
+
+### srcset with Width Descriptors
+
+```html
+<img
+ src="hero-800.jpg"
+ srcset="
+ hero-400.jpg 400w,
+ hero-800.jpg 800w,
+ hero-1200.jpg 1200w
+ "
+ sizes="(max-width: 768px) 100vw, 50vw"
+ alt="Hero image"
+>
+```
+
+**How it works**:
+- `srcset` lists available images with their actual widths (`w` descriptors)
+- `sizes` tells the browser how wide the image will display
+- Browser picks the best file based on viewport width AND device pixel ratio
+
+### Picture Element for Art Direction
+
+When you need different crops/compositions (not just resolutions):
+
+```html
+<picture>
+ <source media="(min-width: 768px)" srcset="wide.jpg">
+ <source media="(max-width: 767px)" srcset="tall.jpg">
+ <img src="fallback.jpg" alt="...">
+</picture>
+```
-[TO BE DEVELOPED: iPhone notch, rounded corners, system UI insets, padding for safe areas]
+## Layout Adaptation Patterns
-### Orientation Handling
+### Navigation: The Three-Stage Pattern
-[TO BE DEVELOPED: Portrait vs landscape, orientation-specific layouts, testing both orientations]
+```css
+/* Mobile: hamburger icon + drawer */
+.nav-menu { display: none; }
+.nav-toggle { display: block; }
-### High-DPI Screens
+/* Tablet: horizontal but compact */
+@media (min-width: 768px) {
+ .nav-menu { display: flex; }
+ .nav-toggle { display: none; }
+}
-[TO BE DEVELOPED: Retina images, 2x/3x assets, SVG for icons, responsive images]
+/* Desktop: full navigation with labels */
+@media (min-width: 1024px) {
+ .nav-item-label { display: inline; }
+}
+```
-## Responsive Images & Media
+### Table to Cards
-### Responsive Images
+Tables work on desktop, fail on mobile. Transform:
-[TO BE DEVELOPED: srcset, sizes, picture element, art direction, lazy loading]
+```css
+@media (max-width: 768px) {
+ table, thead, tbody, th, td, tr {
+ display: block;
+ }
-### Video Adaptation
+ thead { display: none; } /* Hide headers */
-[TO BE DEVELOPED: Responsive video embeds, bandwidth considerations, poster images]
+ tr {
+ margin-bottom: 1rem;
+ border: 1px solid var(--border);
+ padding: 1rem;
+ }
-## Performance on Mobile
+ td::before {
+ content: attr(data-label); /* Add labels via data attribute */
+ font-weight: 600;
+ display: block;
+ }
+}
+```
-### Mobile Performance Budget
+### Progressive Disclosure
-[TO BE DEVELOPED: Constrained CPU/memory, slow connections, battery concerns]
+Not everything needs to show on mobile:
-### Loading Strategies
+```css
+/* Show summary on mobile */
+.details-content { display: none; }
-[TO BE DEVELOPED: Critical path optimization, lazy loading, code splitting for mobile]
+@media (min-width: 768px) {
+ /* Expand on desktop */
+ .details-content { display: block; }
+}
+```
-## Testing Strategies
+Combine with `<details>/<summary>` for interactive expansion on mobile.
-### Device Testing
+## Testing: Don't Trust DevTools Alone
-[TO BE DEVELOPED: Real device testing, browser DevTools, emulators, viewport testing]
+DevTools device emulation is useful for layout but misses:
-### Testing Checklist
+- Actual touch interactions
+- Real CPU/memory constraints
+- Network latency patterns
+- Font rendering differences
+- Browser chrome/keyboard appearances
-[TO BE DEVELOPED: Different viewports, orientations, input methods, connection speeds]
+**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
---
diff --git a/dist/gemini/GEMINI.frontend-design.md b/dist/gemini/GEMINI.frontend-design.md
index e07e95864..2c3a61e72 100644
--- a/dist/gemini/GEMINI.frontend-design.md
+++ b/dist/gemini/GEMINI.frontend-design.md
@@ -51,7 +51,7 @@ Focus on intentional, distinctive design choices:
**Space**: Use a spacing scale (4, 8, 12, 16, 24, 32, 48, 64, 96). Create visual rhythm through varied spacing. Let content breathe. Break the grid intentionally.
-**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity. Stagger reveals for orchestrated page loads.
+**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity with smooth ease-out curves (quart, quint, expo). Stagger reveals for orchestrated page loads.
**Interaction**: Design clear focus indicators. Make touch targets 44×44px minimum. Provide immediate feedback. Write specific, helpful error messages.
@@ -61,11 +61,13 @@ Focus on intentional, distinctive design choices:
These patterns create generic "AI slop" aesthetics:
-**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, wrapping everything in rounded cards, decorative shadows without purpose.
+**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, pure grays without color tint, wrapping everything in rounded cards, decorative shadows without purpose.
-**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards.
+**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards, redundant copy (headers restating intros, repeated explanations).
-**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors.
+**Motion Mistakes**: Bounce and elastic easing (dated and tacky), animating layout properties, durations over 500ms for feedback, animation without purpose.
+
+**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors, gray text on colored backgrounds.
**Accessibility Violations**: Color-only meaning, ignoring prefers-reduced-motion, failing WCAG contrast, creating keyboard traps.
@@ -142,163 +144,263 @@ Then write copy that is:
- Human and empathetic
- Consistent in terminology and tone
-## Fundamental Principles
+## The Button Label Problem
-### Clarity Over Cleverness
+**Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
-[TO BE DEVELOPED: Plain language, avoid jargon, specific over vague, "Save changes" not "OK"]
+| Bad | Good | Why |
+|-----|------|-----|
+| OK | Save changes | Says what will happen |
+| Submit | Create account | Outcome-focused |
+| Yes | Delete message | Confirms the action |
+| Cancel | Keep editing | Clarifies what "cancel" means |
+| Click here | Download PDF | Describes the destination |
-### Concise But Complete
+**For destructive actions**, name the destruction:
+- "Delete" not "Remove" (delete is permanent, remove implies recoverable)
+- "Delete 5 items" not "Delete selected" (show the count)
-[TO BE DEVELOPED: Remove unnecessary words, but include essential information, balance brevity with clarity]
+## Error Messages: The Formula
-### Active Voice
+Every error message should answer three questions:
-[TO BE DEVELOPED: "We saved your changes" not "Your changes have been saved", action-oriented language]
+1. **What happened?** (Clearly state the problem)
+2. **Why?** (If not obvious)
+3. **How to fix it?** (Specific action)
-### User-Focused Language
+```
+Bad: "Invalid input"
-[TO BE DEVELOPED: "Your" not "The", focus on user benefits, user's mental model]
+Good: "Email address isn't valid. Please include an @ symbol."
-### Consistency
+Bad: "Request failed"
-[TO BE DEVELOPED: Use same terms throughout, don't vary for variety, build terminology glossary]
+Good: "We couldn't save your changes. Check your internet connection and try again."
+```
-## Voice & Tone
+### Error Message Templates
-### Establishing Brand Voice
+| Situation | Template |
+|-----------|----------|
+| **Format error** | "[Field] needs to be [format]. Example: [example]" |
+| **Missing required** | "Please enter [what's missing]" |
+| **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
+| **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
+| **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
-[TO BE DEVELOPED: Personality dimensions, voice guidelines, voice vs tone distinction]
+### Don't Blame the User
-### Adapting Tone to Context
+```
+Bad: "You entered an invalid date"
+Good: "Please enter a date in MM/DD/YYYY format"
-[TO BE DEVELOPED: Success = celebratory, Error = empathetic, Loading = reassuring, matching emotional moment]
+Bad: "Your password is too weak"
+Good: "Add at least one number or symbol to strengthen your password"
+```
-### Voice Across Cultures
+## Empty States Are Opportunities
-[TO BE DEVELOPED: Cultural sensitivity, humor translation, formality levels, global considerations]
+An empty list isn't a dead end—it's an onboarding moment.
-## Microcopy Excellence
+```
+Bad: "No items"
-### Button & CTA Copy
+Good: "No projects yet
+ Projects help you organize your work. Create your first one to get started.
+ [+ Create project]"
+```
-[TO BE DEVELOPED: Specific actions ("Create account" not "Submit"), verb + noun structure, outcome-oriented]
+**Empty state formula**:
+1. Acknowledge the emptiness (briefly)
+2. Explain the value of filling it
+3. Provide a clear action
-### Labels & Instructions
+## Voice vs Tone
-[TO BE DEVELOPED: Clear, specific labels, instructions before fields, showing format with examples]
+**Voice** is your brand's personality—consistent everywhere.
+**Tone** adapts to the moment.
-### Placeholder Text
+| Moment | Tone Shift |
+|--------|------------|
+| Success | Celebratory, brief: "Done! Your changes are live." |
+| Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
+| Loading | Reassuring: "Saving your work..." |
+| Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
-[TO BE DEVELOPED: When to use (rarely), never as labels, examples not instructions]
+**Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
-### Tooltips & Help Text
+## Writing for Accessibility
-[TO BE DEVELOPED: Adding value beyond label, answering implicit questions, brevity with links to details]
+### Link Text
-## Error Messages & Validation
+Screen readers can navigate by links. Vague links fail:
-### Error Message Principles
+```html
+<!-- Bad: meaningless without context -->
+<a href="...">Click here</a>
+<a href="...">Learn more</a>
-[TO BE DEVELOPED: Explain what happened, suggest fix, don't blame user, provide examples, link to help]
+<!-- Good: standalone meaning -->
+<a href="...">View pricing plans</a>
+<a href="...">Learn more about data export</a>
+```
-### Validation Feedback
+### Alt Text
-[TO BE DEVELOPED: Inline validation, timing (on blur vs on submit), success states, clear requirements]
+Describe the **information**, not the image:
-### Error Message Patterns
+```html
+<!-- Bad: describes image -->
+<img alt="Chart" src="revenue.png">
-[TO BE DEVELOPED: Format errors, permission errors, network errors, system errors, 404s]
+<!-- Good: describes information -->
+<img alt="Revenue increased 40% in Q4" src="revenue.png">
-## Forms & Inputs
+<!-- Decorative images get empty alt -->
+<img alt="" src="decorative-wave.png">
+```
-### Form Labels
+### Button Context
-[TO BE DEVELOPED: Descriptive labels, required field indication, why you're asking (when not obvious)]
+Buttons need context, especially icons:
-### Help Text
+```html
+<!-- Bad: no context -->
+<button>×</button>
-[TO BE DEVELOPED: Format guidance, why you need this information, examples, constraints]
+<!-- Good: screen reader context -->
+<button aria-label="Close dialog">×</button>
+```
-### Confirmation Dialogs
+## Writing for Translation
-[TO BE DEVELOPED: Specific about action, explain consequences, clear button labels, don't overuse]
+### Plan for Expansion
-## System Messages
+German text is ~30% longer than English. Allocate space:
-### Success Messages
+| Language | Expansion |
+|----------|-----------|
+| German | +30% |
+| French | +20% |
+| Finnish | +30-40% |
+| Chinese | -30% (fewer chars, but same width) |
-[TO BE DEVELOPED: Confirm what happened, what happens next, celebrate appropriately, be brief]
+### Translation-Friendly Patterns
-### Loading States
+```
+Bad: "You have 3 new messages" (number inside sentence)
+Good: "New messages: 3" (number separate)
-[TO BE DEVELOPED: What's happening, time expectations, progress indication, personality in waiting]
+Bad: "Welcome back, {name}!" (word order varies by language)
+Good: "{greeting_message}" (full sentence as one string)
-### Empty States
+Bad: "5 mins ago" (abbrev doesn't translate)
+Good: "5 minutes ago" (full word)
+```
-[TO BE DEVELOPED: Explain why empty, value of filling it, clear CTA, welcoming not dead-end]
+### Give Translators Context
-## Navigation & Wayfinding
+```json
+{
+ "delete_confirm": {
+ "message": "Delete {item}?",
+ "context": "Confirmation dialog when deleting a file or folder. {item} is the name of the item being deleted."
+ }
+}
+```
-### Navigation Labels
+## Consistency: The Terminology Problem
-[TO BE DEVELOPED: Specific and descriptive, user language not internal terms, clear information scent]
+Pick one term and stick with it:
-### Breadcrumbs & Headers
+| Inconsistent | Consistent |
+|--------------|------------|
+| Delete / Remove / Trash | Delete |
+| Settings / Preferences / Options | Settings |
+| Sign in / Log in / Enter | Sign in |
+| Create / Add / New | Create |
-[TO BE DEVELOPED: Clear location indication, hierarchical clarity, shortened for mobile]
+Build a terminology glossary and enforce it. Variety creates confusion.
-### Search & Filters
+## Avoid Redundant Copy
-[TO BE DEVELOPED: Clear search placeholders, filter labels, no results messaging]
+Saying the same thing twice wastes space and dilutes impact.
-## Content Hierarchy & Structure
+**Common redundancies**:
+- Section header + intro paragraph saying the same thing
+- Page title + section title with same/similar text
+- CTA button + surrounding text repeating the action
+- Outro that restates the intro
-### Scannable Writing
+```
+Bad: "Settings"
+ "Here you can adjust your settings and preferences."
+ [Settings form]
+ "Save your settings to apply changes."
-[TO BE DEVELOPED: Short paragraphs, bullet points, clear headings, front-load important info]
+Good: "Settings"
+ [Settings form]
+ [Save]
+```
-### Progressive Disclosure
+**The rule**: If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
-[TO BE DEVELOPED: Essential info first, details on demand, expandable sections, learn more links]
+## Loading States
-## Writing for Accessibility
+Tell users what's happening:
-### Screen Reader Considerations
+```
+Bad: "Loading..."
+Good: "Saving your draft..."
-[TO BE DEVELOPED: ARIA labels, alt text writing, link text clarity, button labels]
+Bad: [spinner]
+Good: "Searching 1,247 documents..."
-### Plain Language
+Bad: "Please wait"
+Good: "Preparing your download... This usually takes 30 seconds."
+```
-[TO BE DEVELOPED: Reading level considerations, avoid jargon, explain technical terms]
+For long waits, show progress or set expectations.
-### Text Alternatives
+## Confirmation Dialogs: Use Sparingly
-[TO BE DEVELOPED: Transcripts for audio/video, alt text for images, descriptions for complex UI]
+**Most confirmation dialogs are design failures.** If an action is dangerous enough to confirm, consider:
+- Undo instead of confirm
+- Making the action less destructive
+- Showing consequences before the action
-## Internationalization (i18n)
+When you must confirm:
-### Writing for Translation
+```
+Bad: "Are you sure?"
+ [Yes] [No]
-[TO BE DEVELOPED: Avoid idioms, complete sentences, context for translators, text expansion space]
+Good: "Delete 'Project Alpha'?
+ This will permanently delete the project and all its files.
+ [Delete project] [Keep project]"
+```
-### Cultural Adaptation
+Name the action, explain consequences, use specific button labels.
-[TO BE DEVELOPED: Cultural sensitivity, date/time formats, address formats, name formats]
+## Form Instructions
-## Content Patterns by Type
+### Format Hints
-### Onboarding Copy
+Show don't tell:
-[TO BE DEVELOPED: Welcome messages, getting started, first-time guidance, value proposition]
+```
+Bad: "Enter date in MMDDYYYY format"
+Good: "Date of birth" + placeholder="04/15/1990"
+```
-### Settings & Preferences
+### Why Are You Asking?
-[TO BE DEVELOPED: Clear option descriptions, impact explanation, defaults indication]
+For non-obvious fields, explain:
-### Notifications
-
-[TO BE DEVELOPED: Scannable, actionable, appropriate urgency, notification fatigue prevention]
+```html
+<label>Phone number (optional)</label>
+<span class="help">We'll only use this to contact you about your order.</span>
+```
---
@@ -346,93 +448,266 @@ Then build layout systems that are:
- Responsive and adaptive across viewports
- Compositionally strong with clear focal points
-## Classic Composition Principles
-
-### Visual Hierarchy Fundamentals
-
-[TO BE DEVELOPED: Size, weight, color, position, contrast as hierarchy tools, Gestalt principles (proximity, similarity, closure)]
-
-### Balance & Symmetry
-
-[TO BE DEVELOPED: Symmetrical vs asymmetrical balance, visual weight calculation, creating tension and resolution]
-
-### The Rule of Thirds & Golden Ratio
-
-[TO BE DEVELOPED: Classic composition grids, golden ratio applications, when to follow vs break rules]
-
-### Focal Points & Eye Movement
-
-[TO BE DEVELOPED: Creating focal points, directing eye flow, Z/F/circular patterns, intentional disruption]
-
## Spacing Systems
-### Spacing Scales
+### Use 4pt Base, Not 8pt
+
+8pt systems are too coarse. **4pt gives you the granularity you actually need:**
+
+```css
+:root {
+ --space-1: 4px; /* 0.25rem - tight */
+ --space-2: 8px; /* 0.5rem */
+ --space-3: 12px; /* 0.75rem */
+ --space-4: 16px; /* 1rem - base */
+ --space-6: 24px; /* 1.5rem */
+ --space-8: 32px; /* 2rem */
+ --space-12: 48px; /* 3rem */
+ --space-16: 64px; /* 4rem */
+ --space-24: 96px; /* 6rem - section gaps */
+}
+```
+
+**The insight**: You'll frequently need 12px (between 8 and 16). An 8pt-only system forces awkward choices.
+
+### Name Tokens by Relationship, Not Value
+
+```css
+/* Bad: tied to pixels */
+--spacing-8: 8px;
+--spacing-16: 16px;
+
+/* Better: semantic */
+--space-xs: 4px; /* Tight inline gaps */
+--space-sm: 8px; /* Between related elements */
+--space-md: 16px; /* Component padding */
+--space-lg: 24px; /* Between components */
+--space-xl: 48px; /* Section padding */
+--space-2xl: 96px; /* Section margins */
+```
+
+### Gap Over Margin
+
+**Stop using margins for spacing between siblings.** Use `gap`:
+
+```css
+/* Old way: margins create double-spacing bugs */
+.card { margin-bottom: 16px; }
+.card:last-child { margin-bottom: 0; } /* Cleanup hack */
+
+/* Modern way: gap just works */
+.card-list {
+ display: flex;
+ flex-direction: column;
+ gap: 16px; /* Automatic, no cleanup needed */
+}
+```
+
+Gap works in Flexbox and Grid. It's cleaner, more intentional, and eliminates margin collapse headaches.
+
+## Grid Systems
+
+### The Self-Adjusting Grid
+
+This pattern creates responsive grids without breakpoints:
+
+```css
+.grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ gap: var(--space-lg);
+}
+```
+
+**How it works**: Columns are at least 280px. As many as fit per row. Leftovers stretch. No media queries needed.
+
+**Variation for exact counts:**
+```css
+/* Always 3 columns on desktop, stack on mobile */
+.grid-3 {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
+ gap: var(--space-lg);
+}
+```
+
+### Grid Area Naming
+
+For complex layouts, named areas are clearer than line numbers:
+
+```css
+.page {
+ display: grid;
+ grid-template-areas:
+ "header header"
+ "sidebar main"
+ "footer footer";
+ grid-template-columns: 280px 1fr;
+ grid-template-rows: auto 1fr auto;
+}
+
+.header { grid-area: header; }
+.sidebar { grid-area: sidebar; }
+.main { grid-area: main; }
+.footer { grid-area: footer; }
+```
+
+At mobile breakpoints, redefine the areas:
+```css
+@media (max-width: 768px) {
+ .page {
+ grid-template-areas:
+ "header"
+ "main"
+ "sidebar"
+ "footer";
+ grid-template-columns: 1fr;
+ }
+}
+```
-[TO BE DEVELOPED: 4pt/8pt systems, modular scales, mathematical progressions (linear, exponential, Fibonacci)]
+## Visual Hierarchy
-### Vertical Rhythm
-
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, spacing ratios, rhythm across components]
-
-### Micro vs Macro Space
-
-[TO BE DEVELOPED: Component-internal spacing, between-component spacing, section spacing, page-level breathing room]
-
-### Spacing Token Architecture
-
-[TO BE DEVELOPED: Primitive spacing tokens, semantic spacing (component gaps, section padding), contextual spacing]
-
-## Grid Systems & Layout Patterns
+### The Squint Test
-### Grid Fundamentals
+Blur your eyes (or screenshot and blur). Can you still identify:
+- The most important element?
+- The second most important?
+- Clear groupings?
+
+If everything looks the same weight blurred, you have a hierarchy problem.
+
+### Hierarchy Through Multiple Dimensions
+
+Don't rely on size alone. Combine:
-[TO BE DEVELOPED: Column grids, modular grids, baseline grids, grid anatomy (columns, gutters, margins)]
+| Tool | Strong Hierarchy | Weak Hierarchy |
+|------|------------------|----------------|
+| **Size** | 3:1 ratio or more | <2:1 ratio |
+| **Weight** | Bold vs Regular | Medium vs Regular |
+| **Color** | High contrast | Similar tones |
+| **Position** | Top/left (primary) | Bottom/right |
+| **Space** | Surrounded by white space | Crowded |
+
+**The best hierarchy uses 2-3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
+
+### Cards Are Not Required
+
+Cards (bordered/shadowed containers) are overused. You don't need a card to create visual grouping—spacing and alignment do this naturally.
+
+**Use cards when**:
+- Content is truly distinct and actionable (a product, a post, a task)
+- Items need to be visually comparable in a grid
+- Content needs clear boundaries for interaction (hover, click)
-### Classic Layout Patterns
+**Don't use cards for**:
+- General layout structure (use spacing instead)
+- Single items (a lone card looks arbitrary)
+- Nesting—**never put cards inside cards**. If you need hierarchy within a card, use spacing, typography, and subtle dividers instead
+
+```css
+/* Bad: card in a card */
+.outer-card > .inner-card { /* Noisy and confusing */ }
+
+/* Good: hierarchy without nesting */
+.card > .card-section { border-top: 1px solid var(--border); }
+```
+
+## Container Queries
+
+Viewport queries are for page layouts. **Container queries are for components**:
+
+```css
+.card-container {
+ container-type: inline-size;
+}
+
+.card {
+ display: grid;
+ gap: var(--space-md);
+}
-[TO BE DEVELOPED: Sidebar layouts, holy grail, card grids, masonry, magazine layouts, asymmetric layouts]
+/* Card layout changes based on its container, not viewport */
+@container (min-width: 400px) {
+ .card {
+ grid-template-columns: 120px 1fr;
+ }
+}
+```
-### Modern CSS Layout
+**Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands—automatically, without viewport hacks.
+
+## Optical Adjustments
-[TO BE DEVELOPED: CSS Grid (explicit placement, auto-placement, grid areas), Flexbox (direction, alignment, distribution), Container Queries]
+### Text Doesn't Align
-## Creating Visual Hierarchy
+A paragraph set to `margin-left: 0` looks indented because letterforms have internal whitespace. Fix with negative margin or padding:
-### Hierarchy Through Scale
+```css
+.heading {
+ margin-left: -0.05em; /* Pull left to optically align */
+}
+```
-[TO BE DEVELOPED: Size relationships, proportional scaling, meaningful jumps vs gradual progression]
+### Icons Need Optical Centering
-### Hierarchy Through Weight & Color
+A geometrically centered icon often looks off-center. Play icons need to shift right, left-arrows need to shift left:
-[TO BE DEVELOPED: Visual weight calculation, using color for emphasis, combining multiple hierarchy tools]
+```css
+.play-button svg {
+ transform: translateX(2px); /* Optical center */
+}
+```
-### Hierarchy Through Position
+### Touch Targets vs Visual Size
-[TO BE DEVELOPED: Placement importance, reading order, visual flow direction, breaking the grid for emphasis]
+Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
-## Responsive Spatial Design
+```css
+.icon-button {
+ width: 24px; /* Visual size */
+ height: 24px;
+ position: relative;
+}
-### Breakpoint Strategy
+.icon-button::before {
+ content: '';
+ position: absolute;
+ inset: -10px; /* Expand tap target to 44px */
+}
+```
-[TO BE DEVELOPED: Mobile-first vs desktop-first, breakpoint values, in-between states, content-driven breakpoints]
+## Depth & Elevation
-### Layout Adaptation
+### Semantic Z-Index
-[TO BE DEVELOPED: Reflow patterns, navigation transformation, content prioritization, progressive disclosure]
+Don't use arbitrary numbers. Create a scale:
-### Fluid Spacing & Layout
+```css
+:root {
+ --z-dropdown: 100;
+ --z-sticky: 200;
+ --z-modal-backdrop: 300;
+ --z-modal: 400;
+ --z-toast: 500;
+ --z-tooltip: 600;
+}
+```
-[TO BE DEVELOPED: clamp() for spacing, viewport units, fluid grids, container-relative spacing]
+### Shadow Scale for Elevation
-## Depth & Layering
+Shadows indicate elevation. Create a consistent scale:
-### Creating Depth
+```css
+:root {
+ --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); /* Subtle lift */
+ --shadow-md: 0 4px 6px rgba(0,0,0,0.07); /* Cards */
+ --shadow-lg: 0 10px 15px rgba(0,0,0,0.1); /* Dropdowns */
+ --shadow-xl: 0 20px 25px rgba(0,0,0,0.15); /* Modals */
+}
+```
-[TO BE DEVELOPED: Layering, shadows, elevation systems, z-index scales, parallax effects]
-
-### Overlap & Intersection
-
-[TO BE DEVELOPED: Intentional overlap, breaking containers, elements that cross boundaries]
+**Key insight**: Shadows should be subtle. If you can clearly see the shadow, it's probably too strong.
---
@@ -476,75 +751,193 @@ Then implement motion that is:
- Accessible with reduced motion alternatives
- Choreographed with thoughtful timing and sequencing
-## Classic Animation Principles
-
-### Disney's 12 Principles (Web Context)
-
-[TO BE DEVELOPED: Squash and stretch, anticipation, staging, follow-through, ease-in/ease-out, arcs, secondary action, timing, exaggeration, solid drawing, appeal - adapted for UI]
-
-### Timing & Duration
-
-[TO BE DEVELOPED: Micro-interactions (100-300ms), transitions (300-500ms), complex animations (500-1000ms), duration by distance, perceived speed]
-
-### Easing & Curves
+## Duration: The 100/300/500 Rule
-[TO BE DEVELOPED: Linear vs eased, ease-out (enter), ease-in (exit), ease-in-out (full cycle), custom cubic-bezier, spring physics]
+Timing matters more than easing. These durations feel right for most UI:
-## Types of UI Animation
+| Duration | Use Case | Examples |
+|----------|----------|----------|
+| **100-150ms** | Instant feedback | Button press, toggle, color change |
+| **200-300ms** | State changes | Menu open, tooltip, hover states |
+| **300-500ms** | Layout changes | Accordion, modal, drawer |
+| **500-800ms** | Entrance animations | Page load, hero reveals |
-### Micro-interactions
+**Exit animations are faster than entrances.** Users want to see what's leaving—quickly. Use ~75% of the enter duration:
+```css
+.modal {
+ --enter: 400ms;
+ --exit: 300ms;
+}
+```
+
+## Easing: Pick the Right Curve
+
+**Don't use `ease`.** It's a compromise that's rarely optimal. Instead:
+
+| Curve | Use For | CSS |
+|-------|---------|-----|
+| **ease-out** | Elements entering | `cubic-bezier(0.16, 1, 0.3, 1)` |
+| **ease-in** | Elements leaving | `cubic-bezier(0.7, 0, 0.84, 0)` |
+| **ease-in-out** | State toggles (there → back) | `cubic-bezier(0.65, 0, 0.35, 1)` |
+
+**For micro-interactions, use exponential curves**—they feel natural because they mimic real physics (friction, deceleration):
+
+```css
+/* Quart out - smooth, refined (recommended default) */
+--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
+
+/* Quint out - slightly more dramatic */
+--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
-[TO BE DEVELOPED: Button feedback, hover states, toggle switches, like buttons, form validation feedback, loading indicators]
+/* Expo out - snappy, confident */
+--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
+```
-### Page Transitions
+**Avoid bounce and elastic curves.** They were trendy in 2015 but now feel tacky and amateurish. Real objects don't bounce when they stop—they decelerate smoothly. Overshoot effects draw attention to the animation itself rather than the content.
-[TO BE DEVELOPED: Route transitions, modal entry/exit, drawer animations, cross-fade, slide, zoom patterns]
+## The Only Two Properties You Should Animate
-### State Transitions
+**transform** and **opacity**. That's it. Everything else causes layout recalculation or repaints:
-[TO BE DEVELOPED: Loading → success → error flows, expand/collapse, show/hide, enable/disable state changes]
+```css
+/* Good: GPU-accelerated, smooth */
+.slide-in {
+ transform: translateX(0);
+ opacity: 1;
+ transition: transform 300ms ease-out, opacity 300ms ease-out;
+}
+.slide-in.hidden {
+ transform: translateX(20px);
+ opacity: 0;
+}
+
+/* Bad: triggers layout, janky */
+.slide-in {
+ left: 0; /* Layout thrashing */
+ height: 100%; /* Expensive */
+}
+```
-### Scrolling & Parallax
+**Exceptions**: Sometimes you must animate `height` for accordions. Use `max-height` with a value larger than content, or better yet, use CSS Grid's `grid-template-rows: 0fr → 1fr` trick.
-[TO BE DEVELOPED: Scroll-triggered animations, reveal on scroll, parallax layers, scroll-linked effects, intersection observer]
+## Staggered Animations
-## Choreography & Sequencing
+Staggering creates rhythm and direction. The formula:
-### Staggered Animations
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+}
-[TO BE DEVELOPED: animation-delay patterns, sequential reveals, cascade effects, list item staggering]
+/* Stagger each item by 50ms */
+.list-item:nth-child(1) { animation-delay: 0ms; }
+.list-item:nth-child(2) { animation-delay: 50ms; }
+.list-item:nth-child(3) { animation-delay: 100ms; }
+/* ... */
+```
+
+**Better approach with CSS custom property:**
+
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+ animation-delay: calc(var(--i, 0) * 50ms);
+}
+```
+```html
+<li class="list-item" style="--i: 0">First</li>
+<li class="list-item" style="--i: 1">Second</li>
+<li class="list-item" style="--i: 2">Third</li>
+```
+
+**Key insight**: Cap the total stagger time. 10 items at 50ms = 500ms before the last item appears. If you have 50 items, reduce to 20ms per item or cap at ~10 staggered items.
+
+## Reduced Motion
+
+This is not optional. Vestibular disorders affect ~35% of adults over 40.
+
+```css
+/* Define animations normally */
+.card {
+ animation: slide-up 500ms ease-out;
+}
+
+/* Provide alternative for reduced motion */
+@media (prefers-reduced-motion: reduce) {
+ .card {
+ animation: fade-in 200ms ease-out; /* Crossfade instead of motion */
+ }
+}
-### Orchestrated Page Loads
+/* Or disable entirely */
+@media (prefers-reduced-motion: reduce) {
+ *, *::before, *::after {
+ animation-duration: 0.01ms !important;
+ transition-duration: 0.01ms !important;
+ }
+}
+```
+
+**What to preserve**: Functional animations like progress bars, loading spinners (slowed down), and focus indicators should still work—just without spatial movement.
+
+## Performance: Avoid These Mistakes
+
+### Don't Use will-change Preemptively
+
+```css
+/* Bad: wastes GPU memory */
+.card { will-change: transform; }
+
+/* Good: only when animation is imminent */
+.card:hover { will-change: transform; }
+.card.animating { will-change: transform; }
+```
+
+`will-change` forces the browser to create a compositing layer. Used everywhere = memory bloat.
+
+### Don't Animate During Scroll
+
+Scroll-linked animations (parallax, reveal) are expensive. If you must:
+
+```javascript
+// Use Intersection Observer, not scroll events
+const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('visible');
+ observer.unobserve(entry.target); // Animate once, then stop observing
+ }
+ });
+}, { threshold: 0.2 });
+```
+
+### Don't Fight the Main Thread
+
+Heavy JavaScript animations block rendering. For complex choreography, use the Web Animations API or a library like Motion One that schedules efficiently.
+
+## Motion Tokens
-[TO BE DEVELOPED: Entry choreography, hero → content → details, creating narrative through sequence, attention management]
-
-### Exit Choreography
-
-[TO BE DEVELOPED: Reverse sequences, intentional exit timing, maintaining spatial relationships during exit]
-
-## Technical Implementation
-
-### CSS-Only Animation
-
-[TO BE DEVELOPED: @keyframes, animation properties, transitions, transform, pseudo-element animations, hardware acceleration]
-
-### JavaScript Animation
-
-[TO BE DEVELOPED: Web Animations API, requestAnimationFrame, animation libraries (GSAP, Framer Motion, Motion One)]
-
-### Performance Optimization
-
-[TO BE DEVELOPED: GPU acceleration (transform, opacity only), will-change, avoiding layout thrashing, reducing paint, FPS monitoring]
-
-## Motion Design Systems
-
-### Motion Tokens
-
-[TO BE DEVELOPED: Duration scales, easing tokens, named animations, consistent motion vocabulary]
-
-### Reduced Motion
-
-[TO BE DEVELOPED: prefers-reduced-motion, graceful degradation, essential vs decorative animation, crossfade alternatives]
+Create a system for consistency:
+
+```css
+:root {
+ /* Durations */
+ --duration-instant: 100ms;
+ --duration-fast: 200ms;
+ --duration-normal: 300ms;
+ --duration-slow: 500ms;
+
+ /* Easings */
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
+ --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
+ --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
+
+ /* Common patterns */
+ --transition-fade: opacity var(--duration-fast) var(--ease-out);
+ --transition-slide: transform var(--duration-normal) var(--ease-out);
+ --transition-all: var(--duration-normal) var(--ease-out);
+}
+```
---
@@ -591,59 +984,207 @@ Then build or refine a typography system that is:
## Classic Typography Principles
-### Vertical Rhythm & Baseline Grids
+### Vertical Rhythm
+
+The non-obvious insight: your line-height should be the base unit for ALL vertical spacing in your design. If body text has `line-height: 1.5` on `16px` type (= 24px), then spacing values should be multiples of 24px: 24, 48, 72, etc.
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, maintaining rhythm across components]
+This creates subconscious harmony. Text and space feel "right" together because they share a mathematical foundation.
+
+```css
+:root {
+ --baseline: 1.5rem; /* 24px if root is 16px */
+ --space-1: var(--baseline); /* 24px */
+ --space-2: calc(var(--baseline) * 2); /* 48px */
+ --space-half: calc(var(--baseline) / 2); /* 12px */
+}
+```
### Modular Scale & Hierarchy
-[TO BE DEVELOPED: Scale ratios, establishing hierarchy through size/weight/spacing, visual balance]
+The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
+
+**Use fewer sizes with more contrast.** A 5-size system covers most needs:
+
+| Role | Typical Ratio | Use Case |
+|------|---------------|----------|
+| xs | 0.75rem | Captions, legal |
+| sm | 0.875rem | Secondary UI, metadata |
+| base | 1rem | Body text |
+| lg | 1.25-1.5rem | Subheadings, lead text |
+| xl+ | 2-4rem | Headlines, hero text |
+
+Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
### Readability & Measure
-[TO BE DEVELOPED: Line length (45-75 CPL), line height ratios, paragraph spacing, optimal reading conditions]
+Line length (measure) guidelines are well-known (45-75 characters), but the implementation detail matters:
+
+```css
+/* Use ch units for true character-based measure */
+.prose { max-width: 65ch; }
+
+/* Line-height scales inversely with line length */
+.narrow-column { max-width: 45ch; line-height: 1.4; }
+.wide-column { max-width: 75ch; line-height: 1.6; }
+```
+
+**Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05-0.1 to your normal line-height.
## Font Selection & Pairing
### Choosing Distinctive Fonts
-[TO BE DEVELOPED: Avoiding generic choices, character in typefaces, matching tone to content, Google Fonts alternatives]
+**Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal—but if you want distinctive design, look elsewhere.
+
+**Better Google Fonts alternatives**:
+- Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
+- Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
+- Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
+- For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
+
+**System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider this for apps where performance > personality.
### Pairing Principles
-[TO BE DEVELOPED: Contrast-based pairing, display + body, serif + sans, mono + geometric, variable fonts]
+**The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces. Only add a second font when you need genuine contrast (e.g., display headlines + body serif).
+
+When pairing, contrast on multiple axes:
+- Serif + Sans (structure contrast)
+- Geometric + Humanist (personality contrast)
+- Condensed display + Wide body (proportion contrast)
+
+**Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
### Web Font Loading
-[TO BE DEVELOPED: FOUT/FOIT strategies, font-display, subsetting, variable fonts, preloading]
+The layout shift problem: fonts load late, text reflows, and users see content jump. Here's the fix:
+
+```css
+/* 1. Use font-display: swap for visibility */
+@font-face {
+ font-family: 'CustomFont';
+ src: url('font.woff2') format('woff2');
+ font-display: swap;
+}
+
+/* 2. Match fallback metrics to minimize shift */
+@font-face {
+ font-family: 'CustomFont-Fallback';
+ src: local('Arial');
+ size-adjust: 105%; /* Scale to match x-height */
+ ascent-override: 90%; /* Match ascender height */
+ descent-override: 20%; /* Match descender depth */
+ line-gap-override: 10%; /* Match line spacing */
+}
+
+body {
+ font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
+}
+```
+
+Tools like [Fontaine](https://github.com/unjs/fontaine) calculate these overrides automatically.
## Modern Web Typography
-### Fluid & Responsive Type
+### Fluid Type
-[TO BE DEVELOPED: clamp(), viewport units, container query typography, breakpoint-based scales]
+Fluid typography eliminates breakpoint jumps. The formula:
-### Advanced Features
+```css
+/* font-size: clamp(min, preferred, max) */
+h1 { font-size: clamp(2rem, 5vw + 1rem, 4rem); }
+```
-[TO BE DEVELOPED: OpenType features, ligatures, font-feature-settings, kerning, number styles]
+The `5vw + 1rem` creates smooth scaling. Adjust the vw coefficient for faster/slower scaling.
-### Performance Optimization
+**When NOT to use fluid type**:
+- Button text, labels, UI elements (should be consistent, not fluid)
+- Very short text (scaling makes less sense)
+- When you need precise control at specific breakpoints
-[TO BE DEVELOPED: Font loading strategies, subsetting, variable fonts vs static, hosting decisions]
+### OpenType Features
-## Typography System Architecture
+Most developers don't know these exist. Use them for polish:
-### Token Structure
+```css
+/* Tabular numbers for data alignment */
+.data-table { font-variant-numeric: tabular-nums; }
+
+/* Proper fractions */
+.recipe-amount { font-variant-numeric: diagonal-fractions; }
+
+/* Small caps for abbreviations */
+abbr { font-variant-caps: all-small-caps; }
+
+/* Disable ligatures in code */
+code { font-variant-ligatures: none; }
+
+/* Enable kerning (usually on by default, but be explicit) */
+body { font-kerning: normal; }
+```
+
+Check what features your font supports at [Wakamai Fondue](https://wakamaifondue.com/).
-[TO BE DEVELOPED: Font stacks, size scales, weight scales, line heights, letter spacing]
+## Typography System Architecture
-### Implementation
+### Token Structure
-[TO BE DEVELOPED: CSS custom properties, utility classes, semantic vs primitive tokens]
+**Name tokens semantically, not by value**:
+
+```css
+/* Bad: tied to implementation */
+--font-size-16: 1rem;
+--font-size-24: 1.5rem;
+
+/* Good: tied to purpose */
+--font-size-body: 1rem;
+--font-size-heading: 1.5rem;
+```
+
+A complete token set:
+
+```css
+:root {
+ /* Font stacks */
+ --font-sans: 'CustomSans', system-ui, sans-serif;
+ --font-serif: 'CustomSerif', Georgia, serif;
+ --font-mono: 'JetBrains Mono', ui-monospace, monospace;
+
+ /* Size scale (semantic) */
+ --text-xs: 0.75rem;
+ --text-sm: 0.875rem;
+ --text-base: 1rem;
+ --text-lg: 1.25rem;
+ --text-xl: 1.5rem;
+ --text-2xl: 2rem;
+ --text-3xl: 3rem;
+
+ /* Weight */
+ --font-normal: 400;
+ --font-medium: 500;
+ --font-semibold: 600;
+ --font-bold: 700;
+
+ /* Line height */
+ --leading-tight: 1.25;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.75;
+
+ /* Letter spacing */
+ --tracking-tight: -0.02em;
+ --tracking-normal: 0;
+ --tracking-wide: 0.05em;
+}
+```
## Accessibility Considerations
-[TO BE DEVELOPED: Text scaling, contrast ratios, font sizes, dyslexia-friendly choices]
+Beyond contrast ratios (which are well-documented), consider:
+
+- **Never disable zoom**: `user-scalable=no` breaks accessibility. If your layout breaks at 200% zoom, fix the layout.
+- **Use rem/em for font sizes**: This respects user browser settings. Never `px` for body text.
+- **Minimum 16px body text**: Smaller than this strains eyes and fails WCAG on mobile.
+- **Adequate touch targets**: Text links need padding or line-height that creates 44px+ tap targets.
---
@@ -687,115 +1228,240 @@ Then implement interactions that are:
- Forgiving with error prevention and recovery
- Responsive with immediate feedback and state changes
-## Interaction States
+## The Eight Interactive States
+
+Every interactive element needs these states designed:
-### Core States
+| State | When | Visual Treatment |
+|-------|------|------------------|
+| **Default** | At rest | Base styling |
+| **Hover** | Pointer over (not touch) | Subtle lift, color shift |
+| **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
+| **Active** | Being pressed | Pressed in, darker |
+| **Disabled** | Not interactive | Reduced opacity, no pointer |
+| **Loading** | Processing | Spinner, skeleton |
+| **Error** | Invalid state | Red border, icon, message |
+| **Success** | Completed | Green check, confirmation |
-[TO BE DEVELOPED: Default, hover, focus, active, disabled, loading, error, success - visual treatment for each]
+**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states.
-### State Transitions
+## Focus Rings: Do Them Right
-[TO BE DEVELOPED: Smooth state changes, animation between states, maintaining context, preserving user intent]
+**Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users:
-### Loading & Progress States
+```css
+/* Hide focus ring for mouse/touch */
+button:focus {
+ outline: none;
+}
-[TO BE DEVELOPED: Skeleton screens, spinners, progress bars, optimistic updates, what to show while waiting]
+/* Show focus ring for keyboard */
+button:focus-visible {
+ outline: 2px solid var(--color-accent);
+ outline-offset: 2px;
+}
+```
-## Affordances & Feedback
+**Focus ring design**:
+- High contrast (3:1 minimum against adjacent colors)
+- 2-3px thick
+- Offset from element (not inside it)
+- Consistent across all interactive elements
-### Visual Affordances
+## Form Design: The Non-Obvious
-[TO BE DEVELOPED: Signaling interactivity, button appearance, link styling, cursor changes, touch target highlighting]
+### Don't Use Placeholders as Labels
-### Immediate Feedback
+Placeholders disappear when you type. Users forget what the field was for. Screen readers may not announce them.
-[TO BE DEVELOPED: Click/tap acknowledgment, hover feedback, focus indication, "something is happening" signals]
+```html
+<!-- Bad -->
+<input placeholder="Email address">
-### Haptic & Sound Feedback
+<!-- Good -->
+<label for="email">Email address</label>
+<input id="email" type="email" placeholder="[email protected]">
+```
-[TO BE DEVELOPED: Vibration patterns, sound cues, cross-modal feedback, when to use non-visual feedback]
+Use placeholders only for examples or format hints, never as the primary label.
-## Form Design & Input Patterns
+### Validate on Blur, Not on Input
-### Form Layout & Structure
+Real-time validation (validating every keystroke) is annoying. Users can't finish typing before seeing errors.
-[TO BE DEVELOPED: Single column vs multi-column, label placement, field grouping, visual hierarchy in forms]
+```javascript
+// Bad: fires on every keystroke
+input.addEventListener('input', validate);
-### Input Field Design
+// Good: fires when user leaves field
+input.addEventListener('blur', validate);
-[TO BE DEVELOPED: Field sizing, placeholder usage (anti-pattern), helper text, character limits, input masking]
+// Exception: password strength (show progress while typing)
+passwordInput.addEventListener('input', showStrength);
+```
-### Validation Patterns
+### Error Message Placement
-[TO BE DEVELOPED: Inline vs on-submit, real-time validation, error message writing, success confirmation, required field indication]
+Place errors **below** the field (users scan top-down), not above. Keep messages close to the field—not in a summary at the top unless also repeated inline.
-### Complex Input Types
+```html
+<label for="email">Email</label>
+<input id="email" type="email" aria-describedby="email-error">
+<span id="email-error" class="error">Please enter a valid email</span>
+```
-[TO BE DEVELOPED: File upload UX, date pickers, time selection, rich text editing, multi-select, autocomplete, search]
+The `aria-describedby` connects the error to the input for screen readers.
-### Progressive Disclosure in Forms
+## Loading States: Optimistic Updates
-[TO BE DEVELOPED: Conditional fields, wizards/multi-step forms, accordions, showing complexity gradually]
+**Show success immediately, handle failure gracefully.** Users perceive the app as faster.
-### Form Error Handling
+```javascript
+// Optimistic update pattern
+async function toggleLike() {
+ // 1. Update UI immediately
+ setLiked(true);
-[TO BE DEVELOPED: Error prevention (constraints, masks), clear error messages, error recovery, field-level vs form-level errors]
+ try {
+ // 2. Send request
+ await api.like(postId);
+ } catch {
+ // 3. Rollback on failure
+ setLiked(false);
+ showToast('Like failed. Please try again.');
+ }
+}
+```
-## Touch & Pointer Interactions
+**When to use**: Low-stakes actions (likes, follows, small edits). **Not for**: Payments, destructive actions, critical data changes.
-### Touch Targets
+### Skeleton Screens > Spinners
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge reach areas on mobile]
+Spinners say "something is happening" but give no sense of what or how long. Skeletons preview the content shape:
-### Touch vs Pointer Patterns
+```css
+.skeleton {
+ background: linear-gradient(
+ 90deg,
+ var(--gray-200) 25%,
+ var(--gray-100) 50%,
+ var(--gray-200) 75%
+ );
+ background-size: 200% 100%;
+ animation: shimmer 1.5s infinite;
+}
-[TO BE DEVELOPED: Hover states on touch (problems), tap feedback, long press, swipe gestures, pinch-to-zoom]
+@keyframes shimmer {
+ 0% { background-position: 200% 0; }
+ 100% { background-position: -200% 0; }
+}
+```
-### Gesture Design
+## Modals: The Inert Approach
-[TO BE DEVELOPED: Swipe to delete, pull to refresh, drag to reorder, custom gestures, gesture discoverability]
+Focus trapping in modals used to require complex JavaScript. Now use the `inert` attribute:
-## Keyboard Navigation
+```html
+<!-- When modal is open -->
+<main inert>
+ <!-- Content behind modal can't be focused or clicked -->
+</main>
+<dialog open>
+ <h2>Modal Title</h2>
+ <!-- Focus stays inside modal -->
+</dialog>
+```
-### Focus Management
+Or use the native `<dialog>` element:
-[TO BE DEVELOPED: Focus rings (never remove without replacement), logical tab order, skip links, focus trapping in modals]
+```javascript
+const dialog = document.querySelector('dialog');
+dialog.showModal(); // Opens with focus trap, closes on Escape
+```
-### Keyboard Shortcuts
+## The Popover API
-[TO BE DEVELOPED: Common shortcuts, discoverability, avoiding conflicts, command palettes, keyboard-first workflows]
+For tooltips, dropdowns, and non-modal overlays, use native popovers:
-### Accessible Interaction Patterns
+```html
+<button popovertarget="menu">Open menu</button>
+<div id="menu" popover>
+ <button>Option 1</button>
+ <button>Option 2</button>
+</div>
+```
-[TO BE DEVELOPED: ARIA roles for custom controls, managing focus in dynamic content, screen reader announcements]
+**Benefits**: Light-dismiss (click outside closes), proper stacking, no z-index wars, accessible by default.
-## Navigation Patterns
+## Destructive Actions: Undo > Confirm
-### Menu & Navigation Design
+Confirmation dialogs are friction. Users click through them mindlessly. **Undo is better**:
-[TO BE DEVELOPED: Mega menus, hamburger menus, breadcrumbs, tabs, pagination, infinite scroll vs load more]
+```javascript
+async function deleteItem(id) {
+ // 1. Remove from UI immediately
+ hideItem(id);
-### Modal & Dialog Patterns
+ // 2. Show undo toast
+ const toast = showToast('Item deleted', {
+ action: { label: 'Undo', onClick: () => restoreItem(id) },
+ duration: 5000
+ });
-[TO BE DEVELOPED: Modal entry/exit, focus management, escape to close, backdrop click behavior, sheet patterns]
+ // 3. Actually delete after toast expires
+ toast.onClose(() => api.delete(id));
+}
+```
-### Command & Context Menus
+**When to still use confirmation**: Irreversible actions (account deletion), high-cost actions (large purchases), batch operations on many items.
+
+## Keyboard Navigation Patterns
+
+### Roving Tabindex
+
+For component groups (tabs, menu items, radio groups), one item is tabbable; arrow keys move within:
-[TO BE DEVELOPED: Right-click menus, command palettes, dropdown menus, action sheets]
+```html
+<div role="tablist">
+ <button role="tab" tabindex="0">Tab 1</button>
+ <button role="tab" tabindex="-1">Tab 2</button>
+ <button role="tab" tabindex="-1">Tab 3</button>
+</div>
+```
-## Error Prevention & Recovery
+Arrow keys move `tabindex="0"` between items. Tab moves to the next component entirely.
-### Constraints & Guards
+### Skip Links
-[TO BE DEVELOPED: Input constraints, disabled states, confirmation dialogs for destructive actions, undo mechanisms]
+For keyboard users, provide a skip link to jump past navigation:
-### Error Messages
+```html
+<a href="#main-content" class="skip-link">Skip to main content</a>
+<nav>...</nav>
+<main id="main-content">...</main>
+```
-[TO BE DEVELOPED: Clear language, actionable guidance, positive framing, where to show errors, when to show errors]
+```css
+.skip-link {
+ position: absolute;
+ left: -9999px;
+}
+.skip-link:focus {
+ left: 0;
+ z-index: 9999;
+ /* Visible styling */
+}
+```
-### Undo & Redo
+## Gesture Discoverability
-[TO BE DEVELOPED: Undo patterns, toast notifications with undo, versioning, draft auto-save]
+Swipe-to-delete and similar gestures are invisible. Hint at their existence:
+
+- **Partially reveal**: Show delete button peeking from edge
+- **Onboarding**: Coach marks on first use
+- **Alternative**: Always provide a visible fallback (menu with "Delete")
+
+Don't rely on gestures as the only way to perform actions.
---
@@ -841,75 +1507,185 @@ Then build a color system that is:
- Flexible enough for theming and variations
- Aesthetically cohesive and on-brand
-## Color Theory Fundamentals
+## Color Spaces: Use OKLCH
-### Color Harmony & Relationships
+**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
-[TO BE DEVELOPED: Complementary, analogous, triadic, split-complementary, monochromatic schemes, color wheel navigation]
+```css
+/* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */
+--color-primary: oklch(60% 0.15 250); /* Blue */
+--color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */
+--color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */
+```
-### Color Psychology & Meaning
+**Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish. A light blue at 85% lightness needs ~0.08 chroma, not the 0.15 of your base color.
-[TO BE DEVELOPED: Emotional associations, cultural considerations, industry conventions, semantic color choices]
+## Building Functional Palettes
-### Color Properties
+### The Tinted Neutral Trap
-[TO BE DEVELOPED: Hue, saturation, lightness/brightness, HSL vs RGB vs LCH, perceptual uniformity]
+**Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals:
-## Building Functional Palettes
+```css
+/* Dead grays */
+--gray-100: oklch(95% 0 0); /* No personality */
+--gray-900: oklch(15% 0 0);
+
+/* Warm-tinted grays (add brand warmth) */
+--gray-100: oklch(95% 0.01 60); /* Hint of warmth */
+--gray-900: oklch(15% 0.01 60);
+
+/* Cool-tinted grays (tech, professional) */
+--gray-100: oklch(95% 0.01 250); /* Hint of blue */
+--gray-900: oklch(15% 0.01 250);
+```
+
+The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI.
### Palette Structure
-[TO BE DEVELOPED: Primary/secondary/tertiary, neutral scales (9-11 steps), semantic colors, state colors]
+A complete system needs:
-### Generating Color Scales
+| Role | Purpose | Example |
+|------|---------|---------|
+| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
+| **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
+| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
+| **Surface** | Cards, modals, overlays | 2-3 elevation levels |
-[TO BE DEVELOPED: Lightness curves, saturation shifts, hue rotation, perceptual uniformity, algorithmic generation]
+**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
-### The Dominant Color Principle
+### The 60-30-10 Rule (Applied Correctly)
-[TO BE DEVELOPED: 60-30-10 rule, accent color strategy, visual weight distribution, avoiding rainbow vomit]
+This rule is about **visual weight**, not pixel count:
+
+- **60%**: Neutral backgrounds, white space, base surfaces
+- **30%**: Secondary colors—text, borders, inactive states
+- **10%**: Accent—CTAs, highlights, focus states
+
+The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power.
## Contrast & Accessibility
-### WCAG Compliance
+### WCAG Requirements
+
+| Content Type | AA Minimum | AAA Target |
+|--------------|------------|------------|
+| Body text | 4.5:1 | 7:1 |
+| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
+| UI components, icons | 3:1 | 4.5:1 |
+| Non-essential decorations | None | None |
+
+**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG.
+
+### Dangerous Color Combinations
+
+These commonly fail contrast or cause readability issues:
+
+- Light gray text on white (the #1 accessibility fail)
+- **Gray text on any colored background**—gray looks washed out and dead on color. Use a tinted version of the background color instead, or transparency
+- Red text on green background (or vice versa)—8% of men can't distinguish these
+- Blue text on red background (vibrates visually)
+- Yellow text on white (almost always fails)
+- Thin light text on images (unpredictable contrast)
+
+### Never Use Pure Gray or Pure Black
+
+Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. They look uncanny and lifeless.
-[TO BE DEVELOPED: AA vs AAA standards, text contrast ratios (4.5:1 / 7:1), UI component contrast (3:1), large text exceptions]
+```css
+/* Dead and artificial */
+--gray: oklch(50% 0 0);
+--black: oklch(0% 0 0);
-### Testing & Tools
+/* Natural and warm */
+--gray: oklch(50% 0.01 60); /* Warm gray */
+--black: oklch(12% 0.01 250); /* Very dark blue-gray */
+```
-[TO BE DEVELOPED: Contrast checkers, automated testing, color blindness simulation, tools for verification]
+Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted.
-### Accessible Color Combinations
+### Testing
-[TO BE DEVELOPED: Which combinations work, which don't, safe pairings, dangerous pairings, contrast matrices]
+Don't trust your eyes. Use tools:
-## Theming Architecture
+- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
+- Browser DevTools → Rendering → Emulate vision deficiencies
+- [Polypane](https://polypane.app/) for real-time testing
-### Light & Dark Mode
+## Theming: Light & Dark Mode
-[TO BE DEVELOPED: Independent palettes vs inverted, neutral strategies, shadows in dark mode, image handling]
+### Dark Mode Is Not Inverted Light Mode
-### CSS Custom Properties
+You can't just swap colors. Dark mode requires different design decisions:
-[TO BE DEVELOPED: Token hierarchy (primitive → semantic → component), naming conventions, theme switching]
+| Light Mode | Dark Mode |
+|------------|-----------|
+| Shadows for depth | Lighter surfaces for depth (no shadows) |
+| Dark text on light | Light text on dark (reduce font weight) |
+| Vibrant accents | Desaturate accents slightly |
+| White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
-### Multi-Theme Systems
+```css
+/* Dark mode depth via surface color, not shadow */
+:root[data-theme="dark"] {
+ --surface-1: oklch(15% 0.01 250);
+ --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */
+ --surface-3: oklch(25% 0.01 250);
-[TO BE DEVELOPED: Brand themes, user preference themes, contextual themes, theme inheritance]
+ /* Reduce text weight slightly */
+ --body-weight: 350; /* Instead of 400 */
+}
+```
-## Advanced Color Techniques
+### Token Hierarchy
-### Gradients & Effects
+Use two layers of abstraction:
-[TO BE DEVELOPED: Mesh gradients, color stops, blend modes, gradient generation, overlay techniques]
+```css
+/* Layer 1: Primitive tokens (rarely use directly) */
+--blue-500: oklch(55% 0.2 250);
+--blue-600: oklch(45% 0.2 250);
-### Transparency & Alpha
+/* Layer 2: Semantic tokens (use these) */
+--color-primary: var(--blue-500);
+--color-primary-hover: var(--blue-600);
+--color-text: var(--gray-900);
+--color-text-muted: var(--gray-600);
+--color-border: var(--gray-200);
+--color-surface: var(--white);
+```
-[TO BE DEVELOPED: Alpha channels, overlay strategies, transparency scales, backdrop effects]
+**For dark mode, only redefine the semantic layer:**
-### Dynamic Color
+```css
+:root[data-theme="dark"] {
+ --color-primary: var(--blue-400); /* Lighter in dark mode */
+ --color-text: var(--gray-100);
+ --color-surface: var(--gray-900);
+}
+```
-[TO BE DEVELOPED: State-based color changes, hover darkening/lightening, interactive color feedback]
+## Alpha Is A Design Smell
+
+If you're using lots of transparency (rgba, hsla), your palette is probably incomplete. Alpha creates:
+- Unpredictable contrast (depends on what's behind it)
+- Performance overhead (compositing)
+- Inconsistency across contexts
+
+**Instead**: Define explicit overlay colors:
+
+```css
+/* Bad: unpredictable */
+--overlay: rgba(0, 0, 0, 0.5);
+
+/* Good: explicit colors for each context */
+--overlay-on-light: oklch(40% 0 0);
+--overlay-on-dark: oklch(70% 0 0);
+--overlay-on-image: oklch(20% 0 0 / 60%); /* Alpha only when necessary */
+```
+
+The exception: Focus rings and interactive states where you need to see through to the element beneath.
---
@@ -955,119 +1731,237 @@ Then build responsive systems that are:
- Performant on constrained devices
- Contextually appropriate
-## Mobile-First Methodology
-
-### Why Mobile-First
-
-[TO BE DEVELOPED: Progressive enhancement, performance benefits, forces priority decisions, mobile usage dominance]
+## Mobile-First: Write It Right
-### Mobile-First Implementation
+Start with base styles for mobile, then layer complexity:
-[TO BE DEVELOPED: Start with mobile styles, add complexity with min-width media queries, content-first approach]
+```css
+/* Base: mobile */
+.nav {
+ display: flex;
+ flex-direction: column;
+}
-## Breakpoint Strategies
+/* Enhancement: tablet and up */
+@media (min-width: 768px) {
+ .nav {
+ flex-direction: row;
+ }
+}
+```
-### Choosing Breakpoints
+**The mistake**: Writing desktop-first (max-width queries) means mobile loads desktop styles first, then overrides. Wasteful and error-prone.
-[TO BE DEVELOPED: Content-driven vs device-driven, common breakpoint values, in-between states, avoiding too many breakpoints]
+## Breakpoints: Content-Driven, Not Device-Driven
-### Breakpoint Architecture
+**Don't chase device sizes.** iPhones change, Android varies wildly, tablets overlap with laptops. Instead, let content tell you where to break:
-[TO BE DEVELOPED: Named breakpoints, breakpoint tokens, consistent usage across codebase]
+1. Start narrow
+2. Stretch the viewport until the design breaks
+3. Add a breakpoint there
-## Fluid & Adaptive Design
+Common content-driven breakpoints (as starting points):
-### Fluid Typography
+```css
+:root {
+ --bp-sm: 640px; /* Larger phones, small content changes */
+ --bp-md: 768px; /* Tablets, significant reflow */
+ --bp-lg: 1024px; /* Laptops, multi-column */
+ --bp-xl: 1280px; /* Desktops, max content width */
+}
+```
-[TO BE DEVELOPED: clamp(), viewport units, fluid type scales, maintaining readability]
+**Three breakpoints usually suffice.** If you have more than five, you're probably over-engineering.
-### Fluid Spacing
-
-[TO BE DEVELOPED: Responsive spacing scales, container-relative spacing, clamp() for margins/padding]
-
-### Fluid Layouts
-
-[TO BE DEVELOPED: CSS Grid auto-fit/auto-fill, flexible columns, aspect-ratio, fluid containers]
+## Fluid Design: The Clamp Formula
-### Container Queries
-
-[TO BE DEVELOPED: Component-level responsiveness, when to use vs media queries, polyfills]
-
-## Layout Adaptation Patterns
+`clamp(min, preferred, max)` creates fluid values without media queries.
-### Navigation Patterns
+### The Formula
-[TO BE DEVELOPED: Mobile hamburger/drawer, tablet side panel, desktop persistent nav, bottom nav bars]
+```css
+/* Font size: 16px min, scales with viewport, 24px max */
+font-size: clamp(1rem, 0.5rem + 2vw, 1.5rem);
+```
-### Content Reflow
+**How to calculate the preferred value**: The middle value determines the scaling rate. Higher vw coefficient = faster scaling:
-[TO BE DEVELOPED: Single column → multi-column, stacking orders, priority content first]
+- `1vw` = gentle scaling
+- `2-3vw` = moderate scaling
+- `4vw+` = aggressive scaling
-### Component Adaptation
+Add a rem offset to shift the baseline: `0.5rem + 2vw` ensures it doesn't collapse to 0 on small screens.
-[TO BE DEVELOPED: Tabs → accordion, horizontal → vertical, show/hide patterns, progressive disclosure]
-
-## Touch vs Pointer Optimization
-
-### Touch Target Sizing
-
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge cases]
-
-### Touch-Specific Interactions
-
-[TO BE DEVELOPED: Swipe gestures, pull-to-refresh, long press, avoiding hover-dependent patterns]
-
-### Hybrid Devices
-
-[TO BE DEVELOPED: Supporting both touch and pointer, feature detection, adaptive interfaces]
-
-## Viewport & Screen Considerations
-
-### Viewport Meta Tag
-
-[TO BE DEVELOPED: Proper viewport configuration, zoom control, initial scale]
+### Fluid Spacing
-### Safe Areas
+```css
+:root {
+ --space-lg: clamp(2rem, 1rem + 3vw, 4rem);
+ --container-padding: clamp(1rem, 5vw, 4rem);
+}
+```
+
+This creates breathing room that naturally expands on larger screens.
+
+## Detect Input Method, Not Just Screen Size
+
+**Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard—use pointer and hover queries:
+
+```css
+/* Fine pointer (mouse, trackpad) */
+@media (pointer: fine) {
+ .button { padding: 8px 16px; }
+}
+
+/* Coarse pointer (touch, stylus) */
+@media (pointer: coarse) {
+ .button { padding: 12px 20px; } /* Larger touch target */
+}
+
+/* Device supports hover */
+@media (hover: hover) {
+ .card:hover { transform: translateY(-2px); }
+}
+
+/* Device doesn't support hover (touch) */
+@media (hover: none) {
+ .card { /* No hover state - use active instead */ }
+}
+```
+
+**Critical**: Don't rely on hover for functionality. Touch users can't hover.
+
+## Safe Areas: Handle the Notch
+
+Modern phones have notches, rounded corners, and home indicators. Use `env()`:
+
+```css
+body {
+ padding-top: env(safe-area-inset-top);
+ padding-bottom: env(safe-area-inset-bottom);
+ padding-left: env(safe-area-inset-left);
+ padding-right: env(safe-area-inset-right);
+}
+
+/* With fallback */
+.footer {
+ padding-bottom: max(1rem, env(safe-area-inset-bottom));
+}
+```
+
+**Enable viewport-fit** in your meta tag:
+```html
+<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
+```
+
+## Responsive Images: Get It Right
+
+### srcset with Width Descriptors
+
+```html
+<img
+ src="hero-800.jpg"
+ srcset="
+ hero-400.jpg 400w,
+ hero-800.jpg 800w,
+ hero-1200.jpg 1200w
+ "
+ sizes="(max-width: 768px) 100vw, 50vw"
+ alt="Hero image"
+>
+```
+
+**How it works**:
+- `srcset` lists available images with their actual widths (`w` descriptors)
+- `sizes` tells the browser how wide the image will display
+- Browser picks the best file based on viewport width AND device pixel ratio
+
+### Picture Element for Art Direction
+
+When you need different crops/compositions (not just resolutions):
+
+```html
+<picture>
+ <source media="(min-width: 768px)" srcset="wide.jpg">
+ <source media="(max-width: 767px)" srcset="tall.jpg">
+ <img src="fallback.jpg" alt="...">
+</picture>
+```
-[TO BE DEVELOPED: iPhone notch, rounded corners, system UI insets, padding for safe areas]
+## Layout Adaptation Patterns
-### Orientation Handling
+### Navigation: The Three-Stage Pattern
-[TO BE DEVELOPED: Portrait vs landscape, orientation-specific layouts, testing both orientations]
+```css
+/* Mobile: hamburger icon + drawer */
+.nav-menu { display: none; }
+.nav-toggle { display: block; }
-### High-DPI Screens
+/* Tablet: horizontal but compact */
+@media (min-width: 768px) {
+ .nav-menu { display: flex; }
+ .nav-toggle { display: none; }
+}
-[TO BE DEVELOPED: Retina images, 2x/3x assets, SVG for icons, responsive images]
+/* Desktop: full navigation with labels */
+@media (min-width: 1024px) {
+ .nav-item-label { display: inline; }
+}
+```
-## Responsive Images & Media
+### Table to Cards
-### Responsive Images
+Tables work on desktop, fail on mobile. Transform:
-[TO BE DEVELOPED: srcset, sizes, picture element, art direction, lazy loading]
+```css
+@media (max-width: 768px) {
+ table, thead, tbody, th, td, tr {
+ display: block;
+ }
-### Video Adaptation
+ thead { display: none; } /* Hide headers */
-[TO BE DEVELOPED: Responsive video embeds, bandwidth considerations, poster images]
+ tr {
+ margin-bottom: 1rem;
+ border: 1px solid var(--border);
+ padding: 1rem;
+ }
-## Performance on Mobile
+ td::before {
+ content: attr(data-label); /* Add labels via data attribute */
+ font-weight: 600;
+ display: block;
+ }
+}
+```
-### Mobile Performance Budget
+### Progressive Disclosure
-[TO BE DEVELOPED: Constrained CPU/memory, slow connections, battery concerns]
+Not everything needs to show on mobile:
-### Loading Strategies
+```css
+/* Show summary on mobile */
+.details-content { display: none; }
-[TO BE DEVELOPED: Critical path optimization, lazy loading, code splitting for mobile]
+@media (min-width: 768px) {
+ /* Expand on desktop */
+ .details-content { display: block; }
+}
+```
-## Testing Strategies
+Combine with `<details>/<summary>` for interactive expansion on mobile.
-### Device Testing
+## Testing: Don't Trust DevTools Alone
-[TO BE DEVELOPED: Real device testing, browser DevTools, emulators, viewport testing]
+DevTools device emulation is useful for layout but misses:
-### Testing Checklist
+- Actual touch interactions
+- Real CPU/memory constraints
+- Network latency patterns
+- Font rendering differences
+- Browser chrome/keyboard appearances
-[TO BE DEVELOPED: Different viewports, orientations, input methods, connection speeds]
+**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
---
diff --git a/public/app.js b/public/app.js
index 8bba49dbe..abc45c980 100644
--- a/public/app.js
+++ b/public/app.js
@@ -1,101 +1,64 @@
+// ============================================
+// MAIN APP - Entry point and orchestration
+// ============================================
+
import {
- initGlassTerminal,
- renderTerminalLayout,
-} from "./js/components/glass-terminal.js";
-import { initLensEffect } from "./js/components/lens.js";
-import { initFrameworkViz } from "./js/components/framework-viz.js";
-import { initHeroEffect } from "./js/effects/liquid-canvas.js";
-import { initScrollReveal } from "./js/utils/reveal.js";
-import { initScrollIndicator, initSmoothScroll, initHashTracking } from "./js/utils/scroll.js";
+ filterCommands,
+ renderCommandsGrid,
+ renderWorkflowDiagram,
+ selectCommand,
+ setupCategoryTabs,
+} from "./js/commands.js";
+import { renderSkillsNav, selectSkill } from "./js/skills.js";
// ============================================
// STATE
// ============================================
+let allSkills = [];
let allCommands = [];
// ============================================
-// CONTENT LOADING
+// INITIALIZATION
// ============================================
async function loadContent() {
try {
- const [commandsRes, patternsRes] = await Promise.all([
+ const [skillsRes, commandsRes] = await Promise.all([
+ fetch("/api/skills"),
fetch("/api/commands"),
- fetch("/api/patterns"),
]);
+ allSkills = await skillsRes.json();
allCommands = await commandsRes.json();
- const patternsData = await patternsRes.json();
- // Render commands (Glass Terminal)
- renderTerminalLayout(allCommands);
+ // Render skills
+ renderSkillsNav(allSkills, (skill) => selectSkill(skill, allSkills));
- // Render patterns with tabbed navigation
- renderPatternsWithTabs(patternsData.patterns, patternsData.antipatterns);
+ // Render commands
+ renderWorkflowDiagram(allCommands, (cmd) =>
+ selectCommand(cmd, allCommands),
+ );
+ renderCommandsGrid(allCommands, (cmd) => selectCommand(cmd, allCommands));
+ setupCategoryTabs(filterCommands);
+
+ // Select first items by default
+ if (allSkills.length > 0) selectSkill(allSkills[0], allSkills);
+ if (allCommands.length > 0) selectCommand(allCommands[0], allCommands);
} catch (error) {
console.error("Failed to load content:", error);
}
}
-function renderPatternsWithTabs(patterns, antipatterns) {
- const container = document.getElementById("patterns-categories");
- if (!container || !patterns || !antipatterns) return;
-
- // Create a map of antipatterns by category name
- const antipatternMap = {};
- antipatterns.forEach(cat => {
- antipatternMap[cat.name] = cat.items;
- });
+// ============================================
+// UTILITIES
+// ============================================
- // Build tabs
- const tabsHTML = patterns
- .map((category, i) => `<button class="pattern-tab${i === 0 ? ' active' : ''}" data-tab="${category.name}">${category.name}</button>`)
- .join("");
-
- // Build panels
- const panelsHTML = patterns
- .map((category, i) => {
- const antiItems = antipatternMap[category.name] || [];
- return `
- <div class="pattern-panel${i === 0 ? ' active' : ''}" data-panel="${category.name}">
- <div class="pattern-columns">
- <div class="pattern-column pattern-column--anti">
- <span class="pattern-column-label">Don't</span>
- <ul class="pattern-list">
- ${antiItems.map((item) => `<li class="pattern-item pattern-item--anti">${item}</li>`).join("")}
- </ul>
- </div>
- <div class="pattern-column pattern-column--do">
- <span class="pattern-column-label">Do</span>
- <ul class="pattern-list">
- ${category.items.map((item) => `<li class="pattern-item pattern-item--do">${item}</li>`).join("")}
- </ul>
- </div>
- </div>
- </div>
- `;
- })
- .join("");
-
- container.innerHTML = `
- <div class="pattern-tabs">${tabsHTML}</div>
- <div class="pattern-panels">${panelsHTML}</div>
- `;
-
- // Tab click handling
- container.querySelectorAll('.pattern-tab').forEach(tab => {
- tab.addEventListener('click', () => {
- const tabName = tab.dataset.tab;
-
- // Update active tab
- container.querySelectorAll('.pattern-tab').forEach(t => t.classList.remove('active'));
- tab.classList.add('active');
-
- // Update active panel
- container.querySelectorAll('.pattern-panel').forEach(p => p.classList.remove('active'));
- container.querySelector(`[data-panel="${tabName}"]`).classList.add('active');
- });
+function animateIn() {
+ const elements = document.querySelectorAll("[data-animate]:not(.animated)");
+ elements.forEach((el, i) => {
+ el.style.animationDelay = `${i * 0.05}s`;
+ el.classList.add("animated");
});
}
@@ -116,22 +79,13 @@ document.addEventListener("click", (e) => {
// STARTUP
// ============================================
-function init() {
- initSmoothScroll();
- initScrollIndicator();
- initHashTracking();
- initHeroEffect();
- initLensEffect();
- initScrollReveal();
- initGlassTerminal();
- initFrameworkViz();
- loadContent();
-
- document.body.classList.add("loaded");
-}
-
if (document.readyState === "loading") {
- document.addEventListener("DOMContentLoaded", init);
+ document.addEventListener("DOMContentLoaded", loadContent);
} else {
- init();
+ loadContent();
}
+window.addEventListener("load", () => {
+ document.body.classList.add("loaded");
+ animateIn();
+});
+
diff --git a/public/css/main.css b/public/css/main.css
index ca36ec8af..c133c3d5c 100644
--- a/public/css/main.css
+++ b/public/css/main.css
@@ -1,14 +1,16 @@
/*
- * impeccable.style — Renaissance Redesign
+ * impeccable.style — Tailwind CSS v4 + Custom Components
*
- * Editorial precision meets fluid motion.
- * Light, high-contrast, typographically bold.
+ * Architecture:
+ * - Tailwind v4 with custom theme tokens
+ * - Custom components for complex UI patterns
+ * - Minimal CSS for what Tailwind can't express
*/
@import "tailwindcss";
/* ============================================
- TAILWIND THEME - Design Tokens
+ TAILWIND THEME - Static Design Tokens
============================================ */
@theme {
@@ -27,14 +29,13 @@
--spacing-3xl: 192px;
/* Width */
- --width-max: 1400px;
- --width-content: 900px;
+ --width-max: 1280px;
+ --width-content: 840px;
/* Animation */
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
- --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
- --duration-fast: 0.15s;
+ --duration-fast: 0.2s;
--duration-base: 0.3s;
--duration-slow: 0.6s;
--duration-slower: 0.8s;
@@ -42,43 +43,33 @@
}
/* ============================================
- COLOR TOKENS - Renaissance Palette
+ COLOR TOKENS - Light/Dark Mode via CSS
============================================ */
:root {
- /* Core Colors - Light Mode */
+ /* Colors - Light Mode */
--color-ink: oklch(10% 0 0);
- --color-text: oklch(10% 0 0);
--color-paper: oklch(98% 0 0);
- --color-cream: oklch(96% 0.005 350);
--color-charcoal: oklch(25% 0 0);
--color-ash: oklch(55% 0 0);
--color-mist: oklch(92% 0 0);
--color-bg: oklch(96% 0.005 350);
-
- /* Accent - Vibrant Magenta/Rose (original) */
--color-accent: oklch(60% 0.25 350);
--color-accent-hover: oklch(52% 0.25 350);
--color-accent-dim: oklch(60% 0.25 350 / 0.15);
- --color-accent-soft: oklch(60% 0.25 350 / 0.25);
}
/* Dark Mode */
@media (prefers-color-scheme: dark) {
:root {
--color-ink: oklch(98% 0 0);
- --color-text: oklch(98% 0 0);
--color-paper: oklch(10% 0 0);
- --color-cream: oklch(12% 0.005 350);
--color-charcoal: oklch(92% 0 0);
--color-ash: oklch(65% 0 0);
--color-mist: oklch(20% 0 0);
--color-bg: oklch(12% 0.005 350);
-
--color-accent: oklch(68% 0.23 350);
--color-accent-hover: oklch(76% 0.23 350);
- --color-accent-dim: oklch(68% 0.23 350 / 0.15);
- --color-accent-soft: oklch(68% 0.23 350 / 0.25);
}
}
@@ -86,1480 +77,299 @@
BASE STYLES
============================================ */
-* {
- box-sizing: border-box;
-}
-
html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
- scroll-behavior: smooth;
-}
-
-html.lenis, html.lenis body {
- height: auto;
-}
-
-.lenis.lenis-smooth {
- scroll-behavior: auto !important;
-}
-
-.lenis.lenis-smooth [data-lenis-prevent] {
- overscroll-behavior: contain;
-}
-
-.lenis.lenis-stopped {
- overflow: hidden;
}
body {
font-family: var(--font-body);
- font-size: 16px;
- line-height: 1.6;
- color: var(--color-text);
+ color: var(--color-ink);
background: var(--color-paper);
- overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-display);
- font-weight: 400;
+ font-weight: 600;
line-height: 1.1;
letter-spacing: -0.02em;
- color: var(--color-ink);
}
a {
color: var(--color-accent);
text-decoration: none;
- transition: color var(--duration-fast) var(--ease-out);
+ transition: opacity var(--duration-fast) var(--ease-out);
}
a:hover {
- color: var(--color-accent-hover);
+ opacity: 0.7;
}
-strong {
- font-weight: 600;
- color: var(--color-ink);
-}
+/* ============================================
+ SECTION TITLE - With accent underline
+ ============================================ */
-code {
- font-family: var(--font-mono);
- font-size: 0.9em;
- padding: 0.15em 0.4em;
- background: var(--color-accent-dim);
- color: var(--color-accent);
- border-radius: 4px;
+.section-title {
+ font-size: clamp(2rem, 4vw, 3rem);
+ font-weight: 600;
+ position: relative;
+ display: block;
+ padding-bottom: var(--spacing-sm);
}
-::selection {
- background: var(--color-accent-soft);
- color: var(--color-ink);
+.section-title::after {
+ content: '';
+ position: absolute;
+ bottom: -0.25em;
+ left: 0;
+ width: 80px;
+ height: 2px;
+ background: var(--color-accent);
}
/* ============================================
- GRAIN OVERLAY
+ BACKGROUND ATMOSPHERE
============================================ */
-.grain-overlay {
+body::before {
+ content: '';
position: fixed;
inset: 0;
+ background:
+ radial-gradient(circle at 20% 30%, var(--color-accent-dim) 0%, transparent 50%),
+ radial-gradient(circle at 80% 70%, var(--color-accent-dim) 0%, transparent 50%);
+ opacity: 0;
+ z-index: -1;
+ animation: fadeInBg var(--duration-slowest) var(--ease-out) 0.3s forwards;
pointer-events: none;
- z-index: 9999;
- opacity: 0.03;
- background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
- background-repeat: repeat;
-}
-
-/* ============================================
- LAYOUT
- ============================================ */
-
-.site-content {
- max-width: var(--width-max);
- margin: 0 auto;
- padding: 0 var(--spacing-lg);
-}
-
-@media (max-width: 768px) {
- .site-content {
- padding: 0 var(--spacing-md);
- }
}
/* ============================================
- SECTION HEADERS
+ HERO DECORATIONS
============================================ */
-.section-header {
- margin-bottom: var(--spacing-xl);
- position: relative;
-}
-
-.section-number {
- display: block;
- font-family: var(--font-mono);
- font-size: 0.75rem;
- font-weight: 500;
- letter-spacing: 0.1em;
- color: var(--color-accent);
- margin-bottom: var(--spacing-sm);
- text-transform: uppercase;
-}
-
-.section-title {
- font-size: clamp(2.5rem, 6vw, 4.5rem);
- font-weight: 300;
- line-height: 1;
- margin: 0;
- position: relative;
-}
-
-.section-title::after {
- content: '';
+.deco-line {
position: absolute;
- bottom: -0.3em;
- left: 0;
- width: 60px;
+ width: 160px;
height: 2px;
background: var(--color-accent);
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) rotate(-25deg);
+ animation: expandLine 1s var(--ease-out) 0.6s both;
}
-.section-subtitle {
- font-size: 1.125rem;
- color: var(--color-ash);
- margin-top: var(--spacing-md);
- max-width: 50ch;
-}
-
-.section-lead {
- font-size: clamp(1.125rem, 2.5vw, 1.5rem);
- line-height: 1.5;
- color: var(--color-charcoal);
- max-width: 55ch;
- margin-bottom: var(--spacing-xl);
+.deco-circle {
+ position: absolute;
+ width: 120px;
+ height: 120px;
+ border: 2px solid var(--color-accent);
+ border-radius: 50%;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ animation: drawCircle 1s var(--ease-out) 0.8s both;
+ opacity: 0.3;
}
/* ============================================
- HERO SECTION
+ BUTTONS
============================================ */
-.hero-section {
- min-height: 100vh;
- /* Use dynamic viewport height for mobile browsers */
- min-height: 100dvh;
- display: flex;
- flex-direction: column;
- justify-content: center;
+.btn {
+ display: inline-flex;
align-items: center;
+ justify-content: center;
+ padding: 0.875rem 2rem;
+ font-family: var(--font-body);
+ font-size: 0.9375rem;
+ font-weight: 600;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ border: none;
+ cursor: pointer;
+ transition: all var(--duration-base) var(--ease-out);
position: relative;
overflow: hidden;
- padding: var(--spacing-2xl) var(--spacing-lg);
+ text-decoration: none;
}
-.hero-canvas {
- position: absolute;
- inset: 0;
+.btn-primary {
+ background: var(--color-accent);
+ color: var(--color-paper);
width: 100%;
- height: 100%;
- pointer-events: none;
- opacity: 0.4;
-}
-
-.hero-container {
position: relative;
z-index: 1;
- text-align: center;
- max-width: 900px;
-}
-
-.hero-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: var(--spacing-md);
}
-.hero-eyebrow {
- font-family: var(--font-mono);
- font-size: 0.8125rem;
- font-weight: 500;
- letter-spacing: 0.15em;
- text-transform: uppercase;
- color: var(--color-accent);
- /* Animation handled by JS reveal.js */
+.btn-primary::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: var(--color-ink);
+ transform: translateY(100%);
+ transition: transform var(--duration-base) var(--ease-out);
+ z-index: -1;
}
-.hero-title {
- font-size: clamp(4rem, 15vw, 12rem);
- font-weight: 300;
- line-height: 0.9;
- letter-spacing: -0.04em;
- margin: var(--spacing-md) 0;
- display: flex;
- flex-direction: column;
+.btn-primary:hover::before {
+ transform: translateY(0);
}
-.hero-title-line {
- display: block;
+.btn-secondary {
+ background: transparent;
+ color: var(--color-ink);
+ border: 1px solid var(--color-ink);
}
-.hero-title-accent {
- font-style: italic;
- color: var(--color-accent);
+.btn-secondary:hover {
+ background: var(--color-ink);
+ color: var(--color-paper);
}
-.hero-subtitle {
- font-size: clamp(1rem, 2.5vw, 1.375rem);
- color: var(--color-charcoal);
- max-width: 45ch;
- line-height: 1.5;
-}
+/* ============================================
+ CARD COMPONENTS
+ ============================================ */
-.hero-cta {
+.card-inner {
+ height: 100%;
+ padding: var(--spacing-lg);
+ background: var(--color-paper);
+ border: 1px solid var(--color-mist);
display: flex;
flex-direction: column;
- align-items: center;
gap: var(--spacing-md);
- margin-top: var(--spacing-lg);
-}
-
-.hero-providers {
- font-size: 0.8125rem;
- color: var(--color-ash);
- letter-spacing: 0.03em;
-}
-
-.hero-scroll-indicator {
- position: absolute;
- bottom: var(--spacing-lg);
- left: 50%;
- transform: translateX(-50%);
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: var(--spacing-xs);
- color: var(--color-ash);
- font-size: 0.6875rem;
- font-weight: 500;
- letter-spacing: 0.1em;
- text-transform: uppercase;
- opacity: 0;
- /* Restore simple CSS animation */
- animation: fadeIn 1s var(--ease-out) 1.5s forwards, float 2s ease-in-out infinite 2s;
-}
-
-/* Removed .revealed dependency for scroll indicator */
-
-.hero-scroll-indicator svg {
- /* No separate bounce animation needed, handled by float */
-}
-
-/* ============================================
- PROBLEM SECTION - Clarity Lens
- ============================================ */
-
-.problem-section {
- padding: var(--spacing-2xl) 0;
- border-top: 1px solid var(--color-mist);
-}
-
-.problem-content {
- display: grid;
- gap: var(--spacing-xl);
-}
-
-/* Split Screen Comparison */
-.split-comparison {
- position: relative;
- width: 100%;
- max-width: 600px;
- margin: 0 auto;
-}
-
-.split-container {
+ transition: all var(--duration-base) var(--ease-out);
position: relative;
- width: 100%;
- max-width: 500px;
- height: 380px;
- margin: 0 auto;
- border-radius: 12px;
overflow: hidden;
- background: var(--color-cream);
- border: 1px solid var(--color-mist);
- cursor: ew-resize;
- user-select: none;
}
-.split-before,
-.split-after {
+.card-inner::before {
+ content: '';
position: absolute;
- inset: 0;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.split-before {
- z-index: 1;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 2px;
+ background: var(--color-accent);
+ transform: translateX(-100%);
+ transition: transform 0.4s var(--ease-out);
}
-.split-after {
- /* Angled clip-path matching divider's skewX(-10deg): top-right, bottom-left */
- clip-path: polygon(78% 0%, 100% 0%, 100% 100%, 62% 100%);
- z-index: 2;
- background: var(--color-paper);
+.card-inner:hover {
+ border-color: var(--color-accent);
+ transform: translateY(-4px);
}
-.split-divider {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 70%;
- width: 3px;
- background: var(--color-accent);
- transform: translateX(-50%) skewX(-10deg);
- pointer-events: none;
- z-index: 3;
- box-shadow: 0 0 20px rgba(0,0,0,0.15);
+.card-inner:hover::before {
+ transform: translateX(0);
}
-.split-label {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) skewX(10deg);
- font-size: 0.6875rem;
- font-weight: 600;
- letter-spacing: 0.08em;
+.badge {
+ font-size: 0.625rem;
text-transform: uppercase;
- color: var(--color-paper);
- background: var(--color-accent);
- padding: 6px 14px;
- border-radius: 4px;
+ letter-spacing: 0.1em;
+ padding: 0.25em 0.625em;
+ border: 1px solid var(--color-accent);
+ color: var(--color-accent);
+ border-radius: 2px;
+ font-weight: 600;
white-space: nowrap;
- box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
-/* Slop Card - Generic AI output */
-.slop-card {
- width: 280px;
- height: 280px;
- background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%);
- border-radius: 16px;
- padding: 24px;
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
- font-family: 'Inter', system-ui, sans-serif;
- display: flex;
- flex-direction: column;
-}
+/* ============================================
+ SOLUTION CARDS
+ ============================================ */
-.slop-header {
- display: flex;
- align-items: center;
- gap: 12px;
- margin-bottom: 16px;
+.solution-card {
+ padding: var(--spacing-lg);
+ background: var(--color-paper);
+ border-left: 3px solid var(--color-accent);
+ transition: all var(--duration-base) var(--ease-out);
}
-.slop-avatar {
- width: 40px;
- height: 40px;
- border-radius: 50%;
- background: linear-gradient(135deg, #8b5cf6, #7c3aed);
- flex-shrink: 0;
+.solution-card:hover {
+ background: color-mix(in oklch, var(--color-paper) 90%, var(--color-accent));
+ transform: translateX(4px);
}
-.slop-text { flex: 1; }
-.slop-title { font-size: 14px; font-weight: 600; color: #1f2937; margin-bottom: 2px; }
-.slop-subtitle { font-size: 12px; color: #6b7280; }
-.slop-body { font-size: 13px; line-height: 1.5; color: #4b5563; margin-bottom: auto; flex: 1; }
-
-.slop-button {
- width: 100%;
- padding: 10px 20px;
- background: linear-gradient(135deg, #8b5cf6, #7c3aed);
- color: white;
- border: none;
- border-radius: 8px;
- font-family: 'Inter', system-ui, sans-serif;
- font-size: 13px;
- font-weight: 500;
- cursor: pointer;
- margin-top: auto;
+.solution-card code {
+ font-family: var(--font-mono);
+ font-size: 0.875em;
+ background: color-mix(in oklch, var(--color-accent) 15%, transparent);
+ color: var(--color-accent);
+ padding: 0.125em 0.375em;
+ border-radius: 3px;
}
-/* Callout labels pointing to issues */
-.slop-callouts {
- position: absolute;
- inset: 0;
- pointer-events: none;
-}
+/* ============================================
+ ANIMATIONS
+ ============================================ */
-.slop-callout {
- position: absolute;
- font-size: 0.625rem;
- font-weight: 600;
- text-transform: uppercase;
- letter-spacing: 0.06em;
- color: var(--color-accent);
- background: var(--color-paper);
- padding: 4px 8px;
- border: 1px solid var(--color-accent);
- border-radius: 3px;
- white-space: nowrap;
- opacity: 0;
- animation: calloutFadeIn 0.4s var(--ease-out) forwards;
- box-shadow: 0 2px 8px rgba(0,0,0,0.1);
+@keyframes fadeInBg {
+ to { opacity: 1; }
}
-.slop-callout[data-point="font"] {
- top: 15%;
- right: 5%;
- animation-delay: 0.1s;
+@keyframes slideInLeft {
+ from {
+ opacity: 0;
+ transform: translateX(-40px);
+ }
}
-.slop-callout[data-point="gradient"] {
- top: 40%;
- left: 5%;
- animation-delay: 0.25s;
+@keyframes slideInRight {
+ from {
+ opacity: 0;
+ transform: translateX(40px);
+ }
}
-.slop-callout[data-point="copy"] {
- bottom: 35%;
- right: 8%;
- animation-delay: 0.4s;
+@keyframes fadeInUp {
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
}
-.slop-callout[data-point="rounded"] {
- bottom: 12%;
- left: 10%;
- animation-delay: 0.55s;
+@keyframes expandLine {
+ from { width: 0; }
}
-@keyframes calloutFadeIn {
+@keyframes drawCircle {
from {
opacity: 0;
- transform: scale(0.9);
+ scale: 0;
}
to {
opacity: 1;
- transform: scale(1);
+ scale: 1;
}
}
-/* Impeccable Card - With Design Skills */
-.impeccable-card {
- width: 280px;
- height: 280px;
- background: var(--color-paper);
- border: 1px solid var(--color-mist);
- padding: var(--spacing-lg);
- text-align: left;
- display: flex;
- flex-direction: column;
+[data-animate] {
+ opacity: 0;
+ transform: translateY(20px);
}
-.impeccable-eyebrow {
- font-family: var(--font-mono);
- font-size: 0.625rem;
- font-weight: 500;
- letter-spacing: 0.15em;
- text-transform: uppercase;
- color: var(--color-accent);
- margin-bottom: var(--spacing-xs);
+[data-animate].animated {
+ animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}
-.impeccable-title {
- font-family: var(--font-display);
- font-size: 1.75rem;
- font-weight: 300;
- font-style: italic;
- color: var(--color-ink);
- margin-bottom: var(--spacing-sm);
- line-height: 1.1;
+/* Hero animations */
+.hero-content {
+ animation: slideInLeft var(--duration-slower) var(--ease-out) 0.1s both;
}
-.impeccable-body {
- font-size: 0.875rem;
- line-height: 1.6;
- color: var(--color-ash);
- margin-bottom: auto;
- flex: 1;
+.hero-decoration {
+ animation: slideInRight var(--duration-slower) var(--ease-out) 0.3s both;
}
-.impeccable-button {
- display: inline-flex;
- padding: 0.625rem 1.5rem;
- background: var(--color-ink);
- color: var(--color-paper);
- border: none;
- font-family: var(--font-body);
- font-size: 0.8125rem;
- font-weight: 500;
- letter-spacing: 0.03em;
- cursor: pointer;
- transition: all var(--duration-base) var(--ease-out);
- margin-top: auto;
- align-self: flex-start;
-}
-
-.impeccable-button:hover {
- background: var(--color-accent);
-}
-
-/* Split Labels */
-.split-labels {
- display: flex;
- justify-content: center;
- gap: var(--spacing-xl);
- margin-top: var(--spacing-md);
-}
-
-.split-label-item {
- display: flex;
- align-items: center;
- gap: var(--spacing-xs);
- font-size: 0.8125rem;
- color: var(--color-ash);
-}
-
-.split-label-dot {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- background: var(--color-mist);
-}
-
-.split-label-dot--accent {
- background: var(--color-accent);
-}
-
-/* ============================================
- SOLUTION SECTION
- ============================================ */
-
-.solution-section {
- padding: var(--spacing-2xl) 0;
- border-top: 1px solid var(--color-mist);
-}
-
-.solution-content {
- display: grid;
- gap: var(--spacing-lg);
-}
-
-.solution-content .section-lead {
- margin-bottom: 0;
-}
-
-/* Two-pillar visual layout */
-.solution-visual {
- display: grid;
- grid-template-columns: 1fr auto 1fr;
- gap: var(--spacing-lg);
- align-items: stretch;
-}
-
-@media (max-width: 900px) {
- .solution-visual {
- grid-template-columns: 1fr;
- gap: var(--spacing-md);
- }
-}
-
-/* Interactive Framework Viz - Periodic Table */
-.solution-visual-interactive {
- width: 100%;
- min-height: 380px;
- background: var(--color-paper);
- border: 1px solid var(--color-mist);
- border-radius: 8px;
- position: relative;
- overflow: hidden;
-}
-
-.solution-pillar {
- background: var(--color-cream);
- border: 1px solid var(--color-mist);
- padding: var(--spacing-lg);
- transition: all var(--duration-base) var(--ease-out);
-}
-
-.solution-pillar:hover {
- border-color: var(--color-accent);
- transform: translateY(-4px);
- box-shadow: 0 20px 60px var(--color-accent-dim);
-}
-
-.pillar-header {
- text-align: center;
- margin-bottom: var(--spacing-lg);
- padding-bottom: var(--spacing-md);
- border-bottom: 1px solid var(--color-mist);
-}
-
-.pillar-icon {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- width: 56px;
- height: 56px;
- border-radius: 50%;
- background: var(--color-accent-dim);
- color: var(--color-accent);
- margin-bottom: var(--spacing-sm);
-}
-
-.pillar-title {
- font-family: var(--font-display);
- font-size: 1.75rem;
- font-weight: 400;
- margin: 0 0 var(--spacing-xs);
-}
-
-.pillar-subtitle {
- font-size: 0.875rem;
- color: var(--color-ash);
- margin: 0;
-}
-
-.pillar-content {
- display: flex;
- flex-direction: column;
- gap: var(--spacing-sm);
-}
-
-.pillar-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: var(--spacing-sm);
- background: var(--color-paper);
- border-radius: 4px;
- transition: all var(--duration-fast) var(--ease-out);
-}
-
-.pillar-item:hover {
- background: var(--color-accent-dim);
-}
-
-.pillar-item-name {
- font-weight: 500;
- color: var(--color-ink);
- font-size: 0.9375rem;
-}
-
-.pillar-item-code {
- font-family: var(--font-mono);
- font-size: 0.875rem;
- font-weight: 500;
- color: var(--color-accent);
- background: transparent;
- padding: 0;
-}
-
-.pillar-item-desc {
- font-size: 0.75rem;
- color: var(--color-ash);
-}
-
-.pillar-item--more {
- justify-content: center;
- font-size: 0.8125rem;
- font-weight: 500;
- color: var(--color-accent);
- background: transparent;
- border: 1px dashed var(--color-mist);
-}
-
-/* Connector between pillars */
-.solution-connector {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.connector-plus {
- font-family: var(--font-display);
- font-size: 3rem;
- font-weight: 300;
- color: var(--color-accent);
- opacity: 0.5;
-}
-
-@media (max-width: 900px) {
- .solution-connector {
- padding: var(--spacing-sm) 0;
- }
-
- .connector-plus {
- font-size: 2rem;
- }
-}
-
-/* Result statement */
-.solution-result {
- text-align: center;
- padding-top: var(--spacing-lg);
-}
-
-.result-arrow {
- display: block;
- font-size: 2rem;
- color: var(--color-accent);
- margin-bottom: var(--spacing-sm);
- animation: bounce 1.5s ease-in-out infinite;
-}
-
-.result-text {
- font-size: 1.25rem;
- color: var(--color-charcoal);
- margin: 0;
-}
-
-.result-text em {
- font-style: italic;
- color: var(--color-accent);
- font-weight: 500;
-}
-
-/* ============================================
- SKILLS SECTION
- ============================================ */
-
-.skills-section {
- padding: var(--spacing-2xl) 0;
- border-top: 1px solid var(--color-mist);
-}
-
-.skills-gallery {
- display: grid;
- grid-template-columns: 200px 1fr;
- gap: var(--spacing-xl);
- align-items: start;
-}
-
-@media (max-width: 968px) {
- .skills-gallery {
- grid-template-columns: 1fr;
- gap: var(--spacing-lg);
- }
-}
-
-.skills-nav {
- display: flex;
- flex-direction: column;
- gap: 2px;
- position: sticky;
- top: var(--spacing-lg);
-}
-
-@media (max-width: 968px) {
- .skills-nav {
- flex-direction: row;
- flex-wrap: wrap;
- gap: var(--spacing-xs);
- position: static;
- }
-}
-
-.skill-nav-item {
- padding: var(--spacing-sm) var(--spacing-md);
- background: transparent;
- border: none;
- border-left: 2px solid transparent;
- color: var(--color-ash);
- font-family: var(--font-body);
- font-size: 0.9375rem;
- font-weight: 400;
- cursor: pointer;
- transition: all 0.2s ease;
- text-align: left;
- text-decoration: none;
- display: block;
-}
-
-.skill-nav-item:hover {
- color: var(--color-text);
- background: var(--color-cream);
-}
-
-.skill-nav-item.active {
- color: var(--color-accent);
- border-left-color: var(--color-accent);
- background: var(--color-accent-dim);
- font-weight: 500;
-}
-
-@media (max-width: 968px) {
- .skill-nav-item {
- border-left: none;
- border-bottom: 2px solid transparent;
- padding: var(--spacing-xs) var(--spacing-md);
- }
-
- .skill-nav-item.active {
- border-bottom-color: var(--color-accent);
- }
-}
-
-.skills-showcase {
- display: grid;
- grid-template-columns: 1.2fr 1fr;
- gap: var(--spacing-lg);
- align-items: start;
-}
-
-@media (max-width: 1100px) {
- .skills-showcase {
- grid-template-columns: 1fr;
- }
-}
-
-.loading-state {
- padding: var(--spacing-xl);
- text-align: center;
- color: var(--color-ash);
- font-style: italic;
-}
-
-/* ============================================
- COMMANDS SECTION
- ============================================ */
-
-.commands-section {
- padding: var(--spacing-2xl) 0;
- border-top: 1px solid var(--color-mist);
-}
-
-.commands-gallery {
- display: grid;
- grid-template-columns: 200px 1fr;
- gap: var(--spacing-xl);
- align-items: start;
-}
-
-@media (max-width: 968px) {
- .commands-gallery {
- grid-template-columns: 1fr;
- gap: var(--spacing-lg);
- }
-}
-
-.commands-nav {
- display: flex;
- flex-direction: column;
- gap: 2px;
- position: sticky;
- top: var(--spacing-lg);
-}
-
-@media (max-width: 968px) {
- .commands-nav {
- flex-direction: row;
- flex-wrap: wrap;
- gap: var(--spacing-xs);
- position: static;
- }
-}
-
-.commands-showcase {
- display: grid;
- grid-template-columns: 1.2fr 1fr;
- gap: var(--spacing-lg);
- align-items: start;
-}
-
-@media (max-width: 1100px) {
- .commands-showcase {
- grid-template-columns: 1fr;
- }
-}
-
-/* ============================================
- DOWNLOADS SECTION
- ============================================ */
-
-.downloads-section {
- padding: var(--spacing-2xl) 0;
- border-top: 1px solid var(--color-mist);
-}
-
-.downloads-grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
- gap: var(--spacing-lg);
-}
-
-.download-card {
- display: flex;
- flex-direction: column;
- padding: var(--spacing-lg);
- background: var(--color-cream);
- border: 1px solid var(--color-mist);
- transition: all var(--duration-base) var(--ease-out);
-}
-
-.download-card:hover {
- border-color: var(--color-accent);
- transform: translateY(-4px);
- box-shadow: 0 20px 60px var(--color-accent-dim);
-}
-
-.download-card-icon {
- color: var(--color-accent);
- margin-bottom: var(--spacing-md);
-}
-
-.download-card-content {
- flex: 1;
- display: flex;
- flex-direction: column;
- gap: var(--spacing-sm);
-}
-
-.download-card-title {
- font-family: var(--font-display);
- font-size: 1.5rem;
- font-weight: 400;
- margin: 0;
-}
-
-.download-card-badge {
- display: inline-block;
- align-self: flex-start;
- font-size: 0.625rem;
- font-weight: 600;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- padding: 4px 10px;
- background: var(--color-accent-dim);
- color: var(--color-accent);
- border-radius: 4px;
-}
-
-.download-card-desc {
- font-size: 0.9375rem;
- line-height: 1.6;
- color: var(--color-ash);
- flex: 1;
-}
-
-.download-card .btn {
- margin-top: var(--spacing-md);
-}
-
-/* ============================================
- OPEN SOURCE SECTION
- ============================================ */
-
-.opensource-section {
- padding: var(--spacing-2xl) 0;
- border-top: 1px solid var(--color-mist);
- text-align: center;
-}
-
-.opensource-content {
- max-width: 500px;
- margin: 0 auto;
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: var(--spacing-md);
-}
-
-.opensource-title {
- font-size: clamp(2rem, 5vw, 3.5rem);
- font-weight: 300;
-}
-
-.opensource-desc {
- font-size: 1.125rem;
- color: var(--color-ash);
- line-height: 1.6;
-}
-
-/* ============================================
- FOOTER
- ============================================ */
-
-.site-footer {
- border-top: 1px solid var(--color-mist);
- padding: var(--spacing-xl) var(--spacing-lg);
- background: var(--color-cream);
-}
-
-.footer-content {
- max-width: var(--width-max);
- margin: 0 auto;
- display: flex;
- justify-content: space-between;
- align-items: center;
- flex-wrap: wrap;
- gap: var(--spacing-lg);
-}
-
-@media (max-width: 768px) {
- .footer-content {
- flex-direction: column;
- text-align: center;
- }
-}
-
-.footer-brand {
- display: flex;
- flex-direction: column;
- gap: var(--spacing-xs);
-}
-
-.footer-logo {
- font-family: var(--font-display);
- font-size: 1.25rem;
- font-weight: 400;
- color: var(--color-ink);
-}
-
-.footer-tagline {
- font-size: 0.875rem;
- color: var(--color-ash);
-}
-
-.footer-links {
- display: flex;
- gap: var(--spacing-lg);
- flex-wrap: wrap;
-}
-
-.footer-links a {
- font-size: 0.875rem;
- color: var(--color-ash);
- transition: color var(--duration-fast) var(--ease-out);
-}
-
-.footer-links a:hover {
- color: var(--color-accent);
-}
-
-/* ============================================
- BUTTONS
- ============================================ */
-
-.btn {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- gap: var(--spacing-xs);
- padding: 1rem 2rem;
- font-family: var(--font-body);
- font-size: 0.9375rem;
- font-weight: 600;
- letter-spacing: 0.03em;
- border: none;
- cursor: pointer;
- transition: all var(--duration-base) var(--ease-out);
- position: relative;
- overflow: hidden;
- text-decoration: none;
-}
-
-.btn-primary {
- background: var(--color-ink);
- color: var(--color-paper);
-}
-
-.btn-primary::before {
- content: '';
- position: absolute;
- inset: 0;
- background: var(--color-accent);
- transform: translateY(100%);
- transition: transform var(--duration-base) var(--ease-out);
- z-index: 0;
-}
-
-.btn-primary:hover::before {
- transform: translateY(0);
-}
-
-.btn-primary:hover {
- color: var(--color-paper);
-}
-
-.btn-primary span,
-.btn-primary svg {
- position: relative;
- z-index: 1;
-}
-
-/* For buttons without span wrapper */
-.btn-primary:not(:has(span)) {
- position: relative;
- z-index: 1;
-}
-
-.btn-secondary {
- background: transparent;
- color: var(--color-ink);
- border: 1px solid var(--color-ink);
-}
-
-.btn-secondary:hover {
- background: var(--color-ink);
- color: var(--color-paper);
-}
-
-/* ============================================
- ANIMATIONS
- ============================================ */
-
-@keyframes revealUp {
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-@keyframes fadeIn {
- to {
- opacity: 1;
- }
-}
-
-@keyframes float {
- 0%, 100% { transform: translateX(-50%) translateY(0); }
- 50% { transform: translateX(-50%) translateY(-8px); }
-}
-
-@keyframes bounce {
- 0%, 100% { transform: translateY(0); }
- 50% { transform: translateY(4px); }
-}
-
-/* Reveal animation for scroll */
-[data-reveal] {
- opacity: 0;
- transform: translateY(30px);
- transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
-}
-
-[data-reveal].revealed {
- opacity: 1;
- transform: translateY(0);
-}
-
-/* Staggered reveals */
-[data-reveal]:nth-child(1) { transition-delay: 0s; }
-[data-reveal]:nth-child(2) { transition-delay: 0.1s; }
-[data-reveal]:nth-child(3) { transition-delay: 0.2s; }
-[data-reveal]:nth-child(4) { transition-delay: 0.3s; }
-
/* ============================================
- IMPORTS
+ IMPORTS - Complex components that need custom CSS
============================================ */
@import "./problem-section.css";
@import "./skill-demos.css";
@import "./gallery.css";
@import "./workflow.css";
-
-/* ============================================
- BIAS GRID (Problem Section Enhancement)
- ============================================ */
-
-.bias-grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
- gap: var(--spacing-md);
- margin-bottom: var(--spacing-xl);
-}
-
-.bias-item {
- display: flex;
- align-items: flex-start;
- gap: var(--spacing-sm);
- padding: var(--spacing-md);
- background: var(--color-cream);
- border: 1px solid var(--color-mist);
- border-left: 3px solid var(--color-accent);
- transition: all var(--duration-fast) var(--ease-out);
-}
-
-.bias-item:hover {
- border-color: var(--color-accent);
- transform: translateX(4px);
-}
-
-.bias-icon {
- font-size: 1.25rem;
- color: var(--color-accent);
- font-weight: 300;
- width: 32px;
- height: 32px;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
-}
-
-.bias-content {
- display: flex;
- flex-direction: column;
- gap: 2px;
-}
-
-.bias-content strong {
- font-size: 0.9375rem;
- font-weight: 600;
- color: var(--color-ink);
-}
-
-.bias-content span {
- font-size: 0.8125rem;
- color: var(--color-ash);
-}
-
-/* ============================================
- ANTIDOTE SECTION
- ============================================ */
-
-.antidote-section {
- padding: var(--spacing-2xl) 0;
- border-top: 1px solid var(--color-mist);
- background: var(--color-cream);
- margin-left: calc(-50vw + 50%);
- margin-right: calc(-50vw + 50%);
- padding-left: calc(50vw - 50% + var(--spacing-lg));
- padding-right: calc(50vw - 50% + var(--spacing-lg));
-}
-
-.antidote-content {
- max-width: var(--width-max);
- margin: 0 auto;
-}
-
-/* Patterns - tabbed layout */
-.patterns-categories {
- margin-bottom: var(--spacing-xl);
-}
-
-/* Tab bar */
-.pattern-tabs {
- display: flex;
- flex-wrap: wrap;
- gap: var(--spacing-xs);
- margin-bottom: var(--spacing-lg);
- border-bottom: 1px solid var(--color-mist);
- padding-bottom: var(--spacing-sm);
-}
-
-.pattern-tab {
- background: none;
- border: none;
- font-family: var(--font-body);
- font-size: 0.875rem;
- color: var(--color-ash);
- padding: var(--spacing-xs) var(--spacing-sm);
- cursor: pointer;
- transition: color var(--duration-fast) var(--ease-out);
- position: relative;
-}
-
-.pattern-tab:hover {
- color: var(--color-charcoal);
-}
-
-.pattern-tab.active {
- color: var(--color-ink);
- font-weight: 500;
-}
-
-.pattern-tab.active::after {
- content: '';
- position: absolute;
- bottom: calc(-1 * var(--spacing-sm) - 1px);
- left: 0;
- right: 0;
- height: 2px;
- background: var(--color-accent);
-}
-
-/* Panels */
-.pattern-panel {
- display: none;
-}
-
-.pattern-panel.active {
- display: block;
-}
-
-.pattern-columns {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: var(--spacing-xl);
-}
-
-@media (max-width: 768px) {
- .pattern-columns {
- grid-template-columns: 1fr;
- gap: var(--spacing-md);
- }
-}
-
-.pattern-column-label {
- display: block;
- font-size: 0.6875rem;
- font-weight: 600;
- text-transform: uppercase;
- letter-spacing: 0.1em;
- margin-bottom: var(--spacing-sm);
- color: var(--color-ash);
-}
-
-.pattern-column--anti .pattern-column-label {
- color: var(--color-accent);
-}
-
-.pattern-column--do .pattern-column-label {
- color: var(--color-success, #22c55e);
-}
-
-/* Pattern list styles */
-.pattern-list {
- list-style: none;
- padding: 0;
- margin: 0;
- display: flex;
- flex-direction: column;
- gap: var(--spacing-xs);
-}
-
-.pattern-item {
- font-size: 0.8125rem;
- padding-left: var(--spacing-md);
- position: relative;
- line-height: 1.5;
-}
-
-/* Anti-pattern items - muted */
-.pattern-item--anti {
- color: var(--color-ash);
-}
-
-.pattern-item--anti::before {
- content: '×';
- position: absolute;
- left: 0;
- color: var(--color-accent);
- font-weight: 600;
-}
-
-/* Pattern items - prominent */
-.pattern-item--do {
- color: var(--color-charcoal);
-}
-
-.pattern-item--do::before {
- content: '✓';
- position: absolute;
- left: 0;
- color: var(--color-success, #22c55e);
- font-weight: 600;
-}
-
-/* ============================================
- SOLUTION SECTION ENHANCEMENTS
- ============================================ */
-
-/* Main skill item styling */
-.pillar-item--main {
- background: var(--color-accent-dim);
- border: 1px solid var(--color-accent);
-}
-
-.pillar-item--main .pillar-item-name {
- font-size: 1.125rem;
- font-weight: 600;
- color: var(--color-accent);
-}
-
-.pillar-item--ref {
- background: transparent;
- padding: var(--spacing-xs) var(--spacing-sm);
-}
-
-.pillar-item-label {
- font-size: 0.75rem;
- font-weight: 500;
- text-transform: uppercase;
- letter-spacing: 0.05em;
- color: var(--color-ash);
-}
-
-/* Reference domain tags */
-.pillar-refs {
- display: flex;
- flex-wrap: wrap;
- gap: var(--spacing-xs);
- padding: 0 var(--spacing-sm);
-}
-
-.pillar-ref {
- font-size: 0.6875rem;
- font-weight: 500;
- text-transform: uppercase;
- letter-spacing: 0.03em;
- padding: 4px 10px;
- background: var(--color-paper);
- color: var(--color-ash);
- border: 1px solid var(--color-mist);
- border-radius: 3px;
- transition: all var(--duration-fast) var(--ease-out);
-}
-
-.pillar-ref:hover {
- border-color: var(--color-accent);
- color: var(--color-accent);
-}
-
-/* Command groups */
-.pillar-command-group {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: var(--spacing-xs);
- padding: var(--spacing-sm);
- background: var(--color-paper);
- border-radius: 4px;
-}
-
-.pillar-group-label {
- font-size: 0.6875rem;
- font-weight: 600;
- text-transform: uppercase;
- letter-spacing: 0.05em;
- color: var(--color-ash);
- width: 100%;
- margin-bottom: 4px;
-}
-
-.pillar-command-group .pillar-item-code {
- font-size: 0.8125rem;
- padding: 4px 8px;
- background: var(--color-accent-dim);
- border-radius: 3px;
-}
-
-/* ============================================
- PLATFORMS SECTION (alias for downloads)
- ============================================ */
-
-.platforms-section {
- padding: var(--spacing-2xl) 0;
- border-top: 1px solid var(--color-mist);
-}
-
-.platforms-section .section-subtitle {
- max-width: 60ch;
-}
diff --git a/public/index.html b/public/index.html
index 7c3b57a80..fb288142f 100644
--- a/public/index.html
+++ b/public/index.html
@@ -9,316 +9,191 @@
<link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&family=Instrument+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600&family=Space+Grotesk:wght@400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="tailwindcss" />
<link rel="stylesheet" href="./css/main.css">
-
- <!-- Import Maps for ES Module dependencies -->
- <script type="importmap">
- {
- "imports": {
- "lenis": "https://cdn.jsdelivr.net/npm/[email protected]/+esm",
- "motion": "https://cdn.jsdelivr.net/npm/[email protected]/+esm",
- "three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js"
- }
- }
- </script>
</head>
-<body class="min-h-screen overflow-x-hidden leading-relaxed">
- <!-- Grain Overlay -->
- <div class="grain-overlay" aria-hidden="true"></div>
-
- <!-- 1. HERO - Liquid Typography -->
- <header class="hero-section" id="hero">
- <canvas class="hero-canvas" id="hero-canvas"></canvas>
- <div class="hero-container">
+<body>
+ <!-- 1. HERO - Hook with the problem statement -->
+ <header class="hero">
+ <div class="hero-grid">
<div class="hero-content">
- <p class="hero-eyebrow" data-reveal data-split-text>The Anti-Slop Framework for AI Design</p>
- <h1 class="hero-title" data-reveal>
- <span class="hero-title-line" data-split-text>Impeccable</span>
- <span class="hero-title-line hero-title-accent" data-split-text>Style</span>
+ <h1 class="title">
+ <span class="title-main">Impeccable style</span>
+ <span class="title-sub">made easy</span>
</h1>
- <p class="hero-subtitle" data-reveal>One design skill and 15 commands that work across Cursor, Claude Code, Gemini CLI, and Codex CLI. Stop getting generic AI output. Start getting intentional design.</p>
- <div class="hero-cta" data-reveal>
- <a href="#downloads" class="btn btn-primary">Get the Framework</a>
- </div>
+ <p class="tagline">Your LLM can design beautiful interfaces.<br>It just needs to know what to ask for.</p>
+ <p class="providers">Works with Cursor · Claude Code · Gemini CLI · Codex CLI</p>
+ </div>
+ <div class="hero-decoration" aria-hidden="true">
+ <div class="deco-line"></div>
+ <div class="deco-circle"></div>
</div>
- </div>
- <div class="hero-scroll-indicator" aria-hidden="true">
- <span>Scroll</span>
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
- <path d="M12 5v14M19 12l-7 7-7-7"/>
- </svg>
</div>
</header>
- <main class="site-content">
- <!-- 2. THE PROBLEM - AI Design Bias -->
- <section class="problem-section" id="problem">
- <div class="section-header" data-reveal>
- <span class="section-number">01</span>
- <h2 class="section-title">AI Has Design Bias</h2>
- </div>
- <div class="problem-content">
- <p class="section-lead" data-reveal>Every LLM learned from the same generic templates. Without guidance, you get the same predictable mistakes—every single time.</p>
-
- <!-- Bias Examples Grid -->
- <div class="bias-grid" data-reveal>
- <div class="bias-item">
- <span class="bias-icon">Aa</span>
- <div class="bias-content">
- <strong>Safe fonts</strong>
- <span>Defaults to Inter, Roboto, system fonts</span>
- </div>
- </div>
- <div class="bias-item">
- <span class="bias-icon">◐</span>
- <div class="bias-content">
- <strong>Purple gradients</strong>
- <span>Purple-to-blue on white backgrounds</span>
- </div>
- </div>
- <div class="bias-item">
- <span class="bias-icon">▢</span>
- <div class="bias-content">
- <strong>Cards everywhere</strong>
- <span>Wraps everything in rounded boxes</span>
- </div>
- </div>
- <div class="bias-item">
- <span class="bias-icon">◫</span>
- <div class="bias-content">
- <strong>Gray on color</strong>
- <span>Gray text on colored backgrounds</span>
- </div>
- </div>
- <div class="bias-item">
- <span class="bias-icon">≡</span>
- <div class="bias-content">
- <strong>Centered everything</strong>
- <span>Centers all text and layouts</span>
- </div>
- </div>
- <div class="bias-item">
- <span class="bias-icon">◌</span>
- <div class="bias-content">
- <strong>Decorative shadows</strong>
- <span>Adds shadows without purpose</span>
- </div>
- </div>
+ <main class="container">
+ <!-- 2. THE PROBLEM - Show the "AI slop" aesthetic -->
+ <section class="problem-section">
+ <div class="problem-grid">
+ <div class="problem-content">
+ <h2 class="section-title">The Problem</h2>
+ <p class="problem-lead">LLMs are biased toward safe, generic design choices. Without guidance, you get the same predictable aesthetic every time.</p>
</div>
-
- <div class="split-comparison" id="lens-comparison">
- <div class="split-container">
- <!-- Before: AI Slop -->
- <div class="split-before">
- <div class="slop-card">
- <div class="slop-header">
- <div class="slop-avatar"></div>
- <div class="slop-text">
- <div class="slop-title">Welcome to Our Platform</div>
- <div class="slop-subtitle">The best solution for your needs</div>
- </div>
+ <div class="problem-showcase">
+ <div class="ai-slop-demo">
+ <div class="slop-card">
+ <div class="slop-header">
+ <div class="slop-avatar"></div>
+ <div class="slop-text">
+ <div class="slop-title">Welcome to Our Platform</div>
+ <div class="slop-subtitle">The best solution for your needs</div>
</div>
- <p class="slop-body">Lorem ipsum dolor sit amet, consectetur adipiscing elit. This is generic placeholder text.</p>
- <button class="slop-button">Get Started</button>
</div>
- <!-- Callout labels pointing to issues -->
- <div class="slop-callouts">
- <span class="slop-callout" data-point="font">Inter font (again)</span>
- <span class="slop-callout" data-point="gradient">Purple gradient</span>
- <span class="slop-callout" data-point="copy">Generic copy</span>
- <span class="slop-callout" data-point="rounded">Cards on cards</span>
- </div>
- </div>
- <!-- After: Impeccable (shown through split) -->
- <div class="split-after">
- <div class="impeccable-card">
- <p class="impeccable-eyebrow">Introducing</p>
- <h3 class="impeccable-title">Thoughtful Design</h3>
- <p class="impeccable-body">Every element serves a purpose. Hierarchy guides the eye. Whitespace breathes.</p>
- <button class="impeccable-button">Explore</button>
- </div>
- </div>
- <!-- The Divider -->
- <div class="split-divider">
- <span class="split-label">With Skills</span>
- </div>
- </div>
- <div class="split-labels">
- <div class="split-label-item" data-point="before">
- <span class="split-label-dot"></span>
- <span>Generic AI Output</span>
+ <p class="slop-body">Lorem ipsum dolor sit amet, consectetur adipiscing elit. This is generic placeholder text in a card layout.</p>
+ <button class="slop-button">Get Started</button>
</div>
- <div class="split-label-item" data-point="after">
- <span class="split-label-dot split-label-dot--accent"></span>
- <span>With Design Skills</span>
+ <div class="slop-labels">
+ <span class="slop-label" data-point="font">Inter font</span>
+ <span class="slop-label" data-point="gradient">Purple gradient</span>
+ <span class="slop-label" data-point="layout">Card layout</span>
+ <span class="slop-label" data-point="copy">Generic copy</span>
</div>
</div>
</div>
</div>
</section>
- <!-- 3. THE ANTIDOTE - Patterns & Anti-Patterns -->
- <section class="antidote-section" id="antidote">
- <div class="section-header" data-reveal>
- <span class="section-number">02</span>
- <h2 class="section-title">The Antidote</h2>
- </div>
- <div class="antidote-content">
- <p class="section-lead" data-reveal>The original Claude frontend-design skill says to avoid Arial and Inter. We've expanded it with 60+ specific patterns that fight model bias across every design domain.</p>
-
- <!-- Patterns by category with tabs -->
- <div class="patterns-categories" id="patterns-categories">
- <!-- Rendered by JS -->
+ <!-- 3. THE SOLUTION - Brief explanation -->
+ <section class="solution-section">
+ <div class="solution-grid">
+ <div class="solution-content">
+ <h2 class="section-title">The Solution</h2>
+ <p class="solution-lead">Teach your AI assistant the language of design. <strong>Skills</strong> provide deep design knowledge. <strong>Commands</strong> give you precise control over the creative process.</p>
+ </div>
+ <div class="solution-cards">
+ <div class="solution-card">
+ <div class="solution-icon">
+ <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
+ <path d="M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25"/>
+ </svg>
+ </div>
+ <h3>8 Skills</h3>
+ <p>Deep knowledge in typography, color, motion, spatial design, and more. The AI learns <em>how</em> to think about design.</p>
+ </div>
+ <div class="solution-card">
+ <div class="solution-icon">
+ <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
+ <path d="M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z"/>
+ </svg>
+ </div>
+ <h3>15 Commands</h3>
+ <p>Precise actions like <code>/bolder</code>, <code>/animate</code>, <code>/audit</code>. Steer the AI through iterative design refinement.</p>
+ </div>
</div>
</div>
</section>
- <!-- 4. THE SOLUTION - Two-part system -->
- <section class="solution-section" id="solution">
- <div class="section-header" data-reveal>
- <span class="section-number">03</span>
- <h2 class="section-title">The Framework</h2>
+ <!-- 4. SKILLS SHOWCASE - Interactive demos -->
+ <section class="skills-section" id="skills-section">
+ <div class="section-header-sticky">
+ <h2 class="section-title">Skills</h2>
+ <p class="section-subtitle">Design knowledge that transforms AI output</p>
</div>
- <div class="solution-content">
- <p class="section-lead" data-reveal>One comprehensive skill with deep expertise, plus 15 commands that form the language of design.</p>
-
- <div class="solution-visual-interactive" id="framework-viz-container" data-reveal>
- <!-- Subway map generated by JS -->
- </div>
-
- <div class="solution-result" data-reveal>
- <span class="result-arrow">↓</span>
- <p class="result-text">Together, they transform generic output into <em>impeccable</em> design.</p>
+ <div class="skills-layout">
+ <nav class="skills-nav" id="skills-nav">
+ <div class="loading">Loading...</div>
+ </nav>
+ <div class="skills-showcase" id="skills-detail">
+ <div class="loading">Select a skill to see it in action</div>
</div>
</div>
</section>
- <!-- 4. COMMANDS - Glass Terminal -->
+ <!-- 5. COMMANDS - Sidebar nav + details (mirrors skills layout) -->
<section class="commands-section" id="commands-section">
- <div class="section-header" data-reveal>
- <span class="section-number">04</span>
- <h2 class="section-title">Commands in Action</h2>
- <p class="section-subtitle">See how commands transform your designs</p>
+ <div class="section-header-sticky">
+ <h2 class="section-title">Commands</h2>
+ <p class="section-subtitle">Precise control over the design process</p>
</div>
-
- <div class="commands-gallery">
- <!-- Rendered by JS -->
+
+ <div class="commands-layout">
+ <!-- Commands nav (left sidebar) -->
+ <nav class="commands-nav" id="workflow-diagram">
+ <!-- Will be rendered by JS -->
+ </nav>
+
+ <!-- Command detail (right side) -->
+ <div class="commands-showcase" id="commands-detail">
+ <div class="loading">Select a command to view details</div>
+ </div>
</div>
</section>
- <!-- 5. PLATFORMS -->
- <section class="platforms-section" id="downloads">
- <div class="section-header" data-reveal>
- <span class="section-number">05</span>
- <h2 class="section-title">One Framework, Every Agent Harness</h2>
- <p class="section-subtitle">We wrote it once, then compiled it for each platform. Same design intelligence, native to your workflow.</p>
+ <!-- 6. DOWNLOAD BUNDLES - After demonstrating value -->
+ <section class="downloads-section" id="downloads">
+ <div class="downloads-header">
+ <h2 class="section-title">Get Started</h2>
+ <p class="downloads-lead">Download the complete bundle for your preferred AI tool. Extract into your project root and start creating.</p>
</div>
-
- <div class="downloads-grid">
- <article class="download-card" data-reveal>
- <div class="download-card-icon">
- <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
- <path d="M9 3H5a2 2 0 00-2 2v4m6-6h10a2 2 0 012 2v4M9 3v18m0 0h10a2 2 0 002-2v-4M9 21H5a2 2 0 01-2-2v-4m0-6v6m18-6v6"/>
- </svg>
- </div>
- <div class="download-card-content">
- <h3 class="download-card-title">Cursor</h3>
- <span class="download-card-badge">Rules + Commands</span>
- <p class="download-card-desc">Commands and rules for Cursor IDE. Works via appending, no frontmatter required.</p>
+ <div class="download-grid">
+ <article class="download-card" data-animate>
+ <div class="card-inner">
+ <div class="card-header">
+ <h3>Cursor</h3>
+ <span class="badge">Rules + Commands</span>
+ </div>
+ <p>Commands and rules for Cursor IDE. Works via appending, no frontmatter required.</p>
+ <button class="btn btn-primary" data-bundle="cursor">Download</button>
</div>
- <button class="btn btn-primary" data-bundle="cursor">
- <span>Download</span>
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/>
- </svg>
- </button>
</article>
- <article class="download-card" data-reveal>
- <div class="download-card-icon">
- <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
- <path d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
- </svg>
- </div>
- <div class="download-card-content">
- <h3 class="download-card-title">Claude Code</h3>
- <span class="download-card-badge">Full Featured</span>
- <p class="download-card-desc">Complete YAML frontmatter with argument support. Follows Anthropic Skills specification.</p>
+ <article class="download-card" data-animate>
+ <div class="card-inner">
+ <div class="card-header">
+ <h3>Claude Code</h3>
+ <span class="badge">Full Featured</span>
+ </div>
+ <p>Complete YAML frontmatter with argument support. Follows Anthropic Skills specification.</p>
+ <button class="btn btn-primary" data-bundle="claude-code">Download</button>
</div>
- <button class="btn btn-primary" data-bundle="claude-code">
- <span>Download</span>
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/>
- </svg>
- </button>
</article>
- <article class="download-card" data-reveal>
- <div class="download-card-icon">
- <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
- <path d="M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25"/>
- </svg>
- </div>
- <div class="download-card-content">
- <h3 class="download-card-title">Gemini CLI</h3>
- <span class="download-card-badge">TOML + Modular</span>
- <p class="download-card-desc">TOML-formatted commands with modular skill imports via GEMINI.md.</p>
+ <article class="download-card" data-animate>
+ <div class="card-inner">
+ <div class="card-header">
+ <h3>Gemini CLI</h3>
+ <span class="badge">TOML + Modular</span>
+ </div>
+ <p>TOML-formatted commands with modular skill imports via GEMINI.md.</p>
+ <button class="btn btn-primary" data-bundle="gemini">Download</button>
</div>
- <button class="btn btn-primary" data-bundle="gemini">
- <span>Download</span>
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/>
- </svg>
- </button>
</article>
- <article class="download-card" data-reveal>
- <div class="download-card-icon">
- <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
- <path d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"/>
- </svg>
- </div>
- <div class="download-card-content">
- <h3 class="download-card-title">Codex CLI</h3>
- <span class="download-card-badge">Prompts + Routing</span>
- <p class="download-card-desc">Custom prompt format with skill routing through AGENTS.md architecture.</p>
+ <article class="download-card" data-animate>
+ <div class="card-inner">
+ <div class="card-header">
+ <h3>Codex CLI</h3>
+ <span class="badge">Prompts + Routing</span>
+ </div>
+ <p>Custom prompt format with skill routing through AGENTS.md architecture.</p>
+ <button class="btn btn-primary" data-bundle="codex">Download</button>
</div>
- <button class="btn btn-primary" data-bundle="codex">
- <span>Download</span>
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/>
- </svg>
- </button>
</article>
</div>
</section>
<!-- 7. OPEN SOURCE -->
- <section class="opensource-section" id="opensource">
- <div class="opensource-content" data-reveal>
- <h2 class="opensource-title">Open Source</h2>
- <p class="opensource-desc">View the source, contribute skills and commands, or report issues on GitHub.</p>
- <a href="https://github.com/pbakaus/vibe-design-plugins" class="btn btn-secondary">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
- <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
- </svg>
- <span>View Repository</span>
- </a>
+ <section class="contribute">
+ <div class="contribute-content">
+ <h2>Open Source</h2>
+ <p>View the source, contribute skills and commands, or report issues on GitHub.</p>
+ <a href="https://github.com/pbakaus/vibe-design-plugins" class="btn btn-secondary">View Repository</a>
</div>
</section>
</main>
- <footer class="site-footer">
+ <footer>
<div class="footer-content">
- <div class="footer-brand">
- <span class="footer-logo">impeccable.style</span>
- <p class="footer-tagline">The anti-slop framework for AI design</p>
- </div>
- <div class="footer-links">
- <a href="#antidote">Anti-Patterns</a>
- <a href="#commands-section">Commands</a>
- <a href="#downloads">Downloads</a>
- <a href="https://github.com/pbakaus/vibe-design-plugins">GitHub</a>
- </div>
+ <p>impeccable.style</p>
+ <p><a href="https://github.com/pbakaus/vibe-design-plugins">GitHub</a></p>
</div>
</footer>
diff --git a/public/js/components/art-gallery.js b/public/js/components/art-gallery.js
index bbe2a005e..c472749cd 100644
--- a/public/js/components/art-gallery.js
+++ b/public/js/components/art-gallery.js
@@ -133,3 +133,4 @@ function setupInteractions() {
}
+
diff --git a/public/js/components/framework-viz.js b/public/js/components/framework-viz.js
deleted file mode 100644
index e0e78f0bb..000000000
--- a/public/js/components/framework-viz.js
+++ /dev/null
@@ -1,357 +0,0 @@
-/**
- * Periodic Table of Commands
- * Clean grid visualization showing all commands organized by category
- */
-
-import { commandCategories, commandRelationships } from '../data.js';
-
-const categoryColors = {
- diagnostic: { bg: '#fdf4ff', border: '#d946ef', text: '#a21caf' },
- quality: { bg: '#f0fdf4', border: '#22c55e', text: '#15803d' },
- intensity: { bg: '#fffbeb', border: '#f59e0b', text: '#b45309' },
- adaptation: { bg: '#eff6ff', border: '#3b82f6', text: '#1d4ed8' },
- enhancement: { bg: '#fdf2f8', border: '#ec4899', text: '#be185d' },
- system: { bg: '#f9fafb', border: '#6b7280', text: '#374151' }
-};
-
-const categoryLabels = {
- diagnostic: 'Diagnostic',
- quality: 'Quality',
- intensity: 'Intensity',
- adaptation: 'Adaptation',
- enhancement: 'Enhancement',
- system: 'System'
-};
-
-// Short symbols for each command (like element symbols)
-const commandSymbols = {
- audit: 'Au',
- normalize: 'No',
- polish: 'Po',
- optimize: 'Op',
- harden: 'Ha',
- clarify: 'Cl',
- simplify: 'Si',
- adapt: 'Ad',
- extract: 'Ex',
- animate: 'An',
- colorize: 'Co',
- delight: 'De',
- bolder: 'Bo',
- quieter: 'Qu',
- onboard: 'On'
-};
-
-// Atomic numbers (just for visual interest)
-const commandNumbers = {
- audit: 1,
- normalize: 2,
- polish: 3,
- optimize: 4,
- harden: 5,
- clarify: 6,
- simplify: 7,
- adapt: 8,
- extract: 9,
- animate: 10,
- colorize: 11,
- delight: 12,
- bolder: 13,
- quieter: 14,
- onboard: 15
-};
-
-export class PeriodicTable {
- constructor(container) {
- this.container = container;
- this.infoPanel = null;
- this.activeElement = null;
- this.init();
- }
-
- init() {
- this.container.innerHTML = '';
- this.container.style.cssText = `
- display: flex;
- flex-direction: column;
- gap: 16px;
- padding: 20px;
- height: 100%;
- box-sizing: border-box;
- `;
-
- this.renderTable();
- this.renderInfoPanel();
- }
-
- renderTable() {
- // Group commands by category
- const groups = {};
- Object.entries(commandCategories).forEach(([cmd, cat]) => {
- if (!groups[cat]) groups[cat] = [];
- groups[cat].push(cmd);
- });
-
- // Category order
- const categoryOrder = ['diagnostic', 'quality', 'adaptation', 'enhancement', 'intensity', 'system'];
-
- // Create grid container
- const grid = document.createElement('div');
- grid.style.cssText = `
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
- gap: 16px;
- flex: 1;
- `;
-
- categoryOrder.forEach(cat => {
- const commands = groups[cat];
- if (!commands) return;
-
- const group = this.createCategoryGroup(cat, commands);
- grid.appendChild(group);
- });
-
- this.container.appendChild(grid);
- }
-
- renderInfoPanel() {
- this.infoPanel = document.createElement('div');
- this.infoPanel.style.cssText = `
- background: var(--color-cream);
- border: 1px solid var(--color-mist);
- border-radius: 8px;
- padding: 16px 20px;
- height: 96px;
- display: flex;
- align-items: center;
- gap: 20px;
- flex-shrink: 0;
- overflow: hidden;
- `;
-
- // Default state
- this.showDefaultInfo();
-
- this.container.appendChild(this.infoPanel);
- }
-
- showDefaultInfo() {
- this.infoPanel.innerHTML = `
- <div style="
- font-family: var(--font-body);
- font-size: 14px;
- color: var(--color-ash);
- font-style: italic;
- ">
- Hover over a command to see details
- </div>
- `;
- }
-
- showCommandInfo(cmd) {
- const category = commandCategories[cmd];
- const colors = categoryColors[category];
- const rel = commandRelationships[cmd] || {};
-
- // Normalize to arrays (pairs can be string or array)
- const toArray = (val) => {
- if (!val) return [];
- if (Array.isArray(val)) return val;
- return [val];
- };
-
- const pairs = toArray(rel.pairs);
- const leadsTo = toArray(rel.leadsTo);
- const combinesWith = toArray(rel.combinesWith);
-
- // Build related info
- let relatedHtml = '';
-
- if (pairs.length > 0) {
- const list = pairs.map(p => `<span style="font-family: var(--font-mono); color: var(--color-ink)">/${p}</span>`).join(', ');
- relatedHtml += `<span style="color: var(--color-ash)">Pairs with:</span> ${list}`;
- }
- if (combinesWith.length > 0) {
- const list = combinesWith.map(p => `<span style="font-family: var(--font-mono); color: var(--color-ink)">/${p}</span>`).join(', ');
- if (relatedHtml) relatedHtml += '<span style="color: var(--color-mist); margin: 0 8px;">•</span>';
- relatedHtml += `<span style="color: var(--color-ash)">Combines with:</span> ${list}`;
- }
- if (leadsTo.length > 0) {
- const list = leadsTo.map(p => `<span style="font-family: var(--font-mono); color: var(--color-ink)">/${p}</span>`).join(', ');
- if (relatedHtml) relatedHtml += '<span style="color: var(--color-mist); margin: 0 8px;">•</span>';
- relatedHtml += `<span style="color: var(--color-ash)">Then:</span> ${list}`;
- }
-
- this.infoPanel.innerHTML = `
- <div style="flex: 1; min-width: 0;">
- <div style="
- display: flex;
- align-items: baseline;
- gap: 10px;
- margin-bottom: 4px;
- ">
- <span style="
- font-family: var(--font-mono);
- font-size: 15px;
- font-weight: 500;
- color: var(--color-ink);
- ">/${cmd}</span>
- <span style="
- font-size: 11px;
- text-transform: uppercase;
- letter-spacing: 0.05em;
- color: ${colors.text};
- font-weight: 500;
- ">${categoryLabels[category]}</span>
- </div>
- <div style="
- font-family: var(--font-body);
- font-size: 13px;
- color: var(--color-charcoal);
- line-height: 1.4;
- margin-bottom: ${relatedHtml ? '6px' : '0'};
- ">${rel.flow || 'Design command'}</div>
- ${relatedHtml ? `<div style="font-size: 12px; line-height: 1.4;">${relatedHtml}</div>` : ''}
- </div>
- `;
- }
-
- createCategoryGroup(category, commands) {
- const colors = categoryColors[category];
-
- const group = document.createElement('div');
- group.style.cssText = `
- display: flex;
- flex-direction: column;
- gap: 6px;
- `;
-
- // Category label
- const label = document.createElement('div');
- label.style.cssText = `
- font-family: var(--font-body);
- font-size: 10px;
- font-weight: 500;
- text-transform: uppercase;
- letter-spacing: 0.05em;
- color: ${colors.text};
- padding-left: 2px;
- `;
- label.textContent = categoryLabels[category];
- group.appendChild(label);
-
- // Elements row
- const row = document.createElement('div');
- row.style.cssText = `
- display: flex;
- flex-wrap: wrap;
- gap: 6px;
- `;
-
- commands.forEach(cmd => {
- const element = this.createElement(cmd, category);
- row.appendChild(element);
- });
-
- group.appendChild(row);
- return group;
- }
-
- createElement(cmd, category) {
- const colors = categoryColors[category];
-
- const el = document.createElement('div');
- el.style.cssText = `
- width: 56px;
- height: 64px;
- background: ${colors.bg};
- border: 1.5px solid ${colors.border};
- border-radius: 5px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- transition: transform 0.15s ease, box-shadow 0.15s ease;
- position: relative;
- `;
-
- // Atomic number
- const number = document.createElement('div');
- number.style.cssText = `
- position: absolute;
- top: 3px;
- left: 5px;
- font-family: var(--font-mono);
- font-size: 7px;
- color: ${colors.text};
- opacity: 0.5;
- `;
- number.textContent = commandNumbers[cmd];
- el.appendChild(number);
-
- // Symbol
- const symbol = document.createElement('div');
- symbol.style.cssText = `
- font-family: var(--font-display);
- font-size: 20px;
- font-weight: 500;
- color: ${colors.text};
- line-height: 1;
- `;
- symbol.textContent = commandSymbols[cmd];
- el.appendChild(symbol);
-
- // Command name
- const name = document.createElement('div');
- name.style.cssText = `
- font-family: var(--font-mono);
- font-size: 8px;
- color: ${colors.text};
- opacity: 0.7;
- margin-top: 3px;
- `;
- name.textContent = `/${cmd}`;
- el.appendChild(name);
-
- // Hover effects
- el.addEventListener('mouseenter', () => {
- // Visual feedback
- el.style.transform = 'translateY(-2px)';
- el.style.boxShadow = `0 4px 12px ${colors.border}40`;
-
- // Update info panel
- this.showCommandInfo(cmd);
-
- // Track active element
- if (this.activeElement) {
- this.activeElement.style.transform = 'translateY(0)';
- this.activeElement.style.boxShadow = 'none';
- }
- this.activeElement = el;
- });
-
- el.addEventListener('mouseleave', () => {
- el.style.transform = 'translateY(0)';
- el.style.boxShadow = 'none';
- });
-
- // Click to scroll to command
- el.addEventListener('click', () => {
- const target = document.getElementById(`cmd-${cmd}`);
- if (target) {
- target.scrollIntoView({ behavior: 'smooth', block: 'center' });
- }
- });
-
- return el;
- }
-}
-
-export function initFrameworkViz() {
- const container = document.getElementById('framework-viz-container');
- if (container) {
- new PeriodicTable(container);
- }
-}
diff --git a/public/js/components/glass-terminal.js b/public/js/components/glass-terminal.js
index 8a0fce3b7..43183c10b 100644
--- a/public/js/components/glass-terminal.js
+++ b/public/js/components/glass-terminal.js
@@ -183,3 +183,4 @@ function updateTerminal(cmd, container, allCommands) {
}
+
diff --git a/public/js/components/lens.js b/public/js/components/lens.js
index 38ef79c04..c3fc87eb7 100644
--- a/public/js/components/lens.js
+++ b/public/js/components/lens.js
@@ -13,3 +13,4 @@ export function initLensEffect() {
}
+
diff --git a/public/js/demo-renderer.js b/public/js/demo-renderer.js
index d7805a059..59dc72a7b 100644
--- a/public/js/demo-renderer.js
+++ b/public/js/demo-renderer.js
@@ -127,3 +127,4 @@ export function setupDemoTabs() {
}
+
diff --git a/public/js/demos/commands/animate.js b/public/js/demos/commands/animate.js
index a5a31906e..f46c79033 100644
--- a/public/js/demos/commands/animate.js
+++ b/public/js/demos/commands/animate.js
@@ -41,3 +41,4 @@ export default {
};
+
diff --git a/public/js/demos/commands/bolder.js b/public/js/demos/commands/bolder.js
index 8c455211e..1c1791c42 100644
--- a/public/js/demos/commands/bolder.js
+++ b/public/js/demos/commands/bolder.js
@@ -21,3 +21,4 @@ export default {
};
+
diff --git a/public/js/demos/commands/index.js b/public/js/demos/commands/index.js
index ac2df7f53..cc7bd4880 100644
--- a/public/js/demos/commands/index.js
+++ b/public/js/demos/commands/index.js
@@ -39,3 +39,4 @@ export function getCommandDemo(commandId) {
}
+
diff --git a/public/js/demos/commands/normalize.js b/public/js/demos/commands/normalize.js
index 6167aa370..58bf16547 100644
--- a/public/js/demos/commands/normalize.js
+++ b/public/js/demos/commands/normalize.js
@@ -39,3 +39,4 @@ export default {
};
+
diff --git a/public/js/demos/index.js b/public/js/demos/index.js
index cad39aa70..1701b1617 100644
--- a/public/js/demos/index.js
+++ b/public/js/demos/index.js
@@ -3,3 +3,4 @@ export { commandDemos, getCommandDemo } from "./commands/index.js";
export { getSkillDemo, skillDemos } from "./skills/index.js";
+
diff --git a/public/js/demos/skills/color-and-contrast.js b/public/js/demos/skills/color-and-contrast.js
index d5cd23be8..306010310 100644
--- a/public/js/demos/skills/color-and-contrast.js
+++ b/public/js/demos/skills/color-and-contrast.js
@@ -65,3 +65,4 @@ export default {
};
+
diff --git a/public/js/demos/skills/index.js b/public/js/demos/skills/index.js
index ae935e15c..f11caf482 100644
--- a/public/js/demos/skills/index.js
+++ b/public/js/demos/skills/index.js
@@ -23,3 +23,4 @@ export function getSkillDemo(skillId) {
}
+
diff --git a/public/js/demos/skills/interaction-design.js b/public/js/demos/skills/interaction-design.js
index d580afbc3..3432922a1 100644
--- a/public/js/demos/skills/interaction-design.js
+++ b/public/js/demos/skills/interaction-design.js
@@ -76,3 +76,4 @@ export default {
};
+
diff --git a/public/js/demos/skills/motion-design.js b/public/js/demos/skills/motion-design.js
index 7fecd65df..ec615db8b 100644
--- a/public/js/demos/skills/motion-design.js
+++ b/public/js/demos/skills/motion-design.js
@@ -66,3 +66,4 @@ export default {
};
+
diff --git a/public/js/demos/skills/responsive-design.js b/public/js/demos/skills/responsive-design.js
index fbbe82062..238f40bf5 100644
--- a/public/js/demos/skills/responsive-design.js
+++ b/public/js/demos/skills/responsive-design.js
@@ -88,3 +88,4 @@ export default {
};
+
diff --git a/public/js/demos/skills/spatial-design.js b/public/js/demos/skills/spatial-design.js
index 2563b18f9..fd7a440aa 100644
--- a/public/js/demos/skills/spatial-design.js
+++ b/public/js/demos/skills/spatial-design.js
@@ -59,3 +59,4 @@ export default {
};
+
diff --git a/public/js/demos/skills/typography.js b/public/js/demos/skills/typography.js
index 13acc3c18..5acd6c589 100644
--- a/public/js/demos/skills/typography.js
+++ b/public/js/demos/skills/typography.js
@@ -35,3 +35,4 @@ export default {
};
+
diff --git a/public/js/demos/skills/ux-writing.js b/public/js/demos/skills/ux-writing.js
index 187c3da27..b04a52336 100644
--- a/public/js/demos/skills/ux-writing.js
+++ b/public/js/demos/skills/ux-writing.js
@@ -68,3 +68,4 @@ export default {
};
+
diff --git a/public/js/effects/liquid-canvas.js b/public/js/effects/liquid-canvas.js
index 5feda32e0..212d2d78b 100644
--- a/public/js/effects/liquid-canvas.js
+++ b/public/js/effects/liquid-canvas.js
@@ -156,3 +156,4 @@ export function initHeroEffect() {
}
+
diff --git a/public/js/utils/reveal.js b/public/js/utils/reveal.js
index d2a8e11bf..96d2b750c 100644
--- a/public/js/utils/reveal.js
+++ b/public/js/utils/reveal.js
@@ -15,3 +15,4 @@ export function initScrollReveal() {
}
+
diff --git a/public/js/utils/scroll.js b/public/js/utils/scroll.js
index cc4f7efe7..6bbd6c593 100644
--- a/public/js/utils/scroll.js
+++ b/public/js/utils/scroll.js
@@ -100,3 +100,4 @@ export function initHashTracking() {
// Initial check
updateHash();
}
+
diff --git a/source/patterns.md b/source/patterns.md
index c8d017138..bc1e70343 100644
--- a/source/patterns.md
+++ b/source/patterns.md
@@ -54,7 +54,7 @@ antipatterns:
items:
- Don't use gray text on colored backgrounds
- Don't rely on color alone to convey information
- - Don't use pure black (#000) or white (#fff) for large areas
+ - Don't use pure gray, pure black (#000), or pure white (#fff) - add subtle color tint
- Don't create palettes with arbitrary color choices
- Don't ignore color blindness (8% of men)
- name: Layout & Space
@@ -68,16 +68,16 @@ antipatterns:
items:
- Don't animate without purpose
- Don't use durations over 500ms for UI feedback
- - Don't animate layout properties (width, height, padding, margin) - they trigger reflows and can cause text wrapping mid-animation; use transform instead
+ - Don't animate layout properties (width, height, padding, margin) - use transform instead
+ - Don't use bounce or elastic easing - they feel dated and tacky; use ease-out-quart/quint/expo
- Don't ignore prefers-reduced-motion
- - Don't use animation to hide slow loading
- name: Interaction
items:
- Don't remove focus indicators without alternatives
- Don't use placeholder text as labels
- Don't make touch targets smaller than 44×44px
- Don't show generic error messages
- - Don't design only for mouse/pointer
+ - Don't repeat the same information (redundant headers, intro restating heading, etc.)
- name: Responsive
items:
- Don't design desktop-first and cram into mobile
@@ -101,7 +101,7 @@ Focus on intentional, distinctive design choices:
**Space**: Use a spacing scale (4, 8, 12, 16, 24, 32, 48, 64, 96). Create visual rhythm through varied spacing. Let content breathe. Break the grid intentionally.
-**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity. Stagger reveals for orchestrated page loads.
+**Motion**: Animate with purpose—guide attention and confirm actions. Use 150-300ms for micro-interactions. Prefer transform and opacity with smooth ease-out curves (quart, quint, expo). Stagger reveals for orchestrated page loads.
**Interaction**: Design clear focus indicators. Make touch targets 44×44px minimum. Provide immediate feedback. Write specific, helpful error messages.
@@ -111,11 +111,13 @@ Focus on intentional, distinctive design choices:
These patterns create generic "AI slop" aesthetics:
-**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, wrapping everything in rounded cards, decorative shadows without purpose.
+**Generic Visuals**: Defaulting to Inter/Roboto/Arial, purple-to-blue gradients on white, pure grays without color tint, wrapping everything in rounded cards, decorative shadows without purpose.
-**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards.
+**Structural Issues**: Arbitrary spacing without a scale, hierarchy through size alone, equal spacing everywhere, cards nested inside cards, redundant copy (headers restating intros, repeated explanations).
-**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors.
+**Motion Mistakes**: Bounce and elastic easing (dated and tacky), animating layout properties, durations over 500ms for feedback, animation without purpose.
+
+**Interaction Failures**: Removing focus outlines without alternatives, placeholder text as labels, touch targets under 44×44px, generic "Something went wrong" errors, gray text on colored backgrounds.
**Accessibility Violations**: Color-only meaning, ignoring prefers-reduced-motion, failing WCAG contrast, creating keyboard traps.
diff --git a/source/skills/frontend-design/reference/color-and-contrast.md b/source/skills/frontend-design/reference/color-and-contrast.md
index 736740d7d..90e20e247 100644
--- a/source/skills/frontend-design/reference/color-and-contrast.md
+++ b/source/skills/frontend-design/reference/color-and-contrast.md
@@ -21,75 +21,185 @@ Then build a color system that is:
- Flexible enough for theming and variations
- Aesthetically cohesive and on-brand
-## Color Theory Fundamentals
+## Color Spaces: Use OKLCH
-### Color Harmony & Relationships
+**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
-[TO BE DEVELOPED: Complementary, analogous, triadic, split-complementary, monochromatic schemes, color wheel navigation]
+```css
+/* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */
+--color-primary: oklch(60% 0.15 250); /* Blue */
+--color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */
+--color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */
+```
-### Color Psychology & Meaning
+**Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish. A light blue at 85% lightness needs ~0.08 chroma, not the 0.15 of your base color.
-[TO BE DEVELOPED: Emotional associations, cultural considerations, industry conventions, semantic color choices]
+## Building Functional Palettes
-### Color Properties
+### The Tinted Neutral Trap
-[TO BE DEVELOPED: Hue, saturation, lightness/brightness, HSL vs RGB vs LCH, perceptual uniformity]
+**Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals:
-## Building Functional Palettes
+```css
+/* Dead grays */
+--gray-100: oklch(95% 0 0); /* No personality */
+--gray-900: oklch(15% 0 0);
+
+/* Warm-tinted grays (add brand warmth) */
+--gray-100: oklch(95% 0.01 60); /* Hint of warmth */
+--gray-900: oklch(15% 0.01 60);
+
+/* Cool-tinted grays (tech, professional) */
+--gray-100: oklch(95% 0.01 250); /* Hint of blue */
+--gray-900: oklch(15% 0.01 250);
+```
+
+The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI.
### Palette Structure
-[TO BE DEVELOPED: Primary/secondary/tertiary, neutral scales (9-11 steps), semantic colors, state colors]
+A complete system needs:
-### Generating Color Scales
+| Role | Purpose | Example |
+|------|---------|---------|
+| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
+| **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
+| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
+| **Surface** | Cards, modals, overlays | 2-3 elevation levels |
-[TO BE DEVELOPED: Lightness curves, saturation shifts, hue rotation, perceptual uniformity, algorithmic generation]
+**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
-### The Dominant Color Principle
+### The 60-30-10 Rule (Applied Correctly)
-[TO BE DEVELOPED: 60-30-10 rule, accent color strategy, visual weight distribution, avoiding rainbow vomit]
+This rule is about **visual weight**, not pixel count:
+
+- **60%**: Neutral backgrounds, white space, base surfaces
+- **30%**: Secondary colors—text, borders, inactive states
+- **10%**: Accent—CTAs, highlights, focus states
+
+The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power.
## Contrast & Accessibility
-### WCAG Compliance
+### WCAG Requirements
+
+| Content Type | AA Minimum | AAA Target |
+|--------------|------------|------------|
+| Body text | 4.5:1 | 7:1 |
+| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
+| UI components, icons | 3:1 | 4.5:1 |
+| Non-essential decorations | None | None |
+
+**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG.
+
+### Dangerous Color Combinations
+
+These commonly fail contrast or cause readability issues:
+
+- Light gray text on white (the #1 accessibility fail)
+- **Gray text on any colored background**—gray looks washed out and dead on color. Use a tinted version of the background color instead, or transparency
+- Red text on green background (or vice versa)—8% of men can't distinguish these
+- Blue text on red background (vibrates visually)
+- Yellow text on white (almost always fails)
+- Thin light text on images (unpredictable contrast)
+
+### Never Use Pure Gray or Pure Black
+
+Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. They look uncanny and lifeless.
+
+```css
+/* Dead and artificial */
+--gray: oklch(50% 0 0);
+--black: oklch(0% 0 0);
+
+/* Natural and warm */
+--gray: oklch(50% 0.01 60); /* Warm gray */
+--black: oklch(12% 0.01 250); /* Very dark blue-gray */
+```
+
+Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted.
+
+### Testing
+
+Don't trust your eyes. Use tools:
-[TO BE DEVELOPED: AA vs AAA standards, text contrast ratios (4.5:1 / 7:1), UI component contrast (3:1), large text exceptions]
+- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
+- Browser DevTools → Rendering → Emulate vision deficiencies
+- [Polypane](https://polypane.app/) for real-time testing
-### Testing & Tools
+## Theming: Light & Dark Mode
-[TO BE DEVELOPED: Contrast checkers, automated testing, color blindness simulation, tools for verification]
+### Dark Mode Is Not Inverted Light Mode
-### Accessible Color Combinations
+You can't just swap colors. Dark mode requires different design decisions:
-[TO BE DEVELOPED: Which combinations work, which don't, safe pairings, dangerous pairings, contrast matrices]
+| Light Mode | Dark Mode |
+|------------|-----------|
+| Shadows for depth | Lighter surfaces for depth (no shadows) |
+| Dark text on light | Light text on dark (reduce font weight) |
+| Vibrant accents | Desaturate accents slightly |
+| White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
-## Theming Architecture
+```css
+/* Dark mode depth via surface color, not shadow */
+:root[data-theme="dark"] {
+ --surface-1: oklch(15% 0.01 250);
+ --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */
+ --surface-3: oklch(25% 0.01 250);
-### Light & Dark Mode
+ /* Reduce text weight slightly */
+ --body-weight: 350; /* Instead of 400 */
+}
+```
-[TO BE DEVELOPED: Independent palettes vs inverted, neutral strategies, shadows in dark mode, image handling]
+### Token Hierarchy
-### CSS Custom Properties
+Use two layers of abstraction:
-[TO BE DEVELOPED: Token hierarchy (primitive → semantic → component), naming conventions, theme switching]
+```css
+/* Layer 1: Primitive tokens (rarely use directly) */
+--blue-500: oklch(55% 0.2 250);
+--blue-600: oklch(45% 0.2 250);
-### Multi-Theme Systems
+/* Layer 2: Semantic tokens (use these) */
+--color-primary: var(--blue-500);
+--color-primary-hover: var(--blue-600);
+--color-text: var(--gray-900);
+--color-text-muted: var(--gray-600);
+--color-border: var(--gray-200);
+--color-surface: var(--white);
+```
-[TO BE DEVELOPED: Brand themes, user preference themes, contextual themes, theme inheritance]
+**For dark mode, only redefine the semantic layer:**
-## Advanced Color Techniques
+```css
+:root[data-theme="dark"] {
+ --color-primary: var(--blue-400); /* Lighter in dark mode */
+ --color-text: var(--gray-100);
+ --color-surface: var(--gray-900);
+}
+```
-### Gradients & Effects
+## Alpha Is A Design Smell
-[TO BE DEVELOPED: Mesh gradients, color stops, blend modes, gradient generation, overlay techniques]
+If you're using lots of transparency (rgba, hsla), your palette is probably incomplete. Alpha creates:
+- Unpredictable contrast (depends on what's behind it)
+- Performance overhead (compositing)
+- Inconsistency across contexts
-### Transparency & Alpha
+**Instead**: Define explicit overlay colors:
-[TO BE DEVELOPED: Alpha channels, overlay strategies, transparency scales, backdrop effects]
+```css
+/* Bad: unpredictable */
+--overlay: rgba(0, 0, 0, 0.5);
-### Dynamic Color
+/* Good: explicit colors for each context */
+--overlay-on-light: oklch(40% 0 0);
+--overlay-on-dark: oklch(70% 0 0);
+--overlay-on-image: oklch(20% 0 0 / 60%); /* Alpha only when necessary */
+```
-[TO BE DEVELOPED: State-based color changes, hover darkening/lightening, interactive color feedback]
+The exception: Focus rings and interactive states where you need to see through to the element beneath.
---
diff --git a/source/skills/frontend-design/reference/interaction-design.md b/source/skills/frontend-design/reference/interaction-design.md
index da67ab32d..a6cbbe014 100644
--- a/source/skills/frontend-design/reference/interaction-design.md
+++ b/source/skills/frontend-design/reference/interaction-design.md
@@ -21,115 +21,240 @@ Then implement interactions that are:
- Forgiving with error prevention and recovery
- Responsive with immediate feedback and state changes
-## Interaction States
+## The Eight Interactive States
-### Core States
+Every interactive element needs these states designed:
-[TO BE DEVELOPED: Default, hover, focus, active, disabled, loading, error, success - visual treatment for each]
+| State | When | Visual Treatment |
+|-------|------|------------------|
+| **Default** | At rest | Base styling |
+| **Hover** | Pointer over (not touch) | Subtle lift, color shift |
+| **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
+| **Active** | Being pressed | Pressed in, darker |
+| **Disabled** | Not interactive | Reduced opacity, no pointer |
+| **Loading** | Processing | Spinner, skeleton |
+| **Error** | Invalid state | Red border, icon, message |
+| **Success** | Completed | Green check, confirmation |
-### State Transitions
+**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states.
-[TO BE DEVELOPED: Smooth state changes, animation between states, maintaining context, preserving user intent]
+## Focus Rings: Do Them Right
-### Loading & Progress States
+**Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users:
-[TO BE DEVELOPED: Skeleton screens, spinners, progress bars, optimistic updates, what to show while waiting]
+```css
+/* Hide focus ring for mouse/touch */
+button:focus {
+ outline: none;
+}
-## Affordances & Feedback
+/* Show focus ring for keyboard */
+button:focus-visible {
+ outline: 2px solid var(--color-accent);
+ outline-offset: 2px;
+}
+```
-### Visual Affordances
+**Focus ring design**:
+- High contrast (3:1 minimum against adjacent colors)
+- 2-3px thick
+- Offset from element (not inside it)
+- Consistent across all interactive elements
-[TO BE DEVELOPED: Signaling interactivity, button appearance, link styling, cursor changes, touch target highlighting]
+## Form Design: The Non-Obvious
-### Immediate Feedback
+### Don't Use Placeholders as Labels
-[TO BE DEVELOPED: Click/tap acknowledgment, hover feedback, focus indication, "something is happening" signals]
+Placeholders disappear when you type. Users forget what the field was for. Screen readers may not announce them.
-### Haptic & Sound Feedback
+```html
+<!-- Bad -->
+<input placeholder="Email address">
-[TO BE DEVELOPED: Vibration patterns, sound cues, cross-modal feedback, when to use non-visual feedback]
+<!-- Good -->
+<label for="email">Email address</label>
+<input id="email" type="email" placeholder="[email protected]">
+```
-## Form Design & Input Patterns
+Use placeholders only for examples or format hints, never as the primary label.
-### Form Layout & Structure
+### Validate on Blur, Not on Input
-[TO BE DEVELOPED: Single column vs multi-column, label placement, field grouping, visual hierarchy in forms]
+Real-time validation (validating every keystroke) is annoying. Users can't finish typing before seeing errors.
-### Input Field Design
+```javascript
+// Bad: fires on every keystroke
+input.addEventListener('input', validate);
-[TO BE DEVELOPED: Field sizing, placeholder usage (anti-pattern), helper text, character limits, input masking]
+// Good: fires when user leaves field
+input.addEventListener('blur', validate);
-### Validation Patterns
+// Exception: password strength (show progress while typing)
+passwordInput.addEventListener('input', showStrength);
+```
-[TO BE DEVELOPED: Inline vs on-submit, real-time validation, error message writing, success confirmation, required field indication]
+### Error Message Placement
-### Complex Input Types
+Place errors **below** the field (users scan top-down), not above. Keep messages close to the field—not in a summary at the top unless also repeated inline.
-[TO BE DEVELOPED: File upload UX, date pickers, time selection, rich text editing, multi-select, autocomplete, search]
+```html
+<label for="email">Email</label>
+<input id="email" type="email" aria-describedby="email-error">
+<span id="email-error" class="error">Please enter a valid email</span>
+```
-### Progressive Disclosure in Forms
+The `aria-describedby` connects the error to the input for screen readers.
-[TO BE DEVELOPED: Conditional fields, wizards/multi-step forms, accordions, showing complexity gradually]
+## Loading States: Optimistic Updates
-### Form Error Handling
+**Show success immediately, handle failure gracefully.** Users perceive the app as faster.
-[TO BE DEVELOPED: Error prevention (constraints, masks), clear error messages, error recovery, field-level vs form-level errors]
+```javascript
+// Optimistic update pattern
+async function toggleLike() {
+ // 1. Update UI immediately
+ setLiked(true);
-## Touch & Pointer Interactions
+ try {
+ // 2. Send request
+ await api.like(postId);
+ } catch {
+ // 3. Rollback on failure
+ setLiked(false);
+ showToast('Like failed. Please try again.');
+ }
+}
+```
-### Touch Targets
+**When to use**: Low-stakes actions (likes, follows, small edits). **Not for**: Payments, destructive actions, critical data changes.
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge reach areas on mobile]
+### Skeleton Screens > Spinners
-### Touch vs Pointer Patterns
+Spinners say "something is happening" but give no sense of what or how long. Skeletons preview the content shape:
-[TO BE DEVELOPED: Hover states on touch (problems), tap feedback, long press, swipe gestures, pinch-to-zoom]
+```css
+.skeleton {
+ background: linear-gradient(
+ 90deg,
+ var(--gray-200) 25%,
+ var(--gray-100) 50%,
+ var(--gray-200) 75%
+ );
+ background-size: 200% 100%;
+ animation: shimmer 1.5s infinite;
+}
-### Gesture Design
+@keyframes shimmer {
+ 0% { background-position: 200% 0; }
+ 100% { background-position: -200% 0; }
+}
+```
-[TO BE DEVELOPED: Swipe to delete, pull to refresh, drag to reorder, custom gestures, gesture discoverability]
+## Modals: The Inert Approach
-## Keyboard Navigation
+Focus trapping in modals used to require complex JavaScript. Now use the `inert` attribute:
-### Focus Management
+```html
+<!-- When modal is open -->
+<main inert>
+ <!-- Content behind modal can't be focused or clicked -->
+</main>
+<dialog open>
+ <h2>Modal Title</h2>
+ <!-- Focus stays inside modal -->
+</dialog>
+```
-[TO BE DEVELOPED: Focus rings (never remove without replacement), logical tab order, skip links, focus trapping in modals]
+Or use the native `<dialog>` element:
-### Keyboard Shortcuts
+```javascript
+const dialog = document.querySelector('dialog');
+dialog.showModal(); // Opens with focus trap, closes on Escape
+```
-[TO BE DEVELOPED: Common shortcuts, discoverability, avoiding conflicts, command palettes, keyboard-first workflows]
+## The Popover API
-### Accessible Interaction Patterns
+For tooltips, dropdowns, and non-modal overlays, use native popovers:
-[TO BE DEVELOPED: ARIA roles for custom controls, managing focus in dynamic content, screen reader announcements]
+```html
+<button popovertarget="menu">Open menu</button>
+<div id="menu" popover>
+ <button>Option 1</button>
+ <button>Option 2</button>
+</div>
+```
-## Navigation Patterns
+**Benefits**: Light-dismiss (click outside closes), proper stacking, no z-index wars, accessible by default.
-### Menu & Navigation Design
+## Destructive Actions: Undo > Confirm
-[TO BE DEVELOPED: Mega menus, hamburger menus, breadcrumbs, tabs, pagination, infinite scroll vs load more]
+Confirmation dialogs are friction. Users click through them mindlessly. **Undo is better**:
-### Modal & Dialog Patterns
+```javascript
+async function deleteItem(id) {
+ // 1. Remove from UI immediately
+ hideItem(id);
-[TO BE DEVELOPED: Modal entry/exit, focus management, escape to close, backdrop click behavior, sheet patterns]
+ // 2. Show undo toast
+ const toast = showToast('Item deleted', {
+ action: { label: 'Undo', onClick: () => restoreItem(id) },
+ duration: 5000
+ });
-### Command & Context Menus
+ // 3. Actually delete after toast expires
+ toast.onClose(() => api.delete(id));
+}
+```
+
+**When to still use confirmation**: Irreversible actions (account deletion), high-cost actions (large purchases), batch operations on many items.
+
+## Keyboard Navigation Patterns
+
+### Roving Tabindex
+
+For component groups (tabs, menu items, radio groups), one item is tabbable; arrow keys move within:
+
+```html
+<div role="tablist">
+ <button role="tab" tabindex="0">Tab 1</button>
+ <button role="tab" tabindex="-1">Tab 2</button>
+ <button role="tab" tabindex="-1">Tab 3</button>
+</div>
+```
-[TO BE DEVELOPED: Right-click menus, command palettes, dropdown menus, action sheets]
+Arrow keys move `tabindex="0"` between items. Tab moves to the next component entirely.
-## Error Prevention & Recovery
+### Skip Links
-### Constraints & Guards
+For keyboard users, provide a skip link to jump past navigation:
-[TO BE DEVELOPED: Input constraints, disabled states, confirmation dialogs for destructive actions, undo mechanisms]
+```html
+<a href="#main-content" class="skip-link">Skip to main content</a>
+<nav>...</nav>
+<main id="main-content">...</main>
+```
+
+```css
+.skip-link {
+ position: absolute;
+ left: -9999px;
+}
+.skip-link:focus {
+ left: 0;
+ z-index: 9999;
+ /* Visible styling */
+}
+```
-### Error Messages
+## Gesture Discoverability
-[TO BE DEVELOPED: Clear language, actionable guidance, positive framing, where to show errors, when to show errors]
+Swipe-to-delete and similar gestures are invisible. Hint at their existence:
-### Undo & Redo
+- **Partially reveal**: Show delete button peeking from edge
+- **Onboarding**: Coach marks on first use
+- **Alternative**: Always provide a visible fallback (menu with "Delete")
-[TO BE DEVELOPED: Undo patterns, toast notifications with undo, versioning, draft auto-save]
+Don't rely on gestures as the only way to perform actions.
---
diff --git a/source/skills/frontend-design/reference/motion-design.md b/source/skills/frontend-design/reference/motion-design.md
index be3683c03..23f738668 100644
--- a/source/skills/frontend-design/reference/motion-design.md
+++ b/source/skills/frontend-design/reference/motion-design.md
@@ -21,75 +21,193 @@ Then implement motion that is:
- Accessible with reduced motion alternatives
- Choreographed with thoughtful timing and sequencing
-## Classic Animation Principles
+## Duration: The 100/300/500 Rule
+
+Timing matters more than easing. These durations feel right for most UI:
+
+| Duration | Use Case | Examples |
+|----------|----------|----------|
+| **100-150ms** | Instant feedback | Button press, toggle, color change |
+| **200-300ms** | State changes | Menu open, tooltip, hover states |
+| **300-500ms** | Layout changes | Accordion, modal, drawer |
+| **500-800ms** | Entrance animations | Page load, hero reveals |
-### Disney's 12 Principles (Web Context)
+**Exit animations are faster than entrances.** Users want to see what's leaving—quickly. Use ~75% of the enter duration:
+```css
+.modal {
+ --enter: 400ms;
+ --exit: 300ms;
+}
+```
+
+## Easing: Pick the Right Curve
+
+**Don't use `ease`.** It's a compromise that's rarely optimal. Instead:
+
+| Curve | Use For | CSS |
+|-------|---------|-----|
+| **ease-out** | Elements entering | `cubic-bezier(0.16, 1, 0.3, 1)` |
+| **ease-in** | Elements leaving | `cubic-bezier(0.7, 0, 0.84, 0)` |
+| **ease-in-out** | State toggles (there → back) | `cubic-bezier(0.65, 0, 0.35, 1)` |
+
+**For micro-interactions, use exponential curves**—they feel natural because they mimic real physics (friction, deceleration):
+
+```css
+/* Quart out - smooth, refined (recommended default) */
+--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
+
+/* Quint out - slightly more dramatic */
+--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
+
+/* Expo out - snappy, confident */
+--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
+```
+
+**Avoid bounce and elastic curves.** They were trendy in 2015 but now feel tacky and amateurish. Real objects don't bounce when they stop—they decelerate smoothly. Overshoot effects draw attention to the animation itself rather than the content.
+
+## The Only Two Properties You Should Animate
-[TO BE DEVELOPED: Squash and stretch, anticipation, staging, follow-through, ease-in/ease-out, arcs, secondary action, timing, exaggeration, solid drawing, appeal - adapted for UI]
+**transform** and **opacity**. That's it. Everything else causes layout recalculation or repaints:
-### Timing & Duration
+```css
+/* Good: GPU-accelerated, smooth */
+.slide-in {
+ transform: translateX(0);
+ opacity: 1;
+ transition: transform 300ms ease-out, opacity 300ms ease-out;
+}
+.slide-in.hidden {
+ transform: translateX(20px);
+ opacity: 0;
+}
+
+/* Bad: triggers layout, janky */
+.slide-in {
+ left: 0; /* Layout thrashing */
+ height: 100%; /* Expensive */
+}
+```
-[TO BE DEVELOPED: Micro-interactions (100-300ms), transitions (300-500ms), complex animations (500-1000ms), duration by distance, perceived speed]
+**Exceptions**: Sometimes you must animate `height` for accordions. Use `max-height` with a value larger than content, or better yet, use CSS Grid's `grid-template-rows: 0fr → 1fr` trick.
-### Easing & Curves
+## Staggered Animations
-[TO BE DEVELOPED: Linear vs eased, ease-out (enter), ease-in (exit), ease-in-out (full cycle), custom cubic-bezier, spring physics]
-
-## Types of UI Animation
-
-### Micro-interactions
-
-[TO BE DEVELOPED: Button feedback, hover states, toggle switches, like buttons, form validation feedback, loading indicators]
-
-### Page Transitions
-
-[TO BE DEVELOPED: Route transitions, modal entry/exit, drawer animations, cross-fade, slide, zoom patterns]
-
-### State Transitions
-
-[TO BE DEVELOPED: Loading → success → error flows, expand/collapse, show/hide, enable/disable state changes]
-
-### Scrolling & Parallax
-
-[TO BE DEVELOPED: Scroll-triggered animations, reveal on scroll, parallax layers, scroll-linked effects, intersection observer]
-
-## Choreography & Sequencing
-
-### Staggered Animations
-
-[TO BE DEVELOPED: animation-delay patterns, sequential reveals, cascade effects, list item staggering]
-
-### Orchestrated Page Loads
-
-[TO BE DEVELOPED: Entry choreography, hero → content → details, creating narrative through sequence, attention management]
-
-### Exit Choreography
-
-[TO BE DEVELOPED: Reverse sequences, intentional exit timing, maintaining spatial relationships during exit]
-
-## Technical Implementation
-
-### CSS-Only Animation
-
-[TO BE DEVELOPED: @keyframes, animation properties, transitions, transform, pseudo-element animations, hardware acceleration]
-
-### JavaScript Animation
-
-[TO BE DEVELOPED: Web Animations API, requestAnimationFrame, animation libraries (GSAP, Framer Motion, Motion One)]
-
-### Performance Optimization
-
-[TO BE DEVELOPED: GPU acceleration (transform, opacity only), will-change, avoiding layout thrashing, reducing paint, FPS monitoring]
-
-## Motion Design Systems
-
-### Motion Tokens
-
-[TO BE DEVELOPED: Duration scales, easing tokens, named animations, consistent motion vocabulary]
-
-### Reduced Motion
-
-[TO BE DEVELOPED: prefers-reduced-motion, graceful degradation, essential vs decorative animation, crossfade alternatives]
+Staggering creates rhythm and direction. The formula:
+
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+}
+
+/* Stagger each item by 50ms */
+.list-item:nth-child(1) { animation-delay: 0ms; }
+.list-item:nth-child(2) { animation-delay: 50ms; }
+.list-item:nth-child(3) { animation-delay: 100ms; }
+/* ... */
+```
+
+**Better approach with CSS custom property:**
+
+```css
+.list-item {
+ animation: fade-in 400ms ease-out both;
+ animation-delay: calc(var(--i, 0) * 50ms);
+}
+```
+```html
+<li class="list-item" style="--i: 0">First</li>
+<li class="list-item" style="--i: 1">Second</li>
+<li class="list-item" style="--i: 2">Third</li>
+```
+
+**Key insight**: Cap the total stagger time. 10 items at 50ms = 500ms before the last item appears. If you have 50 items, reduce to 20ms per item or cap at ~10 staggered items.
+
+## Reduced Motion
+
+This is not optional. Vestibular disorders affect ~35% of adults over 40.
+
+```css
+/* Define animations normally */
+.card {
+ animation: slide-up 500ms ease-out;
+}
+
+/* Provide alternative for reduced motion */
+@media (prefers-reduced-motion: reduce) {
+ .card {
+ animation: fade-in 200ms ease-out; /* Crossfade instead of motion */
+ }
+}
+
+/* Or disable entirely */
+@media (prefers-reduced-motion: reduce) {
+ *, *::before, *::after {
+ animation-duration: 0.01ms !important;
+ transition-duration: 0.01ms !important;
+ }
+}
+```
+
+**What to preserve**: Functional animations like progress bars, loading spinners (slowed down), and focus indicators should still work—just without spatial movement.
+
+## Performance: Avoid These Mistakes
+
+### Don't Use will-change Preemptively
+
+```css
+/* Bad: wastes GPU memory */
+.card { will-change: transform; }
+
+/* Good: only when animation is imminent */
+.card:hover { will-change: transform; }
+.card.animating { will-change: transform; }
+```
+
+`will-change` forces the browser to create a compositing layer. Used everywhere = memory bloat.
+
+### Don't Animate During Scroll
+
+Scroll-linked animations (parallax, reveal) are expensive. If you must:
+
+```javascript
+// Use Intersection Observer, not scroll events
+const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('visible');
+ observer.unobserve(entry.target); // Animate once, then stop observing
+ }
+ });
+}, { threshold: 0.2 });
+```
+
+### Don't Fight the Main Thread
+
+Heavy JavaScript animations block rendering. For complex choreography, use the Web Animations API or a library like Motion One that schedules efficiently.
+
+## Motion Tokens
+
+Create a system for consistency:
+
+```css
+:root {
+ /* Durations */
+ --duration-instant: 100ms;
+ --duration-fast: 200ms;
+ --duration-normal: 300ms;
+ --duration-slow: 500ms;
+
+ /* Easings */
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
+ --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
+ --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
+
+ /* Common patterns */
+ --transition-fade: opacity var(--duration-fast) var(--ease-out);
+ --transition-slide: transform var(--duration-normal) var(--ease-out);
+ --transition-all: var(--duration-normal) var(--ease-out);
+}
+```
---
diff --git a/source/skills/frontend-design/reference/responsive-design.md b/source/skills/frontend-design/reference/responsive-design.md
index 0a4515829..c78563b7b 100644
--- a/source/skills/frontend-design/reference/responsive-design.md
+++ b/source/skills/frontend-design/reference/responsive-design.md
@@ -23,119 +23,237 @@ Then build responsive systems that are:
- Performant on constrained devices
- Contextually appropriate
-## Mobile-First Methodology
+## Mobile-First: Write It Right
-### Why Mobile-First
+Start with base styles for mobile, then layer complexity:
-[TO BE DEVELOPED: Progressive enhancement, performance benefits, forces priority decisions, mobile usage dominance]
+```css
+/* Base: mobile */
+.nav {
+ display: flex;
+ flex-direction: column;
+}
-### Mobile-First Implementation
+/* Enhancement: tablet and up */
+@media (min-width: 768px) {
+ .nav {
+ flex-direction: row;
+ }
+}
+```
-[TO BE DEVELOPED: Start with mobile styles, add complexity with min-width media queries, content-first approach]
+**The mistake**: Writing desktop-first (max-width queries) means mobile loads desktop styles first, then overrides. Wasteful and error-prone.
-## Breakpoint Strategies
+## Breakpoints: Content-Driven, Not Device-Driven
-### Choosing Breakpoints
+**Don't chase device sizes.** iPhones change, Android varies wildly, tablets overlap with laptops. Instead, let content tell you where to break:
-[TO BE DEVELOPED: Content-driven vs device-driven, common breakpoint values, in-between states, avoiding too many breakpoints]
+1. Start narrow
+2. Stretch the viewport until the design breaks
+3. Add a breakpoint there
-### Breakpoint Architecture
+Common content-driven breakpoints (as starting points):
-[TO BE DEVELOPED: Named breakpoints, breakpoint tokens, consistent usage across codebase]
+```css
+:root {
+ --bp-sm: 640px; /* Larger phones, small content changes */
+ --bp-md: 768px; /* Tablets, significant reflow */
+ --bp-lg: 1024px; /* Laptops, multi-column */
+ --bp-xl: 1280px; /* Desktops, max content width */
+}
+```
-## Fluid & Adaptive Design
+**Three breakpoints usually suffice.** If you have more than five, you're probably over-engineering.
-### Fluid Typography
+## Fluid Design: The Clamp Formula
-[TO BE DEVELOPED: clamp(), viewport units, fluid type scales, maintaining readability]
+`clamp(min, preferred, max)` creates fluid values without media queries.
-### Fluid Spacing
-
-[TO BE DEVELOPED: Responsive spacing scales, container-relative spacing, clamp() for margins/padding]
-
-### Fluid Layouts
-
-[TO BE DEVELOPED: CSS Grid auto-fit/auto-fill, flexible columns, aspect-ratio, fluid containers]
-
-### Container Queries
-
-[TO BE DEVELOPED: Component-level responsiveness, when to use vs media queries, polyfills]
-
-## Layout Adaptation Patterns
-
-### Navigation Patterns
-
-[TO BE DEVELOPED: Mobile hamburger/drawer, tablet side panel, desktop persistent nav, bottom nav bars]
-
-### Content Reflow
+### The Formula
-[TO BE DEVELOPED: Single column → multi-column, stacking orders, priority content first]
+```css
+/* Font size: 16px min, scales with viewport, 24px max */
+font-size: clamp(1rem, 0.5rem + 2vw, 1.5rem);
+```
-### Component Adaptation
+**How to calculate the preferred value**: The middle value determines the scaling rate. Higher vw coefficient = faster scaling:
-[TO BE DEVELOPED: Tabs → accordion, horizontal → vertical, show/hide patterns, progressive disclosure]
+- `1vw` = gentle scaling
+- `2-3vw` = moderate scaling
+- `4vw+` = aggressive scaling
-## Touch vs Pointer Optimization
+Add a rem offset to shift the baseline: `0.5rem + 2vw` ensures it doesn't collapse to 0 on small screens.
-### Touch Target Sizing
-
-[TO BE DEVELOPED: 44x44px minimum, spacing between targets, thumb zones, edge cases]
-
-### Touch-Specific Interactions
-
-[TO BE DEVELOPED: Swipe gestures, pull-to-refresh, long press, avoiding hover-dependent patterns]
-
-### Hybrid Devices
-
-[TO BE DEVELOPED: Supporting both touch and pointer, feature detection, adaptive interfaces]
-
-## Viewport & Screen Considerations
-
-### Viewport Meta Tag
-
-[TO BE DEVELOPED: Proper viewport configuration, zoom control, initial scale]
+### Fluid Spacing
-### Safe Areas
+```css
+:root {
+ --space-lg: clamp(2rem, 1rem + 3vw, 4rem);
+ --container-padding: clamp(1rem, 5vw, 4rem);
+}
+```
+
+This creates breathing room that naturally expands on larger screens.
+
+## Detect Input Method, Not Just Screen Size
+
+**Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard—use pointer and hover queries:
+
+```css
+/* Fine pointer (mouse, trackpad) */
+@media (pointer: fine) {
+ .button { padding: 8px 16px; }
+}
+
+/* Coarse pointer (touch, stylus) */
+@media (pointer: coarse) {
+ .button { padding: 12px 20px; } /* Larger touch target */
+}
+
+/* Device supports hover */
+@media (hover: hover) {
+ .card:hover { transform: translateY(-2px); }
+}
+
+/* Device doesn't support hover (touch) */
+@media (hover: none) {
+ .card { /* No hover state - use active instead */ }
+}
+```
+
+**Critical**: Don't rely on hover for functionality. Touch users can't hover.
+
+## Safe Areas: Handle the Notch
+
+Modern phones have notches, rounded corners, and home indicators. Use `env()`:
+
+```css
+body {
+ padding-top: env(safe-area-inset-top);
+ padding-bottom: env(safe-area-inset-bottom);
+ padding-left: env(safe-area-inset-left);
+ padding-right: env(safe-area-inset-right);
+}
+
+/* With fallback */
+.footer {
+ padding-bottom: max(1rem, env(safe-area-inset-bottom));
+}
+```
+
+**Enable viewport-fit** in your meta tag:
+```html
+<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
+```
+
+## Responsive Images: Get It Right
+
+### srcset with Width Descriptors
+
+```html
+<img
+ src="hero-800.jpg"
+ srcset="
+ hero-400.jpg 400w,
+ hero-800.jpg 800w,
+ hero-1200.jpg 1200w
+ "
+ sizes="(max-width: 768px) 100vw, 50vw"
+ alt="Hero image"
+>
+```
+
+**How it works**:
+- `srcset` lists available images with their actual widths (`w` descriptors)
+- `sizes` tells the browser how wide the image will display
+- Browser picks the best file based on viewport width AND device pixel ratio
+
+### Picture Element for Art Direction
+
+When you need different crops/compositions (not just resolutions):
+
+```html
+<picture>
+ <source media="(min-width: 768px)" srcset="wide.jpg">
+ <source media="(max-width: 767px)" srcset="tall.jpg">
+ <img src="fallback.jpg" alt="...">
+</picture>
+```
-[TO BE DEVELOPED: iPhone notch, rounded corners, system UI insets, padding for safe areas]
+## Layout Adaptation Patterns
-### Orientation Handling
+### Navigation: The Three-Stage Pattern
-[TO BE DEVELOPED: Portrait vs landscape, orientation-specific layouts, testing both orientations]
+```css
+/* Mobile: hamburger icon + drawer */
+.nav-menu { display: none; }
+.nav-toggle { display: block; }
-### High-DPI Screens
+/* Tablet: horizontal but compact */
+@media (min-width: 768px) {
+ .nav-menu { display: flex; }
+ .nav-toggle { display: none; }
+}
-[TO BE DEVELOPED: Retina images, 2x/3x assets, SVG for icons, responsive images]
+/* Desktop: full navigation with labels */
+@media (min-width: 1024px) {
+ .nav-item-label { display: inline; }
+}
+```
-## Responsive Images & Media
+### Table to Cards
-### Responsive Images
+Tables work on desktop, fail on mobile. Transform:
-[TO BE DEVELOPED: srcset, sizes, picture element, art direction, lazy loading]
+```css
+@media (max-width: 768px) {
+ table, thead, tbody, th, td, tr {
+ display: block;
+ }
-### Video Adaptation
+ thead { display: none; } /* Hide headers */
-[TO BE DEVELOPED: Responsive video embeds, bandwidth considerations, poster images]
+ tr {
+ margin-bottom: 1rem;
+ border: 1px solid var(--border);
+ padding: 1rem;
+ }
-## Performance on Mobile
+ td::before {
+ content: attr(data-label); /* Add labels via data attribute */
+ font-weight: 600;
+ display: block;
+ }
+}
+```
-### Mobile Performance Budget
+### Progressive Disclosure
-[TO BE DEVELOPED: Constrained CPU/memory, slow connections, battery concerns]
+Not everything needs to show on mobile:
-### Loading Strategies
+```css
+/* Show summary on mobile */
+.details-content { display: none; }
-[TO BE DEVELOPED: Critical path optimization, lazy loading, code splitting for mobile]
+@media (min-width: 768px) {
+ /* Expand on desktop */
+ .details-content { display: block; }
+}
+```
-## Testing Strategies
+Combine with `<details>/<summary>` for interactive expansion on mobile.
-### Device Testing
+## Testing: Don't Trust DevTools Alone
-[TO BE DEVELOPED: Real device testing, browser DevTools, emulators, viewport testing]
+DevTools device emulation is useful for layout but misses:
-### Testing Checklist
+- Actual touch interactions
+- Real CPU/memory constraints
+- Network latency patterns
+- Font rendering differences
+- Browser chrome/keyboard appearances
-[TO BE DEVELOPED: Different viewports, orientations, input methods, connection speeds]
+**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
---
diff --git a/source/skills/frontend-design/reference/spatial-design.md b/source/skills/frontend-design/reference/spatial-design.md
index a8745966c..4dfe26d24 100644
--- a/source/skills/frontend-design/reference/spatial-design.md
+++ b/source/skills/frontend-design/reference/spatial-design.md
@@ -21,93 +21,266 @@ Then build layout systems that are:
- Responsive and adaptive across viewports
- Compositionally strong with clear focal points
-## Classic Composition Principles
-
-### Visual Hierarchy Fundamentals
-
-[TO BE DEVELOPED: Size, weight, color, position, contrast as hierarchy tools, Gestalt principles (proximity, similarity, closure)]
-
-### Balance & Symmetry
-
-[TO BE DEVELOPED: Symmetrical vs asymmetrical balance, visual weight calculation, creating tension and resolution]
-
-### The Rule of Thirds & Golden Ratio
-
-[TO BE DEVELOPED: Classic composition grids, golden ratio applications, when to follow vs break rules]
-
-### Focal Points & Eye Movement
-
-[TO BE DEVELOPED: Creating focal points, directing eye flow, Z/F/circular patterns, intentional disruption]
-
## Spacing Systems
-### Spacing Scales
-
-[TO BE DEVELOPED: 4pt/8pt systems, modular scales, mathematical progressions (linear, exponential, Fibonacci)]
-
-### Vertical Rhythm
-
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, spacing ratios, rhythm across components]
-
-### Micro vs Macro Space
-
-[TO BE DEVELOPED: Component-internal spacing, between-component spacing, section spacing, page-level breathing room]
-
-### Spacing Token Architecture
-
-[TO BE DEVELOPED: Primitive spacing tokens, semantic spacing (component gaps, section padding), contextual spacing]
-
-## Grid Systems & Layout Patterns
-
-### Grid Fundamentals
-
-[TO BE DEVELOPED: Column grids, modular grids, baseline grids, grid anatomy (columns, gutters, margins)]
-
-### Classic Layout Patterns
-
-[TO BE DEVELOPED: Sidebar layouts, holy grail, card grids, masonry, magazine layouts, asymmetric layouts]
+### Use 4pt Base, Not 8pt
+
+8pt systems are too coarse. **4pt gives you the granularity you actually need:**
+
+```css
+:root {
+ --space-1: 4px; /* 0.25rem - tight */
+ --space-2: 8px; /* 0.5rem */
+ --space-3: 12px; /* 0.75rem */
+ --space-4: 16px; /* 1rem - base */
+ --space-6: 24px; /* 1.5rem */
+ --space-8: 32px; /* 2rem */
+ --space-12: 48px; /* 3rem */
+ --space-16: 64px; /* 4rem */
+ --space-24: 96px; /* 6rem - section gaps */
+}
+```
+
+**The insight**: You'll frequently need 12px (between 8 and 16). An 8pt-only system forces awkward choices.
+
+### Name Tokens by Relationship, Not Value
+
+```css
+/* Bad: tied to pixels */
+--spacing-8: 8px;
+--spacing-16: 16px;
+
+/* Better: semantic */
+--space-xs: 4px; /* Tight inline gaps */
+--space-sm: 8px; /* Between related elements */
+--space-md: 16px; /* Component padding */
+--space-lg: 24px; /* Between components */
+--space-xl: 48px; /* Section padding */
+--space-2xl: 96px; /* Section margins */
+```
+
+### Gap Over Margin
+
+**Stop using margins for spacing between siblings.** Use `gap`:
+
+```css
+/* Old way: margins create double-spacing bugs */
+.card { margin-bottom: 16px; }
+.card:last-child { margin-bottom: 0; } /* Cleanup hack */
+
+/* Modern way: gap just works */
+.card-list {
+ display: flex;
+ flex-direction: column;
+ gap: 16px; /* Automatic, no cleanup needed */
+}
+```
+
+Gap works in Flexbox and Grid. It's cleaner, more intentional, and eliminates margin collapse headaches.
+
+## Grid Systems
+
+### The Self-Adjusting Grid
+
+This pattern creates responsive grids without breakpoints:
+
+```css
+.grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ gap: var(--space-lg);
+}
+```
+
+**How it works**: Columns are at least 280px. As many as fit per row. Leftovers stretch. No media queries needed.
+
+**Variation for exact counts:**
+```css
+/* Always 3 columns on desktop, stack on mobile */
+.grid-3 {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
+ gap: var(--space-lg);
+}
+```
+
+### Grid Area Naming
+
+For complex layouts, named areas are clearer than line numbers:
+
+```css
+.page {
+ display: grid;
+ grid-template-areas:
+ "header header"
+ "sidebar main"
+ "footer footer";
+ grid-template-columns: 280px 1fr;
+ grid-template-rows: auto 1fr auto;
+}
+
+.header { grid-area: header; }
+.sidebar { grid-area: sidebar; }
+.main { grid-area: main; }
+.footer { grid-area: footer; }
+```
+
+At mobile breakpoints, redefine the areas:
+```css
+@media (max-width: 768px) {
+ .page {
+ grid-template-areas:
+ "header"
+ "main"
+ "sidebar"
+ "footer";
+ grid-template-columns: 1fr;
+ }
+}
+```
-### Modern CSS Layout
+## Visual Hierarchy
-[TO BE DEVELOPED: CSS Grid (explicit placement, auto-placement, grid areas), Flexbox (direction, alignment, distribution), Container Queries]
+### The Squint Test
-## Creating Visual Hierarchy
+Blur your eyes (or screenshot and blur). Can you still identify:
+- The most important element?
+- The second most important?
+- Clear groupings?
+
+If everything looks the same weight blurred, you have a hierarchy problem.
+
+### Hierarchy Through Multiple Dimensions
+
+Don't rely on size alone. Combine:
-### Hierarchy Through Scale
+| Tool | Strong Hierarchy | Weak Hierarchy |
+|------|------------------|----------------|
+| **Size** | 3:1 ratio or more | <2:1 ratio |
+| **Weight** | Bold vs Regular | Medium vs Regular |
+| **Color** | High contrast | Similar tones |
+| **Position** | Top/left (primary) | Bottom/right |
+| **Space** | Surrounded by white space | Crowded |
+
+**The best hierarchy uses 2-3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
+
+### Cards Are Not Required
+
+Cards (bordered/shadowed containers) are overused. You don't need a card to create visual grouping—spacing and alignment do this naturally.
+
+**Use cards when**:
+- Content is truly distinct and actionable (a product, a post, a task)
+- Items need to be visually comparable in a grid
+- Content needs clear boundaries for interaction (hover, click)
-[TO BE DEVELOPED: Size relationships, proportional scaling, meaningful jumps vs gradual progression]
+**Don't use cards for**:
+- General layout structure (use spacing instead)
+- Single items (a lone card looks arbitrary)
+- Nesting—**never put cards inside cards**. If you need hierarchy within a card, use spacing, typography, and subtle dividers instead
+
+```css
+/* Bad: card in a card */
+.outer-card > .inner-card { /* Noisy and confusing */ }
+
+/* Good: hierarchy without nesting */
+.card > .card-section { border-top: 1px solid var(--border); }
+```
+
+## Container Queries
+
+Viewport queries are for page layouts. **Container queries are for components**:
+
+```css
+.card-container {
+ container-type: inline-size;
+}
+
+.card {
+ display: grid;
+ gap: var(--space-md);
+}
+
+/* Card layout changes based on its container, not viewport */
+@container (min-width: 400px) {
+ .card {
+ grid-template-columns: 120px 1fr;
+ }
+}
+```
+
+**Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands—automatically, without viewport hacks.
+
+## Optical Adjustments
+
+### Text Doesn't Align
+
+A paragraph set to `margin-left: 0` looks indented because letterforms have internal whitespace. Fix with negative margin or padding:
-### Hierarchy Through Weight & Color
+```css
+.heading {
+ margin-left: -0.05em; /* Pull left to optically align */
+}
+```
-[TO BE DEVELOPED: Visual weight calculation, using color for emphasis, combining multiple hierarchy tools]
+### Icons Need Optical Centering
-### Hierarchy Through Position
+A geometrically centered icon often looks off-center. Play icons need to shift right, left-arrows need to shift left:
-[TO BE DEVELOPED: Placement importance, reading order, visual flow direction, breaking the grid for emphasis]
+```css
+.play-button svg {
+ transform: translateX(2px); /* Optical center */
+}
+```
-## Responsive Spatial Design
+### Touch Targets vs Visual Size
-### Breakpoint Strategy
+Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
-[TO BE DEVELOPED: Mobile-first vs desktop-first, breakpoint values, in-between states, content-driven breakpoints]
+```css
+.icon-button {
+ width: 24px; /* Visual size */
+ height: 24px;
+ position: relative;
+}
-### Layout Adaptation
+.icon-button::before {
+ content: '';
+ position: absolute;
+ inset: -10px; /* Expand tap target to 44px */
+}
+```
-[TO BE DEVELOPED: Reflow patterns, navigation transformation, content prioritization, progressive disclosure]
+## Depth & Elevation
-### Fluid Spacing & Layout
+### Semantic Z-Index
-[TO BE DEVELOPED: clamp() for spacing, viewport units, fluid grids, container-relative spacing]
+Don't use arbitrary numbers. Create a scale:
-## Depth & Layering
+```css
+:root {
+ --z-dropdown: 100;
+ --z-sticky: 200;
+ --z-modal-backdrop: 300;
+ --z-modal: 400;
+ --z-toast: 500;
+ --z-tooltip: 600;
+}
+```
-### Creating Depth
+### Shadow Scale for Elevation
-[TO BE DEVELOPED: Layering, shadows, elevation systems, z-index scales, parallax effects]
+Shadows indicate elevation. Create a consistent scale:
-### Overlap & Intersection
+```css
+:root {
+ --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); /* Subtle lift */
+ --shadow-md: 0 4px 6px rgba(0,0,0,0.07); /* Cards */
+ --shadow-lg: 0 10px 15px rgba(0,0,0,0.1); /* Dropdowns */
+ --shadow-xl: 0 20px 25px rgba(0,0,0,0.15); /* Modals */
+}
+```
-[TO BE DEVELOPED: Intentional overlap, breaking containers, elements that cross boundaries]
+**Key insight**: Shadows should be subtle. If you can clearly see the shadow, it's probably too strong.
---
diff --git a/source/skills/frontend-design/reference/typography.md b/source/skills/frontend-design/reference/typography.md
index eefffc474..9874ab641 100644
--- a/source/skills/frontend-design/reference/typography.md
+++ b/source/skills/frontend-design/reference/typography.md
@@ -23,59 +23,207 @@ Then build or refine a typography system that is:
## Classic Typography Principles
-### Vertical Rhythm & Baseline Grids
+### Vertical Rhythm
-[TO BE DEVELOPED: Baseline grids, consistent vertical spacing, maintaining rhythm across components]
+The non-obvious insight: your line-height should be the base unit for ALL vertical spacing in your design. If body text has `line-height: 1.5` on `16px` type (= 24px), then spacing values should be multiples of 24px: 24, 48, 72, etc.
+
+This creates subconscious harmony. Text and space feel "right" together because they share a mathematical foundation.
+
+```css
+:root {
+ --baseline: 1.5rem; /* 24px if root is 16px */
+ --space-1: var(--baseline); /* 24px */
+ --space-2: calc(var(--baseline) * 2); /* 48px */
+ --space-half: calc(var(--baseline) / 2); /* 12px */
+}
+```
### Modular Scale & Hierarchy
-[TO BE DEVELOPED: Scale ratios, establishing hierarchy through size/weight/spacing, visual balance]
+The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
+
+**Use fewer sizes with more contrast.** A 5-size system covers most needs:
+
+| Role | Typical Ratio | Use Case |
+|------|---------------|----------|
+| xs | 0.75rem | Captions, legal |
+| sm | 0.875rem | Secondary UI, metadata |
+| base | 1rem | Body text |
+| lg | 1.25-1.5rem | Subheadings, lead text |
+| xl+ | 2-4rem | Headlines, hero text |
+
+Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
### Readability & Measure
-[TO BE DEVELOPED: Line length (45-75 CPL), line height ratios, paragraph spacing, optimal reading conditions]
+Line length (measure) guidelines are well-known (45-75 characters), but the implementation detail matters:
+
+```css
+/* Use ch units for true character-based measure */
+.prose { max-width: 65ch; }
+
+/* Line-height scales inversely with line length */
+.narrow-column { max-width: 45ch; line-height: 1.4; }
+.wide-column { max-width: 75ch; line-height: 1.6; }
+```
+
+**Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05-0.1 to your normal line-height.
## Font Selection & Pairing
### Choosing Distinctive Fonts
-[TO BE DEVELOPED: Avoiding generic choices, character in typefaces, matching tone to content, Google Fonts alternatives]
+**Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal—but if you want distinctive design, look elsewhere.
+
+**Better Google Fonts alternatives**:
+- Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
+- Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
+- Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
+- For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
+
+**System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider this for apps where performance > personality.
### Pairing Principles
-[TO BE DEVELOPED: Contrast-based pairing, display + body, serif + sans, mono + geometric, variable fonts]
+**The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces. Only add a second font when you need genuine contrast (e.g., display headlines + body serif).
+
+When pairing, contrast on multiple axes:
+- Serif + Sans (structure contrast)
+- Geometric + Humanist (personality contrast)
+- Condensed display + Wide body (proportion contrast)
+
+**Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
### Web Font Loading
-[TO BE DEVELOPED: FOUT/FOIT strategies, font-display, subsetting, variable fonts, preloading]
+The layout shift problem: fonts load late, text reflows, and users see content jump. Here's the fix:
+
+```css
+/* 1. Use font-display: swap for visibility */
+@font-face {
+ font-family: 'CustomFont';
+ src: url('font.woff2') format('woff2');
+ font-display: swap;
+}
+
+/* 2. Match fallback metrics to minimize shift */
+@font-face {
+ font-family: 'CustomFont-Fallback';
+ src: local('Arial');
+ size-adjust: 105%; /* Scale to match x-height */
+ ascent-override: 90%; /* Match ascender height */
+ descent-override: 20%; /* Match descender depth */
+ line-gap-override: 10%; /* Match line spacing */
+}
+
+body {
+ font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
+}
+```
+
+Tools like [Fontaine](https://github.com/unjs/fontaine) calculate these overrides automatically.
## Modern Web Typography
-### Fluid & Responsive Type
+### Fluid Type
-[TO BE DEVELOPED: clamp(), viewport units, container query typography, breakpoint-based scales]
+Fluid typography eliminates breakpoint jumps. The formula:
-### Advanced Features
+```css
+/* font-size: clamp(min, preferred, max) */
+h1 { font-size: clamp(2rem, 5vw + 1rem, 4rem); }
+```
-[TO BE DEVELOPED: OpenType features, ligatures, font-feature-settings, kerning, number styles]
+The `5vw + 1rem` creates smooth scaling. Adjust the vw coefficient for faster/slower scaling.
-### Performance Optimization
+**When NOT to use fluid type**:
+- Button text, labels, UI elements (should be consistent, not fluid)
+- Very short text (scaling makes less sense)
+- When you need precise control at specific breakpoints
-[TO BE DEVELOPED: Font loading strategies, subsetting, variable fonts vs static, hosting decisions]
+### OpenType Features
-## Typography System Architecture
+Most developers don't know these exist. Use them for polish:
-### Token Structure
+```css
+/* Tabular numbers for data alignment */
+.data-table { font-variant-numeric: tabular-nums; }
-[TO BE DEVELOPED: Font stacks, size scales, weight scales, line heights, letter spacing]
+/* Proper fractions */
+.recipe-amount { font-variant-numeric: diagonal-fractions; }
-### Implementation
+/* Small caps for abbreviations */
+abbr { font-variant-caps: all-small-caps; }
-[TO BE DEVELOPED: CSS custom properties, utility classes, semantic vs primitive tokens]
+/* Disable ligatures in code */
+code { font-variant-ligatures: none; }
+
+/* Enable kerning (usually on by default, but be explicit) */
+body { font-kerning: normal; }
+```
+
+Check what features your font supports at [Wakamai Fondue](https://wakamaifondue.com/).
+
+## Typography System Architecture
+
+### Token Structure
+
+**Name tokens semantically, not by value**:
+
+```css
+/* Bad: tied to implementation */
+--font-size-16: 1rem;
+--font-size-24: 1.5rem;
+
+/* Good: tied to purpose */
+--font-size-body: 1rem;
+--font-size-heading: 1.5rem;
+```
+
+A complete token set:
+
+```css
+:root {
+ /* Font stacks */
+ --font-sans: 'CustomSans', system-ui, sans-serif;
+ --font-serif: 'CustomSerif', Georgia, serif;
+ --font-mono: 'JetBrains Mono', ui-monospace, monospace;
+
+ /* Size scale (semantic) */
+ --text-xs: 0.75rem;
+ --text-sm: 0.875rem;
+ --text-base: 1rem;
+ --text-lg: 1.25rem;
+ --text-xl: 1.5rem;
+ --text-2xl: 2rem;
+ --text-3xl: 3rem;
+
+ /* Weight */
+ --font-normal: 400;
+ --font-medium: 500;
+ --font-semibold: 600;
+ --font-bold: 700;
+
+ /* Line height */
+ --leading-tight: 1.25;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.75;
+
+ /* Letter spacing */
+ --tracking-tight: -0.02em;
+ --tracking-normal: 0;
+ --tracking-wide: 0.05em;
+}
+```
## Accessibility Considerations
-[TO BE DEVELOPED: Text scaling, contrast ratios, font sizes, dyslexia-friendly choices]
+Beyond contrast ratios (which are well-documented), consider:
+
+- **Never disable zoom**: `user-scalable=no` breaks accessibility. If your layout breaks at 200% zoom, fix the layout.
+- **Use rem/em for font sizes**: This respects user browser settings. Never `px` for body text.
+- **Minimum 16px body text**: Smaller than this strains eyes and fails WCAG on mobile.
+- **Adequate touch targets**: Text links need padding or line-height that creates 44px+ tap targets.
---
diff --git a/source/skills/frontend-design/reference/ux-writing.md b/source/skills/frontend-design/reference/ux-writing.md
index 0966e455c..b2e833e73 100644
--- a/source/skills/frontend-design/reference/ux-writing.md
+++ b/source/skills/frontend-design/reference/ux-writing.md
@@ -22,163 +22,263 @@ Then write copy that is:
- Human and empathetic
- Consistent in terminology and tone
-## Fundamental Principles
+## The Button Label Problem
-### Clarity Over Cleverness
+**Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
-[TO BE DEVELOPED: Plain language, avoid jargon, specific over vague, "Save changes" not "OK"]
+| Bad | Good | Why |
+|-----|------|-----|
+| OK | Save changes | Says what will happen |
+| Submit | Create account | Outcome-focused |
+| Yes | Delete message | Confirms the action |
+| Cancel | Keep editing | Clarifies what "cancel" means |
+| Click here | Download PDF | Describes the destination |
-### Concise But Complete
+**For destructive actions**, name the destruction:
+- "Delete" not "Remove" (delete is permanent, remove implies recoverable)
+- "Delete 5 items" not "Delete selected" (show the count)
-[TO BE DEVELOPED: Remove unnecessary words, but include essential information, balance brevity with clarity]
+## Error Messages: The Formula
-### Active Voice
+Every error message should answer three questions:
-[TO BE DEVELOPED: "We saved your changes" not "Your changes have been saved", action-oriented language]
+1. **What happened?** (Clearly state the problem)
+2. **Why?** (If not obvious)
+3. **How to fix it?** (Specific action)
-### User-Focused Language
+```
+Bad: "Invalid input"
-[TO BE DEVELOPED: "Your" not "The", focus on user benefits, user's mental model]
+Good: "Email address isn't valid. Please include an @ symbol."
-### Consistency
+Bad: "Request failed"
-[TO BE DEVELOPED: Use same terms throughout, don't vary for variety, build terminology glossary]
+Good: "We couldn't save your changes. Check your internet connection and try again."
+```
-## Voice & Tone
+### Error Message Templates
-### Establishing Brand Voice
+| Situation | Template |
+|-----------|----------|
+| **Format error** | "[Field] needs to be [format]. Example: [example]" |
+| **Missing required** | "Please enter [what's missing]" |
+| **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
+| **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
+| **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
-[TO BE DEVELOPED: Personality dimensions, voice guidelines, voice vs tone distinction]
+### Don't Blame the User
-### Adapting Tone to Context
+```
+Bad: "You entered an invalid date"
+Good: "Please enter a date in MM/DD/YYYY format"
-[TO BE DEVELOPED: Success = celebratory, Error = empathetic, Loading = reassuring, matching emotional moment]
+Bad: "Your password is too weak"
+Good: "Add at least one number or symbol to strengthen your password"
+```
-### Voice Across Cultures
+## Empty States Are Opportunities
-[TO BE DEVELOPED: Cultural sensitivity, humor translation, formality levels, global considerations]
+An empty list isn't a dead end—it's an onboarding moment.
-## Microcopy Excellence
+```
+Bad: "No items"
-### Button & CTA Copy
+Good: "No projects yet
+ Projects help you organize your work. Create your first one to get started.
+ [+ Create project]"
+```
-[TO BE DEVELOPED: Specific actions ("Create account" not "Submit"), verb + noun structure, outcome-oriented]
+**Empty state formula**:
+1. Acknowledge the emptiness (briefly)
+2. Explain the value of filling it
+3. Provide a clear action
-### Labels & Instructions
+## Voice vs Tone
-[TO BE DEVELOPED: Clear, specific labels, instructions before fields, showing format with examples]
+**Voice** is your brand's personality—consistent everywhere.
+**Tone** adapts to the moment.
-### Placeholder Text
+| Moment | Tone Shift |
+|--------|------------|
+| Success | Celebratory, brief: "Done! Your changes are live." |
+| Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
+| Loading | Reassuring: "Saving your work..." |
+| Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
-[TO BE DEVELOPED: When to use (rarely), never as labels, examples not instructions]
+**Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
-### Tooltips & Help Text
-
-[TO BE DEVELOPED: Adding value beyond label, answering implicit questions, brevity with links to details]
+## Writing for Accessibility
-## Error Messages & Validation
+### Link Text
-### Error Message Principles
+Screen readers can navigate by links. Vague links fail:
-[TO BE DEVELOPED: Explain what happened, suggest fix, don't blame user, provide examples, link to help]
+```html
+<!-- Bad: meaningless without context -->
+<a href="...">Click here</a>
+<a href="...">Learn more</a>
-### Validation Feedback
+<!-- Good: standalone meaning -->
+<a href="...">View pricing plans</a>
+<a href="...">Learn more about data export</a>
+```
-[TO BE DEVELOPED: Inline validation, timing (on blur vs on submit), success states, clear requirements]
+### Alt Text
-### Error Message Patterns
+Describe the **information**, not the image:
-[TO BE DEVELOPED: Format errors, permission errors, network errors, system errors, 404s]
+```html
+<!-- Bad: describes image -->
+<img alt="Chart" src="revenue.png">
-## Forms & Inputs
+<!-- Good: describes information -->
+<img alt="Revenue increased 40% in Q4" src="revenue.png">
-### Form Labels
+<!-- Decorative images get empty alt -->
+<img alt="" src="decorative-wave.png">
+```
-[TO BE DEVELOPED: Descriptive labels, required field indication, why you're asking (when not obvious)]
+### Button Context
-### Help Text
+Buttons need context, especially icons:
-[TO BE DEVELOPED: Format guidance, why you need this information, examples, constraints]
+```html
+<!-- Bad: no context -->
+<button>×</button>
-### Confirmation Dialogs
+<!-- Good: screen reader context -->
+<button aria-label="Close dialog">×</button>
+```
-[TO BE DEVELOPED: Specific about action, explain consequences, clear button labels, don't overuse]
+## Writing for Translation
-## System Messages
+### Plan for Expansion
-### Success Messages
+German text is ~30% longer than English. Allocate space:
-[TO BE DEVELOPED: Confirm what happened, what happens next, celebrate appropriately, be brief]
+| Language | Expansion |
+|----------|-----------|
+| German | +30% |
+| French | +20% |
+| Finnish | +30-40% |
+| Chinese | -30% (fewer chars, but same width) |
-### Loading States
+### Translation-Friendly Patterns
-[TO BE DEVELOPED: What's happening, time expectations, progress indication, personality in waiting]
+```
+Bad: "You have 3 new messages" (number inside sentence)
+Good: "New messages: 3" (number separate)
-### Empty States
+Bad: "Welcome back, {name}!" (word order varies by language)
+Good: "{greeting_message}" (full sentence as one string)
-[TO BE DEVELOPED: Explain why empty, value of filling it, clear CTA, welcoming not dead-end]
+Bad: "5 mins ago" (abbrev doesn't translate)
+Good: "5 minutes ago" (full word)
+```
-## Navigation & Wayfinding
+### Give Translators Context
-### Navigation Labels
+```json
+{
+ "delete_confirm": {
+ "message": "Delete {item}?",
+ "context": "Confirmation dialog when deleting a file or folder. {item} is the name of the item being deleted."
+ }
+}
+```
-[TO BE DEVELOPED: Specific and descriptive, user language not internal terms, clear information scent]
+## Consistency: The Terminology Problem
-### Breadcrumbs & Headers
+Pick one term and stick with it:
-[TO BE DEVELOPED: Clear location indication, hierarchical clarity, shortened for mobile]
+| Inconsistent | Consistent |
+|--------------|------------|
+| Delete / Remove / Trash | Delete |
+| Settings / Preferences / Options | Settings |
+| Sign in / Log in / Enter | Sign in |
+| Create / Add / New | Create |
-### Search & Filters
+Build a terminology glossary and enforce it. Variety creates confusion.
-[TO BE DEVELOPED: Clear search placeholders, filter labels, no results messaging]
+## Avoid Redundant Copy
-## Content Hierarchy & Structure
+Saying the same thing twice wastes space and dilutes impact.
-### Scannable Writing
+**Common redundancies**:
+- Section header + intro paragraph saying the same thing
+- Page title + section title with same/similar text
+- CTA button + surrounding text repeating the action
+- Outro that restates the intro
-[TO BE DEVELOPED: Short paragraphs, bullet points, clear headings, front-load important info]
+```
+Bad: "Settings"
+ "Here you can adjust your settings and preferences."
+ [Settings form]
+ "Save your settings to apply changes."
-### Progressive Disclosure
+Good: "Settings"
+ [Settings form]
+ [Save]
+```
-[TO BE DEVELOPED: Essential info first, details on demand, expandable sections, learn more links]
+**The rule**: If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
-## Writing for Accessibility
+## Loading States
-### Screen Reader Considerations
+Tell users what's happening:
-[TO BE DEVELOPED: ARIA labels, alt text writing, link text clarity, button labels]
+```
+Bad: "Loading..."
+Good: "Saving your draft..."
-### Plain Language
+Bad: [spinner]
+Good: "Searching 1,247 documents..."
-[TO BE DEVELOPED: Reading level considerations, avoid jargon, explain technical terms]
+Bad: "Please wait"
+Good: "Preparing your download... This usually takes 30 seconds."
+```
-### Text Alternatives
+For long waits, show progress or set expectations.
-[TO BE DEVELOPED: Transcripts for audio/video, alt text for images, descriptions for complex UI]
+## Confirmation Dialogs: Use Sparingly
-## Internationalization (i18n)
+**Most confirmation dialogs are design failures.** If an action is dangerous enough to confirm, consider:
+- Undo instead of confirm
+- Making the action less destructive
+- Showing consequences before the action
-### Writing for Translation
+When you must confirm:
-[TO BE DEVELOPED: Avoid idioms, complete sentences, context for translators, text expansion space]
+```
+Bad: "Are you sure?"
+ [Yes] [No]
-### Cultural Adaptation
+Good: "Delete 'Project Alpha'?
+ This will permanently delete the project and all its files.
+ [Delete project] [Keep project]"
+```
-[TO BE DEVELOPED: Cultural sensitivity, date/time formats, address formats, name formats]
+Name the action, explain consequences, use specific button labels.
-## Content Patterns by Type
+## Form Instructions
-### Onboarding Copy
+### Format Hints
-[TO BE DEVELOPED: Welcome messages, getting started, first-time guidance, value proposition]
+Show don't tell:
-### Settings & Preferences
+```
+Bad: "Enter date in MMDDYYYY format"
+Good: "Date of birth" + placeholder="04/15/1990"
+```
-[TO BE DEVELOPED: Clear option descriptions, impact explanation, defaults indication]
+### Why Are You Asking?
-### Notifications
+For non-obvious fields, explain:
-[TO BE DEVELOPED: Scannable, actionable, appropriate urgency, notification fatigue prevention]
+```html
+<label>Phone number (optional)</label>
+<span class="help">We'll only use this to contact you about your order.</span>
+```
---