# DESIGN.md

> Generated by Design Frontier. Canonical data lives in `.design-frontier/`.

## Product context

- **Product:** Frontier Ops
- **Type:** b2b-saas
- **Users:** Operations teams handling repeated, data-heavy work
- **Surfaces:** app-and-landing
- **Archetype:** saas-operational-dense
- **Density:** medium-high
- **Theme:** both
- **Device priority:** desktop
- **Accessibility:** wcag-aa
- **Locales:** en, es

## Goals

- find records quickly
- complete workflows without losing context
- understand status and exceptions

## Design principles

1. Repeated work must remain predictable across pages.
2. References influence declared layers only.
3. Semantic tokens are used before literal visual values.
4. Application and marketing surfaces share brand identity, not density or composition.
5. Accessibility, task completion and existing component behavior take precedence over visual imitation.
6. Every new variant is documented before it becomes part of the system.

## Reference composition

| Layer | Primary | Secondary | Weight | Source |
|---|---|---|---:|---|
| application_shell | Metronic |  | 0.75 | override |
| navigation | Linear |  | 0.75 | override |
| tables | Airtable | IBM Carbon Design System | 0.85 | override |
| forms | Stripe | GOV.UK Design System | 0.75 | override |
| feedback | Shopify Polaris |  | 0.8 | archetype |
| marketing_site | Apple | Stripe | 0.55 | override |

Weights resolve conflicts within a layer. They do not represent percentages of a copied visual style.

## Surface hierarchy

1. Page surface for the main background.
2. Panel surface when containment adds meaning or interaction.
3. Raised surface for menus, popovers and overlays.
4. Status surface for feedback with explicit semantic meaning.

Do not wrap every section in a card. Use headings, spacing and dividers when containment adds no function.

## Tokens

The source of truth is `.design-frontier/tokens.json`. Generated code exports live under `.design-frontier/generated/`.

Required semantic groups:

- color.surface
- color.text
- color.border
- color.action
- color.status
- space
- size.control
- size.layout
- radius
- typography
- motion

A page may not create a new semantic meaning by assigning a raw color or dimension locally.

## Typography

- Body and heading families come from tokens.
- Monospace is reserved for code, identifiers and machine output.
- Application headings stay compact.
- Marketing display sizes never transfer into tables, forms or operational navigation.
- Long-form text uses the reading-width token.

## Components

### Buttons

- One primary action per local decision area.
- Destructive actions use danger semantics.
- Pill geometry is reserved for chips, filters and compact selectors unless explicitly registered.
- Disabled actions explain the reason when it is not obvious.

### Forms

- Labels remain visible.
- Validation appears next to the affected field or decision.
- User input survives validation failure.
- Help appears before failure when format expectations are not obvious.
- Every interactive control has a visible focus state.

### Tables and lists

- Tables are used when comparison across fields is the main task.
- Lists or cards are used when each item has a dominant action or narrative summary.
- Bulk actions appear only after explicit selection.
- Active filters are visible and resettable.
- Empty states distinguish absent data, filtered data and unavailable data.

### Navigation

- The application shell is not changed by individual pages.
- Current location is visible.
- Frequent actions are not hidden in overflow menus by default.
- Navigation depth follows the information architecture, not a decorative preference.

### Feedback

Every asynchronous workflow defines loading, success, warning, error and empty behavior. Errors identify the affected task and the next available action.

## Responsive behavior

- Preserve task priority before desktop geometry.
- Secondary filters may collapse into a drawer.
- Tables use horizontal scrolling only when column comparison remains necessary.
- Primary actions remain reachable without traversing unrelated content.
- Mobile adaptations follow the declared desktop priority.

## Requirements

- comparison-friendly tables
- keyboard and focus support
- explicit bulk-action state
- compact but readable spacing
- Keep primary actions visible in repeated workflows.

## Boundaries

- Accessibility requirements override all aesthetic references.
- A reference may influence only the layer where it is selected.
- Marketing spacing, typography and motion do not redefine application density.
- Existing component behavior overrides purely visual inspiration unless a migration is explicit.
- Third-party references never authorize copying proprietary assets, source code or exact compositions.
- Use as structural reference, not as permission to ship every available widget.
- Do not inherit demo-page visual clutter or oversized cards.
- Remove unused navigation levels and decorative dashboard blocks.
- Do not transfer marketing headline scale into the application.
- Do not assume its issue-tracking interaction model fits every domain.
- Low visual noise must not reduce discoverability for novice users.
- Use view-switching patterns only when multiple representations add real value.
- Do not expose database concepts to users who do not need them.
- Table flexibility must not replace explicit workflow design.
- Use behavior and component rigor without importing IBM brand identity.
- Enterprise density still requires task prioritization.
- Do not combine multiple complete component systems in one project.
- Use trust and clarity patterns without copying payment-specific semantics.
- Decorative gradients belong to marketing surfaces, not operational forms by default.
- Documentation density must remain appropriate for the user's expertise.
- Adapt visual identity while preserving interaction clarity.
- Do not copy government branding into unrelated products.
- Service simplicity should not erase necessary expert controls.
- Use operational patterns without inheriting Shopify-specific vocabulary.
- Contextual actions must remain predictable outside commerce workflows.
- Resource-list cards should not replace tables when comparison is primary.
- Never use as a table, form-density or backoffice-shell reference.
- Large type and whitespace require sufficient product imagery and concise copy.
- Do not reproduce proprietary assets, fonts or product-page compositions wholesale.

