Elements

The foundations, component catalog, patterns, assets, and ownership rules of the design system.

Foundations

Scope: every surface. The tokens are the system. Every component, pattern, and page reads from them.

The surface ramp

Each layer has one ramp, --surface-0 through --surface-7. The page is step 1, a card is step 2, a button or field is step 3, hover is step 4, and selected is step 5. The header is step 1 and the footer is step 0. Overlays sit two steps above the surface beneath them. Nothing skips a step, and nesting stops at step 7.

Layer01234567
main, dev#060608#0d0d12#181821#222230#2d2d3e#383849#444458#505068
api#0a1520#0D1B2A#1a253a#263554#32415f#40557E#4d658f#5a7299
mind, welcome dark#0c0c0c#141414#1F1F1F#292929#333333#3d3d3d#474747#525252
mind, welcome light#CFCCC1#D9D6CC#E3E0D6#ECEAE3#F4F2EC#FAF8F3#FDFCF9#FFFFFF

The light ramp runs in the same direction as the dark ramp: the page is the darkest step and each layer lightens, ending at white at step 7. Nesting works the same way in both themes.

main / dev
api
mind / welcome, dark
mind / welcome, light

Text and color

Every color is a solid fill with a hover partner and an on-color partner. There are no tints, no alpha variants, and no opacity variants.

Text
--text-1 #fffbf7, --text-2 #fff6ec, --text-muted #B5B2C2.
Accent
--accent #5e7ce2, hover #6E89E5, on-color #ffffff.
Semantic
Green #a4da8b, yellow #fff78e, orange #ecb041, red #e5484d, purple #9c59df, blue #9aaeff. Each has a hover and an on-color partner.
Focus
#9aaeff on the dark surfaces.
API text
#E0E1DD and #F8F4E3 replace the default text values on the API ramp.
Mind and welcome light
Text #23221F, muted #5F5D55, accent #4257BD, green #286A2B, yellow #765A07, red #B42318, focus #4257BD.
Dark-surface colors
text-1#fffbf7
text-2#fff6ec
muted#B5B2C2
accent#5e7ce2
green#a4da8b
yellow#fff78e
orange#ecb041
red#e5484d
purple#9c59df
blue#9aaeff
focus#9aaeff

Type

Radley is the display face on main, dev, and api. Helvetica is the body and interface face on those surfaces. Mind uses Eina for display and ASM for body and interface. Welcome uses Helvetica only. Body tracking is -0.03em. Mind keeps OpenDyslexic as a reader option; it is not a surface font.

TokenSizePixelsUse
--fs-xs0.75rem12Labels, badges, captions
--fs-sm0.875rem14Interface text, small buttons, notes
--fs-base1rem16Body
--fs-lg1.125rem18Lead paragraphs
--fs-xl1.25rem20Card and section subtitles
--fs-2xl1.5rem24Section titles
--fs-3xl1.875rem30Large headings
--fs-4xl2.25rem36Page titles on narrow surfaces
--fs-5xl3rem48Page titles
Radley display
5xl · 48pxMpalo remembers
4xl · 36pxMpalo remembers
3xl · 30pxMpalo remembers
2xl · 24pxMpalo remembers
xl · 20pxMpalo remembers
lg · 18pxMpalo remembers
base · 16pxMpalo remembers
sm · 14pxMpalo remembers
xs · 12pxMpalo remembers
Helvetica · bodyPreserving what matters against time.
Mind: Eina display, ASM body
Eina · 2xlMemory is intimate.
ASM · basePreserving what matters against time.

Spacing

Spacing is a 4px base scale, --sp-1 through --sp-24. Items inside a group sit --gap-within, 8px apart. Groups sit --gap-between, 32px apart. The header is 64px. The sidebar is 16rem, or 4.5rem collapsed.

Documentation pages follow the API rhythm: 32px top and 40px bottom padding on the article heading, 32px section padding and section gap, 24px title to lead, 20px lead gap, 24px body paragraph gaps, 16px heading to description, 24px heading block to content, 8px subheading to text, and a 1.625 body line height. Callouts use 24px margin and 16px by 20px padding. Tables use 20px margin.

