# Tandem — Design System

> A four-route personal finance workspace: a month tape with a live safe-to-spend number, a searchable transaction ledger with review state, an editable budget plan with a saved scenario, and a method page that explains every term. Demo only, no bank connection.

## Direction

- **Direction**: Chapter Route × Neo Swiss
- **Thesis**: Use the “meandering spine with alternating evidence ledges” silhouette to carry Metrics Report, with the primary content set as the operable main object, then unify type, material, and state feedback through Neo Swiss.
- **Tradeoff**: Limit decorative treatments so the structural pattern serves the visitor's task.
- **Fit**: 1.0

## Pattern Composition

- **Anchor pattern**: metrics-report
- **Support patterns**: control-desk, project-blueprint
- **Design principles**: content-density-rhythm, material-metaphor, readable-type-scale
- **Style capsule**: neo-swiss
- **Negative pattern**: no pattern reproduction

### Template Fingerprint Composition

- **Fingerprints**: tf-065, tf-146, tf-047
- **Composition family**: chapter-route
- **Composition signature**: chapter-route / night ledger / meandering spending spine with alternating evidence ledges / one oversized receipt
- **Silhouette**: a meandering lime spine crosses a near-black desk, carrying category ledges of different heights while a warm paper receipt hangs over its right edge
- **Anchor object**: the safe-to-spend number and the spending spine
- **Spatial system**: one continuous month path from income to category to obligation to goal; the ledger and plan repeat the path rather than introducing a dashboard grid
- **Overlap strategy**: the receipt overlaps the category spine; the goal contribution tag crosses a cobalt pending line; the month label runs behind the main number
- **Depth strategy**: flat dark field, one lifted paper receipt, thin signal lines, and no glassy card shadows
- **Shape grammar**: long rules, stepped ledges, receipt perforation, circular review marks, and one clipped paper corner
- **Material transitions**: near-black desk to warm paper to acid signal tape to cobalt pending ink to coral alert
- **Visual motifs**: month tape, spending spine, receipt perforation, review tick, category ledge, safe-to-spend numeral
- **Motion composition**: numbers count up only on first load when motion is allowed; filters and plan changes settle in 140ms; reduced motion makes every change immediate

**Structural breaks (must be implemented in DOM and layout)**

- the receipt overlaps the category spine and clips the page edge
- the safe-to-spend numeral sits behind the month label rather than inside a card
- one category ledge extends past the content column

- **Anti-rectangular constraint**: No equal dashboard cards, no bento grid, no pie chart in a box, no rectangle sidebar plus table; recolouring a card grid would not satisfy this composition.
- **No fake non-rectangularity**: Uniform radii, uniform shadows, recoloring, or added gradients do not count as a non-rectangular composition. DOM, contour, overflow, and overlap relationships must change.
- **Originality boundary**: Visual fingerprints provide abstract spatial composition only. Do not inherit the source template's copy, brand, palette tokens, assets, component tree, or code.

## Information Architecture

- **Month story** — Explain the month through one safe-to-spend number, six category bands, upcoming obligations, and one goal.; objects: safe-to-spend, category, bill, goal; actions: read, filter, adjust
- **Transaction ledger** — Let the user search, filter, expand, and review every transaction without losing the month context.; objects: transaction, merchant, amount, review state; actions: search, filter, review
- **Budget plan** — Make the safe-to-spend equation editable and show the trade-offs of each budget line.; objects: budget line, income, buffer, scenario; actions: adjust, apply scenario, save
- **Method and trust** — Explain the formula, the data boundary, and the limits of the demo.; objects: formula, definition, privacy note, change log; actions: read, reset, open plan
- **Cross-page state** — Keep reviewed lines, plan values, and the selected category consistent across overview, activity, plan, and method.; objects: reviewed transaction, saved plan, selected category; actions: restore, clear, deep-link

## Site Map

| Page | Route | Role | Sections | Links |
|---|---|---|---:|---|
| Tandem — Your month, in plain sight | `/` | monthly overview | 5 | Activity — Every line, accounted for, Plan — Decide before the month decides, Method — How safe-to-spend is calculated |
| Activity — Every line, accounted for | `/activity/` | transaction ledger | 4 | Tandem — Your month, in plain sight, Plan — Decide before the month decides, Method — How safe-to-spend is calculated |
| Plan — Decide before the month decides | `/plan/` | budget planner | 5 | Tandem — Your month, in plain sight, Activity — Every line, accounted for, Method — How safe-to-spend is calculated |
| Method — How safe-to-spend is calculated | `/method/` | explanation and trust | 5 | Tandem — Your month, in plain sight, Activity — Every line, accounted for, Plan — Decide before the month decides |

**Shared shell**

