# Delta design system

Delta is the monochrome design system created for Ross Amiri’s portfolio. The foundation for new components and unresolved design decisions is
[shadcn Lyra preset buFyykS](https://ui.shadcn.com/create?preset=buFyykS&pointer=true),
with Base UI, square corners, JetBrains Mono, Lucide, and pointer cursors.
The portfolio and Delta guide use the same shared components, with the current
Home/game appearance defining the Delta visual language. The guide has three
views: [Design system](/delta/), [Installation](/delta/installation/), and
[Components](/delta/components/). Its resource links open the Lyra preset,
this Markdown guide, and the exported Delta theme CSS.

The site cursor uses an equilateral triangle rotated 30° counterclockwise for
fine mouse pointers. It fills with a contrasting theme-color border over clickable
controls and stays outlined over other content, including text inputs and the
running A3 playfield. Both forms follow the active screen theme. The cursor sits
above site overlays, dialogs, and toasts, and disappears in print.

## Identity

- **Name:** Amiri, with this capitalization. Use Ross Amiri in personal and
  resume contexts, and amiri.cc when displaying the website address.
- **Primary mark:** the equilateral triangle. Pair it with the
  Amiri wordmark in JetBrains Mono 300, using an 8px gap. A standard compact lockup
  uses a 24px SVG artboard and a 24px wordmark, vertically center-aligned.
- **Geometry rule:** every triangle in the portfolio is equilateral, whether it
  comes from an asset or is drawn with SVG, CSS, or canvas.
- **Supporting marks:** upright filled, flipped line, and flipped
  filled. Use them in supporting graphics and specimens; keep the primary
  orientation consistent in navigation and identity lockups.
- **Color:** white on dark backgrounds; black on light backgrounds and paper.
  Preserve the approved outer geometry, line thickness, and transparent canvas.
  Do not stretch, skew, add effects, or introduce another logo color.
- **Clear space:** at least one-quarter of the visible mark's height on
  every side. Measure from the artwork, rather than the SVG canvas. The visible
  height is 75% of the existing square artboard. A 24px artboard therefore needs
  4.5px of clear space around its visible mark. Built-in whitespace counts, but
  does not provide the required clearance on every edge; surrounding layout
  must supply the remainder.
- **Standard displayed logo size:** 24×24 for every logo specimen. The favicon
  uses the 24×24 line export. All sizes retain the masters' geometry and
  line thickness.
- **Published icons:** upright white line PNGs at
  `/icons/24x24/white-line.png` for the favicon, 180×180 for Apple touch,
  and 192×192/512×512 for the manifest. Their URLs follow the same size-folder
  convention. Black versions serve light-background and print specimens.
- Use SVG for scalable presentation and PNG where a raster asset is required.
  [The asset index](https://github.com/aasmpro/aasmpro.github.io/tree/master/docs/branding/) lists both colors, orientations, styles, and sizes.

### Logo construction

The master artwork uses a **256×256** canvas. The outer equilateral form has
vertices `(128,32)`, `(238.851252,224)`, and `(17.148748,224)`. Its visible bounds
are centered on the canvas: 192 units high and approximately 221.7025 units
wide. This describes the bounding box, not the form's centroid.

Filled and line variants share this exact outer silhouette. Flipped variants
are exact **180° rotations about `(128,128)`**. Black and white variants have
identical geometry. Keep the supplied paths rather than redrawing them.

### Line thickness and scaling

The line variant is an **even-odd filled path**, with an inner shape cut out.
It does not use an SVG `stroke`. The perpendicular distance between the inner
and outer edges is **17.777778 canvas units**, including the horizontal base.
The 35.555556-unit difference between the two apex positions is not the line thickness.

**Effective line thickness = displayed square size × 17.777778 ÷ 256.**
This is about 6.944444% of the displayed size. Upright/flipped and black/white variants
all use the same proportions.

| Displayed size | Effective line thickness |
| --- | --- |
| 24×24 | 1.667px |
| 32×32 | 2.222px |
| 48×48 | 3.333px |
| 180×180 | 12.5px |
| 192×192 | 13.333px |
| 512×512 | 35.556px |

Displayed dimensions determine apparent thickness, independently of the source
export size: a 512px PNG displayed at 24px still has an effective 1.667px line.
These are nominal CSS-pixel measurements; device pixel ratio, resampling, and
PNG antialiasing affect edge coverage. Do not round the line to an integer or
change the path to compensate. Prefer SVG for screen logos; use PNG for the
published platform icons and other raster requirements.

### Clear space and lockup

Clear space is measured from the visible artwork, not the artboard boundary.
At 24px, visible artwork height is 18px, so the minimum clearance is **4.5px**
on every side. The canvas supplies approximately 1.608px left/right and 3px
top/bottom. Add at least approximately 2.893px horizontally and 1.5px vertically
when no other surrounding whitespace is available. A **3px padding wrapper**
around the 24px canvas is a simple safe construction example; this measurement
is specific to artwork clearance, not an additional UI spacing token.

For the standard lockup, use the equilateral triangle at 24×24, **8px between the
canvas and wordmark**, and “Amiri” at 24px in JetBrains Mono 300. Center-align
mark and wordmark vertically; preserve the outer clear space around the lockup.
Use the black mark on white/light backgrounds and paper, and the white mark on
black/dark backgrounds. Keep backgrounds plain behind the artwork.

### Logo usage and accessibility

- Use the equilateral triangle for the primary identity. Filled and flipped
  variants remain supporting artwork, not replacements for the standard lockup.
- Preserve proportions, line thickness, transparency, and approved orientations.
  Do not stretch, skew, crop, recolor, add effects, or rebuild the artwork using
  CSS borders. Do not add a background to the source asset.
- When the mark accompanies a visible “Amiri” wordmark in the same element,
  use `alt=""` on the image to avoid duplicate announcements. Construction
  images may also use empty alternatives when the adjacent text explains them.
- A standalone functional logo needs a destination-specific accessible name,
  such as `aria-label="Amiri — Home"` on its link with `alt=""` on the image.
  Keep the 24px artwork independent of the control's target size.
- Construction frames, guides, and measurement labels in the reference are
  annotations outside the artwork; never include them in logo exports.

## Color

The six working colors are black `#000000`, white `#FFFFFF`, gray-04 `#141414`,
gray-20 `#646464`, gray-32 `#A0A0A0`, and gray-47 `#EBEBEB`.
Only these six colors supply semantic UI colors. Shared Delta variants define
raised surfaces, inversion states, and focus outlines while preserving Base UI
interaction, disabled semantics, keyboard access, and accessibility behavior.

All 50 reference shades are exported as CSS variables and Tailwind utilities,
including `--gray-04` and `bg-gray-04`. For step i from 1–50, every channel is
round(255 × i / 51). Black and white are separate endpoints. This numeric sRGB
scale is not a claim of uniform perceived lightness.

| Token | Value | Use |
| --- | --- | --- |
| `gray-01` | `#050505` | Reference |
| `gray-02` | `#0A0A0A` | Reference |
| `gray-03` | `#0F0F0F` | Reference |
| `gray-04` | `#141414` | UI |
| `gray-05` | `#191919` | Reference |
| `gray-06` | `#1E1E1E` | Reference |
| `gray-07` | `#232323` | Reference |
| `gray-08` | `#282828` | Reference |
| `gray-09` | `#2D2D2D` | Reference |
| `gray-10` | `#323232` | Reference |
| `gray-11` | `#373737` | Reference |
| `gray-12` | `#3C3C3C` | Reference |
| `gray-13` | `#414141` | Reference |
| `gray-14` | `#464646` | Reference |
| `gray-15` | `#4B4B4B` | Reference |
| `gray-16` | `#505050` | Reference |
| `gray-17` | `#555555` | Reference |
| `gray-18` | `#5A5A5A` | Reference |
| `gray-19` | `#5F5F5F` | Reference |
| `gray-20` | `#646464` | UI |
| `gray-21` | `#696969` | Reference |
| `gray-22` | `#6E6E6E` | Reference |
| `gray-23` | `#737373` | Reference |
| `gray-24` | `#787878` | Reference |
| `gray-25` | `#7D7D7D` | Reference |
| `gray-26` | `#828282` | Reference |
| `gray-27` | `#878787` | Reference |
| `gray-28` | `#8C8C8C` | Reference |
| `gray-29` | `#919191` | Reference |
| `gray-30` | `#969696` | Reference |
| `gray-31` | `#9B9B9B` | Reference |
| `gray-32` | `#A0A0A0` | UI |
| `gray-33` | `#A5A5A5` | Reference |
| `gray-34` | `#AAAAAA` | Reference |
| `gray-35` | `#AFAFAF` | Reference |
| `gray-36` | `#B4B4B4` | Reference |
| `gray-37` | `#B9B9B9` | Reference |
| `gray-38` | `#BEBEBE` | Reference |
| `gray-39` | `#C3C3C3` | Reference |
| `gray-40` | `#C8C8C8` | Reference |
| `gray-41` | `#CDCDCD` | Reference |
| `gray-42` | `#D2D2D2` | Reference |
| `gray-43` | `#D7D7D7` | Reference |
| `gray-44` | `#DCDCDC` | Reference |
| `gray-45` | `#E1E1E1` | Reference |
| `gray-46` | `#E6E6E6` | Reference |
| `gray-47` | `#EBEBEB` | UI |
| `gray-48` | `#F0F0F0` | Reference |
| `gray-49` | `#F5F5F5` | Reference |
| `gray-50` | `#FAFAFA` | Reference |

| Role | Light | Dark | Print |
| --- | --- | --- | --- |
| Background | white | black | white |
| Foreground | black | white | black |
| Card / muted surface | gray-47 | gray-04 | white |
| Muted text | gray-20 | gray-32 | gray-20 |
| Border / input | gray-20 | gray-20 | black |
| Primary | black | white | white |
| Primary foreground | white | black | black |
| Focus | black | white | black |

Sidebar, popover, status, and chart tokens use the same six colors. Do not rely on
color alone: include status labels, selected states, and chart markers or patterns.
Normal text requires 4.5:1 contrast; meaningful boundaries require 3:1. White/black
is 21:1, gray-20/white is 5.92:1, gray-32/gray-04 is 7.04:1, and gray-20/gray-04
is 3.11:1. Place swatch labels outside their chips.

## Typography

JetBrains Mono is the preset’s family for body, headings, controls, and code.
Google Fonts supplies weights 100–800 with display=swap and a generic monospace
fallback. No local fonts or font-copy step is required. The maintained stylesheet
uses direct Google-hosted v24 WOFF2 URLs from the
[Google Fonts definitions](https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100..800&display=swap).
All six language subsets remain available. The application and portable theme
embed those declarations; registry consumers load the published fonts.css in
the document head because the pinned shadcn CLI cannot emit font-face descriptors.
No remote stylesheet import or build-time font download is required.

Use standard Tailwind text sizes from `text-xs` (12px) through `text-5xl`
(48px), with responsive sizes for page headings. The shared h1 uses 36px on
small screens and 48px from the medium breakpoint; h2 uses 20px. Use configured
Lyra typography wherever Delta has no approved choice.
Body text remains readable with natural wrapping and measures near 65ch. The
identity wordmark remains 24px at weight 300, with an 8px mark gap.
The guide shows the standard size scale and JetBrains Mono weights 100–800;
its italic examples use the browser's synthesized slant.

## Three layers: values, presentation, and components

1. **Theme:** one set of typography, color, spacing, border, shadow, and motion
   values in theme.css. Customize standard theme tokens for foundational changes;
   add semantic tokens for distinct roles. Never manually redefine numeric
   utilities such as `.p-4` with unrelated values.
2. **Tailwind styling:** base rules give ordinary HTML consistent defaults;
   named classes compose recurring visual treatments. Use native headings and
   anchors without React styling wrappers. Ordinary `a[href]` inherits underline,
   0.3em offset, color, and native-style focus. Component-owned anchors have a
   `data-slot`; special logo/artwork/skip links opt out with `data-link-unstyled`.
3. **Components:** use configured shadcn/Base UI for behavior, accessibility,
   structured composition, and meaningful variants. Retain Button, Input, Card,
   Dialog, Tabs, and application compositions such as the terminal. Lyra remains
   the fallback for designs not yet defined. Keep standard names and compatible
   APIs; pages supply content, state, and layout.

Default h1/h2 typography comes from the theme. Home's greeting and introduction
also use standard Tailwind text sizes. `.site-container`,
`.guide-prose`, `.guide-code`, `.guide-table`, and `.list-triangle` are reusable
presentation recipes. Use `.list-triangle` for content bullets; its small filled
equilateral marker follows the text color and also prints. Responsive values and
print behavior are centralized. Body copy inherits
its surrounding typography so terminal text and compact controls retain their size.
Body font and canvas font selection share `--font-mono`; sans/heading aliases
reference that same family. Standard weights and line heights use the theme's
Tailwind scale. Distinct roles use `--leading-prose`, `--leading-code`, and
`--container-prose`. Hairline borders and link focus use `--spacing-hairline`,
`--spacing-link-focus-offset`, and `--color-link-focus` rather than copied values.
Resume sections use two columns on desktop and stack in print. Paragraphs use
normal wrapping and justified body paragraphs to fill the available content column.

Dialogs center with fixed insets and automatic margins instead of a centering
transform. This avoids compositing seams on thin control borders while retaining
the shared dialog shadow, animation, focus management, and viewport gutters.

Buttons never move on hover or keyboard focus. Shared button/control variants
use Lyra's 1px downward active press treatment, retaining its popup-trigger
exception and disabled behavior. The raised variant names the offset shadow,
not movement. While pressed, the surface moves down 1px and its shadow shrinks
from a 5px offset to 3px on both axes, creating a pressed-in feel. Translation
and shadow use the same transition timing. No pointer-layer workaround is needed.

Buttons retain shared default/outline/raised variants, navigation/play/toolbar/
pause sizes, solid focus outlines, and instant foreground/background inversion.
Input’s `heading` variant inherits its heading typography and removes the field
frame while preserving a visible keyboard focus outline for inline title editing.
The shared `row` size provides full-width record buttons with automatic height,
left-aligned content and right-aligned metadata columns, stacked on small screens.
This applies to all shared controls, including toggles/grouped toggles, tabs,
accordion triggers, linked badges, checkboxes, and fields. Do not use
transition-all or transition-colors on controls that change foreground/background.
Only press movement and shadow animate with 150ms ease timing; color crossfades
are excluded to prevent low-contrast intermediate hover frames.
Switch retains the configured Lyra/Base UI root and thumb behavior, with Delta's
square corners, shared focus outline and motion tokens, and standard Tailwind
sizes. Its state colors change instantly; only thumb movement animates.
Button's link variant uses `.link-text` because component anchors are excluded
from ordinary tag defaults. Card retains canvas/terminal variants; Input retains
terminal; Dialog retains game proportions. Scoreboard remains a structured
variantable component. Necessary CSS/canvas drawing consumes the same tokens;
mathematical/runtime geometry and gameplay rules remain allowed.
Canvas glow radii, stroke widths, opacity levels, font weights, and motion choices
are read through the shared canvas palette from theme.css. Local formulas may
interpolate those values and calculate positions, triangle proportions, trail
ratios, and particle paths; they must not embed new presentation values.

For scanlines, place `<div className="scanlines" aria-hidden="true" />` after
artwork inside a positioned container. It preserves 1px lines every 3px at 7%
foreground opacity, ignores input, follows the theme, and hides in print. This
recipe is included in the theme, not installed as a React component.

The same base rules and recipes ship in registry and portable theme CSS. Optional
component entries export only retained controls/compositions. Presentation-only
TextLink, Heading, Text, Container, CodeBlock, Table, and Scanlines wrappers are
not required or distributed.

Use Lucide SVGs for general actions and visible service names where brand icons
would otherwise be needed. Font Awesome is removed. Existing LinkButton props and
content schemas remain supported. Named and project links carry destinations,
labels, and optional icon identifiers; button variants own their presentation.

Home and the 404 share the matrix canvas and equilateral central triangle, with
the same theme switching and reduced-motion behavior. The 404 omits Home's
content panels, visible error copy, header, and footer. Its single bottom-centered
Home button uses the raised navigation variant and the canvas connection style.

## Theme and distribution

The site starts dark and shares `amiri-theme` storage across routes. An inline
initialization restores the theme before paint. Selection works in memory if
storage fails. Consumer theme controllers remain application-owned.

`src/assets/styles/theme.css` maintains shared tokens, `src/assets/styles/fonts.css`
maintains hosted font-face declarations, and `src/assets/styles/theme-base.css`
maintains pointer, reduced-motion, forced-color and print rules for the whole site.
`scripts/build-registry.mjs` generates a CSS-only `@delta/theme` and portable CSS
from those same definitions. The Design system view lives in `src/app/delta/page.jsx`,
Installation in `src/app/delta/installation/page.jsx`, and Components in
`src/app/delta/components/page.jsx`. The latter shows all 15 installable shared
components with examples and individual install commands; scanlines remain a
theme recipe. The palette swatches copy their hex value when activated.
Shared components live in `src/components/ui` and are also available as optional
registry entries such as `@delta/button` and `@delta/card`. Each entry copies the
same source, uses standard filenames, and declares its UI/npm dependencies.
Application compositions, routes, content, state, and game engines are not exported.
Accordion triggers use a small filled equilateral caret before the label; it
points right when closed and down when open. The Components view's Form/Dialog
header uses Toggle Group to select the visible panel.

See [setup instructions](setup.md) for new projects, existing projects, optional
component adoption, upstream updates, and manual CSS adoption. Local components use Base UI;
theme-only adoption supports Tailwind 4 shadcn with either Base UI or Radix.
Optional Delta component entries use Base UI and require a reviewed migration
when replacing existing component source.

## Accessibility and motion

Preserve semantic controls, visible keyboard focus, dialog focus containment and
return, labels, disabled behavior, and status announcements. Check both themes at
320, 390, 768, and 1280px, enlarged text, spacing overrides, coarse pointers,
forced colors, and blocked Google font requests. Reduced motion removes
nonessential transitions and character rotation. These checks do not establish
complete WCAG conformance.

## Print

Use browser Print → Save as PDF. Print is white paper and black primary text,
independent of screen theme. All printed views use a 74% font and rem-based
spacing scale, with 16mm A4 margins. The shared body starts from 11pt with
1.4 line height; the resume keeps its compact 10.5pt base before scaling.
Hide navigation/toolbars and copy controls. Expand reference accordions
for printing and restore their prior state afterward. Keep specimen and chip
colors exact, headings with following content, and individual examples together.
Enable background graphics when saving the palette guide and inspect pagination.
Print-only physical sizes, pagination metrics, paper colors, and hosted font-face
descriptors are intentional CSS exceptions. They do not authorize literal screen
typography or duplicated presentation values in ordinary page styles.

The resume preserves English content, visible details, and experience print flags.
The build generates its English PDF from the static resume export.

## Notifications

Application notifications use the shared `src/components/ui/toast.jsx`, adapted
from [shadcn Base UI Toast](https://ui.shadcn.com/docs/components/base/toast)
with the configured Lyra style. The root layout mounts one `Toaster`; callers
import `toast` and use `toast.add({ title, description, type })`. Base UI owns
announcements, timeout pausing, stacking, swipe dismissal, actions, and closing.
`toast.promise` is available for asynchronous tasks.

The renderer uses Delta surface/color tokens, square corners, shared Buttons,
Lucide status icons, and centrally defined toast motion/stack tokens. Warning
uses CircleAlert to avoid introducing a non-equilateral triangle. The viewport
sits above shared dialogs, fits narrow screens, and is hidden in print; global
reduced-motion rules apply. Errors that require dismissal and installation
instructions use `timeout: 0`. Persistent content errors and progress indicators
remain next to their content.

## Date selection

Calendar and Popover adapt the configured shadcn Lyra / Base UI sources.
Calendar preserves React DayPicker selection, navigation, locale, and keyboard
behavior; Popover retains Base UI focus management, dismissal, and positioning.
DatePicker composes them for a single optional date, closes after selection,
and offers Clear date. Values use local calendar dates in `YYYY-MM-DD` format
without UTC conversion. Application Actions use this shared component.

Delta adaptations use Lucide chevrons, square corners, shared Buttons, semantic
colors, the panel shadow, interface duration, standard text sizes, and the
central `--spacing-calendar-cell` token. The day button forwards its ref so
keyboard focus follows DayPicker. Calendar, Popover, and DatePicker are portable
registry entries with their dependencies declared from source imports.

## Confirmations

Confirmation modals use the configured shadcn Lyra Alert Dialog with Base UI
alertdialog semantics, focus containment and Cancel as the initial focus.
Delta uses square corners, its shared border/shadow/motion tokens, and centered
inset/margin positioning to match Dialog. Async deletion keeps the modal open
until completion; Panel navigation awaits the discard confirmation. Browser
reload/close warnings remain native because browsers own beforeunload prompts.

Color specimens use Button’s `swatch` variant with `swatch` or `swatchCompact` sizing. Caller-supplied `--swatch` and `--swatch-text` reference palette tokens; interaction preserves the specimen color and shared button keyboard/focus behavior. Hex labels wrap within narrow chips when text is enlarged; grayscale specimens choose the higher-contrast black or white label. Shared print rules render controls as black text on white.