Spacing scale
sp-14px
sp-28px
sp-312px
sp-416px
sp-520px
sp-624px
sp-832px
sp-1040px
sp-1248px
sp-1664px
Grouping: 8px within, 32px between

Radius and focus

There is one radius, 8px. Nested shapes use the outer radius minus the inset, with a floor of 0. Corners are continuous. The avatar is the only circle. Keyboard focus is a 2px outline in the focus color with a 2px offset; fields use a 0 offset.

8px radius, concentric nesting, and the one circle
AL

Motion

Transitions are linear and short: 0.15s for hover, 0.2s for toggles, menus, and tabs, and 0.3s for a modal or a sidebar change. Animate color, outline, transform, and opacity. Reduced motion stops the transition but keeps the state signal. Scribbles draw left to right over 5s, and page loading uses the shimmer. A button can enter a pending state with a compact progress ring while its label stays in place. There are no easing curves, springs, bounce, pulse, breathing, parallax, or hover scale.

Hover: background moves one step in 0.15s, linear

Two shadows have two jobs. --shadow-overlay, 0 8px 24px rgba(0,0,0,.4), belongs to menus, dialogs, popovers, toasts, and the search panel. --shadow-media, 0 8px 24px rgba(0,0,0,.2), belongs to the video player and nothing else. The video player adds one frame-derived ambient edge; it belongs to the player, not to a third shadow token. A card, a button, and a page never cast a shadow.

Components

Every component takes the surface step it sits on and derives its fill, hover, and selected states from it.

A component takes on or level, the surface step of its container. The component fill is on + 1, hover is on + 2, and selected is on + 2. A card on a page is step 2; a button on that card is step 3; hover is step 4. The component never hard-codes a level.

Core

Button
Primary, neutral, success, warning, and danger, in sm, md, and lg, with an optional leading icon. Neutral is container +1 and hover +2. Colored variants use their fill and hover partner. Disabled is container +1 with muted text. A pending button keeps its label and adds a compact progress ring. Action buttons carry an icon. Labels are left-aligned: a long label wraps to two lines and both lines start at the same left edge, while the button keeps its padding and place in the layout. Do not center the two lines, shrink the type, or truncate the label to keep it on one line.
Card
A solid surface container with no border and no shadow. A card is always its container's step +1. Do not nest a card inside a card; use a solid sub-panel or a step of space instead.
Badge
A non-clickable status chip with a solid tone fill and its on-color text. No tints and no left-border accents. The label sits slightly above center.
Icon
A Mpalo Symbols icon painted with currentColor. The interface register uses 16, 20, or 24 pixels at weight 500, with 24 as the default. The name comes from the manifest, so the drawing never depends on a ligature. The parent sets the color.

Forms

Input, Textarea, Select
Solid fields at card +1. Hover is one step up. Focus is a 2px outline with a 0 offset. Error is a red outline plus a sentence that tells the person what to do.
Checkbox, Toggle, Segmented
Checkbox and segmented controls use solid fills. The toggle track and knob use the 8px radius, never a pill. Off is container +2; on is the accent fill. The input stays focusable.
Tabs
Separated text, not filled tabs. A 2px accent bar sits under the active tab. The inactive tab uses muted text; the active tab uses full text color. No fill.

Navigation

TopBar
Header at step 1. A logo, the primary links, and at most two actions. The developer surface keeps the documentation shell focused.
Sidebar
16rem fixed on desktop, and a full-height overlay below 1025 pixels. Icons are 24 pixels with a 12 pixel gap. Group headings are interface text, not display text. The selected item is container +2 and underlines only its label. Hover is +1.
OnThisPage
The right rail. The selected section is container +2. The rail is hidden when a page has no named sections.

Overlays

Modal
Overlay panel at the surface beneath +2, with --shadow-overlay. The scrim is the one full-page translucent layer. Escape and a scrim click close it. Buttons inside use the panel's step.
Menu, Tooltip, Toast
A menu panel is beneath +2 with the overlay shadow; items hover +1. A tooltip is a solid surface-7 fill with no arrow and one line. A toast is beneath +2 with the overlay shadow; its tone is a solid 8px square, not a tint.

Media

Video player
One MP4 player for every surface. One true-black stage with the controls, metadata, and timeline on it. No border, no window chrome, --radius, --shadow-media, and an ambient edge sampled from the current frame. Controls cover picture in picture, expand, volume, skip, play, progress, transcript, and cue sync. The anatomy and markup contract are on Media.