- Shared masthead with brand, four routes, and a local-demo badge on every page.
- Shared footer with the fictional-data notice, storage boundary, and the same four-route navigation.
- Shared night-ledger tokens: near-black desk, warm paper, acid signal tape, cobalt pending, coral alert.

**Cross-page states**

- Reviewed transaction IDs live in localStorage under tandem.reviewed.v1 and update the overview count.
- Budget values and the saved scenario live under tandem.plan.v1 and recalculate safe-to-spend across routes.
- The selected category persists in the activity query string and can arrive from any overview ledge.
- Clearing local data restores the fictional starting plan and review state.

### Page Contracts

### P1 — Tandem — Your month, in plain sight (`/`)

- **Navigation label**: Month
- **Page role**: monthly overview
- **Purpose**: Open on the one number that matters, then explain the month through a spending spine, upcoming obligations, one goal, and the latest ledger lines.
- **Required sections**:
  - `month-opening` **Safe to spend, before the noise** (primary) — Put the calculated safe-to-spend amount and its inputs in one readable opening, with the month tape already visible. Content: safe-to-spend amount / income / fixed costs / buffer. Actions: read the equation / open plan / open activity.
  - `where-it-went` **Where the month went** (primary) — Turn six categories into a continuous spending spine with amounts, shares, and a direct path into filtered activity. Content: category / amount / share / transaction count. Actions: filter activity by category / compare categories.
  - `coming-up` **Coming up** (primary) — Show the next four obligations with dates and amounts so the safe-to-spend number has a reason. Content: upcoming bill / due date / amount / account. Actions: mark reviewed / open activity.
  - `goal` **The winter buffer** (support) — Show one savings goal with a concrete contribution path rather than a gamified progress ring. Content: savings goal / current amount / target / monthly contribution. Actions: adjust contribution / open plan.
  - `recent-lines` **Latest ledger lines** (support) — Expose the most recent transactions with their review state and a clear route to the full ledger. Content: transaction / merchant / amount / review state. Actions: open activity / mark reviewed.
- **Links to**: Activity — Every line, accounted for, Plan — Decide before the month decides, Method — How safe-to-spend is calculated

### P2 — Activity — Every line, accounted for (`/activity/`)

- **Navigation label**: Activity
- **Page role**: transaction ledger
- **Purpose**: Let the user search, filter, expand, and review every transaction while keeping the month summary and plan context visible.
- **Required sections**:
  - `activity-opening` **The full ledger** (primary) — Set the count and total for the current filter and make search and category filters immediately usable. Content: transaction / search term / category / visible total. Actions: search / filter / clear filters.
  - `transaction-ledger` **Transactions, grouped by day** (primary) — Render every line as an expandable row with merchant, category, amount, account, and a note; never reduce the ledger to decorative cards. Content: transaction / merchant / category / amount / account / note. Actions: expand row / mark reviewed / open receipt.
  - `review-queue` **Review queue** (support) — Show how many lines still need a human glance and let the user mark the visible set reviewed. Content: unreviewed line / review count / review action. Actions: mark visible reviewed / clear review filter.
  - `merchant-notes` **Merchant notes** (support) — Explain three recurring or unusually large charges with plain-language context. Content: merchant / charge pattern / note. Actions: read note / filter merchant.
- **Links to**: Tandem — Your month, in plain sight, Plan — Decide before the month decides, Method — How safe-to-spend is calculated

### P3 — Plan — Decide before the month decides (`/plan/`)

- **Navigation label**: Plan
- **Page role**: budget planner
- **Purpose**: Let the user change six budget lines, see safe-to-spend recalculate, test a scenario, and save the plan locally.
- **Required sections**:
  - `plan-opening` **The safe-to-spend equation** (primary) — Show income minus fixed costs minus flexible spending minus buffer as a live equation, not a dashboard of isolated cards. Content: income / fixed costs / flexible spending / buffer / safe-to-spend. Actions: edit income / edit buffer / save plan.
  - `budget-lines` **Six lines you can move** (primary) — Give each budget line a range control, a numeric value, and a plain explanation of what changes when it moves. Content: budget line / amount / range / note. Actions: adjust line / reset line / save plan.
  - `scenario` **Test a smaller month** (primary) — Apply a 15% cut to flexible spending and show the new safe-to-spend, goal contribution, and trade-off before saving. Content: scenario / delta / new safe-to-spend / trade-off. Actions: apply scenario / discard scenario / save scenario.
  - `goals` **Goals with a job** (support) — Show two goals with monthly contributions and the consequence of moving money between them. Content: goal / target / contribution / deadline. Actions: change contribution / open method.
  - `plan-notes` **What this plan assumes** (support) — State the fictional data, the local save boundary, and three assumptions that would change the result. Content: assumption / demo note / saved state. Actions: read assumptions / reset plan.
- **Links to**: Tandem — Your month, in plain sight, Activity — Every line, accounted for, Method — How safe-to-spend is calculated

