# Colors & Fonts

## Colors & Fonts

**Files:** `src/styles/theme.css`, `src/config/fonts.json`, `src/styles/buttons.css` · **Skill level:** Beginner

Covena's look comes from a short list of design tokens: navy and bronze on a cream page, white panels, and two typefaces. Change a token once and every component that uses it follows. Covena has a light theme only.

### Colors
The colors are at the top of `src/styles/theme.css`, each with a comment that says where it is used:

```css
/* src/styles/theme.css */
@theme {
  /* Brand */
  --color-navy: #14295E;        /* hero, practice panel, header CTA, footer */
  --color-navy-hover: #1E3A7E;
  --color-bronze: #B4864F;      /* accent fills; always with an ink label */
  --color-bronze-deep: #85602F; /* accent text and links on light surfaces */
  --color-sand: #DDC7A4;        /* light accent panel; bronze button hover; links on navy */
  --color-peach: #EDDDC6;       /* light accent tile */

  /* Surfaces */
  --color-cream: #F6F4EE;       /* page */
  --color-white: #FFFFFF;       /* panels, cards, header */
  --color-slate: #3E4559;       /* footer marquee strip */

  /* Text */
  --color-ink: #151B33;         /* headings, nav, labels */
  --color-body: #3E4559;        /* body copy */
}
```

| Token                    | Role                                                                                     |
| ------------------------ | ---------------------------------------------------------------------------------------- |
| `navy`, `navy-hover`     | The main brand color: the Home 1 hero, the practice areas panel, the header button, and the footers |
| `bronze`                 | Accent fills such as the bronze buttons and panels. Text on it is ink, not white          |
| `bronze-deep`            | Accent text and links on light backgrounds. It is darker than `bronze` so small text stays readable |
| `sand`, `peach`          | Light accent panels and tiles. `sand` is also the link color on navy                     |
| `cream`                  | The page background                                                                      |
| `white`                  | Panels, cards, and the header                                                            |
| `ink`, `body`            | Headings and body text                                                                   |
| `line`, `line-input`     | Dividers and card outlines, and form field outlines                                      |
| `success`, `danger`      | Form messages                                                                            |

To rebrand, change the hex values and keep the names. The components use the names (for example `bg-navy` and `text-bronze-deep`), so they pick up the new colors without any other edit.

<Aside type="caution">
  Check contrast after you change a color. Text must stay readable on the
  surfaces it sits on: ink on bronze and sand, white on navy, and
  `bronze-deep` on cream and white. A free checker such as WebAIM's contrast
  checker takes two hex values and tells you if they pass.
</Aside>

The rest of `theme.css` holds the radii (`--radius-panel`, `--radius-base`, and others), the section spacing (`--spacing-section` is 96 px between sections on desktop, `--spacing-section-sm` 56 px on phones), the screen breakpoints, the heading sizes (`--text-h1` to `--text-h6`, with a `-sm` size for phones), and the image crops (`--aspect-*`). Each has a comment.

### Buttons
Buttons in content files pick one of four styles with `color`:

```yaml
button:
  enable: true
  label: "Book a free consultation"
  url: "/consultation/"
  color: "bronze" # navy | bronze | outline | link
```

The styles are in `src/styles/buttons.css` (`.btn-navy`, `.btn-bronze`, `.btn-outline`, `.btn-link`), and they read their colors from the tokens above.

### Fonts
Covena uses three fonts, set in `src/config/fonts.json`:

| Font                   | CSS variable     | Used for                                                            |
| ---------------------- | ---------------- | ------------------------------------------------------------------- |
| Onest (400 and 500)    | `--font-primary` | All text and headings                                               |
| Instrument Serif italic | `--font-accent` | The one word in `<em>` in some titles, such as "families and *businesses*" |
| IBM Plex Sans Arabic   | `--font-arabic`  | Arabic pages only                                                   |

Each font is one entry:

```json
{
  "name": "Onest",
  "variants": [
    { "style": "normal", "weight": "400" },
    { "style": "normal", "weight": "500" }
  ],
  "preload": false,
  "display": "swap",
  "cssVariable": "--font-primary",
  "provider": "google",
  "subsets": ["latin"],
  "fallback": "sans-serif"
}
```

Astro downloads the fonts when it builds and serves them from your own site, so visitors' browsers don't contact Google.

**Change a font:** replace `name` with another Google Fonts family, and list the weights you need in `variants`. Keep `cssVariable` as it is, because the styles use it. Headings use weight 500, so include it. Then restart `npm run dev`, since fonts are read only at startup.

**Fonts for one language:** the Arabic entry has `"languages": ["ar"]`, so it loads only on Arabic pages. Add the same field to a font for another script, for example a font for Greek on a Greek site.

`provider` can also be `fontsource`, `bunny`, or `fontshare`, for fonts from those services.

### The Accent Word
In many titles one word is wrapped in `<em>`, and it is set in Instrument Serif italic:

```yaml
title: "Clear legal advice for families and <em>businesses</em>"
```

Remove the `<em>` tags to keep the whole title in Onest. Use it on one word at most, so it stays an accent.

### Do It With AI
```text
Change the brand colors in src/styles/theme.css: navy to [HEX], navy-hover to a slightly lighter
shade of it, bronze to [HEX] and bronze-deep to a darker shade of it that passes WCAG AA contrast on
#F6F4EE. Keep every token name. Then replace Onest with [GOOGLE FONT] in src/config/fonts.json, with
weights 400 and 500, keeping cssVariable "--font-primary". Tell me which text and background pairs
I should check for contrast.
```