# Moey — rules for AI assistants

Moey is a mobile-first CSS + JS framework: one stylesheet (`moey.css`), one script (`moey.js`), plain HTML, no build step, no dependencies. Icons come from Moey Icons (`<i class="mi mi-house"></i>`). Write normal HTML with Moey classes; moey.js finds the elements and adds behavior by itself — you rarely write JavaScript.

## Setup

```html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="moey.min.css">
  <link rel="stylesheet" href="moey-icons.min.css">
  <script src="moey.min.js" defer></script>
</head>
<body>…</body>
</html>
```

## Golden rules

1. **Moey is not Bootstrap or Tailwind.** Use only Moey's class names (below). There is no `d-flex`, `col-md-6`, `btn-primary`, `text-primary`, `data-bs-*`, `bg-white text-gray-700`, `rounded-md`, `px-[13px]`.
2. **Colors have names, never meanings.** `btn-green`, `badge-red`, `theme-blue`. There is NO `primary`, `secondary`, `success`, `danger`, `warning`, `info`. The brand color is `default` (`btn-default`, `badge-default`, `text-default`).
3. **Palette:** `blue indigo purple pink red orange amber yellow lime green teal cyan brown gray` (+ `default`).
4. **Strengths (light → strong):** `-subtle` · `-soft` · *(none = the default fill)* · `-solid` · `-vivid` · `-deep`, plus `-outline` · `-ghost` · `-link` on buttons. Example: `btn btn-green btn-solid`, `badge badge-amber badge-subtle`, `alert alert-red alert-soft`. A component without a color class is neutral.
5. **Phone first.** Write the phone layout first; add breakpoint prefixes for bigger screens: `sm:` 576 · `md:` 768 · `lg:` 1024 · `xl:` 1280 · `2xl:` 1536px. `flex flex-col md:flex-row`. Never assume a wide screen.
6. **Spacing scale = number × 4px:** `p-4` = 16px, `gap-6` = 24px, `mt-2` = 8px. Values: 0 0.5 1 1.5 2 2.5 3 4 5 6 7 8 9 10 11 12 14 16 20 24.
7. **Start/end, not left/right:** `ms-auto`, `pe-4`, `text-start`, `border-s`, `start-0` (RTL works automatically).
8. **No inline styles.** Use utilities and component classes; values go in attributes (`data-value="4.5"` on `.rating-static`, `.progress-stack` parts and `.progress-circle`). To change a component variable, write a CSS rule with your own class (`.btn-rounder { --mo-btn-radius: 99px; }`), not `style="…"`. Sizes: `w-* h-* min-w-* min-h-* max-w-* max-h-*` on the rem×4 scale (`max-w-56` = 14rem).
9. **Accessibility:** every field has a `<label for>`; every icon-only button has `aria-label` (Moey shows it as a tooltip); use `<button>` for actions and `<a href>` for navigation; set `<html lang>`.
10. **Light/dark is automatic.** Never hard-code white/black backgrounds or gray text colors — use `bg-surface`, `bg-body`, `text-muted`, `text-subtle`. Force a mode with `data-mo-theme="light|dark"` on `<html>` or any element.

## Utilities (short names)

