@shavin/skills 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/AGENTS.md +193 -0
  2. package/CHANGELOG.md +27 -0
  3. package/LICENSE +21 -0
  4. package/README.md +48 -2
  5. package/bin/hex-policy.mjs +157 -0
  6. package/bin/install.mjs +219 -0
  7. package/bin/lint-tokens.mjs +178 -0
  8. package/build.mjs +540 -0
  9. package/commands/add-composition.md +14 -0
  10. package/commands/apply-theme.md +59 -0
  11. package/commands/audit-layout.md +15 -0
  12. package/commands/audit-ui.md +42 -0
  13. package/commands/compose-page.md +16 -0
  14. package/commands/create-block.md +79 -0
  15. package/commands/create-primitive.md +40 -0
  16. package/commands/create-screen.md +45 -0
  17. package/commands/create-theme.md +41 -0
  18. package/cursor/shavin.mdc +14 -0
  19. package/package.json +66 -4
  20. package/posix-path.mjs +7 -0
  21. package/skills/core-rules.md +294 -0
  22. package/skills/layout-choreography/SKILL.md +102 -0
  23. package/skills/layout-choreography/references/fallbacks-and-accessibility.md +76 -0
  24. package/skills/layout-choreography/references/scenes.md +113 -0
  25. package/skills/layout-choreography/references/shavin-timelines.md +100 -0
  26. package/skills/layout-choreography/references/tech-and-performance.md +147 -0
  27. package/skills/layout-compositions/SKILL.md +149 -0
  28. package/skills/layout-compositions/references/adapters/shavin-ui.md +122 -0
  29. package/skills/layout-compositions/references/adapters/tailwind-html.md +100 -0
  30. package/skills/layout-compositions/references/component-language.md +105 -0
  31. package/skills/layout-compositions/references/compositions/conversion.md +286 -0
  32. package/skills/layout-compositions/references/compositions/documentation.md +125 -0
  33. package/skills/layout-compositions/references/compositions/editorial.md +126 -0
  34. package/skills/layout-compositions/references/compositions/expressive.md +151 -0
  35. package/skills/layout-compositions/references/compositions/features.md +262 -0
  36. package/skills/layout-compositions/references/compositions/gallery.md +172 -0
  37. package/skills/layout-compositions/references/compositions/hero.md +184 -0
  38. package/skills/layout-compositions/references/compositions/proof.md +194 -0
  39. package/skills/layout-compositions/references/compositions/structural.md +173 -0
  40. package/skills/layout-compositions/references/distinctiveness.md +65 -0
  41. package/skills/layout-compositions/references/foundations.md +119 -0
  42. package/skills/layout-compositions/references/metadata-schema.md +64 -0
  43. package/skills/layout-compositions/references/page-recipes.md +143 -0
  44. package/skills/layout-compositions/references/selection-guide.md +207 -0
  45. package/skills/layout-compositions/references/treatments.md +60 -0
  46. package/skills/layout-compositions/references/unsection-source-examples.md +92 -0
  47. package/skills/layout-compositions/references/visual-review.md +40 -0
  48. package/skills/layout-compositions/scripts/render_wireframes.py +138 -0
  49. package/skills/layout-compositions/scripts/validate_library.py +165 -0
  50. package/skills/layout-motion/SKILL.md +83 -0
  51. package/skills/layout-motion/references/composition-motion-map.md +69 -0
  52. package/skills/layout-motion/references/presets.md +209 -0
  53. package/skills/layout-motion/references/tokens.md +100 -0
  54. package/skills/shavin-app/SKILL.md +242 -0
  55. package/skills/shavin-app/patterns.md +35 -0
  56. package/skills/shavin-studio/SKILL.md +97 -0
  57. package/skills/shavin-webpage/SKILL.md +210 -0
  58. package/skills/shavin-webpage/editorial-craft.md +117 -0
  59. package/skills/shavin-webpage/page-architecture.md +137 -0
  60. package/skills/shavin-webpage/style-recipes.md +107 -0
  61. package/skills/visual-compositor/SKILL.md +200 -0
  62. package/skills/visual-compositor/anti-patterns.md +109 -0
  63. package/skills/visual-compositor/audit-checklist.md +162 -0
  64. package/skills/visual-compositor/cognitive-layer.md +287 -0
  65. package/skills/visual-compositor/composition-motion-map.md +167 -0
  66. package/skills/visual-compositor/concentric-laws.md +147 -0
  67. package/skills/visual-compositor/docs-mode.md +32 -0
  68. package/skills/visual-compositor/editorial-mode.md +48 -0
  69. package/skills/visual-compositor/font-pairings.md +224 -0
  70. package/skills/visual-compositor/graphics-and-assets.md +128 -0
  71. package/skills/visual-compositor/interface-polish.md +125 -0
  72. package/skills/visual-compositor/layout-restraint.md +80 -0
  73. package/skills/visual-compositor/motion-and-physics.md +257 -0
  74. package/skills/visual-compositor/page-motion-presets.md +246 -0
  75. package/skills/visual-compositor/references/EDITORIAL_EXPRESSIVE.md +163 -0
  76. package/skills/visual-compositor/spacing-core.md +386 -0
  77. package/skills/visual-compositor/spacing-dense.md +63 -0
  78. package/skills/visual-compositor/spacing-marketing.md +192 -0
  79. package/skills/visual-compositor/typography-rules.md +114 -0
  80. package/token-budget.json +86 -0
