# Notebook - Complete Design System
> Version 1.0 - Theme 19 in the catalog - slug `notebook`

---

## Table of Contents

1. [System Overview](#1-system-overview)
2. [CSS Custom Properties - Master Token Sheet](#2-css-custom-properties--master-token-sheet)
3. [Color Palette](#3-color-palette)
4. [Typography System](#4-typography-system)
5. [Spacing System](#5-spacing-system)
6. [Border Radius System](#6-border-radius-system)
7. [Shadow & Elevation System](#7-shadow--elevation-system)
8. [Component Specifications](#8-component-specifications)
9. [Layout & Grid System](#9-layout--grid-system)
10. [Animation & Transition Tokens](#10-animation--transition-tokens)
11. [Z-Index System](#11-z-index-system)
12. [Breakpoints](#12-breakpoints)
13. [Icon System](#13-icon-system)
14. [State Definitions](#14-state-definitions)

---

## 1. System Overview

**Design Language:** Notebook
**Mode:** Light
**Typeface:** Caveat
**Personality:** Ruled paper with sticky-note cards, dashed borders and Caveat handwriting for a friendly sketchbook feel.
**Best Suited For:** Note and idea tools, creative portfolios, education, personal blogs, early prototypes

**Core Principles:**
- The page is ruled paper. Cards are sticky notes with dashed borders.
- One font only: Caveat. Run it larger than normal (20px body) because it is small by design.
- Red pen (#c93a40) is the action colour. Blue pen (#8fcbff) is the secondary accent.
- Small imperfection is welcome: a 1 degree tilt on a card is fine.

---

## 2. CSS Custom Properties - Master Token Sheet

All tokens are scoped under `[data-ds="notebook"]`. Nothing is defined at `:root`. The same sheet ships as `tokens.css` in this system's folder.

```css
/*
 * Notebook - scoped design-system tokens (Theme 19 in catalog).
 */

[data-ds="notebook"] {
  --ds-color-bg-base: #fffdf2;
  --ds-color-bg-surface: #fff9c4;
  --ds-color-bg-sunken: #fff3a0;
  --ds-color-bg-secondary: #fff3b0;
  --ds-color-bg-overlay: rgba(43,43,58,0.4);

  --ds-color-primary: #c93a40;
  --ds-color-primary-hover: #b13338;
  --ds-color-primary-active: #9d2d32;
  --ds-color-primary-fg: #ffffff;

  --ds-color-text-primary: #2b2b3a;
  --ds-color-text-secondary: #45455c;
  --ds-color-text-tertiary: #565670;
  --ds-color-text-muted: #565670;
  --ds-color-text-disabled: #9a9aa8;
  --ds-color-text-inverse: #ffffff;

  --ds-color-border-light: #2b2b3a;
  --ds-color-border-medium: #2b2b3a;
  --ds-color-border-strong: #2b2b3a;

  --ds-color-success: #1b7441;
  --ds-color-success-bg: #d7f2e0;
  --ds-color-warning: #8a5700;
  --ds-color-warning-bg: #fff0cc;
  --ds-color-error: #c0262d;
  --ds-color-error-bg: #fde3e4;
  --ds-color-info: #1d5fbf;
  --ds-color-info-bg: #dce9fb;

  --ds-font-display: "Caveat", system-ui, sans-serif;
  --ds-font-body: "Caveat", system-ui, sans-serif;
  --ds-font-label: "Caveat", system-ui, sans-serif;
  --ds-label-transform: none;
  --ds-label-tracking: 0.01em;
  --ds-label-weight: 700;
  --ds-heading-tracking: 0em;
  --ds-heading-weight: 700;

  --ds-radius-badge: 4px;
  --ds-radius-sm: 4px;
  --ds-radius-md: 4px;
  --ds-radius-lg: 6px;
  --ds-radius-xl: 8px;
  --ds-radius-full: 9999px;

  --ds-border-width: 2px;

  --ds-shadow-card: 3px 4px 0 rgba(0,0,0,0.18);
  --ds-shadow-dropdown: 3px 4px 0 rgba(0,0,0,0.2);
  --ds-shadow-modal: 5px 6px 0 rgba(0,0,0,0.22);
  --ds-shadow-focus: 0 0 0 3px #8fcbff;
  --ds-shadow-btn-hover: 2px 3px 0 rgba(0,0,0,0.25);

  --ds-btn-text-transform: none;
  --ds-btn-letter-spacing: 0.01em;
  --ds-btn-font-weight: 700;
  --ds-btn-active-transform: translate(2px, 2px);
  --ds-btn-secondary-bg: #8fcbff;
  --ds-btn-secondary-text: #0b2a44;
  --ds-btn-secondary-border: #8fcbff;
  --ds-btn-secondary-hover-bg: #81b7e6;
  --ds-btn-outline-text: #2b2b3a;
  --ds-btn-outline-border: #2b2b3a;
  --ds-btn-outline-hover-bg: #fff3b0;
  --ds-btn-outline-hover-text: #2b2b3a;

  --ds-table-header-bg: #cfe3f5;
  --ds-table-header-text: #2b2b3a;
  --ds-table-header-border-bottom: 2px solid #2b2b3a;
  --ds-table-container-radius: 4px;
  --ds-table-container-border: 2px dashed #2b2b3a;

  --ds-focus-ring: 0 0 0 3px #8fcbff;

  --ds-ease-standard: ease-out;
  --ds-duration-fast: 80ms;
  --ds-duration-base: 140ms;
  --ds-duration-slow: 220ms;
}

[data-ds="notebook"] { font-size: 20px; background-image: repeating-linear-gradient(#fffdf2 0 31px, #cfe3f5 31px 32px); }
[data-ds="notebook"] .ds-card { border-style: dashed; }
```

---

## 3. Color Palette

### 3.1 Core Colors

| Role | Value |
|---|---|
| Page background | `#fffdf2` |
| Surface | `#fff9c4` |
| Sunken | `#fff3a0` |
| Secondary surface | `#fff3b0` |
| Primary action | `#c93a40` |
| Primary text on action | `#ffffff` |
| Accent / secondary button | `#8fcbff` |
| Accent text | `#0b2a44` |
| Text primary | `#2b2b3a` |
| Text secondary | `#45455c` |
| Text muted | `#565670` |
| Border light | `#2b2b3a` |
| Border strong | `#2b2b3a` |

### 3.2 Semantic Colors

| Status | Foreground | Background | Contrast |
|---|---|---|---|
| Success | `#1b7441` | `#d7f2e0` | 4.9:1 |
| Warning | `#8a5700` | `#fff0cc` | 5.4:1 |
| Error | `#c0262d` | `#fde3e4` | 4.9:1 |
| Info | `#1d5fbf` | `#dce9fb` | 5.0:1 |

### 3.3 Contrast Checks

All pairs below meet WCAG AA (4.5:1) for normal text.

| Pair | Colors | Ratio |
|---|---|---|
| Body text | `#2b2b3a` on `#fffdf2` | 13.6:1 |
| Secondary text | `#45455c` on `#fffdf2` | 9.1:1 |
| Muted text | `#565670` on `#fffdf2` | 7.0:1 |
| Primary button label | `#ffffff` on `#c93a40` | 5.0:1 |
| Accent button label | `#0b2a44` on `#8fcbff` | 8.5:1 |
| Table header | `#2b2b3a` on `#cfe3f5` | 10.6:1 |

---

## 4. Typography System

### 4.1 Font Families

| Role | Family | Usage |
|---|---|---|
| Display | Caveat | Headings, hero titles, buttons |
| Body | Caveat | Body copy, form fields |
| Label | Caveat | Labels, badges, metadata |

### 4.2 Type Scale

| Token | Size | Weight | Tracking | Use |
|---|---|---|---|---|
| Display | 48-64px | 700 | 0em | Hero title |
| H1 | 36px | 700 | 0em | Page title |
| H2 | 28px | 700 | 0em | Section title |
| H3 | 20px | 700 | 0em | Card title |
| Body | 20px | 400 | 0 | Paragraphs |
| Label | 12px | 700 | 0.01em | Eyebrows, badges (none) |

### 4.3 Google Fonts Import Block

```css
@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&display=swap");
```

The same URL is loaded by `app/design-systems/fonts.ts`.

---

## 5. Spacing System

Base unit: 4px. Use only these steps.

| Token | Value |
|---|---|
| space-1 | 4px |
| space-2 | 8px |
| space-3 | 12px |
| space-4 | 16px |
| space-6 | 24px |
| space-8 | 32px |
| space-12 | 48px |
| space-16 | 64px |

Component padding: card 20px, button 10px 20px (md), input 10px 14px, badge 2px 10px.

---

## 6. Border Radius System

| Element | Radius |
|---|---|
| Badge | 4px |
| Small controls (checkbox) | 4px |
| Buttons, inputs | 4px |
| Cards, modals | 6px |
| Large panels | 8px |
| Avatars, switches | 9999px |

Border width: 2px.

---

## 7. Shadow & Elevation System

| Level | Value |
|---|---|
| Card | `3px 4px 0 rgba(0,0,0,0.18)` |
| Dropdown | `3px 4px 0 rgba(0,0,0,0.2)` |
| Modal | `5px 6px 0 rgba(0,0,0,0.22)` |
| Focus | `0 0 0 3px #8fcbff` |
| Button hover | `2px 3px 0 rgba(0,0,0,0.25)` |

---

## 8. Component Specifications

### 8.1 Buttons
- Primary: background `--ds-color-primary`, label `--ds-color-primary-fg`. Hover `#b13338`, active `#9d2d32`.
- Secondary: background `#8fcbff`, label `#0b2a44`.
- Outline: transparent, border `#2b2b3a`, label `#2b2b3a`.
- Label style: `none` text, weight 700, tracking 0.01em.
- Active (pressed): `transform: translate(2px, 2px)`.

### 8.2 Form Inputs
Surface background, 2px border `#2b2b3a`, radius 4px. Focus uses the focus shadow. Error border `#c0262d`.

### 8.3 Labels
Font Caveat, none, weight 700, tracking 0.01em, colour `#565670`.

### 8.4 Card / Surface
Background `#fff9c4`, border 2px `#2b2b3a`, radius 6px, shadow card.

### 8.5 Badge
Pill or 4px radius, label style, semantic backgrounds from section 3.2.

### 8.6 Checkbox, Radio and Switch
Checked fill `#c93a40`, mark `#ffffff`. Switch track uses border strong when off.

### 8.7 Table
Header background `#cfe3f5`, header text `#2b2b3a`. Container border `2px dashed #2b2b3a`, radius 4px.

### 8.8 Dropdown Panel
Surface background, border 2px `#2b2b3a`, dropdown shadow, item hover uses `#fff3b0`.

---

## 9. Layout & Grid System

| Container | Max width |
|---|---|
| Narrow (forms, articles) | 640px |
| Default | 1040px |
| Wide (dashboards) | 1280px |

12-column grid, 24px gutters on desktop, 16px on mobile.

---

## 10. Animation & Transition Tokens

| Token | Value |
|---|---|
| Easing | `ease-out` |
| Fast | 80ms |
| Base | 140ms |
| Slow | 220ms |

Animate colour, transform, opacity and shadow only. Never animate layout properties.

---

## 11. Z-Index System

| Layer | Value |
|---|---|
| Base | 0 |
| Sticky header | 10 |
| Dropdown | 20 |
| Modal backdrop | 40 |
| Modal | 50 |
| Toast | 60 |

---

## 12. Breakpoints

| Name | Min width |
|---|---|
| sm | 640px |
| md | 768px |
| lg | 1024px |
| xl | 1280px |

Page padding: 16px below md, 24px at md, 32px at lg and up.

---

## 13. Icon System

Use Lucide icons at 16, 20 or 24px, stroke 2px (1.5px for Notebook if the type is light). Icon colour follows text colour. Never use filled multi-colour icons.

---

## 14. State Definitions

| State | Treatment |
|---|---|
| Hover | Darker or lighter primary (see 8.1), shadow `2px 3px 0 rgba(0,0,0,0.25)` |
| Active | `translate(2px, 2px)` |
| Focus | `0 0 0 3px #8fcbff` |
| Disabled | Text `#9a9aa8`, no shadow, cursor not-allowed |
| Error | Border `#c0262d`, message in the same colour |
| Success | Border `#1b7441` |