- Display: `block inline-block inline flex inline-flex grid inline-grid contents hidden` (+ `md:hidden`, `lg:flex` …)
- Flex: `flex-row flex-col flex-wrap flex-1 flex-auto flex-none grow shrink-0 order-first order-last`
- Align: `items-start|center|end|stretch|baseline` · `justify-start|center|end|between|around|evenly` · `self-*` · `content-*` · `place-items-center` · `justify-items-*`
- Grid: `grid grid-cols-1…6 grid-cols-12 md:grid-cols-3` (a plain `grid` is ONE column — always say how many) · children `span-1…12 md:span-6 span-full` (spans give a 12-column grid) · `grid-auto` (as many as fit; smallest column `grid-min-48` = 12rem, default 16rem)
- Gap: `gap-4 gap-x-2 gap-y-6`
- Spacing: `p-4 px-6 py-2 pt-1 pb-3 ps-4 pe-4` · `m-0 mx-auto mt-4 mb-2 ms-auto me-2 mt-auto` · `space-y-3 space-x-2`
- Size: `w-full w-auto w-fit w-1/2 w-1/3 w-2/3 w-1/4 w-3/4 w-12 h-full h-screen size-10 min-w-0 min-h-screen max-w-xs|sm|md|lg|xl|2xl…7xl max-w-prose`
- Text: `text-xs text-sm text-base text-lg text-xl text-2xl … text-6xl` · `font-normal font-medium font-semibold font-bold` · `text-start text-center text-end` · `leading-tight leading-relaxed` · `tracking-tight` · `uppercase capitalize` · `underline no-underline` · `text-truncate line-clamp-2 text-balance break-words` · `font-mono tabular-nums`
- Color text: `text-body text-subtle text-muted text-default text-green text-blue-600` (adaptive by name, exact by shade 25…950)
- Background: `bg-body bg-surface bg-raised bg-1 bg-2 bg-3 bg-inverse bg-green bg-blue-100 bg-blur`
- Borders: `border border-0 border-2 border-t border-b border-s border-e border-dashed border-blue rounded-0 rounded-sm rounded rounded-lg rounded-xl rounded-pill rounded-circle divide-y`
- Effects: `shadow-sm shadow shadow-lg shadow-overlay shadow-none opacity-50 transition duration-200 animate-spin animate-pulse`
- Position: `relative absolute fixed sticky inset-0 top-0 end-0 z-10 z-sticky`
- Other: `overflow-auto overflow-hidden overscroll-contain aspect-video aspect-square object-cover pointer-events-none select-none cursor-pointer visually-hidden`
- Container queries: put `@container` on a box, then `@md:flex-row`, `@lg:grid-cols-3` react to that box's width.

## Helpers

`stack` (column, gap 16px) · `hstack` (row, centered, gap 12px) · `cluster` (wrapping row) · `spacer` (pushes the rest away) · `stretched-link` (whole card clickable) · `hover-lift` · `focus-ring` · `icon-link icon-link-hover` · `sticky-top fixed-bottom` · `rtl-flip` (mirror an arrow icon in RTL)

## Layout

```html
<div class="container">…</div>                       <!-- centered, max 80rem; container-sm|md|lg|xl|2xl -->
<div class="grid md:grid-cols-3 gap-4">…</div>          <!-- 1 column on phones, 3 from md -->
<div class="grid gap-4"><div class="span-12 md:span-8">…</div><div class="span-12 md:span-4">…</div></div>
```

App shell (admin apps): sidebar + topbar + content. The sidebar is a drawer below 1024px (popover, no JS).

```html
<div class="app" id="app">
  <aside class="app-sidebar" id="sidebar" popover aria-label="Main navigation">
    <div class="app-sidebar-header"><a class="app-brand" href="/"><span class="app-brand-logo">M</span><span class="app-brand-name">Shop</span></a></div>
    <nav class="app-sidebar-body"><div class="app-nav">
      <div class="app-nav-title">Overview</div>
      <a class="app-nav-link active" href="/"><i class="mi mi-house app-nav-icon"></i><span class="app-nav-label">Dashboard</span></a>
      <a class="app-nav-link" href="/orders"><i class="mi mi-shopping-cart app-nav-icon"></i><span class="app-nav-label">Orders</span><span class="app-nav-badge">3</span></a>
    </div></nav>
  </aside>
  <div class="app-main">
    <header class="app-topbar"><button class="app-sidebar-toggle" popovertarget="sidebar" aria-label="Menu"></button>…</header>
    <main class="app-content">…</main>
  </div>
</div>
```

Collapse to icons: `is-collapsed` on `.app` (e.g. `<button data-moey-toggle="#app" data-moey-toggle-class="is-collapsed">`). Dark sidebar: `data-mo-theme="dark"` on the aside.

## Components (exact markup)

**Button** `<button class="btn">Neutral</button>` · `<button class="btn btn-default btn-solid">Save</button>` · `<button class="btn btn-red btn-ghost btn-sm">Delete</button>` · icon-only: `<button class="btn btn-icon btn-ghost" aria-label="Edit"><i class="mi mi-pencil"></i></button>` · sizes `btn-xs btn-sm btn-lg` · loading `aria-busy="true"`.

**Badge** `<span class="badge badge-green badge-subtle">Paid</span>` · `badge-dot` (status dot) · `badge-count` · `badge-corner` (notification count on an icon button).

