# Ruled Index

A studio index pinned to a black wall. The page is pure black and is cut into columns by thin grey rules that run the full height of the content, like a printed directory. Inside each column sits small monospace text: a grey `Label:` head, then a plain list of white items. Big words are rare and come in one condensed mono display face, light weight with a single bold word. There are no photos, icons or cards. The only picture is a live field of characters, a spotlight drifting across a stage drawn in dots, commas and hashes. One vermilion accent marks what is happening right now. It feels raw, nerdy and creative, like the program notes of a venue that cares more about the work than the lobby.

Use it for: theaters, dance and performance spaces, galleries and cultural venues, festivals and event programmes, studios and collectives, music and sound projects, anything that is mostly a list of things on certain dates. Avoid it for: children's products, healthcare, banks and insurance, shops that sell on photos, anything that needs to feel soft, sunny or reassuring.

## How to use this file

Give this file, `tokens.css` and `components.css` to your AI coding tool and say:

> Build [your page] in the Ruled Index style. Follow DESIGN.md exactly. Use the tokens in tokens.css and the classes in components.css; don't invent new colors, fonts, radii or shadows.

`demo.html` (a landing page), `pricing.html`, `blog.html` and `signup.html` are complete example pages built only with the kit, for a made-up basement venue for new dance, sound and theater called Undercroft.

## Fonts

Two families, both free on Google Fonts:

```html
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,400&family=Martian+Mono:wdth,wght@75..112.5,300..600&display=swap" rel="stylesheet">
```

| Role | Font | Use |
|---|---|---|
| Display and headings | Martian Mono, condensed (`font-stretch: 75%`), 300 with one word at 600 | The hero line, section titles, plan prices, row titles, quotes. Lowercase-friendly sentences with a full stop in `--ri-dim`. |
| Body and UI | IBM Plex Mono 400 and 500 | Everything else: labels, lists, nav, buttons (500), prose, forms, tables. |
| The field | IBM Plex Mono 400 | The character drawing, on a fixed grid. |

Keep body text small (14px) and dense. The contrast between tiny index text and huge condensed words is the style.

## Color

| Token | Hex | Role |
|---|---|---|
| `--ri-black` | #050505 | The page, everywhere |
| `--ri-well` | #0E0E0D | Inputs, hovered rows, inline code |
| `--ri-rule` | #3F3E3B | Every column rule and row rule |
| `--ri-rule-soft` | #22221F | Spare, for very quiet dividers |
| `--ri-white` | #EEECE6 | Headlines, list items, links, solid buttons |
| `--ri-grey` | #8F8D87 | `Label:` heads, statements, meta, captions |
| `--ri-dim` | #57564F | Past items, placeholders, the full stop in headlines, field glyphs |
| `--ri-signal`, `--ri-signal-ink` | #FF5B3A, #120503 | Now: the live dot, tonight's row, the featured plan line, errors, the `?` in Q and A |

Rules:
- Three greys and a white do almost all the work. Vermilion appears at most three or four times per screen.
- Vermilion never fills anything larger than the live dot, except a solid button on hover.
- No gradients, no glow, no shadows.

## Type scale

| Token | Size | Use |
|---|---|---|
| `--ri-text-display` | clamp(40px, 8.4vw, 128px) | The hero line and closing call to action |
| `--ri-text-h1` | clamp(30px, 4.6vw, 64px) | Section titles, article titles |
| `--ri-text-h2` | clamp(20px, 2.4vw, 30px) | Stat numbers, quotes, prose h2s |
| `--ri-text-body` | 14px | Lists, labels, UI |
| `--ri-text-prose` | 15.5px, line height 1.75 | Article paragraphs, max 64ch |
| `--ri-text-small` | 12.5px | Meta, help, tags, footer |
| `--ri-text-field` | clamp(9px, 1.05vw, 13px) | The character field |

