Design Language — Radial Plasmatic Jelly¶
Audience: humans and coding agents. This is the reference for how the site looks and feels, and how to build UI that is visually native to it. For the step-by-step “build a page that fits” checklist, see
docs/page-consistency.md.For the statement of the language — what the design is, why it is that way, and the laws behind these rules, without the values that move — see
design.mdat the repo root. This file is the authority whenever the two disagree.
The design language is Radial Plasmatic Jelly — hazy, translucent, always-gently-moving slabs that keep the refracting rim of Apple’s Liquid Glass, draped over a radial information architecture. Two ideas, one language:
Radial. The site orbits a central RMH mark; content radiates from the centre. The home feed is a vertically-scrolling wheel of cards (on the document’s own scroll) that stay flat and move with their glass, led by an inline compose box; navigation lives in a fixed RMH hub that, when tapped, sends the orb to the middle of the screen and swells it into a liquid globe — the destinations pinned to a glass sphere you turn, hold and let go of to travel — with no tap waves. A fixed ring backdrop, a soft blob field and the aurora keep the whole surface feeling continuous — and still: nothing in the backdrop animates, on any tier (§5.5 Living backdrop;
lib/__tests__/static-backdrop.test.ts). Jelly moves; the room does not. Mobile-first, with a strict high-contrast monochrome palette.Plasmatic jelly. Every surface is a slab of slightly hazy, translucent plasma-jelly: a low-contrast haze always drifts inside it, the 3D refracting, lit rim of liquid glass stays at its edge, it squashes and wobbles under the pointer within tight bounds, and nearby surfaces throw small electric arcs (and every click discharges a few). The public role classes keep their names —
.glass-fill,.glass-pane,.glass-chrome,.glass-overlayand.glass-inset— because “glass” names the elevation role and “jelly” the material. Haze, soft body and arcs are each owned by one document service inlib/jelly/+lib/liquid/glass/; the globe keeps its own dielectric coat and dough body. On top sit the owner’s #989 layers: a gel body that darkens toward its base, dormant plasma inside it that hover wakes and press brightens, an molded RGB-led edge (a lit shoulder rising from the ground, no hairline) and no gloss band across the face, a press lens dent with a light dot that slides with a drag (and rubber-bands off the edge), and charge — click charge that hops to a neighbour, small gaps that break down, Coulomb attraction within the nudge bound.
Identity: silent, sleek, frontier AI. Calm, never busy: a near-black void,
graphite surfaces, white ink and one electric accent (--site-accent), which
is also the plasma colour — this is the default theme (Midnight); Daylight is the same rule in daylight. No
gradients on the ground, no neon or glowing type, no sci-fi illustration. Copy is
short and literal. Text is Geist, data Geist Mono (§3); no eyebrows (2026-11-03: no
letterspaced all-caps labels — site-section-label, site-kicker, soft category chips). One signal
action per view — <Button variant="signal">, ink gel (§5.2).
Everything rests on one contract: a single set of CSS custom properties
(--site-*) that every theme re-defines. Components never hardcode colors,
radii, fonts, or shadows — they consume the contract through Tailwind utilities,
so any theme (and any accent preset layered on top) restyles the entire site
without a single component change.
Current: Plasmatic Jelly (2026-10-23). The material contract is
plasmatic-jelly-system.md; it supersedesliquid-glass-system.md, §5.1.1 below and the “idle at rest” wording of §7 for the jelly services. In short: no glass role usesbackdrop-filter; the budget is per tier (≤24 rim slabs, ≤8 animated haze canvases and ≤24 CSS flow carriers on a desktop, fewer on phones; surfaces past it keep the static haze floor); there are no box-shadows on UI surfaces (the shadow tokens are zero); hosts may squash and wobble within 4 px / 3 % and nudge neighbours ≤ 1.5 px, and layout never changes; arcs pass one site-wide flash ledger (≤ 3 per second). Every jelly service runs on one frame driver (lib/jelly/frame.ts) and one pointer hub (lib/jelly/pointer.ts); bodies sit ≥ 16 px apart with a 16 px unclipped margin; nothing fakes a law (no transform transitions off the--spring-*curves, no keyframes but the woken-haze drift, nofilter:in jelly CSS — the press lens is retired). Everywhere below that speaks of a tier’s “backdrop blur”, a “≤8 backdrop-filters” budget, an@supports not (backdrop-filter)fallback, “taps never emit ripples” or “nothing reacts to the pointer”, read it through that contract. The role-by-purpose rules are unchanged.Material CSS is
app/liquid-glass.css(role base) +app/jelly-material.css(haze, carriers, CSS rim, degradation) +app/jelly-arcs.css(the arc layer), with an app-token adapter incomponents/shared/app-theme.css. The radial shell and navigator live incomponents/radial/. The old SVG lens filters,lib/glass-lens.tsand the unusedlib/liquid-gl/tier remain deleted; historical modifier names are compatibility aliases;liquid-morphis the SVG-metaball path. Historical performance findings below still explain why viewport blur, root writes and blanket capture loops must not return.
Current companions: radial UI + the globe · the per-page checklist · UI audit 2026-10-09 (the most recent site-tier pass) · UI audit 2026-08-01 · performance audit 2026-08-01 (why the cursor effects went).
Historical specs — intent at the time of writing, superseded where this file
disagrees: v1 glass material
(2026-07-14) · v2 optics & floating shell
(2026-07-21; its useGlassLight v2 and shader-tier sections describe code that
has since been deleted).
0. Definition of done for a UI commit¶
Current interaction contract (2026-10-22). Everyday navigation is immediate;
only destinations selected through the open liquid globe use eversion. A legacy
all transition preference resolves to globe. The mobile shortcut bar and
grouped desktop rail supplement the globe. Controls use short colour/opacity
changes; floating surfaces use reversible transitions that preserve their current
frame when interrupted. Motion uses one shared scheme on every device; the website
reduced-motion setting and browser/OS motion overrides are retired. Historical
reduced-motion guidance below is superseded by this contract.
Page titles wrap by default, and search/filter rows must fit a 320px viewport.
Search and filters sit directly below their tab group, before summaries or cards.
Controls use --site-control-radius (the small radius), panels use --site-radius;
avatars, circular icon controls, badges and the globe keep their explicit shape.
The corner scale is concentric (Midnight/Daylight: card 32px, control and inner
tile 24px — 8px steps, so anything inset 8px inside a card follows its curve). 24px is a
full pill up to 48px tall, so a lone button or field is a pill and a taller box is a
softly rounded rectangle, never a lozenge. Related controls are not a row of pills: a
cluster (toolbar, segmented choice, pagination, tabs) is ONE jelly body — JellyGroup, or
LiquidTabs for tabs — whose members are flat on it, the selected one marked by a feathered
accent glow rather than a raised capsule or a filled accent pill. Games and apps keep their
own scheme. A control’s inline padding is about half its
height. A dropdown is one rounded slab, not a stack of pills or bands: its rows are
plain text (inset px-4) with no fill, edge or radius of their own, and hovering one — or
moving the keyboard highlight onto it — wakes a gentle glow behind the text, a soft accent
wash that fades to nothing at the row’s edges (--row-glow-strength; danger rows glow red;
selected rows are marked by accent text and a check). The panel supplies the only curve.
Menu separators are short and soft, not a full-bleed hairline. Change a radius by changing the
tokens, never a component.
Clicks squash the jelly and discharge arcs through the shared services; they never
change layout, and neighbours move at most the bounded nudge. The navigator globe is the one
surface whose (dough) jelly ripples where it is pressed.
Loading buttons reserve both label states before interaction.
The navigator and its flattening/eversion share the liquid-glass studio material
in lib/liquid/globe-material.ts; captured pages transmit through the surface
instead of becoming a matte, diffuse globe.
Read this before touching pixels; it is the short version of everything below,
and the thing to re-read at the end of the change. A UI commit is done when all
ten hold. (docs/page-consistency.md §3 is the same contract expanded into a
per-page checklist with code.)
Nothing is hardcoded. Every color, radius, shadow, font and duration comes from a token utility (
--site-*on the site;--app-*inside a full-screen app, §12) — no hex, norounded-lg, no bespoketransition: 200ms ease. A theme the author never opened must still look deliberate. (§1, §12)Ink tracks its surface. Filled surfaces take their paired foreground (
bg-site-accent→text-site-accent-fg). Nevertext-white/text-blackon a themed surface. (§1)It reuses a primitive. If
components/ui/has it — button, badge, dialog, tabs, empty state, skeleton, spinner, tooltip, copy button, confirm — the commit uses it rather than a local copy. A second copy of something shared is the single most common defect in this repo’s UI history, and the reason §5.2 and §12 exist at all. (§5)One tab-strip grammar. Tab strips are
<LiquidTabs>. No hand-rolledrole="tablist", nolayoutIdcapsule of your own, no active-state underline. This one is CI-enforced — see §13. (§7)Motion comes from the token set.
lib/motion.ts(DURATION,EASE,SPRING,APPLE_SPRING,transition, and the named variants) rather than ad-hoc numbers, so a global re-tune stays a one-line change. (§7)It degrades centrally, not per component. Print, the app tier’s high contrast and the jelly switches (
jellyMotion,electricArcs) are handled by the token layer, the glass classes andlib/jelly/tiers.ts. A component that branches on them by hand is a bug, and so is a component with its own pointer loop, deformation or arc code. Legibility must never depend on an optic: text has to hold on--site-surface-opaque. (§5.1, §7, §9)Every string is translated through
t("key", { defaultValue }), withpnpm i18n:extractrun and the namespace registered inlib/i18n/config.ts. (§10)The keyboard and screen-reader path works. Icon-only controls are named, decorative icons are
aria-hidden, focus stays visible and undoubled. (§8, §9)It was actually looked at in both shipped themes —
default(Daylight) and.style-graphite(Midnight) — at a phone width and a desktop width, and once with jelly motion set to Still (ambient haze and arcs gone, press still works). Three themes × two widths is the floor; the audit matrix indocs/ui-audit-2026-07-28.md§1 is the extended version, anddocs/ui-audit-2026-10-09.mdis the most recent pass over the site tier.One signal, room for the jelly. At most one
<Button variant="signal">per view; bodies sit ≥--space-4(16px) apart with--jelly-margin(16px) unclipped round them — nooverflow: hiddendirectly around a body. Cards--site-radius, controls--site-radius-sm. (docs/plasmatic-jelly-system.md§10)
When the system does not have what you need, extend the system — add the token, add the variant, add the primitive — and say so in the commit message. Do not solve it locally with a magic number; that is how five apps ended up with five focus rings.
0.5 Fluid interfaces (the gesture layer)¶
The site’s motion answers to Apple’s Designing Fluid Interfaces (WWDC 2018
§803). That talk’s claim is that the “magical” feel of native gestures is not
decoration but a handful of mechanics, each with a formula — and those formulas
live in lib/fluid.ts, unit-tested in
lib/__tests__/fluid.test.ts, shared by every gesture surface. Do not re-derive
them locally.
Principle |
What it means here |
API |
|---|---|---|
Instantaneous response |
A surface reacts on |
|
Interruptible & redirectable |
Motion is a spring carrying position and velocity, so grabbing something mid-flight retargets it from where it is and how fast it is going. A duration tween structurally cannot do this. |
|
Momentum crosses the lift |
The velocity the finger left with is handed to the animation, not discarded. |
|
Intent is read from the projection |
“Where would this throw come to rest?”, not “is it past the line right now?” — which is why a fast flick dismisses a sheet that has barely moved. |
|
Limits push back |
Past an edge, travel is damped asymptotically instead of stopping dead. |
|
Springs are described by perceptual duration + bounce, never by hand-tuned
stiffness, so the same spring settles in the same perceived time whether it
moves 4px or 400px. The two animation tiers share one vocabulary — SPRINGS in
lib/fluid.ts (imperative/rAF) and APPLE_SPRING in lib/motion.ts
(framer-motion) — and a test asserts they cannot drift apart.
Where it ships today: every jelly host — buttons, cards, fields, panes — through
the CSS soft body (app/jelly-material.css §8, which absorbed the old
useFluidPress press layer and the lib/jelly/physics.ts service); phone-width sheet dialogs (drag-to-dismiss
with rubber-banding and flick projection); and the navigation globe (throw,
magnetism and keyboard glide all on one interruptible spring). Touch-friendly by
construction: touch-action: manipulation removes the ~300ms tap delay on
everything pressable, and hit targets are grown to 44px with insets rather than
by inflating the drawn control.
A gesture is not a text selection. The two gestures a tap is not — a press that lingers and a press that moves — both collide with what the platform assumes a pointer is for, at opposite ends of the same gesture.
Holding. On touch there is exactly one way to begin a selection: hold still for about half a second. That is also the length of a gesture here — the globe’s dwell is 260–620ms, the reaction menu’s long-press is 500ms, a hold-to-repeat control starts repeating inside the same window — so the platform’s timer and the site’s fire on the same finger at the same instant, and the visitor gets the thing they meant wearing a highlight and a callout bubble.
Dragging. A mouse needs no timer: press-and-move is “select”, from the
first pixel. Every drag the site owns (a sheet thrown down, the globe spun, a
fader pushed, a panel resized, a card carried across a track, a world panned)
otherwise sweeps a highlight across whatever it passes over and leaves it there
for the rest of the gesture — and on touch the same is true of any drag that
starts gently, because a slow start has already spent its first moments looking
exactly like a hold. An element marked draggable fails a third way: if its own
label is selectable the browser drags the text instead of the object, so the
reorder never begins.
The §Selection block in globals.css is the central answer, and it turns on a
distinction worth knowing: user-select: none and -webkit-touch-callout: none are not the same property. The first stops the highlight; the second
stops iOS’s long-press menu, which is a separate mechanism that fires over links
and images whether or not the text under them can be selected. A link with
user-select: none still offers “Open in New Tab” after ~500ms — which is why
the globe, whose pins are real anchors, needs both.
Covered site-wide already: controls (including [role=slider], the pure drag
case), chrome links, icons and avatars, every <canvas> (a press that lands on
one still anchors a selection that the next few pixels sweep across the HUD),
and every [draggable="true"]. Content is deliberately untouched, because
copying a post, a code block or an article link is the point.
A surface that owns the pointer outright — a drag handle, a thumbstick, a
resize separator, a hold-to-confirm control, a card you throw, a board you drag
pieces around — opts in with data-gesture: nothing inside it selects, pops
a callout, flashes a tap highlight or peels off as a drag ghost. Its one
variant, data-gesture="hold", is for an element that is both at once (a post
card, a chat bubble: holding it opens the reaction menu, but its words are still
worth copying) — that takes the noise and leaves the selection. useFluidDrag’s
handleProps carries the same guarantees inline, so every sheet and drawer gets
them without asking.
In the full-screen tier the soft-body service already finds every
button / [role=button] / summary, so data-fluid-press-scope is now a
no-op kept for compatibility. Opt individual elements out with
data-jelly="off" (or the accepted alias data-fluid-press="none"), and whole
subtrees with data-jelly-scope="off"; game play-fields carry
data-jelly-zone="playfield". Do opt out gestures: a joystick, a drag handle
or a fire button held for thirty seconds is not a tap, and springing it reads as
lag while promoting a compositor layer during exactly the frames a game can least
afford one.
The app tier’s high contrast and
jellyMotion = still keep only the press — no hover body, nudge or wobble —
and print and a playing game stand the soft body down entirely
(jellyMode() in lib/jelly/tiers.ts). Direct manipulation that remains useful
(turning the globe, a sheet gesture) keeps working.
1. The token contract (app/globals.css)¶
Tailwind v4 is imported by the two entry sheets that wrap app/globals.css
— app/site-tier.css (what _site pages load; it skips the utilities only
full-screen games and apps use) and app/app-tier.css (the superset every
full-screen route loads). lib/style-tier.ts picks one per route, and
lib/__tests__/style-tiers.test.ts keeps the site sheet’s skip list honest;
app/site-tier.css’s header explains why the app tier is a superset. Inside
globals.css, an @theme inline block binds the --site-* variables to
utility classes. The :root block is
Daylight (theme id default, a historical name) — the strict-monochrome
Radial Avant-Garde Glass baseline (a light palette: white canvas, ink text and
accent). At runtime Daylight is the absence of any .style-* class on
<html>; a .style-default block also exists in globals.css, restating the
same tokens purely so the settings theme gallery can preview Daylight inside a
card while another theme is active. Keep the two in sync. Daylight is no longer
the default theme — Midnight (.style-graphite) is (§2).
Tokens every theme defines (set in :root, overridden by each .style-*
class):
Group |
Tokens |
|---|---|
Backgrounds |
|
Surfaces |
|
Glass material |
|
Borders |
|
Text |
|
Accent |
|
Status |
|
Elevation / shape |
|
Layout rhythm |
|
Typography |
|
Motion / flourish |
|
Media overlays |
|
Podium |
|
Tailwind utilities — use these, never raw hex/oklch¶
Purpose |
Utilities |
|---|---|
Backgrounds |
|
Borders |
|
Text |
|
Accent |
|
Status |
|
Media overlays |
|
Podium |
|
Duration |
|
Radius |
|
Shadow |
|
Fonts |
|
Extra breakpoint: xs = 480px (defined in the @theme inline block).
Foreground pairing — ink must track its surface¶
A filled surface is only readable if the ink on it comes from that surface’s
paired foreground token, not from the page’s ambient --site-text:
Surface |
Ink |
|---|---|
|
|
|
|
|
|
|
|
|
|
a chip/control on media |
|
Forgetting the pair is the classic way to ship invisible UI: inheriting
--site-text onto a dark accent gives near-black on near-black, and onto a light
accent (bright yellow) gives white on white. globals.css now supplies each
pairing by default through zero-specificity :where() rules, so an element
that only sets a background still gets correct ink — and anything that states its
own colour still wins. Since lucide icons paint with currentColor, this covers
icons and text together.
Two things the safety net can’t do for you:
Don’t hardcode
text-white/text-blackon a themed surface. It looks fine against today’s accent and breaks against a user’s. Name the paired token instead — that’s what makes it track every theme and accent preset.Translucent tints are a different case.
bg-site-accent/15withtext-site-accentis correct and deliberate; the safety net only targets the solid fills, so tinted chips are untouched.
--site-accent-fg is contrast-checked at runtime by ensureReadableAccent()
(lib/appearance/contrast.ts), so a custom accent can’t ship an unreadable pair.
A legacy shadcn token set (--card, --primary, --muted, --border,
--ring, --radius, --chart-*, --sidebar*) also exists for a few
shadcn-derived pieces. Prefer --site-* for all new site UI. A separate
.dark class exists only for Slice It game variables — it is not the site
theme mechanism.
2. Themes + accent presets¶
Theme = a .style-<id> class on <html>; the catalog lives in
stores/themeStore.ts (SITE_STYLES, with id/label/icon/group) and the CSS for
each in app/globals.css. Visitors with no saved preference get DEFAULT_STYLE
(graphite, Midnight), and persisted-but-unknown prefs self-heal to it. A
stored default is Daylight and is kept: it is a choice, not “the default”.
Daylight (default = the bare :root, no class) is the Radial Liquid
Glass baseline: strict monochrome — a white aurora canvas, ink text, an ink
accent, hairline black borders — rendered as glass, not paper: its surfaces are
translucent white tints over the drifting canvas. Every other theme is the same
material in its own palette over its own --site-canvas aurora. (The old
liquid-glass theme id is retired — it became the shell.)
The picker ships three, and they are one system in three accessibility modes rather than a gallery of moods — light, dark, and the no-glass fallback:
Shipped in |
Label |
What it is |
|---|---|---|
|
Daylight ☀ |
The light theme. Strict black-&-white, ink accent, translucent white frost over a white aurora. |
|
Midnight ◐ |
The site default. OLED-black ground, near-white ink, graphite elevated surfaces, hairline light borders, one calm blue signal. |
Four more palettes stay in globals.css as complete, ready token sets — they
are not in the picker, and they exist as the reference every user theme
derives from and as a proof that the contract holds outside monochrome:
light (Glass Light — daylight canvas, brighter white frost), sepia (warm
parchment, amber accent), nocturne (deep-navy nightscape, sky-blue aurora),
ultra (near-black spectral canvas, ice-cyan signal, restrained violet energy).
Persisted-but-unknown ids (a retired decorative theme, or the old liquid-glass
id) self-heal to graphite during hydration.
The glass primitives live in components/ui/liquid-glass.tsx (GlassPane and
GlassFilter — the tab-capsule merge host, with no optical lenses) with a
material lab at /jelly (/liquid-glass redirects there). Everyone uses the
shared default jelly material. The Glass clarity slider is retired: saved device and account values
cannot make the site opaque or change its tint. Old device keys are cleared
before first paint and during hydration. The liquid globe keeps its CSS fallback where there is no usable WebGL or the renderer is software (lib/low-end.ts); there is no low-end material tier, and the site has no
high-contrast theme and no OS forced-colours or reduced-transparency fallback.
On top of any theme a user can pick an accent preset — a curated color
(lib/appearance.ts, ACCENT_PRESETS, 14 options) that overrides just the
--site-accent* tokens as inline styles on <html>, keeping everything else
from the theme. null = the theme’s own accent.
User themes (v2, §14) extend the same principle to the marketplace: a
UserTheme’s tokens are colors + a few scalar knobs (lib/themes/tokens.ts,
THEME_TOKENS_VERSION = 2), and themeCssVars() derives the full --site-* /
--site-glass-* contract from them — so every purchased theme is a correct
glass tint and inherits future optics upgrades. Members create/publish (Theme
Studio, components/themes/); anyone buys with RMH coins. v1 token maps upcast
on read (upcastTokens), never rejected.
Themes differ only through the --site-* token contract — there are no
per-theme [data-slot] component overrides or full-page background effects on
site chrome anymore (those belonged to the retired themes). Full-page effects
(scanlines, grain, particle fields) still exist, but only inside individual
games/apps, scoped to their own variable groups. Shared primitives still set
data-slot attributes so future themes (or games) can hook them.
Theme runtime (how switching works)¶
Everything is data-driven from SITE_STYLES: the settings gallery, the runtime
class-swap, the anti-FOUC inline script, and the account-sync API validation
all derive from it — so adding a theme is just a .style-<id> CSS block plus
a SITE_STYLES entry (with its bg); nothing else needs editing.
stores/themeStore.ts— ZustanduseThemeStore { style, setStyle, preview, setPreview, accent, setAccent }.THEME_BGis derived fromSITE_STYLES.components/Providers.tsx— an effect swaps thestyle-*class on<html>(Daylight/defaultneeds none — it uses:root), applies the accent override, persists tolocalStorage, and updates<meta name="theme-color">+ body background. It also self-heals any persisted-but-unknown style back toDEFAULT_STYLE. Games/app routes are excluded (THEME_EXCLUDED_ROUTES) — they own their styling; anapp-routeclass is toggled on<html>for them.No-flash SSR: an inline
themeScriptinapp/routes/__root.tsxapplies the persisted class + accent before hydration, deriving the background from theTHEME_BGmap (also fromSITE_STYLES), so there is no hand-copied theme→background map to keep in sync.
2.1 The appearance & accessibility suite¶
A theme is what the site is made of; the suite is how a visitor tunes it. All of
it composes on top of whichever theme is active, all of it goes through the same
token contract (so no component knows it happened), and all of it is applied
pre-paint by the no-flash script and persisted to localStorage +
account-synced. The shared constants, zod schema and storage keys are
lib/appearance/prefs.ts; the settings UI is Settings → Appearance.
Setting |
Mechanism |
Key |
|---|---|---|
Accent preset |
14 curated colors overriding only |
|
Text size |
Four scales (87.5 / 100 / 112.5 / 125%) — a root font-size multiplier, so every |
|
Density |
|
|
Readable font |
|
|
Jelly motion |
|
|
Electric arcs |
|
|
Colour vision |
|
|
Tilt effects |
The one surviving motion input: |
|
Colour vision is a first-class axis, not a filter. On this site colour is
state — win/loss, up/down, rarity, health, leaderboard deltas, moderation status
— and roughly 8% of men and 0.5% of women have some colour-vision deficiency, so
it was the largest group the suite was missing. Three modes retint the three
semantic tokens only (--site-success, --site-danger, --site-warning) to
a palette that stays separable under that deficiency, on the Okabe–Ito basis:
deuteranopia/protanopia(red–green): success becomes blue and warning a high-lightness amber, so the three differ in hue and lightness instead of leaning on a red/green contrast the viewer cannot see.tritanopia(blue–yellow): red and green read normally and stay; the yellow warning becomes magenta.
It is a retint of the tokens that carry meaning, not a repaint of the site — the
blocks sit after every .style-* block so they win, and none removes the
attribute entirely. The retint alone is not sufficient: colour must never be
the only carrier of meaning, which is why Badge pairs every status variant with
a distinct glyph. Do the same in new UI. Integrity of the three moving parts (the
mode list, the CSS blocks, the pre-paint script) is CI-enforced — §13.
3. Typography & fonts¶
Identity faces: Geist for text, Geist Mono for data (counts, latencies, IDs). Section labels and kickers are Geist in sentence case — there are no eyebrows (no letterspaced all-caps;
lib/__tests__/design-consistency.test.tsenforces it), always through--site-font-body/--site-font-display/--site-font-mono(font-body,font-display,font-mono) — never a literal family in a component. A theme may swap the faces through the same tokens. Status (2026-10-23): the default stacks still lead with the system face / Inter and JetBrains Mono; moving them to Geist is a token change inapp/globals.css(plus a font load), never a per-component one.Body default is
font-body antialiased(set on<body>in__root.tsx), which resolves to--site-font-body.font-sansis its alias;font-nunitostill exists but names one literal face and is not the body default.Fonts load from Google Fonts
<link>s, not @fontsource, for site chrome: Nunito + Inter are critical (loaded in__root.tsxhead); decorative theme fonts (JetBrains Mono, Playfair Display, Bangers, Bebas Neue, Orbitron, Cinzel, Pacifico, Space Grotesk, Permanent Marker, Caveat, Dancing Script, Patrick Hand) are deferred viarequestIdleCallback(deferredFontsScript).@fontsource/ibm-plex-*and@fontsource/newsreaderare used by specific games only.Recurring text patterns:
Page
<h1>:font-display font-bold text-lg text-site-textBody:
text-site-text; secondary:text-sm text-site-text-muted; faint:text-site-text-dimDialog title:
text-lg font-semibold leading-none tracking-tightMono accents (counts, section labels):
font-mono text-xs uppercase tracking-widestChips/pills: use
<Badge>(orinline-flex items-center gap-1 rounded-full text-xs font-medium)
4. Iconography & emoji¶
lucide-reactis the icon library. (react-iconsappears in exactly one legacy file — don’t add more.)Buttonauto-sizes child SVGs tosize-4.Decorative icons get
aria-hidden; icon-only buttons get ansr-onlylabel oraria-label. Directional icons that must mirror in RTL take.rtl-flip.Emoji render through Twemoji (
TwemojiProviderincomponents/ui/) for cross-platform consistency.
6. Layout system & page anatomy¶
The _site layout route delegates to components/feed/SiteShell.tsx, which now
renders the radial shell (components/radial/RadialShell.tsx):
a fixed ring backdrop (concentric hairlines plus a soft blob field — static:
it neither follows the pointer, §5.1.1, nor animates on its own, §5.5), a slim sticky utility top bar
(brand · search · inbox · avatar), the frame and the central RMH hub
(RadialHub). The shell’s backdrop layer paints only the rings and blobs; the
aurora canvas is the document’s own .site-aurora element (rendered in
__root.tsx), which is what every backdrop-filter on the page samples. The
single
<main id="main-content"> landmark lives inside the frame; pages never add
their own sidebars or page-frame (and AnimatedMain renders a <div> — the
shell’s <main> is the one landmark).
The frame is responsive by track count. Mobile is one column. From 1120px
the shell adds a persistent navigation rail, and from 1440px a live rail
(who’s online, the daily loop, friends online, trending, who to follow, plus
whatever a page portals in through PageLayout’s rightSidebar). They are grid
tracks, not overlays, so they cannot ride over the content, and each is
display: none below the width that affords it. The frame itself is capped
(--rad-frame-max, 96rem → 116rem at 1800px): filling the window means filling
it with content, not stretching one reading column across a 34-inch display. See
components/radial/README.md for the width
table and the overlap-bound rules.
The hub is a phase state machine: tapping the fixed orb sends it to the centre
of the screen, where it swells and dissolves into the liquid globe
(LiquidGlobe) while an expanding
circular veil sinks the page behind it. The globe is the navigation: every
destination is a pin on a glass sphere, and you turn it to find where you
want to go — drag to spin, let it coast, and the nearest destination is eased
into the reticle at the front. Hold it there and the reticle’s ring fills;
let go once it is full and you land on that page. Let go early, or turn away,
and the ring drains. Poke the sphere and it ripples — a wave spreads from the
exact point you touched, swells the wireframe as it crosses and dies on the far
side; the impact is stored in the globe’s own coordinates, so the wave is a
mark on the ball and travels with the surface as you keep dragging (shape:
rippleWave in lib/fluid.ts; the swell is applied in the paint only, never in
the hit test). Closing reverses the whole motion (the globe collapses, the
veil contracts, the orb re-condenses and glides home). The hub remains the
navigator on mobile and the fast full-screen switcher on desktop, where the nav
rail shows the same map without a gesture.
One hard constraint comes with it: the globe animates continuously above the
overlay, so the overlay is a painted veil rather than a backdrop-filter.
Chromium re-blurs a viewport-covering backdrop-filter in full whenever anything
above it moves — measured in this exact stack at ~10fps. The frosted material
still ships on the hub’s small, stationary foot capsule. See
components/radial/README.md for the numbers.
Every top-bar control previews before it navigates. Search drops a live
result list, the bell the latest notifications, the inbox recent threads, the
avatar a compact account menu — each with a footer link through to the full
page, so nothing is hidden behind the preview
(QuickPanel owns anchoring, the viewport
clamp, dismissal and focus).
The home (/) is a radial feed
(RadialFeed → RadialWheel): a wheel of
cards in a stable column on the document’s own scroll (no inner
scroll region — that is what lets mobile Safari collapse its toolbars), led by an
inline compose box, with a floating compose button that opens the new-rmhark
modal. A post’s pictures render in the card (RmharkMedia):
up to four tiles, the rest summarised as “+N”. Two rules there are load-bearing
and easy to undo — a lone image’s aspect is clamped to 4:5…16:9, because the
wheel is a glance and a 1:4 panorama would own three screens of it; and every
tile reserves a numeric aspect box before decode, so late images do not shift
the cards while someone is reading or scrolling.
From 1280px it becomes a deck — the wheel keeps the primary column and
an independent second feed (Following · News · Games) runs beside it. Every other
_site route flows the same way — natural document scroll, no pinned/sticky
page chrome — inside the frame’s content track on the backdrop. The radial shell
keeps its layout opinions on content pages — it strips PageLayout’s header
card down to flat big type and unpins sticky headers/tabs/search so every page
flows like the feed — but it no longer touches the material: the glass classes
render at full strength inside the shell, over the ring backdrop and the aurora.
Two page archetypes (see docs/page-consistency.md for full code):
Standard content page — wrap in
components/feed/PageLayout.tsx:PageLayout({ title, children, rightSidebar?, headerRight?, wide?, backTo?, backLabel?, breadcrumbs? }). In the radial shell its.page-headingrenders as a flat, transparent big-type header floating directly on the ring backdrop (the radial content layer strips the old bordered header capsule), followed by the content column.rightSidebaris portalled into the shell’s live rail on wide screens and dropped on narrow ones, so it is supplementary content, never load-bearing.Feed-column / bespoke page — use
AnimatedMaindirectly with a target width fromlib/layout-width.ts, or (home) the radial wheel.
Column widths come from lib/layout-width.ts: DEFAULT_WIDTH = 648,
WIDE_WIDTH = 800, WIDE_NO_RIGHT_SIDEBAR_WIDTH = 952. Those are the page’s
preference, published as --main-target; on a wide screen the shell grants the
column a larger floor (--rad-measure) so a desktop window is not held to a
2019-era constant, and min(100%, …) keeps either from overflowing its track.
wide pages take the whole content track. Inner content is
usually pt-4 pb-12 max-w-2xl mx-auto with no inline px-* (the frame owns the
page gutter; see docs/page-consistency.md §2); the column always carries
pb-dock and no border-r — there is no app-frame edge. Repeated content
floats as spaced cards (space-y-3 px-3); hairline divide-y rhythm lives
inside container cards, not between page-level sections.
Full-screen experiences (games, /login, legal pages, Discord activities) live
at the top level of app/routes/ — outside _site/ — and deliberately get
no shell (no radial chrome — they own their own look; the aurora canvas is
gated off there too, via html.app-route).
7. Motion¶
Page transitions are one very quick, opacity-only swap — on every page. (
lib/page-transition.ts, tokens--swap-dim/--swap-out/--swap-inin globals.css; design indocs/superpowers/specs/2026-10-27-smooth-transitions-design.md.) The old page dims to--swap-dim(0.72) over 100 ms while it leaves and the new one enters from that same level over 220 ms: never blank, no translate (a transform on the page root also breaksposition: fixeddescendants), no stagger. Every other one-shot CSS entrance inside a newly mounted page (title rise, card rises, feed item enters) is finished in the same frame it mounts, so a navigation shows one swap and nothing replays; opt a subtree out withdata-keep-entrance. Pages in the same layout group (shellLayoutFor: catalog / workspace / editorial / social — e.g./games↔/apps) keep their frame still (.page-heading,[data-slot='page-controls']) and swap only the content. The commit explicitly reveals reused DOM and query-string tabs; interrupted selections resume from their painted opacity.PageTabsuses the same reveal for state-based tabs and leaves route tabs to the route service so the fades never stack. Do not add a per-page entrance animation for navigation; it will be finished at mount. Works without View Transitions (off on WebKit by policy).Arrivals fade in — automatically. Two site-wide mechanisms make a slow connection read as “filling in” rather than “popping in”, and neither needs anything from a component: every
<img>fades from 0 to 1 as its bytes land (lib/media-reveal.ts+ globals.css), and content that replaces aSkeleton,Spinner,[data-skeleton]or[aria-busy="true"]placeholder fades in (lib/swap-reveal.ts). Both are opacity-only (they cannot shift layout), skip reduced motion, and never touch the LCP image (fetchpriority="high"). So: render a canonical placeholder while you wait (it is what the reveal keys on), reserve the content’s box (width/height or aspect-ratio on media, a skeleton the size of what replaces it), and putdata-no-revealon anything that must not fade (a live value that updates in place). Do not hand-roll a per-component fade for the same job.Radial motion (the shipped layer). The radial UI is CSS/rAF-driven and framer-motion-free for the shell: the feed wheel uses native document scrolling, with no per-card tilt or scroll listener (
RadialWheel). This keeps content and glass together on asynchronous compositors in every engine. The hub glides the orb to centre and blooms the liquid globe under an expandingclip-pathcircular veil (CSS phase machine + one mount-bounded rAF loop for the sphere’s spin, dwell and ripple), and page headers/heroes rise in on mount (radial-page-rise). The ring backdrop and its blob field are static — no pointer parallax (§5.1.1) and no ambient keyframes (§5.5 Living backdrop). All of it istransform/opacityonly; optional scroll haptics (navigator.vibrate) tick as cards cross the focus line.Jelly motion states (the material layer). The material is the one thing on a page that moves on its own, and only through its owners (
plasmatic-jelly-system.md§2–§4). Engaged (input in the last 20 s): the engine’s haze clock ticks at 60 Hz (30 Hz handheld). Idle: it drops to a 30 Hz floor and does not freeze — this deliberately reverses the 2026-10-08 audit’s 2 fps rest limit (the rest limit is now 31 fps; CPU at rest stays ≤ 250 ms/s on/). Unseen or degraded (hidden tab, unfocused window, scroll in flight, nothing hazy on screen, a degraded tier,jellyMotion = still, a game playing): 0 Hz, no loop. The soft body and the arcs run frames only while a body or an arc is moving. Never add a CSSinfiniteanimation or a rAF of your own for ambient motion.framer-motion is the animation library. Reach for the shared motion system in
lib/motion.tsrather than hand-typing durations/easings: it exports the timing tokens (DURATION,EASE,SPRING,APPLE_SPRING,pressable,transition) and ready-made variants (fade,fadeRise,fadeDown,scaleIn,popIn,overlay,modalContent,staggerContainer/staggerItem). Keeping enters, exits, and lists on these tokens is what makes motion feel like one system — smooth and quick (nothing here is slower than 0.3s). Inline props are still fine for one-offs, but prefertransition/ a named variant so a global re-tune stays a one-line change.Tween or spring — the rule. Tweens (
DURATION/EASE) are for state changes with no gesture behind them: cross-fades, colour shifts, reveals.APPLE_SPRINGis for anything the user acts on — presses, drags, sheet dismissals, morphing containers — because a spring is interruptible: grab a moving element mid-flight and it retargets from its current velocity instead of snapping. It is parameterised the way SwiftUI does it, by perceptualduration+bouncerather than stiffness, which is why the same preset settles in the same perceived time whether it travels 4px or 400px. Presets:smooth(no bounce, the default),snappy(controls/toggles),bouncy(reactions, celebratory pops),sheet(presentation),press. Spreadpressableonto a tappable surface for the standard press acknowledgement rather than re-deriving a scale.iOS large title:
components/ui/large-title.tsxis the collapsing title/nav-bar pair. It currently has no consumers — standard pages takePageLayout/ColumnHeader— and until 2026-08-13 it could not have had any: its bar issticky top-0, and radial.css de-sticks everything a page renders, so the bar was statically positioned wherever it was used and the pair was inert. It carries.site-sticky-pinnednow, which is the sanctioned opt-out. Scroll position maps continuously onto scale/opacity/translation and onto the bar’s scroll-edge material, so the title tracks the finger 1:1 and reverses mid-gesture instead of popping between two states at a CSS threshold. Transform/opacity only — the collapse costs no layout. Reduced motion collapses it to a static title with a permanent bar.Depth from scroll, not from the pointer.
hooks/usePointerParallax.tsis gone (§5.1.1) — it was mounted per card in the arcade hub, which meant N listeners, N spring sets and Npreserve-3dlayers on one page. What remains is scroll-linked:components/radial/Parallax.tsx(a framer-motionuseScrolllayer → GPU transforms, static under reduced motion) andhooks/useSpatialParallax.ts, the marketing shell’s restrained background parallax. The latter is gated on a consumer being present on the page (.rmhp-root, .rmhc-root, .rmht, .spatial-design-hero) and writes to that consumer element, not to<html>— a root custom property is inherited by the whole document, so writing one per frame restyles every element on the page. It also had apointermovehalf until 2026-08-13; that is deleted, both because nothing here tracks the cursor and because its consumers’ unitless0fallback made the entiretranslate3d()invalid, so it had never applied. The principle that survives both: a single sliding layer is just movement — layers moving at different rates read as depth — and no React render runs per frame.<MotionConfig reducedMotion="user">wraps the app (Providers.tsx), so framer-motion automatically respects OS reduced-motion.Entrances: one reveal, and only genuinely new items. Two shared hooks replace what used to be five hand-rolled copies apiece.
hooks/useReveal.tsis the site’s single reveal-on-scroll: attach the ref to a container and every descendant carrying.site-revealfades and rises in on the--site-reveal-*curve. Its hidden state is opt-in — the hook stampsdata-reveal-armedon the container only after it has an observer watching, and the CSS hides.site-revealonly under that attribute, so the resting state of the markup is visible and content can only be hidden by a mechanism already able to show it again. Every implementation this replaced defaulted toopacity: 0and relied on JS to undo it, which is a blank page whenever the JS does not arrive.hooks/useStableListMotion.tsdecides which keyed items get the short.content-item-enterwindow: items present on first render are treated as established, so hydration, a cached navigation and a loading placeholder resolving do not replay every card, and a key is never animated twice even if polling returns a new object for it.CSS motion:
.page-root > *runs thepage-enteranimation (0.16s fade + 4px rise), suppressed on history-back (html.nav-pop) and during View Transitions (html.vt-active). Feed items use.feed-item-enter. Shared-element View Transitions go throughlib/view-transition.ts.Living backdrop (two layers, one host): the aurora is the shared scene every
backdrop-filteron the page samples. Both layers are pseudo-elements of.site-aurora, a leaf element rendered inapp/routes/__root.tsx:::beforeis the near field and::after(per-theme--site-aurora-far-*stops) the far field, offset so the two read as depth. Neither animates. Both used to run ultra-slow infinite drift keyframes (34s / 52s), with the rings breathing and the blobs drifting inradial.csson top — each “transform-only, compositor, costs the main thread nothing”, and each claim true. What it cost was idleness: one perpetual layer means the page renders a new frame every vsync forever. Measured on/(1920×1080, vsync-capped Chromium): ~1020ms/s of browser CPU and 16.7fps with the motion, 63ms/s and a locked 60fps without it — and removingbackdrop-filterinstead changed nothing (perf audit 2026-10-08). The only movement left is the opt-in device-tilt parallax (event-driventranslate, below), which settles.lib/__tests__/static-backdrop.test.tsfails the build if a backdrop layer animates again. Both layers are gated off underhtml.app-routeand stop in high-contrast (canvas isnonethere).Two details are load-bearing. The host is not
<body>and not<html>. The layers used to bebody::before/::after, which forced their offset custom properties up onto<html>to be inherited — and a custom-property write on the root dirties the computed style of every element beneath it (~70ms of forced style+layout on/storeat 4× throttle, versus ~0ms on a leaf), because custom properties have no invalidation sets and this site declares ~250 tokens on:root. If a new value has to reach CSS from JS, give it to the element that reads it. And the aurora is deliberately dormant on iOS/WebKit (html.ios-webkittakes the static CSS aurora): moving a fixed, oversized gradient under several translucent surfaces can wedge WebKit’s compositor.The scene light is static, and the only live input is tilt.
hooks/useGlassLight.tsis deleted — nothing writes--light-x/--light-yany more, and no rule reads them; each glass rim’s glint sits at thevar()fallback, a fixed sun above the element.hooks/useLiquidBackground.ts(one rAF-throttled listener, mounted inProviders.tsx) survives with a single input mode:deviceorientationon coarse-pointer hardware, writing--aurora-mx/--aurora-myon.site-auroraand togglinghtml.tilt-live. Android fires it with no prompt; iOS 13+ needs an explicitrequestPermission()user gesture, which Settings → Appearance → “Tilt effects” performs — never prompt on load — persisting consent asrmh-motion-okand firingrmh:tilt-consentso the hook starts or stops listening live. On a fine pointer this hook attaches no listener at all.Looking at an object (device attitude): the tilt light above is a lean; inspecting something is a full rotation, so it works in quaternions instead.
hooks/useDeviceAttitude.ts(maths inlib/device-attitude.ts, no three.js — it ships on ordinary pages) emits a smoothed orbit per animation frame: the device’s change of heading and elevation since the viewer opened is applied to the object about its own axes, so turning to your left brings its right-hand face round to meet you and raising the phone looks down over its top. Deliberately not the object’s raw relative attitude — that is faithful but tumbles, because a phone is held pitched back and a turn about the world’s vertical then arrives as a rotation about a tilted axis. Consent is the same site-widermh-motion-ok; reduced motion removes it (the control does not render), and a drag/arrow-key path composes on top so desktops and anyone with motion off get the same object. Rendered with CSS 3D — seecomponents/library/Book3DViewer.tsx, where a library book is a real six-faced volume with a printed spine and a block of pages.Overlay/DOM synchronization: the metaball underlays are portalled, fixed and viewport-positioned, so they have to be re-sampled whenever their DOM owner moves under them. Bodies unregister in layout-effect cleanup and re-sample before paint on route/tab commits; scroll, nested scroll, elastic touch movement,
visualViewportchanges, page resume and layout-shift events wake the normally-idle sampler. (Comments inliquid-morph.tsxstill say “shader body” in places — that is the deleted GL tier, and the SVG/CSS path they describe is the one that always ran.)Liquid tabs: tab strips use
components/ui/liquid-tabs.tsx, placed below the page title, never inside header chrome (§5.45; seepage-consistency.md). Since the 2026-10-09 minimalism audit the strip is a segmented control: a neutral raised thumb ([data-tab-thumb], opaque surface + hairline + small shadow) on a flush.glass-insettrack, with the label in full ink. The accent fill is reserved for actions — a solid accent pill read exactly like a primary button. High contrast keeps the filled accent thumb. The thumb’s paint is--tab-thumb-bg/-ink/-borderon the strip, so a game re-skins it with variables (Slice It!). One row; labels never truncate: ≤4 tabs split the track equally, more size to their labels, and a strip that still overflows scrolls with an edge fade and keeps the active tab in view — it never wraps into a grid. The thumb is alayoutIdelement that flows between tabs onSPRING.snappyand jumps under reduced motion. Link-mode strips (renderTab) get the same thumb. A hub whose “tabs” would be product names (/services, /ventures) is a list (HubLinkRow), not a strip.Liquid opens: card→detail navigations morph the clicked glass slab into the detail hero via
runViewTransition(el, { liquid: true })+liquidVTName()(lib/view-transition.ts, §5.48) — the VT name is set at click time and cleared after; the detail’s secondary content (comments, metadata, related lists) then staggers in viastaggerContainer/fadeRise. No-VT browsers get instant nav + the stagger.The animation vocabulary has exactly two halves.
animate-in/fade-in/zoom-in-*/slide-in-from-*are NOT part of it — they belong totailwindcss-animate, which is not installed, so writing them produces no CSS at all (CI-enforced, §13 rule 9). Reach for:1. framer-motion +
lib/motion.ts, for anything React controls the mounting of.fade,fadeRise,fadeDown,scaleIn,popIn,overlay,modalContent, andstaggerContainer/staggerItemfor a sequence:<motion.div variants={modalContent} initial="initial" animate="animate" />
2.
data-motion, for any surface React is not driving the exit of — a Radix popover/dialog/menu, whose unmount is Radix’s to schedule (animating one with framer meansforceMount+AnimatePresencethreaded through every consumer, so the exit rides Radix’s owndata-stateinstead), and equally the hand-rolled menus that mount on open and unmount on close. Three values:attribute
for
travel
data-motion="fade"a scrim / backdrop
overlaydata-motion="pop"a popover, menu, select, hover card
the anchored spring, below
data-motion="rise"modal / dialog content
modalContentDialogandSheetneed no attribute — the rules name theirdata-slots directly, so every one on the site is covered without a markup change.The enter selector is
:not([data-state='closed']), not[data-state='open'], which is what makes the attribute enough on its own: a hand-rolled menu carries nodata-stateat all, and has no exit to animate because React removed it already. Radix surfaces, which stay mounted while they close, still get theclosedhalf.Both halves run on one clock: the
--motion-*tokens inglobals.css§7.1 mirrorDURATION.slow/DURATION.fast/EASE.emphasized.DialogandSheetkeep their own bespoke TRAVEL (a sheet slides from an edge, which none of the three shapes covers) but share the tokens and the cage — they used to hardcode three different answers between them.Every floating surface opens the way Apple’s menus open: an anchored, uniform scale-and-fade on one spring, content arriving with the panel. Scale 0.92 → 1 from the trigger’s own corner, opacity 0 → 1 over the first ~62ms, settled at 260ms. Nothing is staged: the rows are legible as soon as the panel is visible, and that — not the last frame of a settling spring — is what “it opened” means to whoever is reading it.
The scale stops are
spring(0.26, 0.08)fromlib/fluid.ts, sampled and written out as keyframes, because CSS has no spring. That is the same functionSPRINGSandAPPLE_SPRINGare built from, so a surface animated in CSS and one animated in framer are the same motion rather than two impressions of it, andlib/__tests__/motion-pop-spring.test.tsre-derives every stop so the two cannot drift. Bounce 0.08 puts the peak 0.06% past the target — a real spring’s deceleration with an overshoot far below a pixel, so the panel never inflates past its own box (an X overshoot can push a horizontal scrollbar onto the document for two frames).Two things deliberately do not animate, both for cost: the blur lands at once (it is the one property here that cannot be animated cheaply —
.glass-overlayre-samples its whole backdrop per frame), and the shadow is never animated at all (a blurredbox-shadowis a full repaint of the panel and its penumbra every frame). What is left is transform and opacity, and nothing else.What this replaced, and why. Until 2026-08-13 the open was a two-act “bloom” borrowed from the navigation globe: an
::afterwireframe cage (the globe’s 6 × 7 meridian grid) held the first third with the panel’s fill forced transparent and its rows at zero opacity, then dissolved while the content read in behind it — and the panel rocked, a sampled under-damped spring driving a0.9degrotation about the anchor, over an anisotropic0.94 × 0.84scale. It was coherent with the globe and wrong for a menu in four ways a user perceives: a skeleton flash reads as a rendering glitch, not as a signature; no platform rotates a menu, and a rotated panel puts every row of text off-axis and forces glyph-edge antialiasing for the length of the open; an anisotropic scale is a squash rather than an object arriving from further away; and staging the rows made the menu visible-but-unreadable for its first ~100ms, which was the only thing making the open feel slow. Retiring the cage is also a real performance change — it was a full-size extra painted layer carrying two repeating gradients, composited over a backdrop-filtered panel, on every menu, select, dialog and sheet the site opens.--motion-wobble,--motion-cage-*,.motion-cage,motion-pop-cageandmotion-pop-revealare all gone, and the test above fails if any of them comes back.The rest of the CSS motion rides the same springs, as
linear()easings.--spring-smooth/--spring-snappy/--spring-sheet(globals.css §7.1) areAPPLE_SPRING.smooth/.snappy/.sheetsampled at 41 points to within 0.05% of rest, with--spring-*-duration= that settle time; use them as a pair (animation: x var(--spring-smooth-duration) var(--spring-smooth)).lib/__tests__/motion-spring-easings.test.tsre-derives every stop. Therisemenus, dialogs and sheets move on them: the travel lands on the spring while opacity runs on its own quick--motion-inramp, so a panel is readable by ~80ms and the spring’s sub-pixel tail never holds content back. Dialogs and desktop sheets takesmooth; the phone bottom sheet takessheet, and its dismiss, which crosses the whole screen, takes--motion-out-travel(0.24s, accelerating) rather than the 0.1s fade-in-place exit. Every enter/exit pair is one path run both ways — the exit ends on the enter’s start frame. Two exceptions, both deliberate: the per-page enter stays a 0.16s tween (a running transform on a page root re-anchors itsposition: fixeddescendants, and a 0.64s settle would park the compose FAB at the bottom of the document), and exits stay short tweens (a dismissal should feel immediate, and a spring from rest starts slowly). Bare Tailwindtransition*utilities default to--ease-smooth(EASE.smooth: zero speed at both ends) onduration-site-fastrather than Tailwind’s Material curve, and the shared framertransition/exitTransitionare zero-bounce springs, so an interrupted motion carries its speed into the next instead of restarting.The close is real, on both kinds of surface. A dismissal is not a performance — a quick uniform reabsorb toward the anchor over
--motion-collapse(110ms) withpointer-events: none, so a panel that is visibly leaving cannot still be clicked. It is deliberately less than half the open: arriving is a movement, leaving is an erasure, and a dismissal that takes as long as the open is what makes a UI feel like it is arguing with you. Radix schedules its own unmount and needs nothing. A hand-rolled menu is removed by React the instant its state flips, which is why nothing it did used to be visible on close;hooks/usePopPresence.tsholds it mounted for exactly that window and flips it todata-state="closed":const { present, state } = usePopPresence(open); … {present && <div data-motion="pop" data-state={state} className="… origin-top-right" />}
It takes the caller’s own open VALUE, not just a boolean, and hands back the last one — so a menu keyed by a pointer position or by which row’s menu is showing still has something to render from on the way out, after the state that produced it has been cleared. Only the render reads it: Escape handlers, outside-click listeners and focus-return stay on the raw
open, because a menu that is leaving should already have stopped behaving like one. The exception isuseMenuViewportFit, which must be passedpresent— its cleanup strips the clamp it applied, and a panel that snaps back to its unclamped position for the length of its own exit is worse than no exit at all.The anchor is stated three ways, in priority order:
--motion-originon the element, for a menu that picks its side at runtime (LanguageSwitcherhands it the same collision decision it used to place itself, so a list that flipped above its trigger grows upward out of it);Tailwind’s
origin-*utility, for a statically placed menu — writeorigin-top-rightbeside theabsolute right-0 top-fullthat put it there. The §7.1 rule lives in@layer componentsprecisely so the utility outranks it;--radix-popper-transform-origin, which every Radix popper publishes on the wrapper it portals — soSelectandProfileHoverCardre-anchor themselves through a collision flip for free, and neither has to say anything.
Reduced motion removes the whole thing, and the menu simply appears. Retiring the last two menus that still answered this privately —
lib-ctx-inat 120ms andvibe-model-popat 140ms — is what closed the loop §7.1 was opened to close.There is exactly one open, and every floating surface takes it. There used to be two:
data-motionfor most things anduseLiquidPop(§15.6) for the feed’s menus — a goo-filtered droplet that budded off the trigger and crossfaded into the real panel. It looked good and it cost two refs, a portalled underlay and an SVG filter per adopter, so it only ever reached twelve of them and the other forty opened differently. The hook is deleted; its consumers takedata-motion="pop"+usePopPresence, which is two lines and no portal.Eversion: a control’s state turns inside out (globals.css §7.3, 2026-10-20). The globe ends a navigation by turning itself inside out, and every control changes state the same way at its own scale. The new state is never faded in over the old one: a tint emerges from INSIDE the control, swelling out of one point into the control’s whole shape on a spring, and goes back into that point the same way.
Opt in with
data-evert. The layer is the control’s::before, painted in--evert-tint, behind the label: the control’s own shape scaled 0 → 1 about the point. Nothing else on the control moves, so a label never rotates or scales.Button(every variant butlink, in its own hover colour),LiquidTabstabs,MenuItemrows,Select(trigger and items), the nav rail, the top bar’s buttons and sign-in, the compose button, the feed’s post cards and the store’s cards carry it; their hover background rules are gone, because the hover colour arrives by eversion now. The layer turns out on a fine pointer’s hover, a press (data-pressed), a menu’s roving highlight (data-highlighted) and keyboard focus.Untagged controls are adopted (2026-10-21: “ensure the eversion ALWAYS PLAYS ON EVERY BUTTON, INPUT BOX, ETC”). The same listener finds the button, link, tab, menu item, option or field under a first hover, press or focus and, if nobody tagged it, adopts it (
lib/evert-auto.ts):data-evert="auto"when its::beforeis free (armed at rest for one style pass, so the state already on it everts in), or the.evert-ghost— one body-level box in the control’s shape over it,translated into place andscaled out of the same point — for what cannot hold the layer: text fields, textareas and selects (no pseudo-elements), and controls whose::beforeis taken. Thefocusghost stays on a focused field in the accent. Left alone: the switch, native checkboxes and radios, the hub’s orb and globe, anything under[data-evert-off], and anything half the viewport in size. Tag a control yourself when it needs a tint of its own (--evert-tint).Two variants.
data-evert="select"adds a second layer (::after) for a selected state: the nav rail’s current page pours out of the item you pressed and drains out of the one you left, because the rail stays on screen across the navigation.data-evert="over"lifts a translucent tint above the content, for cards whose art covers the whole box.It is a transform, so it survives a navigation. It was a
clip-pathcircle, which the main thread animates. Pressing something that navigates starts the route’s render on that thread, and a probe showed no frame for ~630 ms after the click, so the tint stood still until the new page had painted.scaleruns on the compositor and keeps moving through it.Controls with a mark evert in their own form.
Switch: the “on” colour pours out of the knob as the knob travels on the landing spring. Native checkboxes and radios (drawn site-wide, except on Gecko and under forced colors, which keep the native control): the accent everts from the centre, then the tick or dot springs in.The point is where you are.
hooks/useEvertPoint.tsis one delegated, passive listener, mounted inProviders.tsx. It writes--evert-x/-yon the control (never on<html>), once per event: the pointer’s entry for a hover, the finger for a press, the exit as a hover leaves, the centre for keyboard focus. It never tracks the cursor (§5.1.1). A tap is held forEVERT_MIN_PRESS_MSso a quick one is still seen.Springs as transitions.
--evert-ease(spring(0.3, 0.15)) and--evert-ease-pop(spring(0.32, 0.3), for marks that land) arelinear()easings sampled fromlib/fluid.ts(springLinearEasing), andlib/__tests__/evert-spring.test.tsre-derives them. A transition never plays on mount (a page that loads with boxes ticked does not animate them) and retargets from where it is when interrupted.Cost.
scaleon control-sized layers,transform/translateon marks and knobs, andopacityfor the press deepening, all composited, plusclip-pathon the 16–40 px fills of checkboxes, radios and switches. No shadow, layout property, filter or per-frame script. Measured on a 4×-throttled phone profile: one control everting keeps 60 fps at the 95th percentile; twelve at once drop about one frame in twenty under software raster.Degradation is central. Hover only exists under
(hover: hover) and (pointer: fine), so a phone never shows a sticky hover. The site’s Reduce motion switch collapses it (the state still shows, at once); the OS preference does not (2026-10-21: “it should always play by default”). Forced colors drop the layer.
Never
transition-all, and never animate a layout property.allmakes the engine watch every animatable property on the element, so a class change that happens to touchwidth/padding/gapanimates a reflow nobody asked for. Name what changes:transition-colors,transition-transform,transition-opacity, atransition-[a,b]list, or plaintransition(every visual property, no layout ones). CI-enforced for site UI (§13 rule 8).When a layout property is genuinely the thing you want to move, it is almost always cheaper as a transform, because layout animation relayouts the element and its siblings every frame. A progress bar is a full-width fill with
origin-left+transform: scaleX(p), not an animatedwidth; a column chart isorigin-bottom+scaleY. Seecomponents/onboarding/FirstWeekCard.tsx,components/feed/PollDisplay.tsxandcomponents/feed/InsightsModal.tsx.A menu that fetches on open must reserve the size it is about to be. The animation is never what is wrong when a panel opens and then jumps: the box moved after the animation had committed to it. A one-line “Loading…” note is 108px and six notification rows are 353 — measured, in the top bar’s panels — so the open animated to the wrong height and corrected itself a moment later. Waiting for the data is not the fix; that is a menu that does not respond to being clicked. Predict the size instead, from two sources in order:
What it was last time.
hooks/useReservedRows.tsremembers the row count per panel key for the session. Exact from the second open, and it self-corrects as an inbox fills or empties.The cap the panel already declares. Every preview is bounded —
?limit=6,.slice(0, 6)— so the first open has a real number rather than a guess. Keep the cap and the reservation as one constant; a cap that drifts from the reservation puts the jump back.
Then render that many skeleton rows, built from the real row’s own class with
.skeleton-linestanding in for each line of text..skeleton-lineis1lh— one line box of the element it sits inside — so a placeholder row is exactly as tall as a loaded one by construction and stays that way if the type scale is ever retuned. (1emis the fallback for an engine withoutlh, and it is 11px short per row, which is the whole reason this is not a hardcoded height.) Measured on the notifications panel: a 245px jump becomes 0.The bars are
aria-hidden; announce the state once viarole="status"with ansr-onlylabel, because a screen reader needs “Loading…” and not eighteen empty boxes.Exception: the Globe Eversion is a one-shot navigation transition, and it is longer than 0.3s. “Nothing here is slower than 0.3s” is the rule for state changes; confirming a destination in the hub is a navigation, and the hub may play a ~4.6s WebGL2 effect instead of the veil (WRAP the page onto the globe, EVERT it, UNWRAP the destination, and it ends there —
components/radial/README.mdGlobe Eversion,lib/eversion/README.md). It is allowed because it stays inside everything else this section protects: it is a one-shot canvas, mounted for one navigation and removed, not an ambient layer; it writes no per-frame custom property to<html>(the renderer draws into its own canvas, in a worker where it can); it does not track the cursor (§5.1.1); reduced motion (OS or the account toggle) never runs it and gets the ordinary fade; it always plays in full (4.6 s, under WCAG 2.2.2’s five seconds; no input speeds it up, amended 2026-10-20), and back/forward never animates; and it follows the degradation tiers (the minimum tier on a low-end device,lib/low-end.ts; today’s navigation when WebGL2 or the capture is unavailable). It is dark behindisEversionEnabled()until the device lab signs off. A second long navigation effect is not covered by this exception.hooks/usePopPresence.ts— keeps a hand-rolled menu mounted through itsdata-motion="pop"close, and supplies thedata-stateto play it with. See the close note above; pair it withhooks/useMenuViewportFit.ts, which takes the samepresentso the clamp survives the exit.hooks/useReservedRows.ts— the row count a panel should reserve while it fetches, so its open animation lands on the right height. See the note above.hooks/useReducedMotion.ts— SSR-safe boolean for JS animations CSS can’t reach;prefersReducedMotion()for imperative checks.hooks/useCelebration.ts— confetti/fireworks; lazy-loads canvas-confetti, no-ops under reduced motion, and reads--site-accent/--site-successoff the DOM so bursts match the active theme.Two
@media (prefers-reduced-motion: reduce)blocks inglobals.csscollapse animations/transitions to 0.01ms (keeping spinner/pulse feedback) and disable theme background effects.
8. Interaction & focus states¶
Global (in globals.css):
Keyboard focus is the
--focus-ringtoken: solid, 2px, never the plasma glow (a focused body’s plasma brightens, but that is decoration, not the indicator). Today it is drawn as:focus-visible { outline: 2px solid var(--site-accent); outline-offset: 2px }covers every interactive element (links, buttons,[role],[tabindex]). Text inputs opt out (border + caret instead).Buttontakes the global ring too (since 2026-10-20; it drew its own softer box-shadow ring, which could not evert with everything else’s, §7 Eversion). The ring turns out from inside the control: its offset springs from within the border to where it rests (@keyframes evert-focus, from-only, so it lands on each element’s own offset); colour and width never animate. Don’t add anotherfocus-visible:ringto an element the global outline already covers — you’ll get a doubled indicator. Reach for a self-drawn ring only when the element is excluded from (or not matched by) the global rule.Selection uses the accent with its
--site-accent-fgtext; native controls getaccent-color: var(--site-accent); scrollbars are thin and themed.Scrollbars show on scroll, not always. Every scrollbar on the site — the document’s, both desktop rails’, every panel and every full-screen app tier’s — is painted transparent while its scroller is idle and fades in only while that scroller is actually being scrolled.
lib/scrollbar-reveal.ts(installed once fromProviders.tsx) stampsdata-scrollingon the scrolled element and clears it ~900ms after it stops; the§Scrollbarsblock inglobals.cssis what paints. Two things to know before touching it: the reveal is done with colour, neverscrollbar-width, so the gutter stays reserved and revealing a scrollbar can never reflow the page; and per the engine note in that block, Chromium ignores::-webkit-scrollbar*rules on any element that has a standardscrollbar-width— which* { scrollbar-width: thin }gives every element — so the standard properties are the live path there and the::-webkit-*rules are the older-WebKit fallback. An app tier sets its hover colour with--sb-thumb-hover, not a:hoverrule of its own.Cross-engine consistency: the accent outline replaces every browser’s default focus ring; Firefox’s
::-moz-focus-innerdotted border and:-moz-ui-invalidred validation glow are neutralized;::placeholderis themed atopacity: 1(Gecko dims it otherwise); autofilled fields are repainted to theme colors (WebKit/Blink); scrollbars are themed for bothscrollbar-width/scrollbar-color(Gecko) and::-webkit-scrollbar(WebKit/Blink).Tap highlight removed; active press feedback is
opacity: 0.6.Chrome does not select. Buttons,
[role]controls (sliders included), navigation/menu/tab links, decorative icons, avatars, every<canvas>and every[draggable="true"]carryuser-select: noneplus-webkit-touch-callout: none(§Selection inglobals.css), so a press that lingers — or one that moves, which on a mouse is “select” from the first pixel — cannot leave a highlight or an iOS long-press menu on top of a gesture. Content — prose, post bodies, code blocks, article links — keeps both. Surfaces that own the pointer opt in withdata-gesture; see §0.5. All of it lives in@layer base, so aselect-textutility still wins where a surface needs to hand a piece of itself back.Inputs hold a 16px font floor below 640px (prevents iOS zoom).
9. Accessibility¶
eslint-plugin-jsx-a11yruns at “warn” (curated rules ineslint.config.mjs) — don’t introduce new warnings.Prefer native elements and the Radix-based primitives in
components/ui/over hand-rolled widgets.Patterns to copy: skip link in
_site.tsx(sr-only focus:not-sr-only→#main-content),role="status"+ label on loaders,aria-hiddenon decorative icons,aria-labelon icon-only links/buttons.RTL locales are first-class:
<html dir>is set pre-paint fromRTL_LOCALESinlib/i18n/config.ts(todayarandur— read the constant, don’t hardcode a locale test). Use logical spacing where possible and.rtl-flipon directional icons.The site ships two themes, Midnight (the default) and Daylight (
default, no class) — test new UI in both. There is no high-contrast theme (removed 2026-10-27; the app tier keeps its own).Never let colour be the only carrier of meaning. Colour-vision modes (§2.1) retint the semantic tokens, but a retint cannot rescue a UI where the only difference between two states is hue. Pair status with a glyph, a label, a position or a shape —
Badgealready does, so use it. The three parts of that feature (mode list, CSS blocks, pre-paint script) are CI-checked because a mode with no CSS block is a setting that appears to work and changes nothing.The retired switches do not come back. The retired reduced-motion setting does not come back. Ambient motion and arcs are paused by the jelly switches (
html[data-jelly-motion],html[data-electric-arcs]), whichlib/jelly/tiers.tsreads for every jelly service — never read them in a component.
10. Strings (i18n)¶
Every user-facing string goes through t() with a defaultValue (English is
the authoritative source):
const { t } = useTranslation('site');
t('wallet-title', { defaultValue: 'Wallet' });
Namespace conventions (files under locales/en/):
Namespace |
Used for |
|---|---|
|
most |
|
core shell + feed |
|
feature areas |
|
component strings |
|
route/experience entry strings |
After adding strings run pnpm i18n:extract (populates all
locales/*/<ns>.json), and pnpm i18n:coverage to check locale coverage.
See lib/CLAUDE.md §i18n for the full pipeline (resource generation, RTL,
lazy locale chunks).
11. Do / Don’t summary¶
Do
Use
--site-*utilities (bg-site-surface,text-site-text-muted,rounded-site, …) for every color, radius, shadow, and font.Use
components/ui/primitives,PageLayout/AnimatedMain,EmptyState,Skeleton,Spinner, sonner toasts, lucide icons.Give buttons in-flight feedback with
<Button loading>(not a hand-rolleddisabled+<Loader2>), and animate with the tokens/variants inlib/motion.tsinstead of ad-hocduration/easenumbers.Add
data-slot="..."to new shared primitives so themes can restyle them.Wire every string through
t(..., { defaultValue }).Test in both shipped themes —
default(Daylight) andgraphite(Midnight) — and with jelly motion set to Still.
Don’t
Hardcode hex/oklch colors, raw palette classes (
bg-red-600),rounded-lg, custom shadows, bareduration-200, or font families in site UI. The first three are CI-enforced (§13).Build a dropdown / popover / menu / tooltip on anything but
.glass-overlay— only L4 carries the opaque legibility floor, and it is kept out of neighbour nudges and arcs across its text (§5.1). Also CI-enforced.Track the cursor, deform a surface or draw an arc yourself. The soft body, cursor light and arcs are one service each (
plasmatic-jelly-system.md); a per-component pointer loop, a CSS hover lift or aninfinitekeyframe is the drift they exist to prevent.Re-add navigation/sidebars inside a page (the
_siteshell owns them).Use
react-icons, an ad-hoc standaloneLoader2where<Spinner>belongs (inlineLoader2inheriting a button’s colour is fine), or hand-rolled dialogs.Put a full-screen experience under
_site/, or a standard page outside it.Bypass Twemoji for emoji or
jsonLdScript()for JSON-LD.Re-implement something
components/shared/already provides for full-screen apps (shell, header, toaster, connection status) — see §12.
12. The full-screen app tier (--app-*)¶
The site’s --site-* contract stops at the _site shell. Full-screen apps
(RMHbox, RMHType, RMHStudy, RMHTube, RMHMusic) live at the top level of
app/routes/, are excluded from the theme system (THEME_EXCLUDED_ROUTES), and
have their own parallel contract — which is deliberately the same shape, so
what you know from §1 transfers.
components/shared/app-theme.css owns it: an --app-* token set
(--app-bg/-subtle, --app-surface/-hover/-active, --app-border(-bright),
--app-text/-muted/-dim, --app-accent/-fg/-hover/-dim,
--app-success/-danger/-warning/-info/-rare, --app-font-*,
--app-radius/-sm/-lg, --app-shadow/-sm,
--app-duration-fast/-duration/-slow + --app-ease, density and
--app-safe-* inset tokens) plus every behaviour built on it — scrollbars,
focus rings, ::placeholder, Gecko’s focus/validation quirks, tap-highlight and
double-tap-zoom suppression, the iOS sub-16px input-zoom floor, dvh heights,
and deliberate degradation for backdrop-filter and print.
An app ships only its palette. Each app’s CSS is a class
(rmhbox-theme, …) that redefines the --app-* values — RMHbox’s is ~30 lines.
Components read --app-* directly; there is no per-app alias layer.
The shared pieces, all in components/shared/:
Piece |
What it owns |
|---|---|
|
Root wrapper: palette class + appearance modifier ( |
|
The app bar as a three-column grid — genuinely centred title that truncates instead of overlapping, steps aside below 640px, back label collapsing to its arrow below 480px with an |
|
One toast store and container for every app; timers are tracked, so a hand-dismissed toast doesn’t leave a second one running and a route change cancels rather than leaks. |
|
Reconnect banner + peer-wait overlay, so every socket-backed app reports an outage the same way, in the same place, with |
|
Loading/error surfaces for game routes (strings in the |
The rule: a new full-screen app writes a palette class and mounts
AppShell/AppHeader. Adding a sixth copy of the shell, the header, the toast
store or the connection banner is the defect this tier was created to end — a
fix to any of it previously had to be made five times, and in practice never
was. Games with a bespoke visual identity (Temple of Joy, Slice It, Neon
Driftway) keep their own scoped variable groups in globals.css; they are
exempt from the palette, not from the shared behaviour.
12.1 The full-screen viewport contract¶
The palette is what an app may own. The viewport is not: a game that clips
its own pause menu is broken in the same way whatever its colours are. These
four primitives live in app/globals.css (§”Full-screen app/game layout
helpers”), deliberately global rather than in app-theme.css, so a game with
its own design system does not have to adopt the app palette just to stop its
bottom bar hiding under a phone’s browser chrome.
Primitive |
Use it for |
|---|---|
|
The root of a non-scrolling app shell. |
|
The root of a full-screen screen that is a document — a landing, a lobby, a results card. Scrolls the page, not a box inside it. See rule 6. |
|
A menu / results / lobby screen: full height, centred while it fits, scrolled when it does not. |
|
A fixed-aspect playfield. Put the HUD inside |
|
A full-bleed chrome layer, inset by the device’s safe area. Geometry only — it does not touch |
|
Insets on a surface that is itself full-bleed but whose contents are not (a translucent bar, a letterbox gradient). |
|
The software keyboard’s measured height, so a fixed-height shell can end where the keyboard begins. |
Six rules, each of which was a shipped defect before it was a rule:
The world runs to the edge; the controls do not. Artwork should pass under the notch. A pause button must not. Anything pinned to a viewport edge adds
var(--safe-top|right|bottom|left)to its offset, or sits in an.app-hudlayer that already has. Picture landscape when you check — that is where the notch takes a long edge, and it is the orientation most of these games are played in. Bottom-only insets are the common half-fix.aspect-ratioderives only the axis you leftauto. Sowidth: 100%; max-height: 100%; aspect-ratio: W/His not a fit — the clamp shortens the box without narrowing it and the playfield skews. Setting both axes definite is worse: the ratio is ignored outright. Use.app-stage, which states the fit in container-query units where there is nothing left to clamp.Centring an overflowing flex container hides the top of it. Content taller than the container overflows past both edges, and scroll offsets cannot go negative, so the top is unreachable — with or without
overflow-y: auto. Useitems-center-safe/justify-center-safe(CSS:align-items: safe center) on anything that both centres and can scroll.A full-screen canvas clamps its device-pixel ratio. Fill rate scales with the square of the ratio: a 3× phone at native asks for nine times the pixels of a 1× screen, sixty times a second. 2D surfaces go through
gameSurfaceDpr()(lib/display-scale.ts, capped at 2); 3D surfaces through the tier system (lib/render/tier.ts). Whatever sizes the drawing buffer must also be what the render transform uses — clamping one and not the other scales the whole scene. And never reassigncanvas.widthinside a rAF loop: it reallocates the backing store every frame, and if it was also what cleared your surface, add the explicitclearRectwhen you stop.A shell with text entry subtracts
--kb-inset. The same shell that cannot scroll also cannot reveal a focused field when the keyboard covers the bottom 40% of the screen — anddvhdoes not help, because it tracks the browser’s toolbars, not the keyboard. So the engine moves the only thing it can, the visual viewport: it pans, and where the field still will not fit, it scales. Players report that as the app zooming when they try to type. Size such a surfacecalc(100dvh - var(--kb-inset, 0px))and mountuseKeyboardInset; the shell then ends where the keyboard begins and there is nothing left to reveal. Two companions on the field itself: don’tautoFocuson a coarse pointer (it raises the keyboard for something the player didn’t ask for), and setinputModeso a digits-only field gets the numeric pad rather than a QWERTY that covers a third more of the screen.A screen that is a document scrolls the DOCUMENT.
.app-viewportis for a surface that never scrolls; reaching for it on a landing, a lobby or a results card and then putting aflex-1 overflow-y-autobox inside costs a phone about 110px of screen, permanently. Mobile Safari collapses its address/tab bars only for document scroll — an inner scroller leaves them at full height for the whole visit, which is why the feed, which flows in the document, feels taller than an app screen on the same phone. Use.app-page:min-height: 100svh, a flex column, no inner scroller, and the safe-area gutter at the end. The rule of thumb is what the screen is, not where it lives: if the content is a column you read top to bottom, it is a document, even inside a game. RMHType’s room is both in turn —.app-pageas a lobby,.app-viewportonce the race starts — and resetswindow.scrollYacross the switch, because a fixed viewport cannot undo a scroll offset it inherits.
Rules 2–4’s checkable parts, plus the dvh fallback pair, are enforced by
lib/__tests__/game-viewport-consistency.test.ts (§13). Rules 1 and 5 are
manual — absolute top-3 right-3 is correct inside a card and wrong on the
window, and whether a shell ever hosts a text field is a question about its
subtree, not about the rule that sizes it.
13. What is enforced automatically¶
Most of this document is convention. A slice of it is executable, and runs in
the normal suite (pnpm test, gated by web-ci.yml) — and, so that
you meet it at the keyboard rather than in CI, on every commit through
pnpm check:consistency (scripts/check-consistency.sh, wired into
git commit by .githooks/pre-commit and, for agent sessions, by
.claude/hooks/commit-gate.sh). That script previews these rules against the
added lines of your diff — same rules, same allowlists, read from the test
files themselves so the two cannot drift — and then runs the tests below, which
remain the authority:
lib/__tests__/design-consistency.test.ts— one tab-strip grammar. A static source scan overcomponents/+app/routes/that fails on: (1)role="tablist"outsidecomponents/ui/liquid-tabs.tsxand its documented allowlist; (2) anaria-selectedelement that also carries aborder-b/underlinemarker; (3) an inline tab-capsulelayoutIdoutside the sanctioned renderer; (4) the conditional accent-underline bar shape (absolute+bottom-0+ hairline height +bg-site-accent). The allowlists are short and each entry is justified in the file — new tab strips get no entry. The test also asserts it scanned >200 files, so a broken walker can’t make the rules vacuously pass. Its own docstring records the one rule it can’t automate: a role-less switcher that marks its active slot some other way (an accent pill, a segmented control, aflex-1button row with an active tint) still belongs onLiquidTabs. Reviewers catch those by eye.The same file carries four site-tier rules added 2026-08-01 (games and the
--app-*apps are exempt, by design — Temple of Joy is supposed to be candlelit): (5) no raw Tailwind palette colour (bg-red-600,text-zinc-500, …) in site UI — a domain-fixed colour gets a scoped variable group like--casino-*instead; (6) no hardcoded radius (rounded-lg/-xl/-2xl) —rounded-fullandrounded-noneare shapes, not radii, and stay allowed; (7) no floating surface below L4 — an element that is positioned + stacked + edge-anchored and carries.glass-fill/.glass-pane/bg-site-surfaceis a dropdown without L4’s legibility floor; Plus two that run over the whole tree, because neither is a palette question — a game has no more claim to an exemption than a settings page: (8) notransition-allanywhere — name the properties; (9) notailwindcss-animateclass (animate-in,fade-in-0,zoom-in-95,slide-in-from-*,fill-mode-*): that plugin is a Tailwind v3 thing this project does not have, so they compile to zero rules and the element never animates. 103 of them were in the source, on the command palette, the composer and every Radix open/close pair. The only allowlist entry across rules 5–9 is/login, for the third-party provider brand marks.lib/__tests__/game-viewport-consistency.test.ts— the full-screen viewport contract (§12.1). A static scan over the thirty game/app directories that fails on: (1) a scrolling flex/grid container that centres on the block axis without the-safevariant (the overflow-is-unreachable trap); (2) anaspectRatiobeside amaxWidth/maxHeightclamp, or with both axes definite, either of which defeats the ratio; (3) aheight/min-heightof100vhwith nodvh/svhline after it. Class strings are read fromclassName=specifically, not from string literals generally — an apostrophe in prose opens a literal to a naive scanner and produces confident nonsense. Like the tab gate it asserts it scanned >200 files, so a broken walker can’t make the rules pass vacuously. Its docstring records the three manual rules: safe-area insets on edge-pinned chrome, DPR clamping on full-screen canvases, and no per-frame canvas reallocation.lib/__tests__/filter-cost-budget.test.ts— the SVG-filter cost budget. Three rules, each a shipped ~15fps regression before it was a rule: nofilter: url(…)on a full-viewport layer; no CSS filter function chained after aurl()reference (measured: theurl()alone ~0.4ms/frame, with the chain a 1ssetIntervaldid not fire once in 10s); and no painted cursor / document-widecursor: none. The rationale is incomponents/radial/README.md.lib/__tests__/appearance-contrast.test.ts—ensureReadableAccent()keeps a custom accent from shipping an unreadable--site-accent-fgpair.lib/__tests__/color-vision-a11y.test.ts— the three moving parts of the colour-vision feature (§2.1) must agree: the mode list, a CSS palette block per mode, and the pre-paint script. Each fails silently on its own.lib/__tests__/theme-tokens.test.ts— the user-theme contract (§2): v1 token maps still parse and upcast,themeCssVars()derives a complete--site-*set, and the publish gate’s contrast lint holds.lib/__tests__/responsive-layout-contract.test.ts— the shared page masthead stays inside narrow viewports (themin-w-0on both title paths, andwrapTitlefor headlines that must wrap rather than overflow).lib/__tests__/i18n-catalogs.test.ts/i18n-config.test.ts— catalog and namespace-registry integrity for §10.lib/__tests__/raf-loop-allowlist.test.ts— keeps rAF loops (the §7 radial motion layer) to the sanctioned owners instead of one per feature. Everything is held to “idle at rest” except one: the liquid globe’s ambient clock is “idle when unseen” (it stops for a hidden tab, an off-screen globe, a degraded tier orstill). Since #989 the whole jelly has ONE rAF,lib/jelly/frame.ts: the pointer variable, the drag-settle spring and the arc renderer are drivers on it, awake only while something moves, andjelly-ownership.test.ts(N2 b) pins that single owner plus the single pointer hublib/jelly/pointer.ts.useGlassLight.ts,useCardSheen.tsanduseParallax.tswere removed with the hooks themselves (§5.1.1).lib/__tests__/fluid.test.ts— the shared gesture maths of §0.5: the spring, the rubber band, projection/detents, andrippleWave(the globe’s wave shape). The jelly envelope steps the samespringStep; retune the feel there rather than locally, and it stays tested.The jelly contract —
lib/jelly/__tests__/andlib/jelly/arcs/__tests__/pin the budgets,jellyMode(), the motion bounds and the flash ledger;lib/__tests__/jelly-legibility.test.tsholds text contrast over the haze;appearance-jelly-motion.test.ts/appearance-electric-arcs.test.tskeep the two preference pipelines in agreement. The jelly gates inscripts/check-consistency.sh(ownership, no siteinfiniteanimation outside the woken haze, negative-z paint layers, no blur in any role) are listed inplasmatic-jelly-system.md§9.pnpm lint—eslint-plugin-jsx-a11yat “warn”; the bar is no new warnings versus the base branch.
A green suite means you did not regress the enforced rules. It does not mean
the change looks right — §0.9 is still a human looking at three themes. That is
why check-consistency ends by printing the unautomatable list rather than a
bare “passed”.
Adding a rule. When a class of drift keeps coming back, the fix is a new
executable rule here rather than another paragraph of prose: a source scan in
lib/__tests__/, an allowlist whose entries are each justified in the file and
that only ever shrinks, plus a “scanned > N files” assertion so a broken walker
cannot make the rule pass vacuously. check-consistency.sh picks up anything
added to its gate list, and the fast added-lines preview reads its path
exemptions straight out of design-consistency.test.ts.