**Card**
```html
<div class="card">
  <div class="card-header"><div><h3 class="card-title">Revenue</h3><p class="card-subtitle">Last 12 months</p></div><div class="card-actions">…</div></div>
  <div class="card-body">…</div>
  <div class="card-footer">…</div>
</div>
```
Stat tile: `<div class="card"><div class="card-body stat"><span class="stat-label">Revenue</span><span class="stat-value">$48,210</span></div></div>`

**Alert** `<div class="alert alert-amber" role="status"><i class="mi mi-triangle-alert alert-icon"></i><div class="alert-content"><div class="alert-title">Trial ends soon</div><p>Add a card.</p></div><button class="btn-close" aria-label="Dismiss"></button></div>`

**Form field**
```html
<div class="field">
  <label class="form-label" for="email">Email</label>
  <input class="form-control" id="email" type="email" required>
  <div class="form-text">We'll never share it.</div>
  <div class="form-error">Enter a valid email.</div>
</div>
<select class="form-select" id="status">…</select>                     <!-- becomes a Moey dropdown automatically -->
<label class="form-check"><input type="checkbox" class="form-check-input"> Remember me</label>
<label class="form-check form-switch"><input type="checkbox" role="switch"> Notifications</label>
<label class="form-check form-switch form-switch-text"><input type="checkbox" role="switch" data-on="ON" data-off="OFF"> Wi-Fi</label>  <!-- a short word inside the track (the track fits it); keep the label -->
<input class="form-control" type="date">                               <!-- Moey datepicker automatically -->
<input class="form-control" list="cities">                             <!-- Moey combobox from a <datalist> -->
<input class="form-control" data-moey-tags>                            <!-- tag input -->
<input class="form-control" type="password" data-moey-toggle>          <!-- eye button -->
<input class="form-control" data-moey-otp="6">                         <!-- one-time code boxes -->
```
Form layouts: `form-stack` · `form-inline` · `form-section` (+`form-section-header`, `form-section-body`) · `form-actions`. `<form data-moey-dirty>` tracks unsaved changes.

**Dialog / sheet / drawer** (native `<dialog>`; on phones a dialog becomes a bottom sheet: `.dialog-center` keeps it centered, `.dialog-fullscreen-phone` covers the screen instead; page-wide colors: `--mo-dialog-bg` / `--mo-dialog-fg` on `:root`)
```html
<button class="btn" data-moey-open="#invite">Invite</button>
<dialog class="dialog" id="invite" aria-labelledby="invite-title">
  <div class="dialog-header"><h2 class="dialog-title" id="invite-title">Invite people</h2><button class="btn-close" aria-label="Close"></button></div>
  <div class="dialog-body">…</div>
  <div class="dialog-footer"><button class="btn" data-moey-dismiss>Cancel</button><button class="btn btn-default btn-solid">Send</button></div>
</dialog>
```
`class="sheet"` for a bottom sheet everywhere, `class="drawer"` (`drawer-start`) for a side panel.

**Confirm** `<button class="btn btn-red" data-moey-confirm="This can't be undone." data-moey-confirm-title="Delete order?">Delete</button>` or `if (await Moey.confirm({ title, message })) …`

**Menu**
```html
<div class="dropdown">
  <button class="btn dropdown-toggle">Options</button>
  <div class="menu">
    <button class="menu-item"><i class="mi mi-pencil"></i>Edit</button>
    <hr class="menu-divider">
    <button class="menu-item theme-red"><i class="mi mi-trash-2"></i>Delete</button>
  </div>
</div>
```

**Tabs** `<div class="tabs"><div class="tab-list"><button class="tab">One</button><button class="tab">Two</button></div><div class="tab-panel">…</div><div class="tab-panel">…</div></div>` (panels pair by position)

**Accordion** `<div class="accordion"><details class="accordion-item"><summary class="accordion-header">Question?</summary><div class="accordion-body">Answer.</div></details></div>`

**Table** `<div class="table-wrap"><table class="table table-hover"><thead><tr><th><button class="table-sort">Name</button></th>…</tr></thead><tbody>…</tbody></table></div>` · full data table: add `data-moey-datatable` to the `<table>`. Edit inside it with attributes on the `<th>`: `data-moey-editor="text|number|select|date|email|url|tel"` (double-click / Enter / F2 edits; Enter saves, Esc cancels, Tab moves on), `data-moey-control="switch|checkbox|select|number"` (a live control in every cell), `data-moey-options="A,B,C"`, rules `data-moey-required` / `-min` / `-max` / `-pattern` / `-step`; a toolbar button with `data-moey-toolbar data-moey-add` adds a row. Listen to `moey:edit` (`e.detail`: row, key, value, old; `preventDefault()` refuses) to save.