Headlines are short sentences that end with a dim full stop. One word can be bold. Labels end in a colon, added by CSS. Buttons say what happens ("Book tonight") and carry an arrow added by CSS.

## Shape and space

- Radius 0 everywhere. No shadows.
- Structure comes from rules, not boxes: every column has a 1px left rule in `--ri-rule`, sections add a bottom rule, rows inside a section use a dotted rule.
- Columns come from `.ri-index`, an auto-fit grid with a 168px minimum, so a row of four becomes two on a phone without any extra code.
- Text sits 4px from the top of its column and 8px from its rule, like the reference index. Columns are left open at the bottom so the rules read as long lines.
- Hover inverts: a link or row gets a white background and black text. There is no underline on hover.
- Motion: the live dot blinks in two steps, the field redraws about eleven times a second. Both stop for reduced motion.

## Components (in components.css)

| Class | What it is |
|---|---|
| `.ri`, `.ri-page`, `--form` | Body class (black page, Plex Mono) and the page gutter |
| `.ri-index`, `.ri-col`, `--wide`, `--tall` | The ruled column grid. `--wide` spans two columns |
| `.ri-key` | The grey `Label:` head of a column |
| `.ri-list`, `.is-now`, `.is-past`, `.ri-link`, `--grey`, `--under` | Plain lists of white items; now in vermilion, past in dim; hover inverts |
| `.ri-mast`, `.ri-logo` | The nav is the first row of the index: logo, statement, page list and a "Tonight" column. `aria-current="page"` is inverted |
| `.ri-display`, `.ri-h1`, `.ri-h2`, `.ri-mute`, `.ri-lead`, `.ri-text`, `.ri-small`, `.ri-num` | Type |
| `.ri-dot`, `.ri-now`, `.ri-tag`, `--signal` | The blinking square live dot, vermilion text, ruled tags |
| `.ri-hero`, `__words`, `__stage`, `__foot` | Hero: words on the left, a ruled stage with the field on the right, a row of stat columns below |
| `.ri-field` with `data-mode="stage"` or `"bulb"` | The character field. Needs the inline script from any example page |
| `.ri-figure` | A ruled frame with a field and a caption, for articles |
| `.ri-btn`, `--solid`, `--quiet`, `--block`, `--lg`, `.ri-actions` | Square outlined buttons with an arrow; solid is white and turns vermilion on hover |
| `.ri-section`, `__head` | A ruled section with a title and a short grey note on the right |
| `.ri-rows`, `.ri-row`, `--head`, `__title`, `__meta`, `.is-past` | A programme as ruled rows: date, title, form, length, tickets. Past rows are struck through |
| `.ri-toggle` | Two ruled buttons, the pressed one inverted |
| `.ri-plans`, `.ri-plan`, `--featured`, `__price`, `__per` | Plans as ruled columns with a huge condensed price; the featured one has a vermilion top line |
| `.ri-table-wrap`, `.ri-table`, `.ri-yes`, `.ri-no` | A ruled comparison table |
| `.ri-qa` | Questions with a vermilion `?` and grey answers |
| `.ri-quote` | A condensed display quote with a small cite |
| `.ri-article`, `__side`, `__body`, `.ri-prose`, `.ri-note` | Article: a ruled meta column on the left, prose on the right |
| `.ri-form`, `.ri-row-2`, `.ri-field-wrap`, `--error`, `.ri-fieldset`, `.ri-label`, `.ri-input`, `.ri-select`, `.ri-textarea`, `.ri-help`, `.ri-error`, `.ri-choices`, `.ri-choice`, `.ri-check`, `.ri-or` | Forms. Choices are a ruled grid of `[ ]` and `[x]` cells that invert when picked |
| `.ri-footer`, `__end` | The footer is another index row with a thin end line |

## Drawing with characters

The field is the one picture. It is a `<pre class="ri-field">` filled by a small script (copy it from any example page):

