# Build a wedding guestbook page with the Confetti theme

You are building one page in an existing project: the guestbook of a summer wedding, with messages from guests as cards with a round initials avatar, and a form to leave a message, checked in code, with a confirmation that replaces it. Follow this brief closely. `DESIGN.md` decides the tokens: colors, type, spacing steps and corners. This brief decides the layout, its widths included, and which token goes where. If this brief names a color, a type size, a spacing step or a corner that `DESIGN.md` does not have, `DESIGN.md` wins.

## Before you start

1. **Check the theme is installed.** The project should have `DESIGN.md` in its root and the Confetti variables in its global CSS. If not, run `npx shadcn@latest add https://strictthemes.com/r/confetti.json` and save https://strictthemes.com/themes/confetti/DESIGN.md as `DESIGN.md` in the project root. In a project without shadcn, use https://strictthemes.com/themes/confetti/tailwind.css instead. If the global CSS still imports a font the theme does not use (a new shadcn project imports Geist), remove that import, and uninstall its package if nothing else uses it. Keep every font import the theme's install added, also one for a style no page uses yet.
2. **Read `DESIGN.md` from start to finish.** It is the source of truth for every visual decision.
3. **Look at the project before writing code.** Use its framework, router and file layout. For controls (buttons, inputs, tabs, menus, dialogs, accordions, data tables) use the components in `components/ui`, and add a missing one with `npx shadcn@latest add <name>` rather than writing your own, unless this brief names a plain element. Layout is plain elements with theme classes: sections, panels, figures and lists need no component.
4. **Teach `cn()` the theme's type classes.** shadcn's class merger does not know `text-display` or `text-h1`. It takes them for colors, so `cn("text-label text-muted-foreground")` silently drops one of the two, and a type class passed to a stock component does not replace its size. In a new shadcn project, `lib/utils.ts` only passes `cn` on from the `cn` package. Unless the file already holds the lines below, change it to:

   ```ts
   import { createCn } from "cn/config"

   // The theme's type classes are font sizes, not colors.
   export const cn = createCn({
     extend: {
       classGroups: {
         "font-size": [{ text: ["display", "h1", "h2", "body", "label"] }],
       },
     },
   })
   ```

   Then make every file in `components/ui` use it: where one has `import { cn } from "cn"`, change that line to import `cn` from the project's utils file (`@/lib/utils` in a default setup). Do the same for each component you add later. If the project uses `tailwind-merge` instead of the `cn` package, its components already import from the utils file: pass the same object to `extendTailwindMerge` and keep `clsx`.
5. **Write real content.** If the user gave you details about their product, use them. Otherwise use the sample product in this brief and write the rest of the copy yourself: specific and plain, the way the samples read. Invent the company and people names; do not use real ones. Never use lorem ipsum. A link with no destination yet points to `#`. Set the page's `<title>` and meta description.

## The theme in short

- **Fonts:** Caprasimo for headings, Nunito for body text, Ubuntu Sans Mono for labels and code.
- **Type scale** (size/weight; each class also sets line height and tracking): `text-display` 64px/400, `text-h1` 40px/400, `text-h2` 24px/400, `text-body` 17px/400, `text-label` 13px/500.
- **Font per size:** a type class does not set the font family. Headings (`<h1>` to `<h6>`) get the heading font on their own; on any other element add the font class: `font-heading` with `text-display`, `text-h1`, `text-h2`; `font-mono` with `text-label`.
- **Spacing scale**, with the Tailwind step in brackets: 4px (`1`), 8px (`2`), 12px (`3`), 24px (`6`), 40px (`10`), 88px (`22`).
- **Corners:** `rounded-sm` 8px, `rounded-md` 14px, `rounded-xl` 24px (the `lg` corner in `DESIGN.md`). `rounded-lg` is 14px as well: it is shadcn's name for the base corner, the one its stock buttons and inputs use.
- **Colors (light mode):** primary #4A2A63, on-primary #FFFFFF, secondary #CDB4DB, on-secondary #2E1A3F, tertiary #A2D2FF, on-tertiary #2E1A3F, neutral #6B5480, background #FBF7FD, surface #FFFFFF, foreground #2E1A3F, border #DCCBE6, error #B3123F, blush #FFC8DD, on-blush #2E1A3F, candy #FFAFCC, on-candy #2E1A3F, mist #BDE0FE, on-mist #2E1A3F.

### How Confetti pages are laid out