Data

CodeBlock
A monospace block on a card. The fill is container +1. The copy button becomes a check on solid green for 3 seconds after a copy. There is no "Copied" toast or label.
CopyButton
An icon button at container +1, hover +2. On click it shows the check on solid green for 3 seconds, then reverts. Use it instead of a "Copied" message.
Table
Rows are solid bars 1px apart, container +1, hover +2. The header is muted text with no fill. No rules and no borders.
EmptyState
An optional scribble, one line, one sentence, and one action. Say what the space is for, not that it is empty.
Avatar, Chip, Skeleton
The avatar is the only circle. A chip is a solid fill with a remove action when needed. A skeleton shimmers between container +1 and +2 while content is recalled.
Key and value
A detail list for one record. The label is muted and left, the value is right, and rows sit 1px apart at container +1. Use the mono face for IDs and keys. The full contract is on Data.
BenchmarkTable
Systems by metric. Each cell is a value above a solid bar scaled to its column. The best value takes the accent, a highlighted row sits one step up, and a missing result is a dash. The caption carries the source, date, and method. See Data.
ComparisonTable
Features down, options across. A check means included and a dash means not included. The featured column sits one step above the rest, with no ring or badge. Groups are separated by space, never a rule.
Pagination
Summary left, controls right. Buttons are solid at container +1, hover one step up, and the current page takes the accent. A long range collapses to an ellipsis.
Stat
One headline figure in 48px Helvetica with tabular numerals, a solid delta badge, a comparison period, and an optional area chart flush to the bottom. The chart uses the panel color, not a step above it.

Charts

Chart
The minimal primitive: area, line, bar, and donut. No axis labels, no horizontal grid, solid surface, hover tooltip. Types, dimensions, and markup are on Data.
BarChart
Labelled comparison bars. The value sits above the bar and the category below. Gridlines are solid, ticks are mono, and the top corners are rounded. The direction belongs in the Figure subtitle.
BarList
A ranked list where the bar is the row. The track is solid at container +1, the fill is accent-strong, and the figure and share sit in a fixed column on the right. One tone only.
Figure
The frame for a chart: a display title, a direction subtitle, an optional download action, the chart, and a caption with source and method. The panel is one step above its container.
Heatmap
Five solid intensity steps from the row step to accent-hover. Cells are square and 1px apart, the outer corners take the radius, and hover names the exact value.
ScatterChart
A trade-off plot. Each series takes its own marker shape and solid color, so it reads without color alone. A line joins a settings sweep; a single result has none. Axis labels carry the units.
StackedBar
One bar split into parts of a whole, largest first, within one hue then neutral grey. Segments are 1px apart and the legend puts shares right aligned.
Button variants and sizes
Button labels wrap left, not centered
Fields: default, focus, error, disabled, select, textarea
Tabs, toggle, checkbox, segmented
Badges
Accent Active Low Pending Revoked Private Info
Card, with a neutral button on the card's surface

Production key

Requests authenticated with this key use the hosted reference path.

Code block and copy feedback
bash
curl https://api.mpalo.com/v1/memories \
  -H "Authorization: Bearer $MPALO_KEY"
Table: solid rows, 1px apart, muted header
NameKeyStatusCalls
Productionmp_live_4f...a2Active18,204
Stagingmp_test_91...c7Active2,310
Old laptopmp_live_0b...19Revoked0
Empty state

No keys yet

Keys let your app read and write memories. Create one to start.

Avatar, chip, skeleton
AL memory episodic
Menu, toast, tooltip: overlay surfaces with one shadow
Rename
Copy key
Revoke
Key created

Copy it now. You will not see it again.

Copy key
Chart: line, no axis labels, faint vertical field, solid accent

Do not restyle a shared component in a page. If a component looks wrong on a surface, fix the component or fix the surface. A page-level override becomes a second definition of the system.

Patterns

The recurring arrangements that keep pages consistent without new CSS.