**Charts** `<figure class="chart" data-moey-chart="bar|line|area|donut"><figcaption>Revenue</figcaption><table><thead><tr><th>Month</th><th>Online</th><th>In store</th></tr></thead><tbody><tr><td>Jan</td><td>4200</td><td>3100</td></tr>…</tbody></table></figure>` — first column = labels, each other column = a series; moey.js draws it, adds the legend, tooltips, keyboard reading and a Table switch. Options: `data-moey-stacked`, `data-moey-horizontal`, `data-moey-labels`, `data-moey-format="currency:USD|percent|compact"`, `data-moey-baseline="auto"`, `data-moey-center="Visits"` (donut); `<th data-color="red">` only when the color means something (never cycle your own colors — the fixed palette is color-blind checked). In a card, title it with the card header and `aria-label` on the figure. From data: `Moey.chart(el, { type, labels, series: [{ name, data }], format })` → `.update({...})`. Sparkline: `<span class="chart-spark" data-moey-spark="3,5,4,8"></span>`. Never draw charts with divs or a chart library.

**Kanban** `<div class="kanban" data-moey-kanban><section class="kanban-column" data-id="todo" data-moey-limit="3"><header class="kanban-header"><h3 class="kanban-title">To do</h3><span class="kanban-count"></span></header><div class="kanban-list"><article class="kanban-card" data-id="t4"><div class="kanban-card-title">…</div><div class="kanban-card-meta">…</div></article></div></section>…</div>` — drag (mouse; press-and-hold on touch), keyboard (Space pick up / arrows / Space drop / Esc), counts and limits automatic, one column per screen on phones. Save in `moey:move` (`e.detail`: id, from, to, index; `preventDefault()` puts it back). `Moey.kanban(el).move(id, columnId, index)` · `.value()`. Don't add drag libraries.

**Split view** (inbox, contacts, settings) `<div class="split h-full" data-moey-split><div class="split-list"><a class="split-item is-unread" href="#m1" data-id="m1"><span class="avatar">AK</span><span class="split-item-body"><span class="split-item-title"><span>Ana</span><span class="split-item-meta">9:41</span></span><span class="split-item-subject">…</span><span class="split-item-text">…</span></span></a>…</div><div class="split-detail"><header class="split-header"><button class="split-back" aria-label="Back"></button><h2 class="split-title">…</h2></header><div class="split-body">…</div><div class="split-empty">Choose a message</div></div></div>` — needs a height (`h-full` in the app content, or `h-128`). Side by side from 640px of its own width (resizable divider, `data-moey-persist`), one pane at a time below with the phone Back gesture. Fill details in `moey:select` (`e.detail.id`) or put a `<template>` + `data-title` in each item.

**Calendar** `<div class="calendar" data-moey-calendar data-moey-view="month" data-moey-hours="7-20"><ul class="calendar-data"><li data-start="2026-11-24T09:00" data-end="2026-11-24T09:30" data-color="blue">Standup</li><li data-start="2026-11-27" data-end="2026-11-30" data-color="red">Sale</li></ul></div>` — views month / week / day / agenda (`data-moey-views` limits the switcher); dates only = all day, end day included; compact month + day list under 640px of its own width. Events: `moey:event` (`e.detail.event`), `moey:pick` (`{ date, time, allDay }` — open your "new event" dialog here), `moey:change` (`{ view, start, end }` — load that range). `Moey.calendar(el, { events })` → `.add() .remove(id) .setEvents(list) .view(name) .go(date)`. Not the same as the datepicker (`input[type=date].form-control`).

**List group** `<ul class="list-group"><li class="list-group-item"><span class="avatar">AK</span><div class="list-group-content"><div class="list-group-title">Ana</div><div class="list-group-detail">#10421</div></div><span class="list-group-meta">2m</span></li></ul>`

