# Dusk - Construction Instructions & AI Prompting Guide
> Version 1.0 - Theme 12 in the catalog - slug `dusk`

---

## Table of Contents

1. [Design Philosophy & Core Rules](#1-design-philosophy--core-rules)
2. [Font Law](#2-font-law)
3. [Color Application Rules](#3-color-application-rules)
4. [Border Radius Decision Framework](#4-border-radius-decision-framework)
5. [Shadow & Elevation Rules](#5-shadow--elevation-rules)
6. [Component Construction Guides](#6-component-construction-guides)
7. [Interactive States](#7-interactive-states)
8. [Layout Rules](#8-layout-rules)
9. [Anti-Patterns](#9-anti-patterns)
10. [AI Prompting Guide](#10-ai-prompting-guide)
11. [Pre-Ship Checklist](#11-pre-ship-checklist)

---

## 1. Design Philosophy & Core Rules

Twilight purple canvas with frosted surfaces, warm orange actions and Poppins throughout.

### The Rules
1. Gradients live on the page background only. Never put a gradient on text or buttons.
2. Surfaces are frosted and calm: one step lighter than the page, 22px radius, soft glow shadow.
3. Orange is the single action colour. Pink is a rare accent for badges and charts.
4. Everything is Poppins. Hierarchy comes from weight (400, 600, 700) and size, not from a second font.

---

## 2. Font Law

Use only Poppins. Fallback stack ends in `system-ui, sans-serif`.

- Display and headings: Poppins, weight 700, tracking -0.02em.
- Body: Poppins.
- Labels: Poppins, none, weight 600.
- Never mix in a font from another system. If a glyph is missing, fall back, do not swap families.

---

## 3. Color Application Rules

| Use | Token | Value |
|---|---|---|
| Page | `--ds-color-bg-base` | `#1d0b3d` |
| Cards | `--ds-color-bg-surface` | `#2d1760` |
| Inputs, wells | `--ds-color-bg-sunken` | `#150832` |
| Main action | `--ds-color-primary` | `#ff8a4c` |
| Secondary action | `--ds-btn-secondary-bg` | `#ff5fa2` |
| Body text | `--ds-color-text-primary` | `#fdf4ff` |
| Supporting text | `--ds-color-text-secondary` | `#d8c8f0` |

- One main action per view.
- Never type a raw hex or font name in a component. Read the token.
- Semantic colours (success, warning, error, info) are for status only.

---

## 4. Border Radius Decision Framework

- Badge or chip: 999px.
- Button or input: 12px.
- Card or modal: 22px.
- Anything else: use the nearest token. Never invent a radius.

---

## 5. Shadow & Elevation Rules

- Cards: `0 20px 50px rgba(10,0,30,0.5)`.
- Dropdowns: `0 16px 40px rgba(10,0,30,0.6)`.
- Modals: `0 30px 80px rgba(10,0,30,0.7)`.
- Focus: `0 0 0 3px rgba(255,138,76,0.45)`.
- Do not mix shadow styles from other systems.

---

## 6. Component Construction Guides

**Card:** surface background, 1px border `#4a3190`, radius 22px, card shadow, padding 24px.

**Button:** pick one variant. Label style `none`, weight 600. Pressed state is `scale(0.97)`.

**Badge:** label style, semantic background, no shadow.

**Table:** header uses `#ff8a4c` with `#2b1055` text. Rows separated by border light.

**Form field:** label above, helper text below in muted colour, error replaces helper text.

---

## 7. Interactive States

| State | Rule |
|---|---|
| Hover | Primary darkens or lightens one step. Shadow `0 10px 24px rgba(255,138,76,0.35)` |
| Active | `scale(0.97)` |
| Focus | `0 0 0 3px rgba(255,138,76,0.45)`, always visible |
| Disabled | Text `#8f7fb8`, no hover |

---

## 8. Layout Rules

- Max content width 1040px, 24px gutters.
- Stack to one column below 768px.
- Keep one primary action per section and align it to the same edge as the heading.

---

## 9. Anti-Patterns

- Do not use pure black (#000) backgrounds. The deepest tone is #150832.
- Do not use more than one orange button per view.
- Do not add hard offset shadows or thick borders. The look is soft.
- Do not hard-code colours, fonts, radii or shadows in components.
- Do not define tokens at `:root`. Everything stays under `[data-ds="dusk"]`.
- Do not mix components from other design systems on the same page.

---

## 10. AI Prompting Guide

Paste this at the start of a chat:

> Build the UI with the Dusk design system. Read `design-system.md` and `instructions.md` first. Use only the `--ds-*` tokens under `[data-ds="dusk"]`. Fonts: Poppins. Follow every rule in section 1 of instructions.md. Do not add styles that are not in the token sheet. When unsure, ask before inventing.

Good follow-up prompts:
- "Add a pricing section using only Dusk tokens."
- "Check this page against the Dusk anti-pattern list and fix violations."

---

## 11. Pre-Ship Checklist

- [ ] All colours, fonts, radii and shadows come from tokens
- [ ] One main action per view
- [ ] Text contrast is 4.5:1 or better
- [ ] Focus state is visible on every interactive element
- [ ] No rule from section 9 is broken
- [ ] Wrapped in `data-ds="dusk"`
