# style_guide.md — derez.ai Visual Design Spec > **Scope:** tokens, typography, spacing, colour usage, and every UI component. > Animations and background effects (star-field, perspective grid, horizon glow) are intentionally excluded — see `styles.css` directly for those. --- ## 1. Design Tokens All variables live in `:root` inside `styles.css`. **Never hard-code hex values** in HTML or JS — always use `var(--token-name)`. ### 1.1 Colour palette | Token | Hex / Value | Role | |---|---|---| | `--bg` | `#000810` | Page background — deepest layer | | `--bg-card` | `#010f20` | App shell & auth card surface | | `--bg-inner` | `#000d1a` | Inner cards, tabs bar | | `--bg-hover` | `#001a30` | Hover state fills, ghost button bg | | `--bg-input` | `#000813` | Input, select, textarea background | | `--border` | `#0a3060` | Default 1 px borders | | `--border-hi` | `rgba(0,245,255,0.45)` | Shell / auth card outer glow border | | `--accent` | `#00f5ff` | Electric cyan — primary brand colour | | `--accent-dim` | `#002535` | Active tab fill, logo icon background | | `--danger` | `#ff3b3b` | Destructive actions, error states | | `--danger-dim` | `#3b0000` | Error message background | | `--success` | `#00ff88` | Positive indicators, active pulse dot | | `--warning` | `#ffaa00` | Mid-range credit bar, contract warning | | `--text` | `#c8f0ff` | Primary readable text | | `--text-muted` | `#2e6a80` | Labels, secondary text, placeholders | ### 1.2 Shadow ```css --shadow: 0 0 0 1px rgba(0, 245, 255, 0.25), /* inner border glow */ 0 0 60px rgba(0, 245, 255, 0.12), /* wide cyan ambient */ 0 28px 72px rgba(0, 0, 0, 0.9); /* depth shadow */ ``` Used on `.auth-card` and `.app-shell`. Do not apply to inner cards — they use only `--border`. ### 1.3 Border radius | Token | Value | Applied to | |---|---|---| | `--radius` | `8px` | Cards, inputs, badges, modals | | Hard-coded `20px` | — | Pill shapes: agent tabs, user pill | | Hard-coded `6px` | — | Buttons (`.btn`) | | Hard-coded `4px` | — | Progress bars, small badges | --- ## 2. Typography ### 2.1 Font stack ```css font-family: "Courier New", Courier, monospace; ``` All UI text — body, labels, inputs, buttons — uses this monospace stack. This is a deliberate brand choice for the Digital Grid theme. No external fonts are loaded. ### 2.2 Type scale | Usage | Size | Weight | Colour token | |---|---|---|---| | Auth title (`derez.ai`) | `22px` | `700` | `--text` | | Auth sub-heading | `13px` | `400` | `--text-muted` | | App brand (upper-left) | `15px` | `700` | `--accent` | | Card title | `13px` | `600` | `--text` | | Body / general | `14px` | `400` | `--text` | | Labels, secondary | `12px` | `500` | `--text-muted` | | Monospace values (SSH, keys) | `11.5px` | `400` | `--text` | | Hints / helper text | `11px` | `400` | `--text-muted` | | Badges, tiny labels | `10–11px` | `600` | varies | ### 2.3 Letter spacing - App brand: `1.5px` (no text-transform — renders as `derez.ai` lowercase) - Card titles, tab labels: default (`0`) - Panel-header uppercase labels (e.g. "Support Chat"): `0.6px` --- ## 3. Spacing The layout uses a consistent 4-point base grid. Common values: | Value | Where used | |---|---| | `4px` | Tight gaps, small padding | | `6px` | Button gaps, icon-text gap | | `8px` | Toast padding, small card gap | | `10px` | Form gap, tab gap | | `12px` | Card body padding unit | | `14px` | Card header margin-bottom, button padding | | `16px` | Content grid gap, card padding | | `18px` | Card padding (default), header horizontal padding | | `20px` | Content grid padding | | `22px` | Shell header horizontal padding | --- ## 4. Layout ### 4.1 Shell sizing | Element | Size | |---|---| | `.app-shell` | `min(1060px, 100vw − 16px)` × `min(780px, 100vh − 16px)` | | `.auth-card` (narrow) | `min(440px, 100vw − 24px)` | | `.auth-card` (auth-layout) | `min(1060px, 100vw − 16px)` | | `.app-header` height | `54px` | | `.agent-tabs-bar` height | `50px` | ### 4.2 Content grid ``` .content-grid display: grid grid-template-columns: 1fr 1fr gap: 16px padding: 18px 20px overflow-y: auto ← only this element scrolls ``` Collapses to single column below `700px` viewport width. --- ## 5. Colour usage rules ### Backgrounds (darkest → lightest) ``` --bg page background └── --bg-card shell / auth card └── --bg-inner inner cards, tabs bar └── --bg-input inputs, textareas, code blocks ``` Use these in order. Never place `--bg-card` inside another `--bg-card` element — use `--bg-inner` for nested surfaces. ### Text hierarchy - Main content: `--text` - Labels, secondary: `--text-muted` - Accent / interactive: `--accent` - Error: `--danger` - Success: `--success` ### Borders - Default borders between sections: `1px solid var(--border)` - Highlight / outer glow borders (shell, modal): `1px solid var(--border-hi)` - Focus state on inputs: `border-color: var(--accent)` --- ## 6. Buttons ### 6.1 Variants #### `.btn-primary` — outlined cyan (primary action) ```css background: transparent color: #fff border: 1px solid var(--accent) box-shadow: 0 0 8px rgba(0,245,255,0.35), inset 0 0 8px rgba(0,245,255,0.04) ``` Hover: `background: rgba(0,245,255,0.08)` + brighter glow. `opacity` stays `1`. **Use for:** Open Agent, Sign In, Hire Agent, wizard Next, Send, Invite. #### `.btn-ghost` — dark fill (secondary action) ```css background: var(--bg-hover) color: var(--text) border: 1px solid var(--border) ``` Hover: `opacity: 0.85`. **Use for:** Restart Agent, Make Backup, Restore, Extend Contract, Cancel, all card-header utility actions. #### `.btn-danger` — red fill (destructive confirm) ```css background: var(--danger) color: #fff ``` **Use for:** the confirm-dialog "Confirm" button only. Never on card headers. #### `.btn-success` — green fill ```css background: var(--success) color: #000 ``` Rarely used; reserved for exceptional positive completions. ### 6.2 Size modifiers | Modifier | Padding | Font size | Use | |---|---|---|---| | *(none)* | `7px 14px` | `13px` | Confirm dialog actions | | `.btn-sm` | `5px 10px` | `12px` | Card header, inline | | `.btn-block` | `10px 14px` | `14px` | Auth form full-width submit | ### 6.3 Rules - Card-header buttons: **text label only** — no SVG icons. - Two side-by-side header buttons: wrap in `