## Prohibited patterns

- oversized KPI cards with little information
- marketing typography inside operational screens
- Do not turn every section into a card.
- Do not use marketing display sizes inside operational tables.
- Do not create local spacing scales, radii or color semantics.
- Do not introduce a component variant without documenting its use case.
- Do not import landing composition into operational screens.
- Do not copy proprietary assets, source code or exact page compositions from references.

## Selected reference notes

### Metronic

Modular administrative shell with broad backoffice component coverage.

**Allowed influence:** application_shell, navigation, density, tables, forms, feedback

**Boundaries**

- Use as structural reference, not as permission to ship every available widget.
- Do not inherit demo-page visual clutter or oversized cards.
- Remove unused navigation levels and decorative dashboard blocks.

**Evidence**

- [Metronic official site](https://keenthemes.com/metronic) (primary)
- [Metronic Tailwind documentation](https://keenthemes.com/metronic/tailwind/docs/) (primary)

### Linear

Restrained product interface with controlled density, low visual noise and workflow-first navigation.

**Allowed influence:** navigation, density, application_shell, feedback, marketing_site

**Boundaries**

- Do not transfer marketing headline scale into the application.
- Do not assume its issue-tracking interaction model fits every domain.
- Low visual noise must not reduce discoverability for novice users.

**Evidence**

- [Linear product site](https://linear.app/) (primary)
- [Linear UI redesign article](https://linear.app/blog/how-we-redesigned-the-linear-ui) (primary)

### Airtable

Data operations reference for views, grids, filters and multiple representations of the same records.

**Allowed influence:** tables, density, navigation, forms, feedback

**Boundaries**

- Use view-switching patterns only when multiple representations add real value.
- Do not expose database concepts to users who do not need them.
- Table flexibility must not replace explicit workflow design.

**Evidence**

- [Airtable Views](https://www.airtable.com/platform/views) (primary)
- [Airtable Interface Designer](https://www.airtable.com/platform/interface-designer) (primary)

### IBM Carbon Design System

Enterprise component behavior, data-heavy interfaces and systematic interaction states.

**Allowed influence:** application_shell, tables, forms, data_visualization, accessibility, feedback

**Boundaries**

- Use behavior and component rigor without importing IBM brand identity.
- Enterprise density still requires task prioritization.
- Do not combine multiple complete component systems in one project.

**Evidence**

- [Carbon Design System](https://carbondesignsystem.com/) (primary)

### Stripe

Trust-sensitive forms, developer communication and technical product storytelling.

**Allowed influence:** forms, documentation, marketing_site, feedback, brand

**Boundaries**

- Use trust and clarity patterns without copying payment-specific semantics.
- Decorative gradients belong to marketing surfaces, not operational forms by default.
- Documentation density must remain appropriate for the user's expertise.

**Evidence**

- [Stripe Elements](https://stripe.com/payments/elements) (primary)
- [Stripe Documentation](https://docs.stripe.com/) (primary)

### GOV.UK Design System

Clear public-service forms, error handling, accessible content and task completion.

**Allowed influence:** forms, accessibility, feedback, navigation, documentation

**Boundaries**

- Adapt visual identity while preserving interaction clarity.
- Do not copy government branding into unrelated products.
- Service simplicity should not erase necessary expert controls.

**Evidence**

- [GOV.UK Design System](https://design-system.service.gov.uk/) (primary)

### Shopify Polaris

Commerce operations, resource lists, contextual actions and merchant feedback patterns.

**Allowed influence:** application_shell, navigation, tables, forms, feedback

**Boundaries**

- Use operational patterns without inheriting Shopify-specific vocabulary.
- Contextual actions must remain predictable outside commerce workflows.
- Resource-list cards should not replace tables when comparison is primary.

**Evidence**

- [Shopify Polaris](https://polaris.shopify.com/) (primary)

### Apple

Editorial product presentation, large-scale visual rhythm and platform design guidance.

**Allowed influence:** marketing_site, brand, accessibility

**Boundaries**

- Never use as a table, form-density or backoffice-shell reference.
- Large type and whitespace require sufficient product imagery and concise copy.
- Do not reproduce proprietary assets, fonts or product-page compositions wholesale.

**Evidence**

- [Apple Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines) (primary)
- [Apple Design Resources](https://developer.apple.com/design/resources/) (primary)

## Review

Use `DESIGN-CHECKLIST.md`, then run:

`npx design-frontier validate .`

`npx design-frontier lint .`