### P4 — Method — How safe-to-spend is calculated (`/method/`)

- **Navigation label**: Method
- **Page role**: explanation and trust
- **Purpose**: Explain the formula, the data boundary, the meaning of each term, and what the demo cannot do.
- **Required sections**:
  - `method-opening` **One equation, four terms** (primary) — Write the safe-to-spend formula in large type and show one worked example with real numbers. Content: formula / worked example / result. Actions: read formula / open plan.
  - `definitions` **What each term means** (primary) — Define income, fixed costs, flexible spending, buffer, and reviewed transaction in plain language. Content: term / definition / example. Actions: read definition / jump to ledger.
  - `data-boundary` **Where the numbers live** (primary) — State that no bank account is connected, no payment is made, and all state stays in this browser. Content: data source / storage boundary / permission / demo limit. Actions: read privacy note / reset local data.
  - `faq` **Questions worth asking** (support) — Answer five practical questions about reviewed lines, rollover, irregular income, and why the number can move. Content: question / answer / related term. Actions: expand answer.
  - `change-log` **Method change log** (support) — Show three dated changes to the calculation so the method feels accountable rather than magical. Content: change / date / reason / affected term. Actions: read change.
- **Links to**: Tandem — Your month, in plain sight, Activity — Every line, accounted for, Plan — Decide before the month decides

### Content Inventory

| Entity | Type | Minimum examples | Required fields |
|---|---|---:|---|
| `transactions` | fictional transaction | 18 | date / merchant / category / amount / account / note / reviewed |
| `categories` | spending category | 6 | name / amount / share / transaction count / colour role |
| `budget-lines` | budget line | 6 | name / amount / range / note / editable |
| `goals` | savings goal | 4 | name / target / current / monthly contribution / deadline |
| `method-notes` | method explanation | 5 | term / definition / example / related route |
| `faqs` | finance question | 5 | question / answer / related term |

## Visual System

### Palette

| Role | Value |
|---|---|
| desk | `#11140F — page field, navigation, and dark reading surface` |
| paper | `#F1EADB — receipt, ledger rows, and reversed text` |
| acid | `#D8F36A — safe-to-spend, active spine, and selected filters` |
| cobalt | `#6C86FF — pending and informational states` |
| coral | `#FF7A59 — alert, overspend, and error accent` |
| sage | `#9AA88E — secondary labels and quiet rules` |

### Typography

| Role | Specification |
|---|---|
| display | Helvetica Neue / Arial Black, 64–150px, tight grotesque for the safe-to-spend number and month title |
| body | Charter / Iowan Old Style / Georgia, 16–18px, readable ledger notes and method prose |
| meta | SFMono-Regular / Menlo, 10–12px, uppercase for dates, account labels, and category codes |

- **Concept**: A month laid out on a dark desk as a long paper tape: safe-to-spend is one moving number, and every category, bill, and reviewed transaction is a ledge along the same path.
- **Shape language**: Long rules, stepped ledges, receipt perforations, circular review marks, clipped paper corners, and one thick signal spine.
- **Imagery strategy**: No stock photography or bank logos. Original CSS and inline SVG only: a spending spine, category ledges, a receipt, a goal bridge, and transaction glyphs.
- **Motion strategy**: A single count-up on first load, 140ms state settles, no ambient movement; reduced motion removes counters, transforms, and transitions.

## Layout

- **Opening**: The home page opens on a dark desk with one oversized safe-to-spend number, a thin month tape running behind it, and a receipt panel hanging over the tape's right edge.
- **Primary reading axis**: A meandering spending spine travels from income at the left, through six category ledges, to the goal and the next obligation; the ledger and plan reuse the same spine as their reading order.
- **Navigation**: Every route shares a four-link masthead and footer. The overview uses the month tape, activity uses the full ledger, plan uses an editable equation, and method uses a worked example; no route is a renamed copy of another.
- **Rhythm**: Huge number, thin rule, dense category bands, one receipt, then a quiet note; no repeated equal cards.
- **Counterpoint**: The receipt panel overlaps the category spine and extends past the page edge; a cobalt pending line cuts across the goal ledge.
- **Mobile transformation**: The month tape becomes a vertical spine with category ledges, the receipt moves below the number, the ledger rows become full-width expandable lines, and the plan sliders stack with their values visible. No horizontal page overflow and no lost controls.

## Components and States

- **Month tape**: Carries the safe-to-spend number, six category ledges, and the link into filtered activity.; states: default / hover / focus / selected / empty
- **Category ledge**: Filters the activity ledger by category, updates the visible total, and writes the category to the query string.; states: default / hover / focus / selected / filtered
- **Receipt panel**: Shows upcoming obligations and the goal contribution; review actions update the ledger count.; states: default / upcoming / overdue / reviewed / empty
- **Transaction row**: Expands to show account and note, toggles review state, and preserves the state across routes.; states: collapsed / expanded / reviewed / unreviewed / error
- **Budget range**: Moves a budget line, recalculates safe-to-spend, and exposes the numeric value next to the range.; states: default / hover / focus / changed / saved / reset