1. It measures one character, then works out how many columns and rows fit the box.
2. For each cell it computes a brightness from 0 to 1 and picks a character from the ramp ` .,:;-=+*#`.
3. Cells above 0.92 are wrapped in `<b>` (white). The single hottest cell is an `<i>o</i>` in vermilion.
4. `stage` mode draws a spotlight drifting over a hazy room with a floor at the bottom. `bulb` mode draws one lamp throwing a cone down. Write your own mode for your subject: a tide, a crowd, a radio signal.
5. It redraws every 90ms, and only once when reduced motion is on. Give the `<pre>` an `aria-label` that describes the drawing, or `aria-hidden="true"` if it is decoration.

## Pages in this kit

- `demo.html`: the index masthead, a hero with a vermilion tag, display line, lead, two buttons and the stage field, four stat columns, the season as ruled rows with past works struck through, four "how it works" columns, a quote beside a list, Q and A in two columns, a closing display line, the footer index.
- `pricing.html`: label, display line, lead and the billing toggle, three plan columns (the middle one featured), small print, a comparison table and money questions.
- `blog.html`: a tag, title and lead, then a ruled meta column beside prose with h2s, a bulb field figure, a quote, inline code, a note, and a row of more posts.
- `signup.html`: a two-column join panel: title, lead, step strip and a small field on the left; the form with an error, a select, `[x]` choice grids, a checkbox, a solid block button, "or" and an outlined block button on the right.

## Page recipe

1. `.ri-index.ri-mast`: logo and address, a `--wide` statement in grey, a `Season:` list of pages, and a `Tonight:` column with the `.ri-dot`.
2. `.ri-hero`: `__words` with a `.ri-tag--signal`, `.ri-display` with one `<b>` word and a `.ri-mute` full stop, `.ri-lead`, `.ri-actions`. `__stage` with the field and a `.ri-key` caption. `__foot` with three or four stat columns.
3. `.ri-section`s, each with a `__head` (an `.ri-h1` and a short `.ri-text`), then rows, an index of columns, a quote or a Q and A.
4. A closing section with a `.ri-display` and two buttons.
5. `.ri-footer`: an index row and `__end`.

## Pricing page recipe

1. A two-column intro: label, display line and lead on the left; the `.ri-toggle` and a signal tag on the right. Keep prices in `data-monthly` and `data-yearly` and swap them with a few lines of JS.
2. `.ri-plans` inside a section. Each plan: a `.ri-key` name, a `__price` and `__per`, one sentence, a list with `+` for included and dim `-` for not, then a block button. Only the featured plan gets `--solid`.
3. Small print, a `.ri-table` and a `.ri-qa` in two wide columns.

## Article page recipe

1. A title block: `.ri-tag`, `.ri-h1` with a dim full stop, `.ri-lead`.
2. `.ri-article`: `__side` with `Written by:`, `Published:`, `Read:` and `About:` pairs; `__body.ri-prose` with short paragraphs, h2s (which get a rule above), one `.ri-figure`, one `.ri-quote`, a list, inline `code` and a `.ri-note`.
3. A section of more posts as index columns with dates as labels.

## Sign-up page recipe

1. Two columns: a label, `.ri-h1`, lead, a three-step strip and an optional small field on the left.
2. `.ri-form` on the right: two-up names, email with an error, password with help, a select, two `.ri-choices` grids in `.ri-fieldset`s, a `.ri-check`, a `--solid --block` button, `.ri-or` and a plain `--block` button.

## Don'ts

- Don't add cards, rounded corners, shadows or filled panels. Rules and black space divide everything.
- Don't add photos, icons or illustrations. Draw with characters, or leave the column empty.
- Don't make body text bigger to fill space. Leave columns short and open.
- Don't use a sans or serif face. Both families are monospace.
- Don't use vermilion for decoration. It means now, live, featured or wrong.
- Don't underline links on hover; invert them.
- Don't use em dashes in copy.