Page and card nesting
Page 1, card 2, nested card 3, button 4, hover 5. Nothing skips a step. Past step 7, stop nesting and use space instead.
Header and footer
The header is step 1. The footer is step 0. The developer surface does not carry a marketing footer.
Overlays
Beneath +2, with the overlay shadow. The scrim is the only full-page translucent layer. Menus and dialogs close with Escape; dialogs also close on a scrim click.
Grouping by proximity
8px within a group, 32px between groups. Do not nest a card inside a card and do not add divider rules. Use space, not lines.
Tabs
Separated text with a 2px accent bar under the active tab. Not filled tabs. The bar is a drawn shape, not a border.
Provider cards
No arrow and no fill behind the logo. The logo sits directly on the card. The card fill is container +1; hover +1; selected +2.
Empty states
One line, one sentence, one action. Say what the space is for. Do not apologize for the absence of data.
Disabled
A solid container +1 fill with muted text and a not-allowed cursor. No opacity change. Quiet text actions keep a transparent background.
Error
A red outline plus a sentence that names the problem and the next step. The outline is not the only signal.
Selected
Selected nav items and tabs are +2. The selected state is a solid fill or the accent bar, never a border or a tint.
Banners
A solid fill with its on-color text. No tint, no translucent surface, no left-border accent.
Copy feedback
The icon becomes a check on solid green for 3 seconds. No "Copied" text and no toast.

Assets

The system uses one logo set, one icon set, one scribble library, and two typefaces.

Logos

The canonical logos are logo.svg and Mpalo-Logo.svg. Use Mpalo-Logo.svg on dark surfaces. The shared footer uses logo2.svg at footer scale. Favicons are derived from the canonical files. Do not redraw a logo, recolor it, or add a variant outside this set.

Mpalo marklogo.svg
Mpalo logoMpalo-Logo.svg
Mpalo footer marklogo2.svg, footer

Icons

Mpalo draws from one variable icon family, Material Symbols Rounded, and names every subject the surfaces actually use. The family is not a general library. It is a working vocabulary, and the manifest is the record of what the institution has agreed to say with it. A name describes a subject, never a decoration, a vendor, or a file.

Only the named subjects ship. The full Material Symbols font is about 15 MB and holds thousands of drawings; the served subset is about 249 KB. A new subject is added to the manifest and the font is rebuilt, so the vocabulary grows by decision, not by availability. npm run icons:search <keyword> finds the upstream drawing by name.

Weight and optical size

Weight and optical size are two axes of the same drawing, and they are chosen together. Weight controls the mass of the stroke. Optical size controls how much of the em the drawing occupies and how tightly its curves are cut. A 24 pixel interface icon uses weight 500 at optical size 24, which holds its shape beside body text without becoming a second focal point. A 16 pixel icon lowers optical size to 20 and keeps the same weight, because the stroke that reads as calm at 24 pixels clots at 16. Editorial use drops to weight 300 at optical size 48, where the larger drawing has room to breathe. The heavier weights exist for emphasis, not for a second family. Because every weight comes from one variable font, a change in weight never changes the name or the meaning.

200, light
300, editorial
500, interface
700, strong

Fill

Fill is a separate axis, not a heavier weight. The outline master is the default because it sits beside text without competing with it. The filled master is used where the outline loses presence: the media transport at the center of the picture, the micro register below 12 pixels where a hairline stroke disappears, and state that must remain legible without relying on color. The subtitle control is the clearest example. Outline means captions are off. Filled means they are on. The drawing changes, the name does not, and the state survives a monochrome surface.

outline, captions off
filled, captions on
micro, filled below 12

Color

An icon has no color of its own. It paints with currentColor, so it inherits the surface and follows the same token rules as the text beside it. The semantic modifiers are the only color layer: muted for secondary affordances, accent for the active path, and success, warning, and danger for status. A literal color in markup is a defect, because it cannot follow the light ramp, a surface step, or a status token. Provider and platform marks are the exception, and they are not icons. They keep their official art under assets/logos/providers and are never recolored, outlined, or substituted with a glyph.

inherits text
muted
accent
success
danger

Direction

Direction is rotation, not a second drawing. One chevron ships as chevron, and the surface rotates it by 90, 180, or 270 degrees for right, down, or left. The dropdown arrow is the common case. The closed state rotates the chevron 180 degrees, and the open state returns it to zero. The same rule applies to any subject whose meaning is orientation. Keeping one drawing and rotating it makes the vocabulary smaller and the geometry consistent when a control changes state.