@@ -0,0 +1,257 @@
1
+ # Motion, Physics & Animation Invariants
2
+
3
+ > Synthesizing the motion doctrines of **Emil Kowalski** (*animations.dev*) and **Rauno Freiberg** (*Interface Craft*), bound strictly to `@shavin/ui` token architecture and hardware-accelerated CSS.
4
+
5
+ ---
6
+
7
+ ## 1. The Animation Decision Framework (Emil Kowalski)
8
+
9
+ Before writing any animation or transition, answer these four questions in order:
10
+
11
+ ### 1. Should this animate at all? (The Frequency Law)
12
+
13
+ How often will users trigger this interaction?
14
+
15
+ | Frequency | Decision | Rule / Reference |
16
+ |---|---|---|
17
+ | **100+ times / day** | **No animation. Ever.** | Keyboard shortcuts, command palettes (`Cmd+K`), quick search, row navigation. Any animation here feels slow, delayed, and frustrating (e.g. Raycast has zero open/close animation). |
18
+ | **Tens of times / day** | **Subtle or instant (<150ms)** | Hover states, tab switches, list sorting. |
19
+ | **Occasional** | **Standard animation (150–250ms)** | Dialogs, drawers, popovers, dropdowns, toast notifications. |
20
+ | **Rare / First-time** | **Delight allowed (300–600ms)** | Onboarding sequences, billing confirmation, empty state celebrations. |
21
+
22
+ > ⚠️ **Never animate keyboard-initiated actions.** Keyboards mean high-intent and high-frequency. Animate mouse gestures or viewport scroll, never keyboard triggers.
23
+
24
+ ---
25
+
26
+ ### 2. What is the purpose?
27
+
28
+ Every motion must satisfy at least one functional purpose:
29
+ - **Spatial consistency**: Toast enters and exits from the same direction; drawer slides from its edge.
30
+ - **State feedback**: A button scales down on `:active` press to acknowledge input.
31
+ - **Cognitive continuity**: Shared element morphing so users don't lose context between views.
32
+ - **Preventing jarring cuts**: Elements appearing or vanishing instantaneously feel broken or glitchy.
33
+
34
+ If the purpose is merely *"it looks cool"* and users see it repeatedly, **do not animate**.
35
+
36
+ ---
37
+
38
+ ### 3. Custom Easing Curves (Foundation Tokens)
39
+
40
+ Default CSS easings (`ease`, `ease-in`) feel weak and sluggish. UI motions require high-initial-velocity custom cubic beziers — now **tokenized** as foundation-level CSS variables:
41
+
42
+ ```css
43
+ /* Foundation tokens — defined in :root, never overridden per-component */
44
+ --ease-out: cubic-bezier(0.23, 1, 0.32, 1); /* Snappy UI: dropdowns, popovers, enter */
45
+ --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* On-screen morph: elements changing shape */
46
+ --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1); /* Sheet/drawer: iOS tactile momentum */
47
+ ```
48
+
49
+ **Tailwind utilities:** `ease-out`, `ease-in-out`, `ease-drawer` (via `transitionTimingFunction` preset).
50
+
51
+ #### The Ease-In Ban
52
+ - ❌ **Never use `ease-in` for UI animations.** It starts slow, creating noticeable lag during the first 100ms when the user's eye is most focused.
53
+ - ✅ **Entering / Appearing elements:** Always use `--ease-out` (snappy, high initial velocity).
54
+ - ✅ **Sheet / Drawer / Sidebar:** Use `--ease-drawer` for iOS-momentum tactile feel.
55
+ - ✅ **Exiting / Disappearing elements:** Fast `--ease-out` under 160ms.
56
+
57
+ ---
58
+
59
+ ### 4. Duration Tokens (Foundation → Semantic)
60
+
61
+ Durations are now **tokenized** at the foundation level. Every semantic utility and page-level preset references these — **never hardcode `ms` values in components**.
62
+
63
+ | Token | Value | Purpose | Tailwind Utility |
64
+ |---|---|---|---|
65
+ | `--dur-instant` | 100ms | Press feedback, instant toggles, tooltip re-open | `duration-instant` |
66
+ | `--dur-fast` | 160ms | Hover color shifts, panel exit, quick transitions | `duration-fast` |
67
+ | `--dur-base` | 240ms | State changes: modals, menus, accordions, backdrop | `duration-base` |
68
+ | `--dur-slow` | 400ms | Large surface changes, sidebar collapse, sheet open | `duration-slow` |
69
+ | `--dur-enter` | 560ms | Entrances, reveals, page-load stagger sequences | `duration-enter` |
70
+
71
+ > **Perception Rule:** UI animations should almost always stay **under 300ms** (`--dur-base`). A 160ms dropdown feels significantly more responsive than a 350ms dropdown. `--dur-slow` and `--dur-enter` are reserved for large-surface and entrance choreography only.
72
+
73
+ ---
74
+
75
+ ### 5. Distance Tokens (Foundation)
76
+
77
+ Entrance travel distances are tokenized so that reduced-motion can zero them in one place:
78
+
79
+ | Token | Value | Purpose |
80
+ |---|---|---|
81
+ | `--dist-xs` | 4px | Micro-shifts, subtle parallax |
82
+ | `--dist-sm` | 8px | Popover/tooltip entrance travel |
83
+ | `--dist-md` | 16px | Default entrance travel for stagger reveals |
84
+ | `--dist-lg` | 24px | Maximum entrance travel, hero reveals |
85
+
86
+ ---
87
+
88
+ ### 6. Stagger Token
89
+
90
+ | Token | Value | Purpose |
91
+ |---|---|---|
92
+ | `--stagger` | 60ms | Interval between sequentially revealed elements |
93
+
94
+ Used in page-level presets (see `page-motion-presets.md`). Multiply by index: delay = `calc(var(--stagger) * N)`.
95
+
96
+ ---
97
+
98
+ ## 2. Reduced-Motion Safety Net
99
+
100
+ Shavin's reduced-motion strategy is **token-level, not rule-level**. Instead of overriding each animation utility individually, all motion tokens collapse to zero in one media query:
101
+
102
+ ```css
103
+ @media (prefers-reduced-motion: reduce) {
104
+ :root {
105
+ --dur-instant: 0ms; --dur-fast: 0ms; --dur-base: 0ms;
106
+ --dur-slow: 0ms; --dur-enter: 0ms; --stagger: 0ms;
107
+ --dist-xs: 0px; --dist-sm: 0px; --dist-md: 0px; --dist-lg: 0px;
108
+ }
109
+ }
110
+ ```
111
+
112
+ **What this achieves automatically:**
113
+ - All `.animate-*` utilities collapse to 0ms duration → content appears instantly.
114
+ - All entrance travel distances become 0px → nothing shifts position.
115
+ - Stagger intervals become 0ms → all elements reveal simultaneously.
116
+ - CSS `transition-duration` is zeroed via the existing `*{}` rule.
117
+
118
+ **What still runs (by design):**
119
+ - Functional infinite loops: Spinner's spin, Skeleton's pulse, caret-blink — these are keyframe animations, not transition-duration based, so they keep running. They're non-distracting and communicate ongoing state.
120
+ - Opacity fades via `fade-only` / `fade-only-out` keyframes still provide gentle enter/exit (at 0ms = instant snap, or 100ms = barely perceptible).
121
+
122
+ **Component code needs zero changes.** No `@media` checks in components. No conditional logic. The token safety net handles everything.
123
+
124
+ ---
125
+
126
+ ## 3. Spring Physics & Velocity Preservation
127
+
128
+ Springs simulate physical mass, stiffness, and damping. Unlike fixed-duration curves, springs settle naturally and preserve velocity when interrupted.
129
+
130
+ ### Apple Spring Presets
131
+ ```ts
132
+ // Standard UI Interaction (Snappy, no oscillation)
133
+ const snappySpring = { type: "spring", duration: 0.35, bounce: 0 };
134
+
135
+ // Interactive Gesture / Sheet (Subtle tactile bounce)
136
+ const tactileSpring = { type: "spring", duration: 0.5, bounce: 0.15 };
137
+
138
+ // Playful / Celebration
139
+ const playfulSpring = { type: "spring", duration: 0.6, bounce: 0.28 };
140
+ ```
141
+
142
+ ### Interruptibility: CSS Transitions vs. Keyframes (Rauno Freiberg)
143
+
144
+ - **CSS Transitions (`transition: transform ...`)**: Interpolate toward the *latest* state. When a user changes intent mid-interaction (e.g. clicking away while a drawer opens), transitions retarget smoothly from the current position.
145
+ - **CSS Keyframes (`animation: slideIn ...`)**: Run on an immutable timeline. Reversing mid-motion causes sudden snapping or jumpy restarts.
146
+ - **Rule**: Always use CSS transitions or springs for interactive states. Reserve keyframes strictly for non-interactive, one-shot loop sequences (e.g. pulsing status lights).
147
+
148
+ ---
149
+
150
+ ## 4. Semantic Animation Utilities (Two-Tier System)
151
+
152
+ Shavin's motion system follows the same two-tier architecture as colors and radii — **foundation tokens** (raw cubic-beziers + durations + distances) are wrapped into **semantic utilities** (purpose-driven CSS classes that bundle easing + duration + keyframes). Always reach for the semantic utility, never the raw cubic-bezier.
153
+
154
+ | Utility | Purpose | Duration Token | Easing | Keyframe |
155
+ |---|---|---|---|---|
156
+ | `.animate-rise` | Popover / tooltip / hover-card enter (directional) | `--dur-fast` (160ms) | `--ease-out` | `fade-rise-{up,down,left,right}` |
157
+ | `.animate-rise-fast` | Quick tooltip re-open (skips delay) | `--dur-instant` (100ms) | `--ease-out` | `fade-rise-{dir}` |
158
+ | `.animate-modal-in` | Modal dialog enter (scale + fade from center) | `--dur-base` (240ms) | `--ease-out` | `fade-zoom` |
159
+ | `.animate-overlay` | Dialog / spotlight backdrop fade | `--dur-base` (240ms) | `ease` | `fade-only` (opacity only) |
160
+ | `.animate-accordion-down` | Accordion content expand | `--dur-base` (240ms) | `--ease-out` | `accordion-down` |
161
+ | `.animate-accordion-up` | Accordion content collapse | `--dur-base × 0.8` (192ms) | `--ease-out` | `accordion-up` |
162
+ | `.animate-progress-indeterminate` | Loading bar indeterminate loop | loop | `ease-in-out` | `progress-indeterminate` |
163
+ | `.animate-pulse-dot` | Status light pulse (functional loop) | loop | `ease-in-out` | `pulse-dot` |
164
+ | `.animate-caret-blink` | Code editor caret blink | loop | `steps(2)` | `caret-blink` |
165
+
166
+ > **Closed-state animations**: Radix `data-state="closed"` variants reuse `fade-fall` (`--dur-instant`) for exit — faster than enter, as the user already decided to dismiss.
167
+ >
168
+ > **Reduced motion**: All duration tokens collapse to 0ms via the safety net. Utilities effectively snap to final state. Components need no extra code.
169
+
170
+ ---
171
+
172
+ ## 5. Enter Choreography: Split & Stagger (Rauno Freiberg)
173
+
174
+ When revealing a new screen, hero section, or modal, never animate the entire container as one monolithic block. Split the content into semantic layers and stagger their entrance using `--stagger` and `--dist-md`:
175
+
176
+ ### Stagger Recipe (Token-Based)
177
+ 1. **Group 1 (0ms)**: Eyebrow badge / category pill.
178
+ 2. **Group 2 (`--stagger × 1`)**: Headline (`<Heading>`).
179
+ 3. **Group 3 (`--stagger × 2`)**: Subheading and description (`<Text>`).
180
+ 4. **Group 4 (`--stagger × 3`)**: Primary & secondary action buttons (`<Button>`).
181
+ 5. **Group 5 (`--stagger × 4`)**: Visual artifact (mockup, metric grid, inspector window).
182
+
183
+ ### Visual State Transition
184
+ Combine three properties for cinematic entrance:
185
+ ```css
186
+ /* Initial State — uses distance token */
187
+ opacity: 0;
188
+ transform: translateY(var(--dist-md)); /* 16px, collapses to 0 under reduced-motion */
189
+ filter: blur(4px);
190
+
191
+ /* Final Settled State */
192
+ opacity: 1;
193
+ transform: translateY(0);
194
+ filter: blur(0px);
195
+ ```
196
+ ```tsx
197
+ // Tailwind representation with staggered delays using --stagger token
198
+ <div className="opacity-0 translate-y-[var(--dist-md)] blur-sm
199
+ animate-fade-up [animation-delay:calc(var(--stagger)*0)]
200
+ [animation-fill-mode:forwards]">...</div>
201
+ <div className="opacity-0 translate-y-[var(--dist-md)] blur-sm
202
+ animate-fade-up [animation-delay:calc(var(--stagger)*1)]
203
+ [animation-fill-mode:forwards]">...</div>
204
+ <div className="opacity-0 translate-y-[var(--dist-md)] blur-sm
205
+ animate-fade-up [animation-delay:calc(var(--stagger)*2)]
206
+ [animation-fill-mode:forwards]">...</div>
207
+ ```
208
+
209
+ > 💡 Under `prefers-reduced-motion`, `--stagger` and `--dist-md` both collapse to 0 — all elements appear instantly at their final position with zero blur. No conditional code needed.
210
+
211
+ ---
212
+
213
+ ## 6. Micro-Interaction Invariants
214
+
215
+ ### 1. The Press State
216
+ Every pressable element (`<Button>`, `<IconButton>`, clickable card) MUST provide immediate tactile feedback:
217
+ ```tsx
218
+ className="active:scale-[0.97] transition-transform duration-instant ease-out"
219
+ ```
220
+
221
+ ### 2. Never Animate From `scale(0)`
222
+ In the physical world, objects do not appear from a single zero-dimension singularity. Animating from `scale(0)` feels jarring and cartoonish.
223
+ - ❌ `transform: scale(0) -> scale(1)`
224
+ - ✅ `transform: scale(0.95) opacity: 0 -> transform: scale(1) opacity: 1`
225
+
226
+ ### 3. Origin Anchor Alignment
227
+ Popovers, dropdown menus, and tooltips must animate outward from their trigger element:
228
+ - ❌ Scaling from `transform-origin: center` for dropdowns.
229
+ - ✅ Scaling from `transform-origin: top left` or `transform-origin: top center` matching the trigger anchor.
230
+
231
+ ---
232
+
233
+ ## 7. Page-Level Motion Presets
234
+
235
+ For entrance choreography patterns, stagger recipes, and composition-specific motion recommendations, see:
236
+
237
+ - **`page-motion-presets.md`** — Tier-1 entrance presets (fade-rise, blur-rise, split-stagger, word-reveal) with token-based timing.
238
+ - **`composition-motion-map.md`** — Which preset to apply per layout composition. "None" is a valid and often best answer.
239
+
240
+ **Key principle:** Pick one or two presets per page section, not all of them. Motion should guide the eye, not perform.
241
+
242
+ ---
243
+
244
+ ## 8. Review Format: Before / After / Why Table
245
+
246
+ When reviewing, auditing, or refactoring UI motion in `@shavin`, format all findings into this mandatory comparative table:
247
+
248
+ | Before | After | Why |
249
+ |---|---|---|
250
+ | `transition: all 300ms ease` | `transition: transform var(--dur-fast) ease-out, opacity var(--dur-fast) ease-out` | Specify exact hardware properties; ban `all`; token-based duration; snappy custom easing. |
251
+ | `duration: 200ms` hardcoded | `duration-fast` (`var(--dur-fast)`) | Duration tokens enable reduced-motion safety net + consistency across components. |
252
+ | `translateY(12px)` hardcoded | `translateY(var(--dist-md))` | Distance tokens collapse to 0 under reduced-motion. |
253
+ | `scale(0) -> scale(1)` | `scale(0.95) opacity(0) -> scale(1) opacity(1)` | Elements in reality never pop out of zero space; starting at 95% scale looks organic. |
254
+ | `animate-bounce` on button | `active:scale-[0.97]` | Bouncing is distracting; physical press feedback confirms interaction. |
255
+ | Monolithic container fade | Split & stagger (badge → h1 → text → cta) | Staggering guides eye along natural reading path. |
256
+ | `ease-in` on dropdown menu | `ease-out` (`--ease-out`) | `ease-in` delays initial movement, making menus feel unresponsive. |
257
+ | Per-component `@media (reduced-motion)` checks | Token safety net (automatic) | One media query zeros all durations/distances; zero component-level conditionals. |
@@ -0,0 +1,246 @@
1
+ # Page-Level Motion Presets
2
+
3
+ > Tier-1 entrance presets using `@shavin/ui` motion tokens. Each preset is a self-contained recipe — easing, duration, distance, and stagger all reference foundation tokens, so reduced-motion collapses them automatically. See `composition-motion-map.md` for which preset to apply per layout composition. The full 11-preset catalogue and composition-motion-map now also live in the `layout-motion` skill (`layout-motion/references/presets.md`).
4
+
5
+ ---
6
+
7
+ ## How to Use
8
+
9
+ 1. **Pick one or two presets per page section** — not all of them. Motion should guide the eye, not perform.
10
+ 2. **Match the preset to the content density** — a hero can afford `word-reveal`; a dense feature grid should use a simple `fade-rise`.
11
+ 3. **Always use tokens** — `var(--dur-*)`, `var(--dist-*)`, `var(--stagger)`, `var(--ease-out)`. Never hardcode ms/px values.
12
+ 4. **Reduced-motion is automatic** — all tokens collapse to 0 via the safety net in `global.css`. No conditional code needed.
13
+
14
+ ---
15
+
16
+ ## P1: Fade-Rise (Default Entrance)
17
+
18
+ **Best for:** Most sections. Safe, subtle, universal.
19
+ **Feel:** Content rises into place with a gentle opacity fade. No blur, no overshoot.
20
+
21
+ ```tsx
22
+ <div
23
+ className="opacity-0 translate-y-[var(--dist-md)] ease-out
24
+ [animation:fade-in-rise_var(--dur-enter)_var(--ease-out)_both]
25
+ [animation-delay:calc(var(--stagger)*var(--i,0))]"
26
+ style={{ "--i": 0 }}
27
+ />
28
+ ```
29
+
30
+ | Property | Value | Token |
31
+ |---|---|---|
32
+ | Duration | 560ms | `--dur-enter` |
33
+ | Distance | 16px | `--dist-md` |
34
+ | Easing | `cubic-bezier(0.23, 1, 0.32, 1)` | `--ease-out` |
35
+ | Stagger | 60ms per item | `--stagger` |
36
+
37
+ **Keyframe (if not using inline):**
38
+ ```css
39
+ @keyframes fade-in-rise {
40
+ from { opacity: 0; transform: translateY(var(--dist-md)); }
41
+ to { opacity: 1; transform: translateY(0); }
42
+ }
43
+ ```
44
+
45
+ **When to use:** Feature grids, stats, testimonials, FAQ, footer. Any section where you want a gentle "content has arrived" feel without drawing attention to the motion itself.
46
+
47
+ **When NOT to use:** If the section is seen 100+ times/day (Frequency Law). Skip animation entirely.
48
+
49
+ ---
50
+
51
+ ## P2: Blur-Rise (Cinematic Entrance)
52
+
53
+ **Best for:** Hero sections, major section transitions, premium reveals.
54
+ **Feel:** Content emerges from a blurred state while rising — cinematic, high-production-value.
55
+
56
+ ```tsx
57
+ <div
58
+ className="opacity-0 translate-y-[var(--dist-md)] blur-[4px] ease-out
59
+ [animation:blur-in-rise_var(--dur-enter)_var(--ease-out)_both]
60
+ [animation-delay:calc(var(--stagger)*var(--i,0))]"
61
+ style={{ "--i": 0 }}
62
+ />
63
+ ```
64
+
65
+ | Property | Value | Token |
66
+ |---|---|---|
67
+ | Duration | 560ms | `--dur-enter` |
68
+ | Distance | 16px | `--dist-md` |
69
+ | Blur | 4px → 0 | (fixed, not tokenized) |
70
+ | Easing | `cubic-bezier(0.23, 1, 0.32, 1)` | `--ease-out` |
71
+ | Stagger | 60ms per item | `--stagger` |
72
+
73
+ **Keyframe:**
74
+ ```css
75
+ @keyframes blur-in-rise {
76
+ from { opacity: 0; transform: translateY(var(--dist-md)); filter: blur(4px); }
77
+ to { opacity: 1; transform: translateY(0); filter: blur(0); }
78
+ }
79
+ ```
80
+
81
+ **When to use:** Hero headline + subhead + CTA reveal. First viewport only — never repeat on scroll for below-the-fold sections (becomes tedious).
82
+
83
+ ---
84
+
85
+ ## P3: Split-Stagger (Rauno Sequence)
86
+
87
+ **Best for:** Hero sections with distinct semantic layers (badge → headline → text → CTA → visual).
88
+ **Feel:** Each layer enters in sequence, guiding the eye along the natural reading path.
89
+
90
+ This is not a single keyframe but a **choreography pattern** — apply P1 or P2 to each layer with incremental `--i` values:
91
+
92
+ ```tsx
93
+ {/* Layer 0: Eyebrow badge */}
94
+ <div className="... [animation-delay:calc(var(--stagger)*0)]" style={{ "--i": 0 }} />
95
+
96
+ {/* Layer 1: Headline */}
97
+ <div className="... [animation-delay:calc(var(--stagger)*1)]" style={{ "--i": 1 }} />
98
+
99
+ {/* Layer 2: Subheading */}
100
+ <div className="... [animation-delay:calc(var(--stagger)*2)]" style={{ "--i": 2 }} />
101
+
102
+ {/* Layer 3: CTA buttons */}
103
+ <div className="... [animation-delay:calc(var(--stagger)*3)]" style={{ "--i": 3 }} />
104
+
105
+ {/* Layer 4: Visual artifact */}
106
+ <div className="... [animation-delay:calc(var(--stagger)*4)]" style={{ "--i": 4 }} />
107
+ ```
108
+
109
+ **Total sequence duration:** `--dur-enter` + (4 × `--stagger`) = 560ms + 240ms = **800ms**.
110
+ Under reduced-motion: `--dur-enter` = 0, `--stagger` = 0 → **all layers appear instantly**.
111
+
112
+ **When to use:** Hero sections, major section reveals, onboarding sequences. Maximum 5 layers — more becomes exhausting.
113
+
114
+ ---
115
+
116
+ ## P4: Word-by-Word Tagline Reveal
117
+
118
+ **Best for:** Hero taglines, mission statements, brand-defining headlines.
119
+ **Feel:** Each word appears in sequence — forces the reader to consume the message at a deliberate pace.
120
+
121
+ ```tsx
122
+ <h1 className="text-balance">
123
+ {"Your headline split into words".split(" ").map((word, i) => (
124
+ <span
125
+ key={i}
126
+ className="inline-block opacity-0 translate-y-[var(--dist-sm)] blur-[3px] ease-out
127
+ [animation:word-reveal_var(--dur-fast)_var(--ease-out)_both]
128
+ [animation-delay:calc(var(--stagger)*${i})]"
129
+ >
130
+ {word}&nbsp;
131
+ </span>
132
+ ))}
133
+ </h1>
134
+ ```
135
+
136
+ | Property | Value | Token |
137
+ |---|---|---|
138
+ | Duration (per word) | 160ms | `--dur-fast` |
139
+ | Distance | 8px | `--dist-sm` |
140
+ | Blur | 3px → 0 | (fixed) |
141
+ | Easing | `--ease-out` | `--ease-out` |
142
+ | Stagger | 60ms per word | `--stagger` |
143
+
144
+ **Keyframe:**
145
+ ```css
146
+ @keyframes word-reveal {
147
+ from { opacity: 0; transform: translateY(var(--dist-sm)); filter: blur(3px); }
148
+ to { opacity: 1; transform: translateY(0); filter: blur(0); }
149
+ }
150
+ ```
151
+
152
+ **When to use:** Exactly once per page — the hero tagline. Never repeat. This is a "rare/first-time" interaction per the Frequency Law.
153
+
154
+ **A11y note:** Each word is a separate `<span>` — screen readers still read the full sentence naturally since the text node is intact. The animation is purely visual.
155
+
156
+ ---
157
+
158
+ ## P5: Scale-In (Surface Appear)
159
+
160
+ **Best for:** Cards, modals, images entering the viewport on scroll.
161
+ **Feel:** Element scales up from 0.96 with opacity fade — organic, no singularity.
162
+
163
+ ```tsx
164
+ <div
165
+ className="opacity-0 scale-[0.96] ease-out
166
+ [animation:scale-in_var(--dur-slow)_var(--ease-out)_both]
167
+ [animation-delay:calc(var(--stagger)*var(--i,0))]"
168
+ style={{ "--i": 0 }}
169
+ />
170
+ ```
171
+
172
+ | Property | Value | Token |
173
+ |---|---|---|
174
+ | Duration | 400ms | `--dur-slow` |
175
+ | Scale | 0.96 → 1.0 | (fixed ratio, not distance) |
176
+ | Easing | `--ease-out` | `--ease-out` |
177
+ | Stagger | 60ms per item | `--stagger` |
178
+
179
+ **Keyframe:**
180
+ ```css
181
+ @keyframes scale-in {
182
+ from { opacity: 0; transform: scale(0.96); }
183
+ to { opacity: 1; transform: scale(1); }
184
+ }
185
+ ```
186
+
187
+ **When to use:** Image galleries, bento grid items, card-heavy sections on scroll-into-view. Pair with `IntersectionObserver` for scroll-triggered reveals.
188
+
189
+ ---
190
+
191
+ ## P6: Slide-In (Directional)
192
+
193
+ **Best for:** Drawers, sidebars, mobile sheets, off-canvas panels.
194
+ **Feel:** Surface slides in from its mounted edge with momentum easing.
195
+
196
+ ```tsx
197
+ {/* Left drawer */}
198
+ <div
199
+ className="ease-out
200
+ [animation:slide-in-left_var(--dur-slow)_var(--ease-drawer)_both]"
201
+ />
202
+
203
+ {/* Right drawer */}
204
+ <div
205
+ className="ease-out
206
+ [animation:slide-in-right_var(--dur-slow)_var(--ease-drawer)_both]"
207
+ />
208
+
209
+ {/* Bottom sheet */}
210
+ <div
211
+ className="ease-out
212
+ [animation:slide-in-up_var(--dur-slow)_var(--ease-drawer)_both]"
213
+ />
214
+ ```
215
+
216
+ | Property | Value | Token |
217
+ |---|---|---|
218
+ | Duration | 400ms | `--dur-slow` |
219
+ | Distance | 100% of element width/height | (not tokenized — directional) |
220
+ | Easing | `cubic-bezier(0.32, 0.72, 0, 1)` | `--ease-drawer` |
221
+
222
+ **Keyframes:**
223
+ ```css
224
+ @keyframes slide-in-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }
225
+ @keyframes slide-in-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
226
+ @keyframes slide-in-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
227
+ ```
228
+
229
+ **When to use:** Drawers, sidebars, bottom sheets. Uses `--ease-drawer` for iOS tactile momentum.
230
+
231
+ > Note: Slide distance (100%) is intentionally NOT tokenized — it's always the full element dimension. Under reduced-motion, `--dur-slow` = 0 → instant appear.
232
+
233
+ ---
234
+
235
+ ## Reduced-Motion Behavior Summary
236
+
237
+ | Preset | Normal | Reduced Motion |
238
+ |---|---|---|
239
+ | P1 Fade-Rise | 560ms fade + 16px rise | Instant appear, no movement |
240
+ | P2 Blur-Rise | 560ms fade + 16px rise + blur | Instant appear, no movement, no blur |
241
+ | P3 Split-Stagger | Sequential 800ms total | All layers appear simultaneously |
242
+ | P4 Word-Reveal | 160ms per word, 60ms stagger | All words appear simultaneously |
243
+ | P5 Scale-In | 400ms scale 0.96→1 | Instant appear at full scale |
244
+ | P6 Slide-In | 400ms slide + drawer easing | Instant appear, no slide |
245
+
246
+ All automatic via token safety net. Zero conditional code in components.
@@ -0,0 +1,163 @@
1
+ # Editorial & Expressive Mode Reference
2
+
3
+ > **Active for: `EDITORIAL` (full), `HYBRID` (hero/marquee sections), `MARKETING` (hero section only)**
4
+ >
5
+ > This chapter covers the 8 design capabilities that separate award-winning creative sites from competent marketing pages. All rules here are quantifiable — they produce specific visual outputs.
6
+
7
+ ---
8
+
9
+ ## 1. Motion Architecture
10
+
11
+ Motion is the single biggest differentiator between editorial and standard layouts. Every motion decision must serve a cognitive purpose — entrance (draws attention), transition (maintains orientation), or expression (communicates brand energy).
12
+
13
+ ### Easing Vocabulary
14
+
15
+ ```css
16
+ /* UI / Functional motion — fast, decisive, purposeful */
17
+ --ease-ui: cubic-bezier(0.2, 0, 0, 1); /* 150ms–300ms */
18
+ --ease-ui-out: cubic-bezier(0, 0, 0.2, 1); /* 200ms–400ms */
19
+
20
+ /* Editorial / Expressive motion — slow, confident, weighty */
21
+ --ease-editorial: cubic-bezier(0.76, 0, 0.24, 1); /* 700ms–1200ms */
22
+ --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1); /* 800ms–1000ms — spring-like */
23
+ --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1); /* 600ms–900ms — material-inspired */
24
+
25
+ /* Parallax / continuous — linear by intent */
26
+ --ease-parallax: linear;
27
+ ```
28
+
29
+ **Rule:** Never apply `--ease-editorial` timing to UI feedback (button press, form validation). Never apply `--ease-ui` timing to editorial reveals — it makes them feel mechanical.
30
+
31
+ ### Scroll-Triggered Entrance Animations
32
+
33
+ ```css
34
+ /* Starting state */
35
+ .reveal-up { opacity: 0; transform: translateY(2rem); } /* 32px — standard */
36
+ .reveal-fade { opacity: 0; } /* fade only */
37
+ .reveal-scale { opacity: 0; transform: scale(0.95); } /* subtle scale */
38
+
39
+ /* Ending state */
40
+ .revealed {
41
+ opacity: 1;
42
+ transform: translateY(0) scale(1);
43
+ transition: opacity 900ms var(--ease-reveal), transform 900ms var(--ease-reveal);
44
+ }
45
+ ```
46
+
47
+ **IntersectionObserver threshold:** `0.1` to `0.2` — trigger when 10–20% of the element is visible. Never `0` or `0.5`.
48
+
49
+ **Stagger delays:** `0ms`, `100ms`, `200ms`, `300ms` (max 500ms total stagger).
50
+
51
+ ### Parallax Ratios
52
+
53
+ ```
54
+ Background image / atmospheric layer: scroll × 0.3 to 0.5
55
+ Mid-layer content: scroll × 0.7 to 0.85
56
+ Foreground content: scroll × 1.0 (normal)
57
+ Sticky pinned layer: scroll × 0.0
58
+ ```
59
+
60
+ ### Responsive Motion
61
+
62
+ - **Desktop:** Full motion (entrance, parallax, stagger, page transitions).
63
+ - **Tablet:** Entrance + stagger — no parallax.
64
+ - **Mobile:** Entrance only, no stagger > 200ms, no parallax. Respect `@media (prefers-reduced-motion: reduce)`.
65
+
66
+ ---
67
+
68
+ ## 2. Editorial Typography
69
+
70
+ In editorial mode, typography is visual material — it creates shape, texture, and atmosphere.
71
+
72
+ ### Viewport-Relative Sizing with clamp()
73
+
74
+ ```css
75
+ font-size: clamp(3.5rem, 10vw, 10rem); /* 56px → scales with vw → 160px max */
76
+ font-size: clamp(2.5rem, 6vw, 6rem); /* 40px → scales → 96px max */
77
+ font-size: clamp(1.25rem, 2.5vw, 2rem); /* 20px → scales → 32px max */
78
+ font-size: clamp(1rem, 1.2vw, 1.125rem); /* 16px → scales → 18px max */
79
+ ```
80
+
81
+ ### Contrast Ratios & Display Rules
82
+
83
+ | Context | Standard mode minimum | Editorial mode target |
84
+ |---|---|---|
85
+ | Headline : body | 2:1 | 6:1 to 10:1 |
86
+ | Display : subtext | 3:1 | 8:1 to 15:1 |
87
+ | Overline : headline | 1:2 | 1:4 to 1:8 |
88
+
89
+ Display leading: `leading-none` (1.0) or `leading-[0.9]`. Tracking: `tracking-tight` or `tracking-tighter`.
90
+ Overline tracking: `tracking-[0.25em]` to `tracking-[0.4em]`.
91
+
92
+ ---
93
+
94
+ ## 3. Z-Axis and Spatial Depth
95
+
96
+ ### Z-Index Scale
97
+
98
+ `z-0` (base), `z-10` (floating cards/blobs), `z-20` (sticky headers/sidebars), `z-30` (dropdowns/popovers), `z-40` (modals/drawers), `z-50` (tooltips/alerts). Never `z-[9999]`.
99
+
100
+ ### 3D Transforms & Grid Escape
101
+
102
+ ```css
103
+ .card-3d {
104
+ transform-style: preserve-3d;
105
+ perspective: 1000px;
106
+ transition: transform 600ms var(--ease-smooth);
107
+ }
108
+ .card-3d:hover { transform: rotateX(4deg) rotateY(-4deg); }
109
+ ```
110
+
111
+ Grid Escape full-bleed: `className="w-screen relative left-[50%] right-[50%] -ml-[50vw] -mr-[50vw]"`
112
+
113
+ ---
114
+
115
+ ## 4. Asymmetric Grid and Composition
116
+
117
+ ### Asymmetric Column Patterns
118
+
119
+ ```jsx
120
+ className="grid grid-cols-[1.618fr_1fr] gap-16" /* Golden ratio */
121
+ className="grid grid-cols-[2fr_1fr] gap-12" /* 2/3 content — 1/3 void */
122
+ className="grid grid-cols-[auto_1fr] gap-10" /* Stat/number left, text right */
123
+ ```
124
+
125
+ The standard 50% content width minimum is suspended in Editorial mode. Content occupying 20–40% of viewport is valid for high-impact statements.
126
+
127
+ ---
128
+
129
+ ## 5. Section Transitions
130
+
131
+ - **Diagonal Clip-Path:** `clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);`
132
+ - **Section Overlap:** `<section className="-mt-12 md:-mt-20 rounded-t-[var(--radius-panel)] z-20">`
133
+ - **Atmospheric Continuity:** Page wrapper linear-gradient spanning multiple sections.
134
+
135
+ ---
136
+
137
+ ## 6. Color Atmosphere
138
+
139
+ - **Grain Texture:** `backgroundImage: svgNoise`, `opacity: 0.03`–`0.05`.
140
+ - **Glassmorphism:** `bg-white/5 backdrop-blur-2xl border border-white/10 shadow-[0_8px_32px_rgba(0,0,0,0.3)]`. Needs dynamic backdrop content.
141
+ - **Radial Glow:** `bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,var(--brand)/0.3,transparent)]`.
142
+
143
+ ---
144
+
145
+ ## 7. Theatrical White Space
146
+
147
+ - **Breath Section:** Viewport-filling pause (`min-h-[60vh]`) with one statement.
148
+ - **Void Minimums:** 20% viewport content floor. Generous vertical padding (`py-24`+).
149
+
150
+ ---
151
+
152
+ ## 8. Hero Scale & DVH Viewport Fill
153
+
154
+ ```jsx
155
+ <section className="min-h-[100dvh] relative flex flex-col items-center justify-center overflow-hidden pt-16">
156
+ <div className="absolute inset-0 z-0 bg-gradient-to-br from-[var(--n-950)] to-black" />
157
+ <div className="relative z-10 text-center px-4 max-w-7xl mx-auto">
158
+ <h1 className="text-[clamp(3.5rem,10vw,9rem)] font-display font-bold leading-none tracking-tight">
159
+ Headline
160
+ </h1>
161
+ </div>
162
+ </section>
163
+ ```