## Interaction and Motion

- **filter-category**: Choose a category ledge on the overview or a filter on activity → The activity ledger filters to that category, the visible total updates, and the URL keeps the category.. Keyboard: Tab to a ledge and activate with Enter or Space; the filter buttons expose aria-pressed.. Reduced motion: The ledger changes instantly with no slide or fade..
- **review-line**: Toggle a transaction's reviewed state → The row, overview count, and review queue update; the choice survives navigation and reload.. Keyboard: Enter or Space toggles; aria-pressed and a status message announce the new state.. Reduced motion: No tick animation or row movement; the text and border change immediately..
- **adjust-plan**: Move a budget range or edit income and buffer → Safe-to-spend, the goal contribution, and the scenario delta recalculate inline; saving stores the plan locally.. Keyboard: Arrow keys move a range; Enter or Space activates save and reset buttons; numeric values are always visible.. Reduced motion: Numbers update immediately without count-up or easing..
- **apply-scenario**: Apply the 15% flexible-spending scenario → The scenario ledge shows the new safe-to-spend and trade-off; saving replaces the plan values and updates the overview.. Keyboard: Tab to Apply scenario and press Enter; Escape discards and returns focus to the scenario button.. Reduced motion: No transition; the delta and result appear as text immediately..

## Responsive Behavior

- **Breakpoints**: wide: 1180px and up: month tape, receipt panel, and goal bridge share one desk; mid: 720–1179px: the receipt moves below the tape and the category ledges compress; narrow: below 720px: vertical spine, stacked ledger rows, and full-width plan controls
- **Priorities**: safe-to-spend and its inputs; category filters and upcoming bills; review queue and ledger; budget lines and scenario; method and privacy
- **Navigation strategy**: The masthead keeps the brand, four routes, and a compact demo badge on narrow screens; every route stays visible.

## Accessibility

- **Contrast**: Paper on desk exceeds 7:1; acid is used for large numbers and selected fills with dark text, never as the only signal.
- **Keyboard**: Native buttons, links, inputs, and range controls; transaction rows use a button for expansion; focus order follows the month path.
- **Focus**: A 3px acid outline with 3px offset stays visible on dark and paper surfaces.
- **Semantics**: Landmarks, one h1 per route, labelled sections, fieldsets, aria-live status, and an error summary describe the ledger and plan.
- **Motion**: prefers-reduced-motion removes counters, transitions, and transforms while keeping all amounts and states read as text.
- **Touch targets**: Interactive targets are at least 44x44px, including category ledges and review toggles.

## Content and Assets

- **Voice**: Plain-spoken, numerically honest, and calm. Say what changed, by how much, and what the user can do next; never imply a bank connection or financial advice.
- **Demo-data note**: All balances, transactions, merchants, and goals are fictional. No bank account is connected, no payment is made, and every plan or review change stays in this browser.
- **Asset constraints**: Original inline SVG, CSS gradients, and generated geometric artwork only; no template assets or stock photography.

## Acceptance Snapshot

- AC-BUILD [build] The site is served from site/index.html with no build dependency.
- AC-RUNTIME [build] Every route loads without console errors, page errors, or failed requests.
- AC-KEYBOARD [keyboard] All visible interactive controls are reachable by Tab with visible focus.
- AC-RESPONSIVE [responsive] Neither the desktop nor the mobile viewport has horizontal overflow.
- AC-MOTION [motion] Reduced-motion users receive complete content without ongoing animation.
- AC-NAMES [accessibility] Every visible interactive control has an accessible name.
- AC-LANGUAGE [accessibility] The output is English-dominant and uses lang=en.
- AC-INTERACTION [interaction] A visitor can filter the ledger by category, expand and review transactions, adjust six budget lines, apply the 15% scenario, save the plan, reload, and see the overview reflect the reviewed count and safe-to-spend.
- AC-PAGES [content] Every one of the four routes contains at least three substantive sections with finance-specific content, and the overview, ledger, plan, and method each have a distinct role.
- AC-COVERAGE [navigation] All four declared routes load successfully and expose a main landmark.
- AC-NAV [navigation] Every route shares the same complete primary navigation to all four routes.
- AC-LINKS [navigation] Every internal link resolves without a broken route.
- AC-VISUAL [visual] The night-ledger month tape, meandering category spine, receipt panel, and editable equation keep a non-card, non-bento identity in both viewports.
- AC-NOBOX [visual] No route reduces the primary content to an equal-card dashboard; the month tape, spine, receipt, and ledger rows carry the composition.