**Navbar** `<header class="navbar navbar-sticky"><a class="navbar-brand" href="/">Shop</a><button class="navbar-toggle" aria-label="Menu"></button><div class="navbar-collapse"><nav class="nav"><a href="/" aria-current="page">Home</a></nav><div class="navbar-actions">…</div></div></header>`
On phones (below 1024px, or 768px with `navbar-expand-md`; `navbar-expand` never folds) the links fold into ☰. Put `navbar-toggle` first for ☰ at the start · `navbar-center` centers the brand · a `navbar-actions` placed *outside* `navbar-collapse` stays in the bar (avatar, cart, one key button) · the menu opens as a floating card, or with `navbar-full` (whole screen) or `navbar-drawer` / `navbar-drawer-start` (side sheet).

**Nav** `<nav class="nav nav-pills"><a href="/" aria-current="page">Home</a><a href="/orders">Orders</a></nav>` · `nav-underline` · `nav-vertical` · `nav-overflow` (extra links go into a More menu).

**Others:** avatar (`avatar avatar-sm avatar-blue`), progress (`<progress class="progress" value="40" max="100">`), spinner (`spinner`), skeleton (`skeleton`), tooltip (`data-moey-tooltip="Text"`), popover (`data-moey-open="#id"` + `class="popover"`), pagination (`<nav class="pagination" data-moey-pages="24" data-moey-page="5">`), breadcrumb (`<nav class="breadcrumb"><ol><li><a>…</a></li></ol></nav>`), chips (`chip chip-pill`, `chip-group data-moey-chips="multiple"`), toast (`Moey.toast({ message: 'Saved', type: 'success' })` or `data-moey-toast="Saved"`), command palette (`dialog class="palette"`), empty state (`empty`), steps (`steps`), timeline (`timeline`), carousel (`carousel`), rating, dropzone, tree view, notification center, segmented control (`btn-group btn-group-segmented`).

## Phone-app patterns

**Tab bar** (main sections at the bottom on phones): `<nav class="tabbar" aria-label="Main"><a class="tabbar-item" href="/" aria-current="page"><i class="mi mi-house"></i><span>Home</span></a>…</nav>` — 3–5 items, last thing in `<body>` (or the `.app`); gone from 1024px (`tabbar-always` keeps it). `.tabbar-badge` (count, or empty = dot), `.tabbar-action` (big middle button), `.tabbar-floating`, `data-moey-hide-on-scroll`. Add `viewport-fit=cover` to the viewport meta. The page padding and toasts adjust by themselves.

**Swipe actions** on rows: `<div class="swipe-item" data-moey-swipe><div class="swipe-content">…row…</div><div class="swipe-start"><button class="swipe-action theme-blue">Read</button></div><div class="swipe-end"><button class="swipe-action theme-amber">Archive</button><button class="swipe-action theme-red" data-moey-swipe-full>Delete</button></div></div>` — handle the buttons with a click listener; `moey:swipe-full` is cancelable.

**Pull to refresh**: `data-moey-refresh` on the content that scrolls (or a scrolling panel); `el.addEventListener('moey:refresh', (e) => e.detail.waitUntil(load()))`; give desktops a button calling `Moey.refresh(el)`.