- **Pastel blocks:** a large block of color is `bg-blush text-blush-foreground`, `bg-candy text-candy-foreground` or `bg-mist text-mist-foreground`, the pair always together on the block itself. The three pastels and their ink are the same in both modes, so the ink class keeps text on a pastel plum (`#2E1A3F`) in dark mode too. A block is `rounded-xl p-6 md:p-10` with the fill and the ink, `flex flex-col gap-6` inside, no border and no shadow. Everything inside it inherits the ink: no element in a block gets a text color class of its own, so never `text-foreground`, `text-muted-foreground` or `text-primary` there, also not on the labels and small figures that the notes below make muted elsewhere. A block holds a heading and a few facts as text, and nothing that takes focus or carries its own color: no link, button, field, error line, badge or card. In dark mode the main button and the focus outline are pink, the candy color, so they would vanish on a block; the action that goes with a block sits on the paper right after it. A mark drawn on a block (a meter) uses the ink as a fill or a border: `bg-mist-foreground`, `border-mist-foreground`, or the same with `blush` or `candy`. One pastel per block, white paper between blocks: two blocks never touch, and a block is never inside a card. Where a block is a section, the `<section>` itself carries the block's classes.
- **Page:** one `<div>` wraps the whole page with `min-h-screen bg-background text-body text-foreground`. Inside it sit the `<header>`, a `<main>` and the `<footer>`.
- **Container:** the header's row, the `<main>` and the footer's row each sit in a centered container, `mx-auto max-w-[1088px] px-6`, so the content is at most 1040px wide, the grid in `DESIGN.md`, with 24px at each side at every width. This width is the one arbitrary value allowed.
- **Main:** the `<main>` element itself carries the container classes, `flex flex-col gap-22` (88px between sections) and `pt-10 pb-22`. Its items are the page's sections, in the order the brief gives.
- **Sections:** where this brief calls something a section, it is a `<section>` with `aria-labelledby` pointing at its heading; without a visible heading it gets an `aria-label`. There are three kinds, and the brief says which:
  - A full-width section is `flex flex-col gap-6`: the heading (or a heading group) first, the content after it.
  - A section in the centered column, the way a card is read, is `grid grid-cols-1 md:grid-cols-12` holding one `<div>` with `flex flex-col gap-6 md:col-span-8 md:col-start-3`, which holds the heading and the content. A pastel block in the centered column is that `<div>`, with the block's classes added.
  - A section of parts side by side is itself the grid: `grid grid-cols-1 gap-10 md:grid-cols-12 md:gap-x-6 md:items-start`, and each part gets the `md:col-span-*` (and `md:col-start-*`) the brief gives it. Below `md` the parts stack in their order, 40px apart.