0, up
90, right
180, down
270, left

Motion

Icons do not animate. A glyph that moves stops reading as a sign and starts competing with the content it is meant to label. Motion belongs to the scribble register and to media that is its own accessible object. If a state change needs motion, the motion is designed as a separate drawing, not applied to the icon font. The reduced motion guard in public/mpalo-icons.css exists to keep that boundary explicit.

Vocabulary and registers

The canonical names are lowercase snake_case and live in design/icons/manifest.json. The generated map binds each name to a fixed codepoint, so drawing never depends on ligature shaping. One subset variable font and one styling layer serve every surface, and npm run check:icons keeps the vocabulary and the markup in agreement. The interface register uses 16, 20, and 24 pixel sizes at weight 500. The micro register uses 12 pixels or below with the filled master. The editorial register uses weight 300 at 48 pixels. A subject enters the manifest when a surface needs it, and the name it receives is the name it keeps.

Registers in use: 16 and 24 interface, micro at 12, editorial at 40

Scribbles

Scribbles are illustration, not icons. The library holds 48 files. The canonical animation is animationscribblecombined.svg, drawn left to right over 5s. At 1280px, keep the visible ink at least 48px from headlines and controls, and 32px from body copy. At 390px, keep 32px from headlines and controls, and 24px from body copy. The global connector is hidden below 1280px.

Canonical animated scribbleanimationscribblecombined.svg
Scribble sample7scribble.svg
Flower scribble sampleflower1.svg

Fonts

Radley 400, Helvetica LT Std Bold, Eina 400/600/700 and ASM 400/700 are supplied in the design-system font folder. Verify licences before adding a new weight or file. Mind uses Eina for display and ASM for body; welcome uses Helvetica. OpenDyslexic remains a reader option in Mind and is not a surface font.

Charts

Charts are minimal: no axes, no horizontal grid, vertical faint lines, straight strokes, a solid accent, and a hover tooltip. The drawing is rendered from the surface's own markup and tokens. Do not add a translucent canvas, a gradient, a third-party chart runtime, or a border.

Editorial media

Use approved editorial media with recorded provenance. When no approved media exists, use the black placeholder. Do not substitute stock imagery, invent a visual motif, or describe a placeholder as final art.

Ownership and lifecycle

The tokens are the source; the pages are the output. Change the source, build, and verify every surface.

Source and build

Tokens live in apps/dev-site/design-system/tokens/. Shared components live in apps/dev-site/design-system/components.css. The media player lives in design-system/media.css and media.js. Fonts and assets sit beside them. The dev-site build bundles the token imports into /design-system/mpalo.css, writes /design-system/components.css and the media files, and copies the fonts and assets. Every host serves that folder at /design-system/.

Every page loads /design-system/mpalo.css first and /design-system/components.css last, sets data-surface on the root, and sets data-theme="light" on mind and welcome when the light ramp is in use. The legacy token files alias these values; they never redefine them.

Adding a page

Add an EJS template, register it in pages.config.js, add it to the navigation group it belongs to, map the route in the Worker, then build. Use relative links so the page resolves locally under /dev and in production at the subdomain root. The developer build writes the page, its Markdown edition, the search index, llms.txt, and the sitemap from the same registry.

Changing a token

A token change is a system change. Edit the token source, build, run the token checks, and preview every surface. Do not add a value to a page, a legacy stylesheet, or a component to solve a local problem. If the system cannot express the need, add the token in the source and document its use here.

Review

Build the dev site. Run the token checks. Preview at desktop and mobile widths. Check keyboard focus, reduced motion, selected states, and the overlay surfaces. Do not ship a visual change without a preview. Do not change a surface that serves production traffic without one.

Protection

Generated files under public/ are never hand-edited. Material under recovery/ and archived assets are not deleted without asking. A destructive change to a shared token follows the same rule as a database change: rehearse, preview, and report.

Enforcement

Run npm run check:design-rules and npm run check:design-runtime after a token or component change. Build the developer site and preview every affected surface. A rule that is not checked will be reintroduced.

Continue with No-Go's for the boundaries and Components for the usage rules that sit on these foundations.