**Sortable** (drag to reorder): `data-moey-sortable` on the list (ul, .list-group, tbody, a grid of cards) with `data-id` on items; `<span class="sort-handle"></span>` for a grip; `data-moey-sortable="name"` links lists; save in `moey:sort` with `Moey.sortable(list).value()`. (`th[data-moey-sortable="false"]` is the data table's column option — different thing.)

**Chat**: `<div class="chat" data-moey-chat><div class="chat-log"><div class="chat-day">Today</div><div class="chat-msg"><span class="avatar avatar-sm">AK</span><div class="chat-bubbles"><div class="chat-bubble">Hi</div><div class="chat-meta">Ana · 9:41</div></div></div><div class="chat-msg chat-msg-out">…</div></div><form class="chat-composer"><textarea class="form-control" rows="1" aria-label="Message"></textarea><button class="btn btn-default btn-icon" aria-label="Send"><i class="mi mi-send"></i></button></form></div>` — `.chat-full` for a full-screen, keyboard-aware chat; `moey:send` (`e.detail.text`, `e.detail.status('Read')`); `Moey.chat(el).add({ text, name, avatar })`, `.typing(true, 'Ana')`. `data-moey-names` for group threads. **Files**: `<input type="file" multiple accept="…">` in the composer = attach button + tray + paste/drop (`data-moey-max-size="25MB"` on the chat); a file bubble `<div class="chat-bubble"><a class="chat-file" href="…" download data-size="48213"><span class="chat-file-name">Report.pdf</span></a></div>`; pictures/videos `<div class="chat-bubble chat-media"><a href="big.jpg"><img src="small.jpg" alt="…"></a>…</div>` (1–4, "+N", lightbox; `data-duration` on video links). Upload in `moey:send`: `e.detail.files[i]` = `{ file, name, size, type, signal, progress(0–1), url(href) }` inside `e.detail.waitUntil(promise)` (progress ring, cancel, Retry). `Moey.chat(el).add({ files: [{ name, size, type, url, thumb }] })`.

**Tour** (first-run walkthrough): `data-moey-tour="welcome" data-moey-tour-order="1" data-moey-tour-title="…" data-moey-tour-text="…"` on the parts, a button `data-moey-tour-start="welcome"`; or `Moey.tour([{ target, title, text }], { once: 'welcome-v1' }).start()`.

**Keyboard shortcuts**: `data-moey-shortcut="c"` / `"mod+s"` / `"g i"` on buttons and links (a field gets focus); `data-moey-shortcut-label`, `data-moey-shortcut-group`; `<kbd class="shortcut-hint" data-moey-keys="c"></kbd>` inside the button; "?" lists them all. `Moey.shortcuts.add({ keys, label, group, run })`.

## More form fields

**Time**: every `<input type="time" class="form-control">` becomes a Moey time field (type "930", "9:30pm"; a list of times; `step` in seconds, `min`, `max`; 12/24h from `lang` or `data-moey-clock`). `type="datetime-local"` becomes date + time. The real input keeps "HH:MM" for the form.

**Rich text**: load Mob next to Moey (`mobtexteditor` on npm / jsDelivr: mob.css + mob.js), then `<textarea class="form-control" name="body" data-mob></textarea>` — Moey styles it; `data-toolbar="bold italic link ul"`, `data-counter="true"`. The value is HTML: clean it on the server, show it in `.prose`.

## Data, galleries and media

**Data table, more**: `data-moey-virtual` / `virtual: true` for thousands of rows; `detail: (row) => html` or `<template data-moey-detail>` for expandable rows; `children: [...]` or `<tr data-parent="id">` for tree rows; `groupBy: 'status'` / `data-moey-group-by` with `sum: true` / `data-moey-sum` for grouped rows. Never put a table inside a table cell.

**Masonry**: `<div class="masonry grid-cols-2 md:grid-cols-4 gap-3" data-moey-masonry>…items…</div>` (images need width/height); `span-2` wide items, `.masonry-dense` fills holes, add `data-moey-sortable` to rearrange, `data-moey-enter` (any list or grid) animates items added later. `.gallery-tile` + `.gallery-caption` for picture tiles.

**Filter & sort**: buttons in `<div data-moey-filters="#items">` with `data-moey-filter="tag"` (`"*"` = all) and `data-moey-sort-by="date"` (+ `data-moey-sort-dir="desc"`); items carry `data-tags="a b"` and `data-date`…; `data-moey-filter-search="#items"`, `data-moey-filter-count="#items"`, a `.filter-empty` inside.

**Infinite scroll**: `data-moey-infinite` on the list; `moey:load` → append items inside `e.detail.waitUntil(promise)`, call `e.detail.done()` on the last page. A "Load more" button takes over after 3 loads.

**Lightbox**: `data-moey-lightbox` on a gallery: `<a href="big.jpg" data-caption="…"><img src="small.jpg" alt="…"></a>` — also video (.mp4), audio (.mp3), YouTube/Vimeo links, `data-type="iframe"` pages/PDFs, `href="#template-id"` HTML. Parts: `data-moey-lightbox-thumbs="auto|always|never"`, `-counter`, `-caption`, `-zoom`, `-loop`, `-download`, `-share`, `-fullscreen`, `-slideshow="4000"` ("false" turns off). `data-moey-lightbox="name"` groups links across the page. `Moey.lightbox.open([...], options)`.

**Audio & video**: `<div class="player" data-moey-player><video src="…" poster="…"></video></div>` (or `<audio>`, with `.player-head` > `.player-cover` + `.player-title`); `data-moey-controls="speed volume captions pip fullscreen"` or `"none"`. A file that can't play shows a message + Try again by itself (`data-moey-error-text`, event `moey:player-error`). Embeds that load on click: `<a class="embed" href="https://www.youtube.com/watch?v=…" data-moey-embed><img src="cover.jpg" alt=""><span class="embed-play"></span><span class="embed-title">…</span></a>` (`.embed-9x16` for Shorts). Never paste a raw YouTube iframe.

**Marquee** (logos, testimonials, tickers): `<div class="marquee" data-moey-marquee aria-label="…"><ul class="marquee-group"><li>…</li></ul></div>` — `data-moey-speed`, `.marquee-reverse`, `.marquee-vertical` (with a height). It pauses on hover/focus and has a pause button; don't remove it without another way to stop it.

## Website sections

```html
<section class="hero hero-center"><div class="container"><div class="hero-body">
  <h1 class="hero-title">Run your shop from one place.</h1>
  <p class="hero-lead">…</p>
  <div class="hero-actions"><a class="btn btn-default btn-solid btn-lg" href="#">Start free</a></div>
</div></div></section>
```
`hero-split` + `hero-media` (text beside a picture) · `section` / `section-alt` · `section-head section-head-center` with `eyebrow`, `h2`, `p` · `feature-grid` > `feature` (`feature-icon`) · `pricing` > `price-card` (`is-featured`, `price`, `price-period`, `list-check`) · `testimonials` > `testimonial` · `cta cta-center` · `logo-cloud` · `stats` > `stat` · `footer` > `footer-grid`, `footer-links`, `footer-bottom`.

## Painted areas and themes

- `theme-<color>` on any element recolors the components inside (buttons, links, switches, focus).
- `theme-<color>-<strength>` paints an area (`theme-indigo-deep`, `theme-green-subtle`) and keeps everything inside readable. Use it for heroes, banners, colored sidebars, CTAs.
- Brand color for the whole site: `<html data-mo-brand="blue">` (default is black, "tuxedo").

## Entrance animations

`animate-fade-up` (also `fade-in fade-down fade-start fade-end zoom-in slide-up`), `delay-150`, `stagger` on a parent; `data-moey-animate="fade-up"` plays when scrolled into view. Reduced motion is respected automatically.

## JavaScript API (only when needed)

`Moey.toast()` · `Moey.confirm() / alert() / prompt()` · `Moey.open(el) / close(el)` · `Moey.tab()` · `Moey.tags()` · `Moey.chips()` · `Moey.toggle()` · `Moey.datatable()` · `Moey.select()` · `Moey.datepicker()` · `Moey.combobox()` · `Moey.palette()` · `Moey.notify()` · `Moey.clean(form)` · `Moey.chart()` · `Moey.kanban()` · `Moey.split()` · `Moey.calendar()` · `Moey.swipe()` · `Moey.refresh()` · `Moey.sortable()` · `Moey.timepicker()` · `Moey.chat()` · `Moey.shortcuts` · `Moey.tour()` · `Moey.marquee()` · `Moey.masonry()` · `Moey.filter()` · `Moey.infinite()` · `Moey.lightbox` · `Moey.player()`. Events are `moey:*` (e.g. `moey:select`, `moey:change`, `moey:open`, `moey:close`).

## Common mistakes to avoid

- ❌ `btn-primary`, `text-danger`, `bg-success` → ✅ `btn-default`, `text-red`, `bg-green`
- ❌ `d-flex justify-content-between` → ✅ `flex justify-between`
- ❌ `class="grid md:grid-cols-3"` thinking it's 12 columns on phones → it is 1 column, correct ✅
- ❌ `ml-4`, `pr-2`, `text-left` → ✅ `ms-4`, `pe-2`, `text-start`
- ❌ `<div onclick>` buttons → ✅ `<button>`
- ❌ Hard-coded `#fff` / `text-gray-500` → ✅ `bg-surface`, `text-muted`
- ❌ Writing JS for dropdowns, dialogs, tabs, tooltips, selects, datepickers → ✅ the markup above already works
- ❌ `<div class="progress"><div class="progress-bar">` (works, but) → ✅ `<progress class="progress" value="72" max="100">`