- **Grid of cards:** a row of cards of the same kind is `grid grid-cols-1 gap-6 md:grid-cols-12`, `gap-6` in both directions, each card with the column span the brief gives. Cards in one row stretch to the same height.
- **Vertical rhythm:** written as gaps on stacks, never as top margins and never as `space-y-*`. Every element that holds more than one thing in a column is `flex flex-col` with one of these gaps: `gap-2` between a label and what it labels, between a heading and a label or small figure right above or under it, and between a field's label, the field, its helper text and its error; `gap-3` between a heading and its paragraph, between paragraphs, and between the parts inside a card; `gap-6` between the fields of a form, between a section's heading and its content, between cards of the same kind, and between the groups of a pastel block; `gap-22` between sections, on the `<main>`. A row of things side by side is `flex flex-wrap items-center gap-3`, or `gap-2` for things that belong together (an icon and its word). Where this brief gives no gap, use the one of these that fits.
- **Header:** the first thing on the page is a `<header>` with `border-b border-border`, running the full width. Inside it, one `<div>` carries both the container classes and the row's classes, `flex flex-wrap items-center gap-x-6 gap-y-2 py-3`. On the left the couple's names, "Clem & Rafe", a link to `/` in `inline-flex h-11 items-center font-heading text-h2 text-foreground`, never marked as the current page. Then the `<nav>`, the page's only one, with the `aria-label` "Main" and `w-full md:ml-auto md:w-auto`, so from `md` up it sits at the row's right end and below `md` it takes a line of its own under the names. It holds a `<ul>` with `flex flex-wrap gap-x-6` and four links, in this order: "Reply" to `/rsvp`, "Gifts" to `/gifts`, "The day" to `/day`, "Guestbook" to `/guestbook`. Each link is `inline-flex h-11 items-center font-mono text-label text-foreground underline-offset-4 hover:underline transition-colors duration-150`. The current page's link, where the brief names one, keeps its address and adds `aria-current="page"` and `underline`. The four fit on one line at 375px, so there is no "Menu" button.
- **Footer:** a `<footer>` with `border-t border-border`, running the full width. Inside it, one `<div>` carries both the container classes and `flex flex-col gap-3 py-10 md:flex-row md:items-center md:justify-between`: the names as a `<p>` in `font-heading text-h2`, "Clem & Rafe" (not a heading and not a link), then a `flex flex-col gap-2 md:items-end` with two labels in `text-muted-foreground`: `Saturday 17 July 2027 · Quillbrook Barn, Little Saltry`, the date a `<time dateTime="2027-07-17">`, and `Questions: hello@clemandrafe.example`, the address a text link to `mailto:hello@clemandrafe.example`.
- **The occasion:** the wedding of Clem Ashdown and Rafe Linnell on Saturday 17 July 2027 at Quillbrook Barn, Saltry Lane, Little Saltry, ZQ4 7HB, a village in the English countryside near the market town of Market Fenley. Replies by Friday 30 April 2027. Every page uses these names, this date and this place, word for word.
- **Headings:** the `<h1>` is `text-h1`, and `text-display` from `md` up only where this brief says so (`text-h1 md:text-display`). An `<h2>` is `text-h2`. An `<h3>` is `text-h2` too, unless this brief gives it `text-body`. Headings get the heading font on their own; any other element in `text-display`, `text-h1` or `text-h2` adds `font-heading`. Caprasimo has one weight, already bold, and no italic: never put `font-bold`, `font-semibold` or `font-medium` on a heading or on any text in `font-heading`, and never slant it. Sentence case, no full stop.
- **Labels:** field labels, nav links, button and badge text, captions, dates, times, addresses in a short line, counts of guests and prices are labels: `font-mono text-label`, in sentence case. Nothing is uppercased, in the text or with a class. A label is a short fragment; helper text and error lines use the label style too and may be one sentence. Parts of a label line are joined with ` · `. A label on its own line is a block element such as a `<p>`.
- **Small figures:** a date, a time, a count or a price note that this brief calls a small figure is `font-mono text-label tabular-nums text-muted-foreground`, on the element that holds the whole figure.
- **Text color:** on paper and on cards, headings, body text, prices, field labels and the names of things are `text-foreground`. Other labels, small figures, captions and helper text are `text-muted-foreground`. Paragraphs are never muted. `text-primary` is only for links in running text. On a pastel block every text inherits the block's ink, as the first note says.
- **Writing:** warm and plain, in short sentences, addressing the guest as "you" and written by the couple as "we". No exclamation marks in headings. An error says what to do.
- **Measure:** a paragraph of body text is at most `max-w-xl` wide.
- **Dates and times:** a date or a clock time is a `<time>` with a `dateTime` wherever it appears, in a sentence, a label or a row too, except inside an `<option>` or an `aria-hidden` drawing: `<time dateTime="2027-07-17">Saturday 17 July 2027</time>`, `<time dateTime="14:00">14:00</time>`. A date is written with the weekday, the day, the month in words and the year, with no comma (`Saturday 17 July 2027`), or shorter only where this brief shows it (`30 April`). A clock time is 24-hour with two-digit hours, `09:30`, `14:00`. A time in a row takes `tabular-nums`. A copyright year is plain text.
- **Prices:** whole pounds with the pound sign and no pence: `£85`, `£900`. A price is a label in `text-foreground` with `tabular-nums`.
- **Links:** a link in running text is `text-primary underline underline-offset-4 hover:text-foreground` with `transition-colors duration-150`, and inherits its size. A link whose destination this brief does not name points to `#`.
- **Added components:** a component you add with `npx shadcn@latest add` during the build (an `Input`, a `Textarea`, a `Badge`, an `Accordion`) gets the `cn` import, the focus outline only if it takes focus on the page, and the edits these notes give its file.
- **Buttons:** the shadcn `Button` with `className="h-11 rounded-md px-6 font-mono text-label"`: 44px tall, 14px corners, sentence case, two to four words. The default variant (plum, pink in dark mode) is for the page's one main action; the brief names it, and no page has two. Every other button is `variant="secondary"`, lilac with ink in both modes. Its stock hover mixes in the foreground and can hardly be told from its resting color: in `components/ui/button.tsx`, replace the `secondary` variant's `hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]` with `hover:bg-secondary/80`, once, on every page. Quiet buttons (the unchosen ones in a group, a stepper's minus and plus) are `variant="outline"`; on a page that uses one, in the `outline` variant replace `bg-background` with `bg-card` and take out `dark:bg-input/30`, so it is the card's white in both modes, its hover classes unchanged. A button that sends a form needs `type="submit"`: this `Button` is `type="button"` unless told otherwise. A button that its own click disables gets `focusableWhenDisabled`, so keyboard focus stays on it: only a stepper's minus and plus. Base UI then sets `aria-disabled="true"` and `data-disabled` in place of the `disabled` attribute, so the stock `disabled:` classes do nothing: on a page that uses the prop, and only there, add `data-disabled:pointer-events-none data-disabled:opacity-50` beside them in `components/ui/button.tsx`. A call to action that goes to another page is an `<a>` with the same classes: write `cn(buttonVariants({ variant }), "h-11 rounded-md px-6 font-mono text-label")`, because `buttonVariants` alone does not merge classes. An icon inside a button comes before the text.
- **Button groups:** a set of buttons where one is chosen is a `role="group"` with `flex flex-wrap gap-2`, named by its visible label (`aria-labelledby`). The chosen button has `aria-pressed="true"` and `variant="secondary"`; the others have `aria-pressed="false"` and `variant="outline"`. Not `Tabs`: there are no tab panels.
- **Steppers:** a number set with minus and plus buttons is a `role="group"` named by its visible label (`aria-labelledby`), with `flex items-center gap-2`: a minus `Button`, the value, a plus `Button`. Each button is `variant="outline" size="icon"` with `className="size-11 rounded-md"` (not the text button's classes) and an `aria-label` that says what it does, holding the `Minus` or `Plus` icon. The value is a `<span>` in `inline-flex min-w-24 justify-center font-mono text-label text-foreground tabular-nums` with `aria-live="polite"`, written with its unit (`2 guests`). At the lowest and highest value the matching button is `disabled` with `focusableWhenDisabled`.
- **Inputs:** the shadcn `Input` and `Textarea` with `className="h-11 rounded-md px-3 text-body md:text-body"` (a `Textarea` takes `min-h-32 rounded-md px-3 py-2 text-body md:text-body` instead, with no `h-11`). Fields only ever sit in cards, and their fill is the card's, like the select's: in `components/ui/input.tsx` and `components/ui/textarea.tsx`, replace the stock `bg-transparent` and `dark:bg-input/30` with `bg-card` (in `input.tsx`, `file:bg-transparent` stays), and delete `dark:aria-invalid:border-destructive/50`, so an error border is the same red as the select's in dark mode. Every field has a visible `<label>` above it with `block`, a label in `text-foreground`, tied to it with `htmlFor`. The label, the field, helper text and the error sit in a `flex flex-col gap-2`. Helper text is a label in `text-muted-foreground`, and the field names it in `aria-describedby`. A field that may be left empty says so in its label: `A note (optional)`.
- **Selects:** a choice from a short list is a native `<select>` with `h-11 w-full rounded-md border border-input bg-card px-3 text-body text-foreground aria-invalid:border-destructive` and the focus outline from the rules (`focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`). Its first option is an empty choice in words ("Choose a dinner"). It gets the same label, stack and error handling as any field.
- **Forms:** a form sits in a card, the card is the wrapper for the form and the confirmation that replaces it, and the form's heading sits above the card, in the section's stack, not inside it. In place of the card's column stack, such a card is a plain block (`rounded-xl border border-border bg-card p-6` with no `flex`), holding the `<form>` and, after it, the status element. The `<form>` has `noValidate`, an `aria-label` and `flex flex-col gap-6`; its last item is the submit button, full width below `md` (`w-full md:w-auto md:self-start`).
- **Errors:** an error is a line under its field, inside the field's stack: `flex items-start gap-2 font-mono text-label text-destructive`, holding the `CircleAlert` icon (`size-4 shrink-0`, `aria-hidden="true"`; `items-start` sets it on the first line) and one sentence that says what to do. The field gets `aria-invalid` and adds the line's `id` to its `aria-describedby`. Fields are checked in code when the form is sent, and focus moves to the first field with an error; before the first send no error shows. To focus a field in the same step that adds its error line, set the errors in state and move the focus in an effect that runs after that render (or wrap the state change in `flushSync`), so the line is in the page when focus lands. An email is well formed when, trimmed, it matches `/^[^\s@]+@[^\s@]+\.[^\s@]+$/`. An error line is removed when its own field changes (on `input` or `change`); every other error stays until the next send.
- **Confirmations:** a confirmation is plain text in `text-foreground`, no colored box: a heading at the level this brief gives and a sentence or two. It goes into an element with `role="status"` that is in the card from the start, empty, so that its message is announced. It is never hidden (no `hidden` attribute, no `empty:hidden`) and has no classes and no margin; empty, it takes no space. The message in it is a `<div>` with `flex flex-col gap-3`, rendered only once there is a message, and the form is removed when it appears, so the message stands where the form stood. Give the message's heading `tabIndex={-1}` and move focus to it, because the button that had focus is gone.
- **Cards:** a card is a plain element with `rounded-xl border border-border bg-card p-6` (24px corners, 24px padding, a 1px lilac border, no shadow) and `flex flex-col gap-3` inside, unless this brief says otherwise. Not the shadcn `Card`, which ships its own padding and a ring. Never a card inside a card, never a bordered box inside a card, and never a pastel block inside a card: divide a card's parts with a 1px `border-t border-border` and `pt-3`.
- **Cards with a picture:** a card whose picture fills its top edge is `flex flex-col overflow-hidden rounded-xl border border-border bg-card` with no padding: the picture is a plain `<div>` first in it, with no corners, border or caption of its own, and the text follows in a `<div>` with `flex flex-1 flex-col gap-3 p-6`.
- **Pictures:** there are no image files. A picture is a plain `<div>` with the aspect ratio this brief gives (`aspect-3/2`), `bg-muted`, `role="img"` and an `aria-label` that says what it shows, drawn from plain elements inside it with only the classes this brief gives. A drawn shape is a flat fill with no border and no shadow, in one pastel (`bg-blush`, `bg-candy` or `bg-mist`, one per picture) and, where the brief says, `bg-secondary`. A shape less than 24px on its shorter side has square corners (no `rounded-*`); a larger one takes `rounded-sm`, or `rounded-md` where the brief says. No shape is round.
- **Rows:** a list where each row has a name or a time on one side and its value on the other is a `<ul>`, `<ol>` or `<dl>` with no markers and no padding, and `divide-y divide-border`, so a 1px rule falls between rows and none above the first or below the last. Each row is `flex items-baseline gap-6 py-3 first:pt-0 last:pb-0`, with `justify-between` where the value stands at the right end. On a pastel block rows have no rules: they are a `flex flex-col gap-3`.
- **Badges:** the shadcn `Badge` with `className="h-auto rounded-sm border-transparent bg-tertiary px-2 py-1 font-mono text-label text-tertiary-foreground"`: sky blue with ink, in both modes. One or two words, no icon. Sky blue is a fill only: never `text-tertiary` or a sky-blue border. Badges sit on paper or on a card, never on a pastel block.
- **Avatars:** a circle with the person's initials: `flex size-11 shrink-0 items-center justify-center rounded-full bg-secondary font-mono text-label text-secondary-foreground`, with `aria-hidden="true"` beside the written name. 44px, under the theme's 64px limit for full rounds.
- **Meters:** a bar that shows a share sits on a pastel block and is drawn in its ink: a track `h-6 w-full overflow-hidden rounded-sm border` with the block's ink border (`border-mist-foreground` on mist), holding a fill `h-full` with the block's ink fill (`bg-mist-foreground`), whose width is set with an inline `style`. The track has `aria-hidden="true"`; the numbers beside it say the share in words.
- **Icons:** from `lucide-react`, with `size-4`, `strokeWidth={1.5}` and `aria-hidden="true"`, only where this brief or these notes name one. Beside a line of body text in an `items-start` row, the icon gets `mt-1` to sit on the first line. Never an emoji, however festive the page.
- **Corners:** `rounded-sm` (8px) for badges, meters and drawn shapes; `rounded-md` (14px) for buttons, inputs and selects; `rounded-xl` (24px, the spec's `lg`) for cards and pastel blocks. `rounded-lg` is 14px too, shadcn's name for the base corner; write `rounded-md`. `rounded-full` only for avatars.
- **Surfaces:** flat, like a printed card. No shadows, blur, gradients or glows in the code you write, and no decoration drawn in code: no confetti, dots, streamers, hearts or flourishes. A stock component that floats over the page keeps the one soft shadow it ships with.
- **Motion:** in the code you write, the only transition is color, `transition-colors duration-150`. Nothing moves on scroll. Stock components keep the motion they ship with.

## The page

Where this section and the layout notes above differ, this section wins.

Sample content, if the user gave none: the guestbook of Clem Ashdown and Rafe Linnell, who marry on Saturday 17 July 2027 at Quillbrook Barn, Little Saltry. Six guests have written so far, newest first:

1. Juno Pell, `Margot's daughter, aged 9`, 9 April 2027: she is going to dance every dance, and reminds Rafe that he promised the one with the arches.
2. Tobias Wren, `Your neighbour on Saltry Lane`, 1 April 2027: the croquet set is theirs to borrow for the day, and he wishes them a garden that grows faster than his.
3. Hester Quayle, `Clem's friend from the library`, 24 March 2027: she remembers Clem reading recipes aloud at the issue desk, and hopes the new kitchen hears plenty of them.
4. Dev Raman, `Rafe's flatmate at university`, 15 March 2027: he has known for years that Rafe would marry someone who could out-walk him, and he is glad it is Clem.
5. Ade Fairbrother, `Clem's cousin`, 9 March 2027: the family has waited a long time for a ceilidh, and he has been practising in the kitchen.
6. Margot Pell, `Clem's godmother`, 2 March 2027: she held Clem at her christening and will try very hard not to cry at the barn.

Write each message yourself from its line, in one to three sentences, in the guest's own voice. Initials: JP, TW, HQ, DR, AF, MP.

Build these parts in order.

### 1. Header

The header from the layout notes, with "Guestbook" as the current page; its link keeps `/guestbook`.

### 2. Opening

A full-width section that is a pastel block in blush, as the layout notes describe it, with its `aria-labelledby` pointing at the `<h1>`. The block element itself carries `bg-blush text-blush-foreground`, the pair from the first layout note, so its text stays plum in dark mode; nothing inside it gets a text color class of its own. It holds one `flex flex-col gap-3`: a `flex flex-col gap-2` with a label, `For Clem and Rafe`, and the `<h1>` "Leave us a few words" in `text-h1 md:text-display`; then one paragraph in `text-body` with `max-w-xl`: "A memory, a wish or a piece of advice for the years ahead. We read every one, and we are keeping them all."

### 3. Messages and the form

Here, in place of a section, the `<main>`'s item is a `<div>` with the grid classes of the layout notes' parts side by side (`grid grid-cols-1 gap-10 md:grid-cols-12 md:gap-x-6 md:items-start`), holding two sections. Below `md` the messages come first, then the form.

**Messages,** a section with `md:col-span-7`, `flex flex-col gap-6`, and its `aria-labelledby` pointing at its `<h2>`. It opens with a `flex flex-col gap-2` holding the `<h2>` "Messages" and, under it, a small figure: `6 messages` (`1 message` at one). Then the messages as a `<ul>` with no markers and no padding and `flex flex-col gap-6`, newest first. Each `<li>` is a card from the layout notes, with the card's `gap-3`:

- A row, `flex items-center gap-3`: the avatar from the layout notes with the writer's initials, then a `flex min-w-0 flex-col gap-2` holding the writer's name as an `<h3>` in `text-body` and, under it, a small figure: how they know the couple and the date, joined with ` · `: `Clem's godmother · 2 March 2027`, the date a `<time dateTime="2027-03-02">`. The small figure wraps under the name at 375px, not beside it.
- The message, one `<p>` in `text-body`.

The cards have no other parts: no badge, no button, no reply link.

**Write in the guestbook,** a section with `md:col-span-5`, `flex flex-col gap-6`, and its `aria-labelledby` pointing at its `<h2>`. It opens with a `flex flex-col gap-3` holding the `<h2>` "Write in the guestbook" and one sentence in `text-body`: "Your message goes at the top of the list straight away." Then the form card, as the Forms note describes it. Add the fields with `npx shadcn@latest add input textarea` if the project has none, and give the new files the edits the Added components note lists. The `<form>` has the `aria-label` "Write in the guestbook". Its fields, each in its own `flex flex-col gap-2`:

1. **Name**: the label "Your name", an `Input` with `autoComplete="name"` and `maxLength={60}`.
2. **How you know them**: the label "How you know Clem and Rafe (optional)", an `Input` with `autoComplete="off"` and `maxLength={60}`, and the helper text `Like "Rafe's cousin" or "the neighbours at number 4"`.
3. **Message**: the label "Your message", a `Textarea` with `maxLength={500}`, and under it helper text that counts down: `500 characters left`, down to `1 character left` and `0 characters left`. Where an error shows, it comes after the count, and the field's `aria-describedby` names both.

The last item of the form is the page's one main action: the default `Button`, `type="submit"`, "Add my message", full width below `md` as the Forms note says. After the form, in the card, the empty `role="status"` element.

### 4. On the day

A section in the centered column from the layout notes, with an `<h2>` "On the day" and, in the column's `gap-6`, one paragraph in `text-body`: "There is a paper guestbook too, on the table by the barn door, with pens that work. Write in both if you like."

### 5. Footer

The footer from the layout notes.

### Behavior

- Keep the messages in component state as a list of objects with a name, the initials, how they know the couple (or none), the date (or none, for a new one) and the text. The count reads from the list.
- When the form is sent, check it in code:
  - Name: empty, or only spaces, gives "Write your name, so they know who it is from."
  - Message: empty, or only spaces, gives "Write a message. A line or two is plenty."
  - How you know them is optional and never gets an error.
- Each error line follows the layout notes, which say when it shows, when it goes and how focus reaches it. Focus moves to the first field with an error.
- When both are good, add a card at the top of the list from the trimmed values. Its initials are the first letter of the first two words of the name, in capitals (`Dev Raman` gives `DR`; a one-word name gives one letter). Its small figure is how they know the couple, if given, then `Just now`, joined with ` · `: `Rafe's cousin · Just now`, or `Just now` alone; `Just now` is plain text, not a `<time>`. The count follows: `7 messages`. The form is replaced in its card by the confirmation in the status element: an `<h3>` in `text-h2`, "Thank you, Dev Raman" (the name as typed, trimmed), with `tabIndex={-1}`, and one sentence: "Your message is at the top of the guestbook." The heading and the sentence sit in the message `<div>`; no button follows. Move focus to the heading.
- The list is not a live region: the confirmation says what happened.
- The other links need no behavior.

## Rules

- **Colors:** only the theme's colors, through the semantic classes (`bg-background`, `text-foreground`, `bg-card`, `bg-primary`, `text-primary-foreground`, `text-muted-foreground`, `border-border` and so on). No hex, rgb or named colors in components, and no Tailwind palette classes such as `bg-blue-500` or `text-gray-600`.
- **Spacing:** padding, margin and gap use only the scale's steps (`1`, `2`, `3`, `6`, `10`, `22`) plus 0, 1px and 2px. No arbitrary values such as `p-[18px]`, and no other steps such as `p-5` or `gap-9`. `auto` margins are fine. Widths and heights such as `w-64` or `size-4` are sizes, not spacing. This applies to the code you write: a stock component keeps the spacing inside it, unless this brief changes it.
- **Type:** every piece of text you write gets its size from one of `text-display`, `text-h1`, `text-h2`, `text-body`, `text-label`, set on the element or on a parent it inherits from. Put `text-body` on the outermost element of the page you write. No other sizes. A stock shadcn component keeps the size it ships with, unless `DESIGN.md` or this brief gives that component its own style. A type class does not replace a weight class: where a stock component ships `font-medium` and the text should be regular, add `font-normal`.
- **Fonts:** only the theme's fonts, through `font-sans`, `font-heading` and `font-mono`. Do not add a font.
- **Corners:** only the `rounded-*` classes, which the theme already sets. No arbitrary radius, and `rounded-full` only where `DESIGN.md` or this brief names a full round, such as an avatar or a status dot. The theme allows a full round on a box up to 64px across; Strict Check reports a larger one, and a pill counts by its height.
- **Contrast:** all text meets WCAG AA against its background.
- **Stock components:** a component from `components/ui`, and an `<a>` styled with `buttonVariants`, keeps the hover, pressed and disabled colors and the motion it ships with, unless this brief changes them. They are the theme's colors under other names.
- **Counts:** a number with a noun reads right at one: "1 set", not "1 sets". Where this brief gives the words for only one of the two, write the other the same way.
- **Sizes from data:** a height or a width that comes from data (a chart bar, a meter) is set with an inline `style`. That is the one use for an inline style.
- **Focus:** every link and control shows a 2px outline on keyboard focus: `focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`. Keep `focus-visible:outline-solid` in it: in Tailwind 4 an `outline-none` on the same element, which stock components carry, otherwise hides the outline. An element that only gets focus from code (a heading or a message with `tabIndex={-1}`) gets the same outline written with `focus:` in place of `focus-visible:` (`focus:outline-solid focus:outline-2 focus:outline-offset-2 focus:outline-ring`): after a mouse click, a browser does not match `:focus-visible` on an element that code focuses. A link, a button or a field that code focuses keeps the `focus-visible:` classes it has: after a mouse click it shows no outline, which is how a browser treats every control, and is right. A stock component that ships its own focus ring (`Button`, `buttonVariants`, `Input`, `Textarea`, `Checkbox`, `Switch`, `AccordionTrigger`, the close button of a `Sheet`) must lose that ring. Do it once, in the component's file in `components/ui`, which is yours to change: replace its `focus-visible:ring-*` classes with the outline classes, and in a field replace its `aria-invalid:ring-*` classes, the `dark:` ones included, with `aria-invalid:ring-0`, or a field with an error shows a tinted ring. `Button` has two more sets. Its base classes also carry `aria-invalid:ring-*` classes: replace them with `aria-invalid:ring-0`, as in a field. Its `destructive` variant carries `focus-visible:ring-*` classes of its own, the `dark:` one included: delete them and put nothing in their place, because the base classes already give every variant the outline. Wherever this rule says replace, change the classes in the file and do not add `ring-0` beside them: an added class only wins where it comes later and passes through `cn`. The stock `focus-visible:border-ring` can stay. These ring changes go only into the files of components that this page uses and that can take focus on it: a `Badge` that is not a link keeps its ring classes. The `cn` import from the setup steps is another matter and goes into every file. A box that scrolls sideways (a code block, a wide table) gets `tabIndex={0}`, `role="region"`, an `aria-label` and the same outline, also at widths where it happens to fit. Where a focusable box touches the edges of a parent that has `overflow-hidden`, draw its outline inside it: `focus-visible:-outline-offset-2` in place of `focus-visible:outline-offset-2`.
- **Not allowed:** purple or multi-color gradients; emoji used as icons or bullets; glows and colored shadows.
- **Avoid:** a card inside a card.
- **Dark mode:** the page must work with the `dark` class on `<html>`. Because every color comes from a semantic class, this needs no extra code; do not write `dark:` color overrides. A new shadcn project follows the system's mode and switches on the `d` key: leave that as it is, and add no mode switch of your own. If the page has a native `<select>` or a date or time field, tell the browser the mode, or its list and its picker stay light in dark mode: in the global CSS, give `:root` `color-scheme: light` and `.dark` `color-scheme: dark`.

From the theme's own do's and don'ts:

- Do keep text in plum ink: a pastel is a fill, never a text color.
- Do keep buttons, links and fields on the paper: a pastel block holds text only.
- Do use one pastel per block, and white paper between blocks.
- Do say the date, the time and the place plainly, near the top.
- Don't scatter decoration: no confetti drawn in code, no gradients, no glows.
- Don't put a pastel block inside a card or a card inside a card.
- Don't introduce a color, size or radius that is not a token above.

## Check before you finish

Go through this list against the code you wrote, and fix anything that fails.

- [ ] Each message is a card with a 44px round avatar of the writer's initials, hidden from screen readers, the writer's name as a heading and the date as a time element.
- [ ] Sending the form with an empty name or an empty message gives each its own error line with an icon, tied to its field, and focus moves to the first of them.
- [ ] A good message replaces the form, inside the same card, with a confirmation that a screen reader announces and that takes focus, a new card appears at the top of the list, and the count reads 7 messages.
- [ ] The message field counts down the characters left, and reads 1 character left at one.
- [ ] No card sits inside another card, and the blush block holds no avatar, badge, link or field.
- [ ] The opening block element carries bg-blush text-blush-foreground, so its text stays plum ink in dark mode, and nothing inside it has a text color class of its own.
- [ ] No color is written as a hex, rgb or Tailwind palette value in the page's code.
- [ ] Every padding, margin and gap in the code you wrote is a step of the spacing scale.
- [ ] Every text element you wrote gets its size from a type-scale class, its own or an inherited one. Visually hidden text is exempt.
- [ ] No file in `components/ui` imports `cn` from `"cn"` directly.
- [ ] Text contrast meets WCAG AA in light and dark mode.
- [ ] The page has one `<h1>`, headings are in order, and every image has alt text.
- [ ] Every interactive element can be reached with the keyboard and shows the focus outline from the rules.
- [ ] At 375px wide the page does not scroll sideways. Wide tables and code blocks scroll inside their own box.
- [ ] The project builds without errors or warnings.

Then tell the user which checks pass, which you could not verify, and anything in this brief you did not do and why.
