# Cove design system This document describes the design as implemented in the final source of the Cove lending simulation. Every value below is taken from `src/styles/tokens.css`, `src/styles/base.css`, `src/styles/components.css` and the components under `src/components/`. It exists so that another page can be added that belongs to the same product. ## Overview Cove is a lending dashboard for a crypto-literate person managing one position: ETH collateral against USDC debt. The visual character is a quiet, light financial tool: a near-white cool-gray page, white cards, a single deep-teal accent used for the one primary action per view and for “current” states, and semibold tabular figures that carry the hierarchy. Decoration is limited to a brand mark and one progress bar; the information and its order do the work. System-wide rules: - **One primary action per view** gets the filled accent; every peer action is outlined or quiet. - **Figures lead.** Values are semibold, tabular, and larger than their labels; labels are 13px secondary text above them. - **Group with space, then with a hairline.** Card sections are separated by a 1px divider only after a 24px gap; inside a section, 8px to 16px spacing does the grouping. - **Simulation is always visible.** The header badge, the notice, the panel hint and the footer restate that nothing is real. New pages keep at least the header badge and footer. Page-specific arrangements (not rules): the two-column dashboard grid, the sticky action panel and the LTV bar belong to the dashboard page. ## Colors Declared in `src/styles/tokens.css` in `oklch()`. Two tiers: primitives named by hue (never used in components) and semantic tokens named by role (the only tier components use). Light theme only; there is no dark theme and none should be added by mechanically inverting these values. ### Primitives | Token | Value | Consumed by | | --- | --- | --- | | `--gray-0` | `oklch(1 0 0)` | surface, text on accent | | `--gray-50` | `oklch(0.982 0.003 230)` | page background | | `--gray-100` | `oklch(0.962 0.004 230)` | subtle/inset/hover backgrounds | | `--gray-200` | `oklch(0.92 0.006 230)` | dividers | | `--gray-300` | `oklch(0.86 0.009 230)` | strong dividers | | `--gray-400` | `oklch(0.655 0.015 230)` | control borders (measured 3.15:1 on white) | | `--gray-500` | `oklch(0.535 0.018 230)` | tertiary text, placeholder (measured 5.16:1 on white) | | `--gray-600` | `oklch(0.49 0.02 230)` | secondary text (measured 6.21:1 on white) | | `--gray-800` | `oklch(0.3 0.02 230)` | generic coin glyph fill | | `--gray-900` | `oklch(0.22 0.02 230)` | body text | | `--gray-950` | `oklch(0.17 0.02 230)` | headings, key figures | | `--teal-50` | `oklch(0.972 0.018 200)` | accent-soft background | | `--teal-100` | `oklch(0.935 0.04 200)` | text selection | | `--teal-200` | `oklch(0.87 0.07 200)` | accent border | | `--teal-600` | `oklch(0.52 0.1 200)` | focus ring (measured 5.19:1 on white, 4.66:1 on inset) | | `--teal-700` | `oklch(0.45 0.09 200)` | accent solid fill, ETH glyph (white text measured 6.94:1) | | `--teal-800` | `oklch(0.39 0.08 200)` | accent text, links, solid hover | | `--teal-900` | `oklch(0.32 0.065 200)` | solid active | | `--green-50` / `--green-700` | `oklch(0.965 0.03 150)` / `oklch(0.45 0.12 150)` | success badge and result (measured 6.42:1) | | `--amber-50` / `--amber-700` | `oklch(0.968 0.04 80)` / `oklch(0.5 0.12 70)` | warning badge, LTV bar over max | | `--red-50` / `--red-200` / `--red-700` | `oklch(0.965 0.02 25)` / `oklch(0.86 0.07 25)` / `oklch(0.5 0.18 25)` | errors, danger badge, destructive confirm | ### Semantic roles | Role | Token | Points at | | --- | --- | --- | | Page background | `--color-bg-page` | gray-50 | | Card / control surface | `--color-bg-surface` | gray-0 | | Subtle, inset, hover | `--color-bg-subtle`, `--color-bg-inset`, `--color-bg-hover` | gray-100 | | Accent soft (notice, current nav, badge) | `--color-bg-accent-soft` | teal-50 | | Accent solid (+ hover, active) | `--color-bg-accent-solid`, `-hover`, `-active` | teal-700 / 800 / 900 | | Dialog backdrop | `--color-bg-backdrop` | `oklch(0.17 0.02 230 / 0.45)` | | Text: primary / heading / secondary / tertiary / placeholder | `--color-text-primary`, `-heading`, `-secondary`, `-tertiary`, `-placeholder` | gray-900 / 950 / 600 / 500 / 500 | | Text on accent, accent text, links | `--color-text-on-accent`, `--color-text-accent`, `--color-text-link` | gray-0, teal-800, teal-800 | | Dividers | `--color-border`, `--color-border-strong` | gray-200, gray-300 | | Input and outlined-button boundary | `--color-border-control` | gray-400 | | Accent border, danger border | `--color-border-accent`, `--color-border-danger` | teal-200, red-200 | | Focus ring | `--color-focus-ring` | teal-600 | | Status text/background | `--color-status-{success,warning,danger}-{text,bg}` | green/amber/red 700 and 50 | Meaning is fixed per hue: teal = interactive or current; green = healthy/complete; amber = watch; red = error, at-risk or destructive. Status is never carried by color alone: every badge has text, every error has an icon and text, and the LTV bar has a text legend and an accessible name. Contrast figures above were measured in Chromium on the rendered export with a WCAG 2 luminance calculation (see `artifacts/validation.md`). All measured text pairs are at or above 4.5:1; measured control borders and the focus ring are at or above 3:1. ## Typography - Family: `--font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`. No web font is bundled; the system face renders. `--font-mono` is declared but not consumed by any component. - Root: `font-size: 100%`, `line-height: 1.5`, antialiased smoothing on `html` (`src/styles/base.css`). - Scale (`tokens.css`): `--text-xs` 12px (badges, table captions), `--text-sm` 13px (labels, helper, table body, footer), `--text-base` 15px (body, controls, key/value rows), `--text-md` 17px (card titles, dialog title, review step title), `--text-lg` 22px (page titles, stat values), `--text-xl` 28px (declared; not used on the current pages). - Headings: weight 600, `line-height: 1.15`, `letter-spacing: -0.01em`, `text-wrap: balance`. Levels descend: page `h1` 22px → card `h2` 17px → section `h3` 13px uppercase secondary with `+0.04em` tracking. The dashboard’s `h1` is visually hidden; cards are `h2`. - Body paragraphs use `text-wrap: pretty`; long-form text is capped at `68ch` (`.prose`) or `60ch` (`.page-head__lede`). - Numbers: every changing value uses `font-variant-numeric: tabular-nums` (`.stat__value`, `.kv dd`, `.table .num`, `.activity__amount`, `.amount__input`, `.field__meta`). Stat values split into `.stat__number` (22px, 600, `white-space: nowrap`) and `.stat__unit` (13px, 500, secondary, non-breaking). Table numbers align to the trailing edge. - Inputs: `.amount__input` is 20px semibold on all viewports, above the 16px iOS zoom threshold. - Links: underline from font metrics with a `0.12em` offset (`base.css`). - Weight floor: nothing under 400; 500 for nav links, tab labels, table headers and key/value values; 600 for buttons, labels, badges and headings; 650 for the brand. ## Layout - Container: `.container` is `max-width: 1120px`, centered, with `--container-pad` of 16px (≥40rem: 24px). - Spacing scale: `--space-1` 4px, `-2` 8px, `-3` 12px, `-4` 16px, `-5` 20px, `-6` 24px, `-8` 32px, `-10` 40px, `-12` 48px. Cards pad 20px (≥40rem: 24px). Card head to content: 16px. Sections: 24px gap plus a hairline. Form groups: 20px between fields, 8px inside a field. - Header: sticky, 56px minimum (`--header-height`), white with a bottom hairline. Brand row, primary nav (`