Commit awal: prototipe UI SIAKAD Untan

This commit is contained in:
Ariyutta
2026-10-24 11:45:32 +07:00
commit d9b9cb5c0f
477 changed files with 51958 additions and 0 deletions
+125
View File
@@ -0,0 +1,125 @@
#!/usr/bin/env node
// Screenshots of the real product, for the page that sells it (imagery.md § 4).
//
// node capture.mjs <url | file.html> [--out <dir>] [--name <prefix>] [--routes /,/pricing]
// [--sizes desktop,phone] [--full] [--selector "<css>"] [--wait <ms>]
// [--dark] [--scale <1|2>]
// node capture.mjs --cdp <port> [--target "<window title>"] [--selector "<css>"] [--out <dir>] [--name <prefix>]
//
// --cdp attaches to a desktop app already running with a DevTools port (an Electron app started with
// --remote-debugging-port=<port>, a WebView2 or CEF app) and captures its window as it is.
//
// Opens each route at 1440 x 900 (desktop) and 390 x 844 (phone), waits for fonts and images,
// and writes PNGs into --out (default ./images/screens). It prints, for each file, its size and a
// ready <img> for a data-slot. --selector captures one element (a panel, a chart, a dialog) instead
// of the viewport; --full captures the whole scroll height. It never draws a browser bar or a device
// frame: the page frames the picture in the theme's material.
import { mkdirSync, existsSync, writeFileSync } from 'node:fs';
import { join, dirname, resolve, relative } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { createRequire } from 'node:module';
const HERE = dirname(fileURLToPath(import.meta.url));
const argv = process.argv.slice(2);
const flag = (k, d) => { const i = argv.indexOf(`--${k}`); return i >= 0 && argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[i + 1] : d; };
const has = (k) => argv.includes(`--${k}`);
const VALUED = new Set(['--out', '--name', '--routes', '--sizes', '--selector', '--wait', '--scale', '--cdp', '--target']);
const target = argv.find((a, i) => !a.startsWith('--') && !VALUED.has(argv[i - 1]));
if (!target && !has('cdp')) {
console.error('usage: node capture.mjs <url | file.html> [--out <dir>] [--name <prefix>] [--routes /,/pricing] [--sizes desktop,phone] [--full] [--selector "<css>"] [--wait <ms>] [--dark] [--scale 2]');
process.exit(2);
}
const out = resolve(flag('out', 'images/screens'));
const name = flag('name', 'screen').replace(/[^\w.-]+/g, '-').replace(/^\.+/, '') || 'screen';
const routes = flag('routes', '/').split(',').map((r) => r.trim()).filter(Boolean);
const sizes = flag('sizes', 'desktop,phone').split(',').map((s) => s.trim());
const wait = Number(flag('wait', '600'));
const scale = Number(flag('scale', '2'));
const selector = flag('selector', '');
const SIZES = { desktop: [1440, 900, false], laptop: [1280, 800, false], tablet: [834, 1112, true], phone: [390, 844, true] };
let puppeteer = null;
const roots = [process.env.HALLMARK_PUPPETEER, process.cwd(), HERE].filter(Boolean);
const globalRoot = async () => { try { const { execSync } = await import('node:child_process'); return dirname(execSync('npm root -g', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim()); } catch { return null; } };
for (const root of roots) {
for (const n of ['puppeteer-core', 'puppeteer']) {
try { puppeteer = (await import(pathToFileURL(createRequire(join(root, 'noop.js')).resolve(n)).href)).default; } catch {}
if (puppeteer) break;
}
if (puppeteer) break;
}
if (!puppeteer) { const g = await globalRoot(); for (const n of ['puppeteer-core', 'puppeteer']) { if (puppeteer || !g) break; try { puppeteer = (await import(pathToFileURL(createRequire(join(g, 'noop.js')).resolve(n)).href)).default; } catch {} } }
if (!puppeteer) { console.error('capture.mjs needs puppeteer-core or puppeteer (local, global or HALLMARK_PUPPETEER). Without it, take the screenshots with the harness or the OS (imagery.md § 4).'); process.exit(1); }
const CHROMES = [process.env.CHROME_PATH, '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '/Applications/Chromium.app/Contents/MacOS/Chromium', '/usr/bin/google-chrome', '/usr/bin/google-chrome-stable', '/usr/bin/chromium', '/usr/bin/chromium-browser', '/snap/bin/chromium', 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'];
const findChrome = () => { const c = CHROMES.find((x) => x && existsSync(x)); if (c) return c; try { const b = typeof puppeteer.executablePath === 'function' ? puppeteer.executablePath() : null; if (typeof b === 'string' && existsSync(b)) return b; } catch {} return null; };
const chrome = findChrome();
if (has('cdp')) {
const port = Number(flag('cdp', ''));
if (!Number.isInteger(port) || port < 1 || port > 65535) { console.error('--cdp takes the app\'s DevTools port, for example --cdp 9222'); process.exit(2); }
const want = flag('target', '').toLowerCase();
const app = await puppeteer.connect({ browserURL: `http://127.0.0.1:${port}`, defaultViewport: null }).catch((e) => { console.error(`no DevTools endpoint on port ${port}: ${e.message}`); process.exit(1); });
let page = null;
for (const pg of await app.pages()) { const t = (await pg.title().catch(() => '')).toLowerCase(); if (!want || t.includes(want)) { page = pg; break; } }
if (!page) { console.error(`no window${want ? ` titled like "${want}"` : ''} on port ${port}`); await app.disconnect(); process.exit(1); }
mkdirSync(out, { recursive: true });
const file = join(out, `${name}-app${selector ? '-part' : ''}.png`);
const el = selector ? await page.$(selector) : null;
if (selector && !el) { console.error(`no element matches ${selector}`); await app.disconnect(); process.exit(1); }
await (el || page).screenshot({ path: file });
const box = el ? await el.boundingBox() : await page.evaluate(() => ({ width: innerWidth, height: innerHeight }));
const dpr = await page.evaluate(() => devicePixelRatio).catch(() => 1);
const rel = relative(process.cwd(), file);
console.log(`${rel} ${Math.round(box.width * dpr)} x ${Math.round(box.height * dpr)} (app window)`);
console.log(` <img src="${rel}" width="${Math.round(box.width * dpr)}" height="${Math.round(box.height * dpr)}" alt="" loading="lazy">`);
await app.disconnect();
process.exit(0);
}
if (!chrome) { console.error('no Chrome or Chromium found; set CHROME_PATH'); process.exit(1); }
const isUrl = /^https?:\/\//i.test(target);
const urlFor = (route) => {
if (!isUrl) return pathToFileURL(resolve(target)).href;
const u = new URL(target);
if (route === '/') return u.href;
const r = new URL(route, u.origin);
return r.origin === u.origin ? r.href : null;
};
mkdirSync(out, { recursive: true });
const browser = await puppeteer.launch({ executablePath: chrome, headless: true });
const made = [];
try {
for (const route of isUrl ? routes : ['/']) {
for (const size of sizes) {
const [w, h, mobile] = SIZES[size] || SIZES.desktop;
const p = await browser.newPage();
if (has('dark')) await p.emulateMediaFeatures([{ name: 'prefers-color-scheme', value: 'dark' }]);
await p.setViewport({ width: w, height: h, deviceScaleFactor: scale, isMobile: mobile, hasTouch: mobile });
const to = urlFor(route);
if (!to) { console.log(`skip ${route}: not on ${new URL(target).origin}`); await p.close(); continue; }
const res = await p.goto(to, { waitUntil: 'networkidle2', timeout: 45000 }).catch((e) => ({ err: e.message }));
if (res && res.err) { console.log(`skip ${route} at ${size}: ${res.err}`); await p.close(); continue; }
await p.evaluate(async () => { if (document.fonts) await document.fonts.ready; for (const i of document.querySelectorAll('img[loading="lazy"]')) i.loading = 'eager'; await Promise.race([Promise.all([...document.images].filter((i) => !i.complete).map((i) => new Promise((r) => { i.onload = i.onerror = r; }))), new Promise((r) => setTimeout(r, 6000))]); }).catch(() => {});
await new Promise((r) => setTimeout(r, wait));
await p.bringToFront();
const slug = route === '/' ? 'home' : route.replace(/^\/|\/$/g, '').replace(/[^\w-]+/g, '-');
const file = join(out, `${name}-${slug}-${size}${selector ? '-part' : ''}.png`);
let shot;
if (selector) {
const el = await p.$(selector);
if (!el) { console.log(`skip ${route} at ${size}: no element matches ${selector}`); await p.close(); continue; }
shot = await el.screenshot({ path: file });
} else shot = await p.screenshot({ path: file, fullPage: has('full') });
const dims = await p.evaluate((full) => [innerWidth, full ? document.documentElement.scrollHeight : innerHeight], has('full'));
const box = selector ? await (await p.$(selector)).boundingBox() : { width: dims[0], height: dims[1] };
made.push({ file, w: Math.round(box.width * scale), h: Math.round(box.height * scale), route, size });
await p.close();
}
}
} finally { await browser.close(); }
for (const m of made) {
const rel = relative(process.cwd(), m.file);
console.log(`${rel} ${m.w} x ${m.h} (${m.route}, ${m.size})`);
console.log(` <img src="${rel}" width="${m.w}" height="${m.h}" alt="" loading="lazy">`);
}
if (!made.length) process.exitCode = 1;
else console.log(`\n${made.length} screenshot${made.length > 1 ? 's' : ''}. Look at each one before placing it: sample data only, nothing personal (names, emails, tokens), the screen in the state that tells the page's story.`);
@@ -0,0 +1,324 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Night Cellar: natural wine after five, Thursday to Sunday</title>
<meta name="description" content="Night Cellar is a natural wine shop and bar with 140 bottles on the list, open Thursday to Sunday from 5pm, with a tasting once a month.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Young+Serif&family=Instrument+Sans:wght@400;500;600&display=swap" rel="stylesheet">
<style>
/* Hallmark · job: visit · shape: Photographic · genre: atmospheric · theme: Spore (by request)
* hero: Settled · nav: floating pill · footer: statement · imagery: photographs, library 3, warm con=6 exp=-4 · signature: a pour into the decanter after five beside the head, with tonight's door in the nav · spore: cellar
* axes: dark/roman-serif/warm · posture: committed · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V4 · weakest: S, the photographs are a stand-in bar; every head carries a fact from the brief, the pour is pink like the one signal, and the nav reads tonight's door from the brief's hours */
/* Hallmark · hero-review: in-thread · ship · 0 findings · finish-review: subagent · fix · 5 findings · 5 resolved · gap: the maker's-log voice can name no bottle until the user gives the list */
:root {
color-scheme: dark;
--space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
--text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
--text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
--text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
--ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
--dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
--color-error: oklch(72% 0.15 27); --color-success: oklch(76% 0.13 150);
--container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
--z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
--color-paper: oklch(15% 0.01 60); --color-paper-2: oklch(19% 0.012 60); --color-paper-3: oklch(24% 0.02 50);
--color-ink: oklch(93% 0.02 85); --color-ink-2: oklch(88% 0.02 120); --color-muted: oklch(64% 0.02 70);
--color-rule: oklch(30% 0.015 60);
--color-accent: oklch(77% 0.09 30); --color-accent-2: oklch(86% 0.06 30); --color-accent-ink: oklch(15% 0.01 60); --color-focus: oklch(86% 0.06 30);
--font-display: "Young Serif", Georgia, serif; --font-body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
--font-outlier: "DM Mono", ui-monospace, monospace;
--radius-card: 12px; --radius-pill: 999px; --rule-hair: 1px;
--shadow-card: 0 12px 32px oklch(8% 0.01 60 / 0.35);
--tracking-display: -0.01em;
--grain: 0.15; --display-weight: 400;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); }
[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
/* photographs: warm con=6 exp=-4 */
[data-slot] > img { filter: sepia(0.28) saturate(0.94) contrast(1.06) brightness(0.96); }
/* Page */
*, *::before, *::after { box-sizing: border-box; }
.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-paper); }
.skip:focus-visible { top: var(--space-md); }
/* Controls: the theme's pair */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-pill); font: 600 var(--text-md)/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background: var(--color-accent-2); }
.btn--secondary { background: transparent; color: var(--color-ink); box-shadow: inset 0 0 0 1.5px var(--color-ink-2); }
.btn--secondary:hover { background: var(--color-paper-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
/* Nav: a floating pill on a blur, the genre's one glass */
.nav { position: fixed; top: var(--space-md); left: 0; right: 0; z-index: var(--z-sticky-nav); display: flex; justify-content: center; padding-inline: var(--gutter); pointer-events: none; }
.nav__pill { pointer-events: auto; display: flex; align-items: center; gap: var(--space-xl); min-height: 56px; padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) var(--space-lg); border-radius: var(--radius-pill); background: color-mix(in oklab, var(--color-paper-2) 74%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-ink) 9%, transparent); }
.wordmark { font: 400 var(--text-lg)/1 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-ink); text-decoration: none; white-space: nowrap; }
.nav__links { display: flex; gap: var(--space-lg); margin: 0; padding: 0; list-style: none; }
.nav__links a { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); text-decoration: none; text-underline-offset: 0.3em; white-space: nowrap; }
.nav__links a:hover { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); }
.nav__links a:active { color: var(--color-accent-2); }
.wordmark:focus-visible, .nav__links a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; border-radius: var(--radius-pill); }
.nav__door { margin: 0; padding-right: var(--space-lg); font-size: var(--text-sm); color: var(--color-muted); white-space: nowrap; }
/* Photographs */
.photo { position: relative; margin: 0; border-radius: var(--radius-card); }
.photo > img { border-radius: inherit; outline: var(--rule-hair) solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; }
/* Hero: Settled, the pour standing beside the head */
.hero { display: grid; align-items: center; min-height: 100dvh; padding-block: calc(56px + var(--space-xl)) var(--space-lg); box-sizing: border-box; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, min(35rem, 42%)); column-gap: var(--space-3xl); align-items: center; }
.hero__text { display: grid; gap: var(--space-lg); }
.hero__text h1 { max-width: 13ch; }
.hero__text .lead { color: var(--color-ink-2); max-width: 34ch; }
.hero__text .actions { margin-top: var(--space-md); }
.hero__photo { aspect-ratio: 5 / 6; max-height: calc(100dvh - 56px - var(--space-3xl) - var(--space-xl)); }
@media (max-width: 60rem) {
.nav { padding-inline: var(--space-md); }
.nav__pill { gap: var(--space-md); padding-left: var(--space-md); }
.nav__links { display: none; }
.hero { min-height: 0; padding-block: calc(56px + var(--space-3xl)) var(--space-2xl); }
.hero__grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); }
.hero__photo { max-height: none; }
}
/* Grain: the theme's speck, on a band or a panel, never on a photograph */
.grained { position: relative; isolation: isolate; }
.grained::after { content: ""; position: absolute; inset: 0; z-index: var(--z-base); border-radius: inherit; pointer-events: none; opacity: var(--grain); mix-blend-mode: screen;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"); }
.grained > * { position: relative; z-index: var(--z-raised); }
/* The list: the racks edge to edge, the head on a grained plate across its foot */
.list { padding-top: var(--section-gap); }
.list__photo { aspect-ratio: 21 / 9; }
.plate { display: grid; gap: var(--space-md); width: min(100%, 37rem); margin: calc(-1 * var(--space-4xl)) 0 0 var(--space-2xl); padding: var(--space-xl); border-radius: var(--radius-card); background: var(--color-paper-2); box-shadow: var(--shadow-card); z-index: var(--z-raised); }
.plate__more { color: var(--color-ink-2); }
/* Four nights: the week set in type, the open nights lit, the dark ones left dim */
.nights { margin-top: var(--section-gap); }
.statement { max-width: 18ch; font-size: var(--text-display); line-height: 1.02; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: var(--space-3xl) 0 0; padding: 0; list-style: none; border-top: var(--rule-hair) solid var(--color-rule); }
.week__day { display: grid; gap: var(--space-xs); padding: var(--space-lg) var(--space-md) 0 0; }
.week__name { font: 400 var(--text-xl)/1.1 var(--font-display); letter-spacing: var(--tracking-display); }
.week__hours { font-size: var(--text-sm); color: var(--color-ink-2); }
.week__day.is-open { box-shadow: inset 0 2px 0 var(--color-ink); }
.week__day.is-shut .week__name, .week__day.is-shut .week__hours { color: var(--color-muted); }
.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap-columns); margin-top: var(--space-3xl); }
.way { display: grid; gap: var(--space-sm); padding-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }
.way h3 { font-size: var(--text-section); max-width: none; }
.way p { font-size: var(--text-lead); color: var(--color-ink-2); }
/* Tastings: the one band, grained, the price in pink */
.tastings { margin-top: var(--section-gap-s); padding-block: var(--section-gap-s); background: var(--color-paper-3); }
.tastings__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: center; }
.tastings__text { display: grid; gap: var(--space-lg); padding-right: var(--space-2xl); }
.tastings__text > p:not([class]) { color: var(--color-ink-2); }
.price { display: flex; align-items: baseline; gap: var(--space-sm); margin-top: var(--space-xs); color: var(--color-ink-2); font-size: var(--text-lead); }
.price__figure { font: 400 var(--text-display-s)/1 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-accent); font-variant-numeric: lining-nums tabular-nums; }
.tastings__photo { aspect-ratio: 5 / 4; min-height: 440px; }
.fill { padding: 0 0.25em; border: 1px dashed color-mix(in oklch, var(--color-muted) 70%, transparent); border-radius: 3px; color: var(--color-muted); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.signup { display: grid; gap: var(--space-xs); margin-top: var(--space-xs); }
.signup label { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.signup__row { display: flex; gap: var(--space-xs); }
.signup input { flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--space-md); border: 1.5px solid var(--color-ink-2); border-radius: 0; background: var(--color-paper-2); color: var(--color-ink); outline: 2px solid transparent; outline-offset: -4px; }
.signup input:hover { background: var(--color-paper); }
.signup input:focus-visible { outline-color: var(--color-focus); }
.signup input[aria-invalid] { border-color: var(--color-error); }
.signup input:disabled { opacity: 0.55; cursor: not-allowed; }
.signup__help { min-height: 1lh; font-size: var(--text-sm); color: var(--color-muted); }
/* Footer: a statement, then the facts and links */
.footer { padding-block: var(--section-gap-l) var(--space-2xl); }
.footer__line { max-width: 16ch; font-size: var(--text-display); line-height: 1.02; }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-lg); margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }
.footer__where { color: var(--color-ink-2); }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-lg); margin: 0; padding: 0; list-style: none; }
.footer__links a { color: var(--color-ink); text-decoration-color: var(--color-muted); white-space: nowrap; }
.footer__links a:hover { text-decoration-color: var(--color-accent); }
.footer__links a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.legal { margin-top: var(--space-xl); font-size: var(--text-sm); color: var(--color-muted); }
.credits { max-width: 80ch; margin-top: var(--space-xs); font-size: var(--text-sm); line-height: 1.6; color: var(--color-muted); }
.credits span { white-space: nowrap; }
.credits a { color: inherit; text-decoration-color: color-mix(in oklab, var(--color-muted) 50%, transparent); text-underline-offset: 0.2em; }
.credits a:hover { text-decoration-color: var(--color-accent); }
@media (max-width: 60rem) {
.plate { margin: calc(-1 * var(--space-2xl)) 0 0; padding: var(--space-lg); }
.list__photo { aspect-ratio: 4 / 3; }
.week { grid-template-columns: minmax(0, 1fr); margin-top: var(--space-2xl); border-top: 0; }
.week__day { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; padding: var(--space-sm) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.week__day.is-open { box-shadow: none; }
.week__name { font-size: var(--text-lg); }
.ways { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); margin-top: var(--space-3xl); }
.statement, .footer__line { font-size: var(--text-section); }
.tastings__grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); }
.tastings__text { padding-right: 0; }
.tastings__photo { min-height: 0; }
}
@media (max-width: 40rem) {
.signup__row { flex-direction: column; }
}
</style>
<script>document.documentElement.classList.add('js');</script>
</head>
<body>
<a class="skip" href="#main">Skip to content</a>
<header class="nav">
<nav class="nav__pill" aria-label="Main">
<a class="wordmark" href="#top" aria-label="Night Cellar, home">Night Cellar</a>
<ul class="nav__links" role="list">
<li><a href="#list">The list</a></li>
<li><a href="#tastings">Tastings</a></li>
<li><a href="#find">Find us</a></li>
</ul>
<p class="nav__door" role="status" id="door">Open Thursday to Sunday</p>
</nav>
</header>
<main id="main">
<section class="hero" id="top" aria-labelledby="hero-title">
<div class="container hero__grid">
<div class="hero__text">
<h1 id="hero-title">Natural wine after five.</h1>
<p class="lead">A shop and bar with 140 bottles on the list.</p>
<div class="actions">
<a class="btn btn--primary" href="#tastings">Get the tasting date</a>
<a class="btn btn--secondary" href="#find">Find us</a>
</div>
</div>
<figure class="photo hero__photo" data-slot="hero" data-alt="A glass being poured at the bar after five">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Pouring_wine_into_a_decanter.jpg/1280px-Pouring_wine_into_a_decanter.jpg" width="3872" height="2592" fetchpriority="high" alt="Wine poured from a bottle into a glass decanter in low light" style="object-position: 42% 50%">
</figure>
</div>
</section>
<section class="list" id="list" aria-labelledby="list-title">
<div class="container">
<figure class="photo list__photo" data-slot="photo-1" data-alt="The bottles on the list, racked in the shop">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Schramsberg_Vineyards%2C_July_2019-7579%2B7580.jpg/1280px-Schramsberg_Vineyards%2C_July_2019-7579%2B7580.jpg" width="6244" height="3903" loading="lazy" alt="A long cellar aisle between racks of bottles laid neck down" style="object-position: 50% 60%">
</figure>
<div class="plate grained">
<h2 id="list-title">Every bottle here is natural.</h2>
<p class="plate__more">The full list: <span class="fill" data-fill="list">link to come</span>.</p>
</div>
</div>
</section>
<section class="nights" aria-labelledby="nights-title">
<div class="container">
<h2 id="nights-title" class="statement">Four nights a week, Thursday to Sunday.</h2>
<ol class="week" role="list" aria-label="Opening hours">
<li class="week__day is-shut"><span class="week__name">Monday</span><span class="week__hours">Closed</span></li>
<li class="week__day is-shut"><span class="week__name">Tuesday</span><span class="week__hours">Closed</span></li>
<li class="week__day is-shut"><span class="week__name">Wednesday</span><span class="week__hours">Closed</span></li>
<li class="week__day is-open"><span class="week__name">Thursday</span><span class="week__hours">From 5pm</span></li>
<li class="week__day is-open"><span class="week__name">Friday</span><span class="week__hours">From 5pm</span></li>
<li class="week__day is-open"><span class="week__name">Saturday</span><span class="week__hours">From 5pm</span></li>
<li class="week__day is-open"><span class="week__name">Sunday</span><span class="week__hours">From 5pm</span></li>
</ol>
<div class="ways">
<div class="way">
<h3>The bar</h3>
<p>Open a bottle and stay.</p>
</div>
<div class="way">
<h3>The shop</h3>
<p>Take one home.</p>
</div>
</div>
</div>
</section>
<section class="tastings grained" id="tastings" aria-labelledby="tastings-title">
<div class="container tastings__grid">
<div class="tastings__text">
<h2 id="tastings-title">A tasting, once a month.</h2>
<p class="price"><span class="price__figure">£25</span> a place</p>
<p>The next date is <span class="fill" data-fill="date">to be announced</span>.</p>
<form class="signup" data-endpoint="" novalidate>
<label for="email">Email for the date</label>
<div class="signup__row">
<input id="email" name="email" type="email" autocomplete="email" inputmode="email" required>
<button class="btn btn--primary" type="submit">Send me the date</button>
</div>
<p class="signup__help" id="email-help" aria-live="polite"></p>
</form>
</div>
<figure class="photo tastings__photo" data-slot="photo-2" data-alt="Glasses poured for a tasting">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e3/Wine_being_poured_into_a_glass.jpg/1280px-Wine_being_poured_into_a_glass.jpg" width="1955" height="1300" loading="lazy" alt="A taste of red wine poured into a glass held by its stem" style="object-position: 62% 50%">
</figure>
</div>
</section>
</main>
<footer class="footer" id="find" aria-labelledby="find-title">
<div class="container">
<h2 id="find-title" class="footer__line">Find us after five.</h2>
<div class="footer__row">
<p class="footer__where"><span class="fill" data-fill="address">Address to be announced</span></p>
<ul class="footer__links" role="list">
<li><a href="#list">The list</a></li>
<li><a href="#tastings">Tastings</a></li>
</ul>
</div>
<p class="legal">&copy; 2026 Night Cellar</p>
<p class="credits" data-credits>Photographs: <a href="https://commons.wikimedia.org/wiki/File:Pouring_wine_into_a_decanter.jpg">suksim</a> <span>(CC BY 2.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Schramsberg_Vineyards,_July_2019-7579%2B7580.jpg">Frank Schulenburg</a> <span>(CC BY-SA 4.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Wine_being_poured_into_a_glass.jpg">Fabio Ingrosso</a> <span>(CC BY 2.0)</span>, via Wikimedia Commons.</p>
</div>
</footer>
<script>window.hallmarkSlots = (m) => { for (const [k, v] of Object.entries(m)) { const s = document.querySelector(`[data-slot="${k}"]`); if (!s) continue; const im = new Image(); im.src = typeof v === 'string' ? v : v.src; im.alt = (typeof v === 'object' && v.alt) || s.dataset.alt || ''; s.querySelectorAll(':scope > img').forEach((o) => o.remove()); s.prepend(im); } };
document.querySelectorAll('[data-slot] > img').forEach((i) => { if (i.complete && !i.naturalWidth) i.remove(); else i.addEventListener('error', () => i.remove(), { once: true }); });</script>
<script>
(() => {
const door = document.getElementById('door');
if (door) door.textContent = [4, 5, 6, 0].includes(new Date().getDay()) ? 'Open tonight from 5pm' : 'Opens Thursday at 5pm';
document.querySelectorAll('form[data-endpoint]').forEach((form) => {
const input = form.querySelector('input'), help = form.querySelector('[aria-live]');
form.addEventListener('submit', (e) => {
e.preventDefault();
const ok = input.checkValidity();
input.toggleAttribute('aria-invalid', !ok);
if (!ok) { input.setAttribute('aria-describedby', help.id); help.textContent = 'That address looks incomplete. Write it as name@example.com.'; input.focus(); return; }
if (!form.dataset.endpoint) { help.textContent = 'Nothing was sent: this form is not connected yet.'; return; }
fetch(form.dataset.endpoint, { method: 'POST', body: new FormData(form) })
.then((r) => { help.textContent = r.ok ? 'The date goes to ' + input.value.trim() + '.' : 'That did not go through. Try again in a minute.'; })
.catch(() => { help.textContent = 'That did not go through. Try again in a minute.'; });
});
});
})();
</script>
</body>
</html>
@@ -0,0 +1,363 @@
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Fenwick and Daughters, coffee roasted in York since 1921</title>
<meta name="description" content="Fenwick and Daughters roasts six coffees a week in York, sold in 250 g bags or by subscription.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Grenze+Gotisch:wght@600&family=Hanken+Grotesk:wght@400;500;600&family=IBM+Plex+Mono:wght@400&display=swap" rel="stylesheet">
<style>
/* Hallmark · job: buy · shape: Trade Ledger (custom: the roast as a Poster, the house's day book set as its own ledger, the cup as a pair, the order on the pigment) · genre: editorial · theme: Vellum (by request)
* hero: Poster · nav: masthead, the blackletter wordmark centred over a double rule, one link at each end · footer: letter close · imagery: photographs, library 3, warm con=6 · signature: the roast itself, beans swept round the cooling tray full-bleed under a parchment plate · vellum: parchment
* axes: light/blackletter/cool · posture: committed · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R4 V4 · weakest: E, the plate must not bury the hand and the falling beans; it rests on the tray's far side and the plain wall, so the stream and the lever stay clear */
/* Hallmark · hero-review: in-thread · fix · 1 finding · 1 resolved (the head breaks after York) */
/* Hallmark · finish-review: in-thread (the subagent limit was reached) · fix · 3 findings · 1 resolved (the order head failed the swap test, then its blackletter I read as J: now 250 g bags, or a subscription) · 2 answered (the pair's captions are card facts, imagery.md 5; the pair are the closest honest frames the library holds) · gap: none */
/* Hallmark · answered F4 · the order field inverts the primary to parchment on pigment, as the theme's own hint sets it for its one field */
:root {
color-scheme: light;
--space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
--text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
--text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
--text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
--ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
--dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
--color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150);
--container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
--z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
--color-paper: oklch(93% 0.025 80); --color-paper-2: oklch(89% 0.03 78); --color-paper-3: oklch(85% 0.032 76);
--color-ink: oklch(22% 0.02 60); --color-ink-2: oklch(30% 0.02 60); --color-muted: oklch(46% 0.02 65);
--color-rule: oklch(74% 0.03 75);
--color-accent: oklch(42% 0.16 275); --color-accent-deep: oklch(34% 0.15 275); --color-accent-ink: oklch(94% 0.02 80);
--color-focus: oklch(50% 0.17 275); --color-field: var(--color-accent);
--font-display: "Grenze Gotisch", ui-serif, Georgia, serif; --font-body: "Hanken Grotesk", ui-sans-serif, sans-serif;
--font-outlier: "IBM Plex Mono", ui-monospace, monospace;
--radius-card: 2px; --radius-pill: 2px; --rule-hair: 1px; --shadow-card: none;
--tracking-display: -0.01em; --fibre: 0.5;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); }
[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
/* photographs: warm con=6 */
[data-slot] > img { filter: sepia(0.28) saturate(0.94) contrast(1.06); }
:root {
--mast-h: 80px;
--plate-w: 37rem;
--color-field: var(--color-accent);
}
/* The fibre wash: long tan fibres, stitched so they never tile (texture.md, the low-frequency wash) */
.fibre { position: relative; isolation: isolate; }
.fibre::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: var(--fibre); mix-blend-mode: multiply; pointer-events: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.02' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.62 0 0 0 0 0.52 0 0 0 0 0.36 0 0 0 0.3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"); }
/* Type */
h1, h2 { font-weight: 600; line-height: 0.92; color: var(--color-ink); }
h3 { font-family: var(--font-body); font-weight: 600; }
.lead { color: var(--color-ink-2); }
/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--space-lg); border: var(--rule-hair) solid var(--color-ink); border-radius: var(--radius-card); background: transparent; color: var(--color-ink); font: 500 var(--text-md)/1 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.btn:hover { background: var(--color-paper-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background: var(--color-accent-deep); border-color: var(--color-accent-deep); }
.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); }
.skip:focus-visible { top: var(--space-md); }
/* Masthead */
.mast__bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; min-height: calc(var(--mast-h) - 4px); border-bottom: 4px double var(--color-ink); }
.wordmark { font: 600 2rem/1 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-ink); text-decoration: none; white-space: nowrap; padding-block: var(--space-sm); }
.mast__link { justify-self: start; font: 600 var(--text-sm)/1 var(--font-body); color: var(--color-ink); padding-block: var(--space-sm); text-decoration: underline 1px; text-decoration-color: transparent; text-underline-offset: 0.3em;
transition: text-decoration-color var(--dur-short) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.mast__link--end { justify-self: end; }
.mast__link:hover { text-decoration-color: var(--color-accent); color: var(--color-accent); }
.wordmark:focus-visible, .mast__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
/* Hero: the roast, full-bleed, under a parchment plate */
.hero { position: relative; height: calc(100dvh - var(--mast-h)); min-height: 36rem; overflow: hidden; background: var(--color-ink); color: var(--color-paper); }
.hero__photo { position: absolute; inset: 0; margin: 0; }
.hero__photo > img { object-position: 50% 62%; }
.hero__inner { position: relative; z-index: var(--z-raised); height: 100%; display: flex; align-items: flex-end; justify-content: flex-end; padding-bottom: var(--space-2xl); box-sizing: border-box; }
.plate { width: min(100%, var(--plate-w)); box-sizing: border-box; padding: var(--space-xl); background: var(--color-paper); color: var(--color-ink); border-top: 4px double var(--color-ink); border-radius: var(--radius-card); }
.plate h1 { font-size: var(--text-display); max-width: 16ch; }
.plate .lead { margin-top: var(--space-lg); max-width: 30ch; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-xl); }
@media (max-width: 60rem) {
.hero { height: auto; min-height: 0; background: none; color: var(--color-ink); overflow: visible; }
.hero__photo { position: relative; aspect-ratio: 4 / 3; }
.hero__inner { height: auto; padding-bottom: 0; }
.plate { width: 100%; padding: var(--space-xl) 0 0; background: none; border-top: 0; }
.plate.fibre::before { display: none; }
.wordmark { font-size: 1.875rem; }
}
@media (max-width: 40rem) {
.mast__bar { grid-template-columns: auto; justify-items: center; row-gap: var(--space-2xs); padding-block: var(--space-xs); }
.mast__link { display: none; }
}
/* Shared section grid: one container, twelve columns, one column gap */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); }
.band { background: var(--color-paper-2); padding-block: var(--section-gap-s); }
.photo { margin: 0; border-radius: var(--radius-card); }
.photo > img { outline: var(--rule-hair) solid var(--color-rule); outline-offset: -1px; }
figcaption { margin-top: var(--space-sm); font: 500 var(--text-sm)/1.4 var(--font-body); color: var(--color-muted); }
/* The day book: the house's ledger on the fibre band, the entries kept in the hand of the wordmark */
.ledger__grid { align-items: start; }
.ledger__text { grid-column: 1 / span 4; position: sticky; top: var(--space-2xl); }
.ledger__text h2 { font-size: var(--text-display); max-width: 9ch; }
.ledger .lead { margin-top: var(--space-lg); max-width: 22ch; }
.ledger__book { grid-column: 6 / span 7; }
.book { width: 100%; border-collapse: collapse; font-size: var(--text-lg); line-height: 1.35; }
.book thead th { padding: 0 0 var(--space-sm); border-bottom: 4px double var(--color-ink); font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-muted); text-align: left; }
.book td, .book tbody th { padding: var(--space-lg) 0; border-top: var(--rule-hair) solid var(--color-rule); vertical-align: baseline; }
.book tbody tr:first-child > * { border-top: 0; }
.book tbody tr:last-child > * { border-bottom: var(--rule-hair) solid var(--color-ink); }
.book tbody th { font-weight: 500; text-align: left; color: var(--color-ink); }
.book .idx { width: 3.5rem; font-weight: 600; color: var(--color-accent); }
.book .r, .book thead th.r { text-align: right; }
.book td.r { font: 600 var(--text-2xl)/1 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-ink); }
.book td.r .unit { font: 500 var(--text-md)/1 var(--font-body); color: var(--color-ink-2); }
.book .num { font-variant-numeric: lining-nums tabular-nums; }
/* The cup: one wide frame, then a pair, each with its fact */
.cup { padding-top: var(--section-gap-l); }
.cup__head { align-items: end; }
.cup__head h2 { grid-column: 1 / span 6; }
.cup__head .lead { grid-column: 8 / span 5; }
.cup__pair { margin-top: var(--space-2xl); }
.cup__pair > figure { margin: 0; }
.cup__note { grid-column: 1 / span 7; }
.cup__cup { grid-column: 8 / span 5; }
.cup__pair .photo { height: 34rem; }
/* The order, on the one pigment field */
.order-band { margin-top: var(--section-gap-s); padding-block: var(--section-gap-s); background: var(--color-field); color: var(--color-accent-ink); }
.order-band h2 { color: var(--color-accent-ink); }
.order-band .lead { margin-top: var(--space-md); color: var(--color-accent-ink); }
.order-band :focus-visible { outline-color: var(--color-accent-ink); }
.order { align-items: center; }
.order__text { grid-column: 1 / span 6; }
.order__fields { grid-column: 8 / span 5; display: grid; gap: var(--space-lg); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); margin: var(--space-xl) 0 0; padding: 0; border: 0; }
.field label { font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-accent-ink); }
.seg input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.seg label { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-accent-ink); border-radius: var(--radius-card); font-weight: 500; cursor: pointer;
transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.seg label:hover { background: var(--color-accent-deep); }
.seg input:checked + label { background: var(--color-accent-ink); color: var(--color-accent); }
.seg input:focus-visible + label { outline: 2px solid var(--color-accent-ink); outline-offset: 2px; }
.field { display: grid; gap: var(--space-xs); }
.field input { min-height: 48px; padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-accent-ink); border-radius: var(--radius-card); background: var(--color-paper); color: var(--color-ink); outline: 2px solid transparent; outline-offset: 2px; }
.field input:focus-visible { outline-color: var(--color-accent-ink); }
.field input[aria-invalid] { border-color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); }
.field input:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--on-field { width: 100%; background: var(--color-accent-ink); border-color: var(--color-accent-ink); color: var(--color-accent); }
.btn--on-field:hover { background: var(--color-paper-2); border-color: var(--color-paper-2); }
.help { min-height: 1lh; font-size: var(--text-sm); color: var(--color-accent-ink); }
/* The letter close */
.letter { padding-block: var(--space-3xl) var(--space-2xl); }
.letter__inner { padding-top: var(--space-2xl); border-top: var(--rule-hair) solid var(--color-ink); }
.letter__sign { font-size: var(--text-lead); color: var(--color-ink-2); }
.letter__name { margin-top: var(--space-xs); font: 600 var(--text-display-s)/0.92 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-ink); }
.letter__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-md) var(--space-xl); margin-top: var(--space-2xl); }
.letter__nav { display: flex; flex-wrap: wrap; gap: var(--space-lg); }
.letter__nav a { font-size: var(--text-sm); color: var(--color-ink); text-decoration-color: var(--color-rule); text-underline-offset: 0.25em; transition: text-decoration-color var(--dur-short) var(--ease-out); }
.letter__nav a:hover { text-decoration-color: var(--color-accent); }
.letter__nav a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.legal { font-size: var(--text-sm); color: var(--color-muted); }
.letter__credit { flex: 1 0 100%; max-width: 88ch; font-size: var(--text-sm); line-height: 1.6; color: var(--color-muted); }
.letter__credit a { color: inherit; text-decoration-color: var(--color-rule); text-underline-offset: 0.25em; }
.letter__credit a:hover { color: var(--color-ink); text-decoration-color: var(--color-accent); }
@media (max-width: 60rem) {
.ledger__text, .ledger__book, .cup__head h2, .cup__head .lead, .cup__note, .cup__cup, .order__text, .order__fields { grid-column: 1 / -1; }
.ledger__text { position: static; }
.ledger__book { margin-top: var(--space-2xl); }
.book td.r { font-size: var(--text-xl); }
.cup__head .lead { margin-top: var(--space-md); }
.cup__pair { row-gap: var(--space-xl); }
.cup__pair .photo { height: auto; aspect-ratio: 4 / 3; }
.order__fields { margin-top: var(--space-xl); }
}
@media (max-width: 40rem) {
.book { font-size: var(--text-md); }
.book .idx { width: 2rem; }
}
</style>
<script>document.documentElement.classList.add('js');</script>
</head>
<body id="top">
<a class="skip" href="#main">Skip to content</a>
<header class="mast">
<div class="container mast__bar">
<a class="mast__link" href="#daybook">The day book</a>
<a class="wordmark" href="#top" aria-label="Fenwick and Daughters, back to the top">Fenwick and Daughters</a>
<a class="mast__link mast__link--end" href="#order">Order</a>
</div>
</header>
<main id="main">
<section class="hero" aria-labelledby="hero-h">
<figure class="hero__photo" data-slot="roaster" data-alt="The York roaster at work, a fresh roast tipping into the cooling tray">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Cooling_time_for_coffee.jpg/1280px-Cooling_time_for_coffee.jpg" width="1920" height="1348" fetchpriority="high"
alt="A fresh roast swept round the cooling tray by its paddle arm" style="object-position: 50% 55%">
</figure>
<div class="container hero__inner">
<div class="plate fibre">
<h1 id="hero-h">Roasted in York<br> since 1921</h1>
<p class="lead">Six coffees a week, sold by the bag or by subscription.</p>
<div class="actions">
<a class="btn btn--primary" href="#order" data-kind="subscription">Start a subscription</a>
<a class="btn" href="#order" data-kind="bag">Buy a bag</a>
</div>
</div>
</div>
</section>
<section class="ledger band fibre" id="daybook" aria-labelledby="ledger-h">
<div class="container split ledger__grid">
<div class="ledger__text">
<h2 id="ledger-h">Written in the day book</h2>
<p class="lead">Five lines the roastery keeps to.</p>
</div>
<div class="ledger__book">
<table class="book">
<thead>
<tr><th scope="col">No.</th><th scope="col">Entry</th><th scope="col" class="r">Kept</th></tr>
</thead>
<tbody>
<tr><td class="idx">1</td><th scope="row">Coffees roasted each week</th><td class="r"><span class="num">6</span></td></tr>
<tr><td class="idx">2</td><th scope="row">Weight of each bag</th><td class="r"><span class="num">250</span>&nbsp;<span class="unit">g</span></td></tr>
<tr><td class="idx">3</td><th scope="row">Ways to buy</th><td class="r">By the bag, or by subscription</td></tr>
<tr><td class="idx">4</td><th scope="row">Roastery</th><td class="r">York</td></tr>
<tr><td class="idx">5</td><th scope="row">Roasting since</th><td class="r"><span class="num">1921</span></td></tr>
</tbody>
</table>
</div>
</div>
</section>
<section class="cup" id="cup" aria-labelledby="cup-h">
<div class="container">
<div class="split cup__head">
<h2 id="cup-h">From a York drum to your kettle</h2>
<p class="lead">Fenwick and Daughters roasts the coffee. The cup is yours to make.</p>
</div>
<div class="split cup__pair">
<figure class="cup__note">
<div class="photo" data-slot="desk" data-alt="The York roaster between roasts, the drum over its cooling tray">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Coffee_roasting_machine%2C_The_Roastery%2C_Coaltown_Coffee%2C_Ammanford%2C_Wales.jpg/1280px-Coffee_roasting_machine%2C_The_Roastery%2C_Coaltown_Coffee%2C_Ammanford%2C_Wales.jpg" width="1920" height="2560" loading="lazy"
alt="A drum coffee roaster above its copper cooling tray in a roastery" style="object-position: 50% 69%">
</div>
<figcaption>Six coffees a week</figcaption>
</figure>
<figure class="cup__cup">
<div class="photo" data-slot="cup" data-alt="A cup of Fenwick and Daughters coffee on the shop counter">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Espresso_coffee_pouring_from_retro_espresso_machine.jpg/1280px-Espresso_coffee_pouring_from_retro_espresso_machine.jpg" width="1920" height="2876" loading="lazy"
alt="Espresso streaming from a chrome machine into two glass cups" style="object-position: 50% 62%">
</div>
<figcaption>Sold in 250&nbsp;g bags</figcaption>
</figure>
</div>
</div>
</section>
<section class="order-band" id="order" aria-labelledby="order-h">
<div class="container">
<form class="split order" data-endpoint="" novalidate>
<div class="order__text">
<h2 id="order-h">250&nbsp;g bags, or a subscription</h2>
<p class="lead">Tell the roastery which you would like, and where to reach you.</p>
<fieldset class="seg">
<legend class="visually-hidden">How would you like it?</legend>
<input type="radio" name="kind" id="kind-bag" value="bag" checked><label for="kind-bag">One 250&nbsp;g bag</label>
<input type="radio" name="kind" id="kind-sub" value="subscription"><label for="kind-sub">A subscription</label>
</fieldset>
</div>
<div class="order__fields">
<div class="field">
<label for="order-name">Full name</label>
<input id="order-name" name="name" type="text" autocomplete="name" required>
</div>
<div class="field">
<label for="order-email">Email address</label>
<input id="order-email" name="email" type="email" autocomplete="email" inputmode="email" required>
</div>
<button class="btn btn--on-field" type="submit">Send the order</button>
<p class="help" id="order-help" aria-live="polite"></p>
</div>
</form>
</div>
</section>
</main>
<footer class="letter">
<div class="container letter__inner">
<p class="letter__sign">With thanks from the roastery,</p>
<p class="letter__name">Fenwick and Daughters</p>
<div class="letter__foot">
<nav class="letter__nav" aria-label="Footer">
<a href="#daybook">The day book</a>
<a href="#cup">The cup</a>
<a href="#order">Order</a>
</nav>
<p class="legal">&copy; 2026 Fenwick and Daughters</p>
<p class="letter__credit" data-credits>Photographs: <a href="https://commons.wikimedia.org/wiki/File:Cooling_time_for_coffee.jpg">Jameswasswa</a> (CC&nbsp;BY-SA&nbsp;4.0), <a href="https://commons.wikimedia.org/wiki/File:Coffee_roasting_machine,_The_Roastery,_Coaltown_Coffee,_Ammanford,_Wales.jpg">Vouliagmeni</a> (CC&nbsp;BY-SA&nbsp;4.0), <a href="https://commons.wikimedia.org/wiki/File:Espresso_coffee_pouring_from_retro_espresso_machine.jpg">Shixart1985</a> (CC&nbsp;BY&nbsp;2.0), all on Wikimedia Commons.</p>
</div>
</div>
</footer>
<script>
window.hallmarkSlots = (m) => { for (const [k, v] of Object.entries(m)) { const s = document.querySelector(`[data-slot="${k}"]`); if (!s) continue; const im = new Image(); im.src = typeof v === 'string' ? v : v.src; im.alt = (typeof v === 'object' && v.alt) || s.dataset.alt || ''; s.querySelectorAll(':scope > img').forEach((o) => o.remove()); s.prepend(im); } };
document.querySelectorAll('[data-slot] > img').forEach((i) => { if (i.complete && !i.naturalWidth) i.remove(); else i.addEventListener('error', () => i.remove(), { once: true }); });
document.querySelectorAll('[data-kind]').forEach((a) => a.addEventListener('click', () => { const r = document.getElementById(a.dataset.kind === 'subscription' ? 'kind-sub' : 'kind-bag'); if (r) r.checked = true; }));
document.querySelectorAll('form[data-endpoint]').forEach((form) => {
const help = form.querySelector('[aria-live]');
const fields = [...form.querySelectorAll('input[required]')];
form.addEventListener('submit', (e) => {
e.preventDefault();
const bad = fields.filter((i) => !i.checkValidity());
fields.forEach((i) => { i.toggleAttribute('aria-invalid', bad.includes(i)); if (bad.includes(i)) i.setAttribute('aria-describedby', help.id); else i.removeAttribute('aria-describedby'); });
if (bad.length) { help.textContent = bad[0].type === 'email' ? 'That email address looks incomplete. Write it as name@example.com.' : 'Add your name, so the roastery knows who the coffee is for.'; bad[0].focus(); return; }
if (!form.dataset.endpoint) { help.textContent = 'Nothing was sent: this form is not connected yet.'; return; }
fetch(form.dataset.endpoint, { method: 'POST', body: new FormData(form) })
.then((r) => { help.textContent = r.ok ? 'The roastery has your order and will write to ' + form.elements.email.value.trim() + '.' : 'That did not go through. Try again in a minute.'; })
.catch(() => { help.textContent = 'That did not go through. Try again in a minute.'; });
});
});
</script>
</body>
</html>
@@ -0,0 +1,527 @@
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tilly, invoicing that chases late payments for you</title>
<meta name="description" content="Tilly is invoicing for freelancers that sends the reminders, logs the replies and marks invoices paid, for 8 pounds a month.">
<link rel="preconnect" href="https://api.fontshare.com" crossorigin>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600&amp;display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400&amp;display=swap" rel="stylesheet">
<style>
/* Hallmark · job: sign up · shape: Conversational FAQ, opened by the product · genre: modern-minimal · theme: Coral (by request)
* hero: Settled · nav: edge-aligned, the wordmark at the left, one link and one outlined pill at the right · footer: mast, the wordmark large over the links · imagery: product sample in hero, demo-2 and demo-3, photographs library 1 muted sepia=8 · signature: invoice 0042 being chased, live in the hero
* axes: light/grotesk-sans/warm · posture: restrained · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V5 · weakest: E, the built screens must read as one product at every width, so every inner length is in em on a container-unit base, the screens scale as a whole and re-lay themselves on a phone */
/* Hallmark · hero-review: subagent · fix · 5 findings · 5 resolved · finish-review: in-thread, the subagent limit was reached · ship · 1 finding · 1 resolved · gap: none */
:root {
color-scheme: light;
--space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
--text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
--text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
--text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
--ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
--dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
--color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150);
--container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
--z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
--color-paper: oklch(97% 0.006 55); --color-paper-2: oklch(94.5% 0.007 55); --color-paper-3: oklch(91.5% 0.009 55);
--color-ink: oklch(20% 0.010 35); --color-ink-2: oklch(27% 0.012 40); --color-muted: oklch(46% 0.012 45);
--color-rule: oklch(87% 0.009 55); --color-rule-2: oklch(81% 0.011 55);
--color-accent: oklch(74% 0.125 30); --color-accent-ink: oklch(20% 0.010 35); --color-accent-2: oklch(54% 0.165 29); --color-focus: oklch(54% 0.17 30);
--font-display: "General Sans", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display);
--font-outlier: "Geist Mono", ui-monospace, monospace;
--radius-card: 8px; --radius-input: 6px; --radius-pill: 999px; --rule-hair: 1px;
--shadow-card: 0 1px 2px oklch(20% 0.01 35 / 0.05);
--shadow-lift: 0 1px 2px oklch(20% 0.01 35 / 0.05), 0 18px 40px -22px oklch(20% 0.01 35 / 0.22);
--tracking-display: -0.025em; --display-weight: 600;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); }
[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
/* photographs: muted sepia=8 */
[data-slot] > img { filter: saturate(0.65) contrast(0.97) sepia(0.08); }
:root { --nav-h: 72px; --app-line: color-mix(in oklab, var(--color-ink) 8%, transparent); }
/* Chrome */
.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-input); background: var(--color-ink); color: var(--color-paper); }
.skip:focus-visible { top: var(--space-md); }
.site__in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: var(--nav-h); }
.wordmark { font: var(--display-weight) var(--text-xl)/1 var(--font-display); letter-spacing: -0.03em; text-decoration: none; color: var(--color-ink); }
.site__nav { display: flex; align-items: center; gap: var(--space-lg); }
.site__link { font-weight: 500; text-decoration: none; text-decoration-color: transparent; transition: text-decoration-color var(--dur-short) var(--ease-out); }
.site__link:hover { text-decoration: underline; text-decoration-color: var(--color-accent-2); text-underline-offset: 0.3em; }
.wordmark:focus-visible, .site__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: var(--space-2xs); border-radius: var(--space-3xs); }
/* Controls: the ink pill and the outlined pill */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 48px; padding: 0 var(--space-lg); border: 1px solid transparent; border-radius: var(--radius-pill); font: 500 var(--text-md)/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn--primary { background: var(--color-ink); color: var(--color-paper); }
.btn--primary:hover { background: var(--color-ink-2); }
.btn--secondary { border-color: var(--color-rule-2); background: transparent; color: var(--color-ink); }
.btn--secondary:hover { border-color: var(--color-ink); }
.btn--sm { min-height: 44px; padding: 0 var(--space-md); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
/* Hero: Settled, the text on one half and the product on the other */
.hero { display: grid; align-items: center; min-height: calc(100dvh - var(--nav-h)); padding-block: var(--space-xl); box-sizing: border-box; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-2xl); align-items: center; }
.hero__text { display: grid; gap: var(--space-lg); justify-items: start; }
.hero h1 { max-width: none; line-height: 1.02; }
.hang { margin-left: -0.46em; }
.hero .lead { max-width: 34ch; color: var(--color-ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-xs); }
/* The built product: one picture that scales as a whole; every inner length is in em of a design pixel times ten */
.slot { margin: 0; container-type: inline-size; }
.lifted { border-radius: var(--radius-card); box-shadow: var(--shadow-lift); outline: 1px solid var(--app-line); outline-offset: -1px; }
.app[data-slot] { background: var(--color-paper); }
.app--hero { aspect-ratio: 68 / 60; }
.ui { height: 100%; display: flex; flex-direction: column; font-size: calc(100cqi / 68); color: var(--color-ink); line-height: 1.35; }
.ui svg { width: 1.6em; height: 1.6em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fig { font-family: var(--font-outlier); font-weight: 400; font-variant-numeric: tabular-nums; }
.ui__bar { display: flex; align-items: center; gap: 2em; height: 5.6em; padding: 0 2.4em; border-bottom: 1px solid var(--color-rule); font-size: 1.3em; font-weight: 500; }
.ui__bar svg { width: 1.3em; height: 1.3em; }
.ui__mark { font-weight: 600; font-size: 1.25em; letter-spacing: -0.03em; }
.ui__chips { display: flex; gap: 0.4em; }
.ui__chip { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.45em 0.9em; border-radius: var(--radius-pill); color: var(--color-muted); }
.ui__chip.is-on { background: var(--color-paper-2); color: var(--color-ink); }
.ui__badge { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.4em; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font-size: 0.8em; font-weight: 600; box-sizing: border-box; }
.ui__input { display: inline-flex; align-items: center; gap: 0.6em; white-space: nowrap; margin-left: auto; height: 2.6em; padding: 0 1em; border: 1px solid var(--color-rule); border-radius: var(--radius-pill); color: var(--color-muted); font-weight: 400; }
.ui__control { display: inline-flex; align-items: center; gap: 0.4em; white-space: nowrap; height: 2.6em; padding: 0 1.1em 0 0.9em; border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-paper); }
.ui__head { display: flex; align-items: center; gap: 2em; padding: 2.4em 2.4em 1.6em; }
.ui__title { font-size: 2.4em; font-weight: 600; letter-spacing: -0.025em; line-height: 1; }
.ui__tags { display: flex; gap: 0.6em; font-size: 1.3em; font-weight: 500; }
.ui__tag { padding: 0.35em 0.9em; border: 1px solid var(--color-rule); border-radius: var(--radius-pill); color: var(--color-muted); }
.ui__tag.is-on { border-color: var(--color-ink); color: var(--color-ink); }
.ui__owed { display: grid; gap: 0.2em; margin-left: auto; text-align: right; font-size: 1.2em; font-weight: 500; color: var(--color-muted); }
.ui__owed b { font-size: 1.35em; color: var(--color-ink); }
.ledger { padding: 0 2.4em; font-size: 1.45em; }
.ledger__row { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) 5.2em 7.4em 7.6em; align-items: center; column-gap: 1.2em; min-height: 3.6em; border-top: 1px solid var(--color-rule); }
.ledger__row--head { min-height: 2.6em; border-top: 0; font-size: 0.86em; font-weight: 500; color: var(--color-muted); }
.ledger__row .r { text-align: right; }
.ledger__row .late { color: var(--color-accent-2); }
.ledger__row.is-open { margin: 0 -1em; padding: 0 1em; border-radius: 0.6em; border-top-color: transparent; background: color-mix(in oklab, var(--color-accent) 16%, var(--color-paper)); }
.ledger__row.is-open + .ledger__row { border-top-color: transparent; }
.status { display: inline-block; padding: 0.3em 0.75em; border: 1px solid var(--color-rule-2); border-radius: var(--radius-pill); font-size: 0.95em; font-style: normal; font-weight: 500; white-space: nowrap; }
.status--late { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-accent-ink); }
.status--done { border-color: var(--color-ink); background: var(--color-ink); color: var(--color-paper); }
.chase { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.4em; padding: 0.3em 0 1.2em; font-size: 0.95em; font-weight: 500; white-space: nowrap; }
.chase__status { display: inline-flex; align-items: center; gap: 0.45em; flex-shrink: 0; color: var(--color-ink-2); }
.chase__status svg { width: 1.2em; height: 1.2em; color: var(--color-muted); }
.chase__status b { font-weight: 400; color: var(--color-muted); }
.chase__status.is-late b { color: var(--color-accent-2); }
.chase__status.is-now { padding: 0.3em 0.85em 0.3em 0.65em; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); }
.chase__status.is-now svg { color: var(--color-accent-ink); }
.chase__status.is-now b { color: var(--color-accent-ink); }
.chase__note { margin-left: auto; color: var(--color-muted); font-weight: 400; }
/* The questions, in the order a freelancer asks them */
.q--work { padding-top: var(--section-gap-s); }
.q--receive { padding-top: var(--section-gap-l); }
.q--replies { padding-top: var(--section-gap); }
.q--paid { padding-block: var(--section-gap-l) var(--section-gap); }
.q__head { display: grid; gap: var(--space-md); margin-bottom: var(--space-2xl); }
.split, .rows, .band__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); }
.split { align-items: center; }
.split__text { display: grid; gap: var(--space-md); align-content: center; }
.split--work .split__text { grid-column: 1 / span 5; }
.split--work .photo { grid-column: 6 / span 7; }
.split--replies .app--replies { grid-column: 1 / span 8; }
.split--replies .split__text { grid-column: 9 / span 4; }
.photo { margin: 0; aspect-ratio: 4 / 3; border-radius: var(--radius-card); }
.photo > img { border-radius: inherit; outline: 1px solid color-mix(in oklab, var(--color-ink) 6%, transparent); outline-offset: -1px; }
/* The client's side: the reminder and the invoice it links to, straight on the paper */
.showcase { margin: 0; }
.showcase figcaption { margin-top: var(--space-md); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.client { aspect-ratio: 1312 / 640; }
.client[data-slot] { background: var(--color-paper); }
.client__in { height: 100%; box-sizing: border-box; display: flex; align-items: flex-start; gap: 4.8em; padding: 2.4em; font-size: calc(100cqi / 131.2); color: var(--color-ink); line-height: 1.4; }
.doc { background: var(--color-paper); border-radius: var(--radius-card); box-shadow: var(--shadow-lift); outline: 1px solid var(--app-line); outline-offset: -1px; }
.doc p { margin: 0; max-width: none; }
.mail { display: grid; flex: 76 1 0; min-width: 0; }
.mail__head { display: grid; gap: 1.6em; padding: 3.2em 4em 2.4em; border-bottom: 1px solid var(--color-rule); }
.mail__subject { font-size: 2.6em; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.mail__meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.45em 1.4em; font-size: 1.5em; }
.mail__meta span:nth-child(odd) { color: var(--color-muted); }
.mail__body { display: grid; gap: 1.8em; padding: 3.2em 4em 3.6em; line-height: 1.55; }
.mail__body p { font-size: 1.7em; }
.mail__link { justify-self: start; display: inline-flex; align-items: center; gap: 0.5em; margin-top: 0.6em; padding: 0.75em 1.25em 0.75em 1em; border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-paper); font-size: 1.5em; font-weight: 500; }
.doc svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mail__foot { padding: 2em 4em 2.4em; border-top: 1px solid var(--color-rule); color: var(--color-muted); }
.mail__foot span { font-size: 1.3em; }
.inv { display: grid; flex: 50 1 0; min-width: 0; gap: 3.2em; padding: 3.6em; margin-top: 4em; }
.inv__top { display: flex; align-items: center; justify-content: space-between; }
.inv__title { font-size: 2.8em; font-weight: 600; letter-spacing: -0.02em; }
.inv__title b { margin-left: 0.2em; }
.inv .status { font-size: 1.35em; }
.inv__parties, .inv__dates { display: flex; gap: 2em; font-size: 1.4em; color: var(--color-muted); }
.inv__parties span, .inv__dates span { flex: 1 1 0; display: grid; gap: 0.3em; }
.inv__parties b, .inv__dates b { color: var(--color-ink); font-weight: 500; }
.inv__dates b.late, .thread__steps b.late { color: var(--color-accent-2); }
.inv__lines { display: grid; grid-template-columns: minmax(0, 1fr) auto; font-size: 1.5em; border-top: 1px solid var(--color-ink); }
.inv__lines span { padding: 0.85em 0; border-bottom: 1px solid var(--color-rule); }
.inv__lines .fig { text-align: right; }
.inv__lines .inv__total { border-bottom: 0; font-weight: 600; }
.inv__pay { font-size: 1.35em; color: var(--color-muted); }
/* The replies screen */
.app--replies { aspect-ratio: 864 / 500; }
.app--replies .ui { font-size: calc(100cqi / 86.4); }
.inbox { flex: 1; display: grid; grid-template-columns: 30em minmax(0, 1fr); min-height: 0; }
.inbox__list { display: grid; align-content: start; gap: 0.4em; padding: 1.4em 1.2em; border-right: 1px solid var(--color-rule); }
.inbox__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35em 1em; padding: 1.1em 1.3em; border-radius: 0.6em; font-size: 1.35em; }
.inbox__item b { font-weight: 600; }
.inbox__item .fig { grid-row: 2; color: var(--color-muted); }
.inbox__date { grid-column: 2; grid-row: 1; color: var(--color-muted); }
.inbox__line { grid-column: 1 / -1; color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox__item.is-on { background: var(--color-paper-2); }
.thread { display: grid; align-content: start; gap: 2.4em; padding: 2.8em 3.2em; }
.thread__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5em 1em; }
.thread__who { font-size: 2.4em; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.thread__what { grid-row: 2; display: flex; gap: 1em; font-size: 1.4em; color: var(--color-muted); }
.thread__what b { color: var(--color-ink); font-weight: 400; }
.thread__head .status { grid-row: 1 / span 2; grid-column: 2; font-size: 1.3em; }
.thread__steps { list-style: none; margin: 0; padding: 0; font-size: 1.45em; border-top: 1px solid var(--color-ink); }
.thread__steps li { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto; align-items: center; column-gap: 0.8em; padding: 0.85em 0; border-bottom: 1px solid var(--color-rule); }
.thread__steps svg { width: 1.1em; height: 1.1em; color: var(--color-muted); }
.thread__steps b { font-weight: 400; color: var(--color-muted); }
.thread__steps .is-reply { border-bottom: 0; }
.thread__steps .is-reply svg, .thread__steps .is-reply span { color: var(--color-accent-2); }
.thread__quote { grid-column: 2 / -1; margin: 0.7em 0 0; padding: 1em 1.2em; border-radius: 0.6em; background: var(--color-paper-2); }
.thread__quote p { margin: 0; color: var(--color-ink); line-height: 1.45; }
.thread__quote cite { display: block; margin-top: 0.5em; font-size: 0.85em; font-style: normal; color: var(--color-muted); }
/* One invoice from sent to paid, as rows */
.rows { align-items: start; }
.rows__head { grid-column: 1 / span 4; display: grid; gap: var(--space-md); }
.life { grid-column: 5 / span 8; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--color-ink); }
.life li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; column-gap: var(--gap-columns); min-height: 88px; border-bottom: 1px solid var(--color-rule); }
.life__date { font-size: var(--text-lead); color: var(--color-muted); }
.life__what { font-size: var(--text-title); font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.life .status { font-size: var(--text-sm); }
/* The price, on the one ink band */
.band { padding-block: var(--section-gap-s); background: var(--color-ink); color: var(--color-paper); }
.band__grid { align-items: end; }
.band__text { grid-column: 1 / span 7; display: grid; gap: var(--space-md); }
.band h2 { color: var(--color-paper); }
.price { font: var(--display-weight) var(--text-display)/1 var(--font-display); letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; color: var(--color-paper); }
.band__line { font-size: var(--text-lead); color: var(--color-paper-3); }
.signup { grid-column: 8 / span 5; display: grid; gap: var(--space-xs); min-width: 0; }
.signup label { font-size: var(--text-sm); font-weight: 500; color: var(--color-paper-3); }
.signup__row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.signup input { flex: 1 1 12rem; min-width: 0; width: 100%; height: 48px; padding: 0 var(--space-md); border: 1px solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-paper); color: var(--color-ink); font-size: var(--text-md); outline: 2px solid transparent; outline-offset: -3px; transition: background-color var(--dur-short) var(--ease-out); }
.signup input:hover { background: var(--color-paper-2); }
.signup input:focus-visible { outline-color: var(--color-focus); }
.signup input[aria-invalid] { border-color: var(--color-error); }
.signup input:disabled { opacity: 0.55; cursor: not-allowed; }
.signup__help { min-height: 1lh; margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--color-paper-3); }
.btn--invert { background: var(--color-paper); color: var(--color-ink); }
.btn--invert:hover { background: var(--color-paper-2); }
/* The mast */
.mast { padding-block: var(--section-gap-s) var(--space-2xl); }
.mast__mark { margin-bottom: var(--space-2xl); font: var(--display-weight) clamp(7rem, 17vw, 15rem)/0.9 var(--font-display); letter-spacing: -0.045em; color: var(--color-ink); }
.mast__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); }
.mast__links { display: flex; flex-wrap: wrap; gap: var(--space-lg); }
.mast__links a { font-weight: 500; text-decoration-color: transparent; text-underline-offset: 0.3em; transition: text-decoration-color var(--dur-short) var(--ease-out); }
.mast__links a:hover { text-decoration-color: var(--color-accent-2); }
.mast__links a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: var(--space-2xs); border-radius: var(--space-3xs); }
.mast__legal { font-size: var(--text-sm); color: var(--color-muted); }
.mast__credit { margin-top: var(--space-md); font-size: var(--text-sm); line-height: 1.55; color: var(--color-muted); }
.mast__credit a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: color-mix(in oklab, currentColor 40%, transparent); }
.mast__credit a:hover { text-decoration-color: currentColor; }
@container (max-width: 40rem) {
.client__in { font-size: calc(100cqi / 48); padding: 1.2em; }
.inv, .inbox__list { display: none; }
.app--replies .ui { font-size: calc(100cqi / 48); }
.inbox { grid-template-columns: minmax(0, 1fr); }
.thread { padding: 2em; }
}
@container (max-width: 30rem) {
.ui { font-size: calc(100cqi / 40); }
.ui__input, .ui__chip:nth-child(2), .ui__owed, .chase__note, .chase__status:nth-child(1) { display: none; }
.ledger__row { grid-template-columns: minmax(0, 1fr) auto auto; }
.ledger__row > :nth-child(1), .ledger__row > :nth-child(3), .ledger__row:nth-child(n+8) { display: none; }
.chase { flex-wrap: wrap; row-gap: 0.6em; }
}
@media (max-width: 40rem) { .app--hero { aspect-ratio: 4 / 5; } .app--replies { aspect-ratio: 1 / 1; } .client { aspect-ratio: 5 / 7; } .hang { margin-left: -0.3em; } .life li { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-2xs); padding-block: var(--space-md); } .life__date { grid-column: 1 / -1; } }
@media (max-width: 60rem) {
.hero { min-height: 0; padding-block: var(--space-xl) var(--space-3xl); }
.hero__grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); }
.split, .rows, .band__grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); }
.split > *, .rows > *, .band__grid > *, .split--work .split__text, .split--work .photo, .split--replies .app--replies, .split--replies .split__text, .rows__head, .life, .band__text, .signup { grid-column: 1 / -1; }
.split--replies .split__text { order: -1; }
.life li { min-height: 72px; }
}
</style>
</head>
<body id="top">
<a class="skip" href="#main">Skip to content</a>
<header class="site">
<div class="container site__in">
<a class="wordmark" href="#top" aria-label="Tilly, back to the top">Tilly</a>
<nav class="site__nav" aria-label="Page">
<a class="site__link" href="#cost">Pricing</a>
<a class="btn btn--secondary btn--sm" href="#start">Sign up</a>
</nav>
</div>
</header>
<main id="main">
<section class="hero" aria-labelledby="hero-head">
<div class="container hero__grid">
<div class="hero__text">
<h1 id="hero-head">Never write<br><span class="hang">“</span>following&nbsp;up”<br>again.</h1>
<p class="lead">Invoicing for freelancers that sends reminders, logs replies and marks invoices paid.</p>
<div class="actions">
<a class="btn btn--primary" href="#start">Start for £8 a month</a>
<a class="btn btn--secondary" href="#receive">See a reminder</a>
</div>
</div>
<figure class="slot app app--hero lifted" data-slot="hero" data-alt="Your invoices screen, with one late invoice being chased" role="img" aria-label="The Tilly invoices screen: invoice 0042 for Example Kitchen, 380 pounds, due on 2 October, is being chased; its first reminder went on 5 October and the second this morning.">
<div class="ui" aria-hidden="true">
<div class="ui__bar">
<span class="ui__mark">Tilly</span>
<span class="ui__chips"><span class="ui__chip is-on">Invoices</span><span class="ui__chip">Clients</span><span class="ui__chip">Replies<b class="ui__badge">2</b></span></span>
<span class="ui__input"><svg aria-hidden="true" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>Search invoices</span>
<span class="ui__control"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M5 12h14"/><path d="M12 5v14"/></svg>New invoice</span>
</div>
<div class="ui__head">
<span class="ui__title">Invoices</span>
<span class="ui__tags"><span class="ui__tag is-on">All</span><span class="ui__tag">Chasing</span><span class="ui__tag">Paid</span></span>
<span class="ui__owed">Outstanding<b class="fig">£4,520.00</b></span>
</div>
<div class="ledger">
<div class="ledger__row ledger__row--head"><span>No.</span><span>Client</span><span>Due</span><span class="r">Amount</span><span>Status</span></div>
<div class="ledger__row"><span class="fig">0045</span><span>Example Press</span><span class="fig">23 Oct</span><span class="fig r">£1,450.00</span><span><i class="status">Sent</i></span></div>
<div class="ledger__row"><span class="fig">0044</span><span>Example Films</span><span class="fig">30 Sep</span><span class="fig r">£2,150.00</span><span><i class="status">Reply logged</i></span></div>
<div class="ledger__row"><span class="fig">0043</span><span>Example Florist</span><span class="fig">16 Oct</span><span class="fig r">£540.00</span><span><i class="status">Sent</i></span></div>
<div class="ledger__row is-open">
<span class="fig">0042</span><span>Example Kitchen</span><span class="fig late">2 Oct</span><span class="fig r">£380.00</span><span><i class="status status--late">Chasing</i></span>
<div class="chase">
<span class="chase__status is-done is-late"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg>Due<b class="fig">2 Oct</b></span>
<span class="chase__status is-done"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg>Reminder 1<b class="fig">5 Oct</b></span>
<span class="chase__status is-now"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/></svg>Reminder 2<b class="fig">Today, 09:00</b></span>
<span class="chase__note">No reply yet</span>
</div>
</div>
<div class="ledger__row"><span class="fig">0041</span><span>Example Bakery</span><span class="fig">26 Sep</span><span class="fig r">£960.00</span><span><i class="status status--done">Paid</i></span></div>
<div class="ledger__row"><span class="fig">0040</span><span>Example Gallery</span><span class="fig">19 Sep</span><span class="fig r">£1,200.00</span><span><i class="status status--done">Paid</i></span></div>
<div class="ledger__row"><span class="fig">0039</span><span>Example Theatre</span><span class="fig">12 Sep</span><span class="fig r">£640.00</span><span><i class="status status--done">Paid</i></span></div>
</div>
</div>
</figure>
</div>
</section>
<section class="q q--work" id="chase" aria-labelledby="q1">
<div class="container split split--work">
<div class="split__text">
<h2 id="q1">Do I still have to chase?</h2>
<p class="lead">No. Tilly writes to the client while you get on with the work.</p>
</div>
<figure class="photo" data-slot="photo-1" data-alt="Your own work in progress: the desk, bench or studio you invoice from">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Florist_working.jpg/1280px-Florist_working.jpg" width="1920" height="1280" loading="lazy" decoding="async"
style="object-position: 55% 45%" alt="Hands gathering green stems into a bouquet at a flower shop counter">
</figure>
</div>
</section>
<section class="q q--receive" id="receive" aria-labelledby="q2">
<div class="container">
<div class="q__head">
<h2 id="q2">What does my client receive?</h2>
<p class="lead">A short, polite reminder, with the invoice one click away.</p>
</div>
<figure class="showcase">
<div class="slot client" data-slot="demo-2" data-alt="A reminder as your client receives it, beside the invoice it links to" role="img" aria-label="The second reminder for invoice 0042 as Example Kitchen receives it: a short email saying the 380 pounds was due on 2 October, with a link to the invoice, beside the invoice itself marked overdue.">
<div class="client__in" aria-hidden="true">
<div class="doc mail">
<div class="mail__head">
<p class="mail__subject">Invoice 0042 is now 7 days overdue</p>
<div class="mail__meta">
<span>From</span><span>Example Studio</span>
<span>To</span><span>accounts@example.com</span>
<span>Sent</span><span class="fig">Today, 09:00</span>
</div>
</div>
<div class="mail__body">
<p>Hello,</p>
<p>A quick reminder that invoice 0042 for £380.00 was due on 2 October. You can see it in full from the link below.</p>
<p>Thank you,<br>Example Studio</p>
<span class="mail__link"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>View invoice 0042</span>
</div>
<p class="mail__foot"><span>Sent by Tilly for Example Studio</span></p>
</div>
<div class="doc inv">
<div class="inv__top"><span class="inv__title">Invoice <b class="fig">0042</b></span><i class="status status--late">Overdue</i></div>
<div class="inv__parties"><span>From<b>Example Studio</b></span><span>To<b>Example Kitchen</b></span></div>
<div class="inv__dates"><span>Issued<b class="fig">18 Sep 2026</b></span><span>Due<b class="fig late">2 Oct 2026</b></span></div>
<div class="inv__lines">
<span>Menu illustrations, six dishes</span><span class="fig">£300.00</span>
<span>Two rounds of changes</span><span class="fig">£80.00</span>
<span class="inv__total">Total</span><span class="fig inv__total">£380.00</span>
</div>
<p class="inv__pay">Pay by bank transfer, quoting 0042.</p>
</div>
</div>
</div>
<figcaption>Reminder 2 for invoice 0042, as Example Kitchen receives it.</figcaption>
</figure>
</div>
</section>
<section class="q q--replies" id="replies" aria-labelledby="q3">
<div class="container split split--replies">
<figure class="slot app app--replies lifted" data-slot="demo-3" data-alt="Your replies screen, with a client's answer filed under its invoice" role="img" aria-label="The Tilly replies screen: Example Films answered the first reminder for invoice 0044 on 3 October, sorry, this slipped through, we will pay on Friday, and the reply sits in the invoice's history under that reminder.">
<div class="ui" aria-hidden="true">
<div class="ui__bar">
<span class="ui__mark">Tilly</span>
<span class="ui__chips"><span class="ui__chip">Invoices</span><span class="ui__chip">Clients</span><span class="ui__chip is-on">Replies<b class="ui__badge">2</b></span></span>
<span class="ui__input"><svg aria-hidden="true" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>Search replies</span>
</div>
<div class="inbox">
<div class="inbox__list">
<div class="inbox__item is-on"><b>Example Films</b><span class="fig">0044</span><span class="fig inbox__date">3 Oct</span><span class="inbox__line">“Sorry, this slipped through…”</span></div>
<div class="inbox__item"><b>Example Bakery</b><span class="fig">0041</span><span class="fig inbox__date">30 Sep</span><span class="inbox__line">“Paying this week.”</span></div>
<div class="inbox__item"><b>Example Theatre</b><span class="fig">0039</span><span class="fig inbox__date">15 Sep</span><span class="inbox__line">“Can we settle on the 20th?”</span></div>
<div class="inbox__item"><b>Example Gallery</b><span class="fig">0040</span><span class="fig inbox__date">22 Sep</span><span class="inbox__line">“Paid this morning, thank you.”</span></div>
</div>
<div class="thread">
<div class="thread__head">
<span class="thread__who">Example Films</span>
<span class="thread__what">Invoice <b class="fig">0044</b><b class="fig">£2,150.00</b></span>
<i class="status">Reply logged</i>
</div>
<ol class="thread__steps">
<li><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg><span>Sent</span><b class="fig">16 Sep</b></li>
<li><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg><span>Due</span><b class="fig late">30 Sep</b></li>
<li><svg aria-hidden="true" viewBox="0 0 24 24"><path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/></svg><span>Reminder 1 sent</span><b class="fig">3 Oct, 09:00</b></li>
<li class="is-reply"><svg aria-hidden="true" viewBox="0 0 24 24"><polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/></svg><span>Reply logged</span><b class="fig">3 Oct, 11:42</b>
<blockquote class="thread__quote"><p>Sorry, this slipped through. We’ll pay on Friday.</p><cite>finance@example.com</cite></blockquote>
</li>
</ol>
</div>
</div>
</div>
</figure>
<div class="split__text">
<h2 id="q3">What if they write back?</h2>
<p class="lead">Tilly files the reply with the invoice it answers, beside every reminder that went out.</p>
</div>
</div>
</section>
<section class="q q--paid" id="paid" aria-labelledby="q4">
<div class="container rows">
<div class="rows__head">
<h2 id="q4">When does the chasing stop?</h2>
<p class="lead">When it’s paid. Tilly marks the invoice and stops asking.</p>
</div>
<ol class="life" aria-label="Invoice 0041, from sent to paid">
<li><span class="fig life__date">12 Sep</span><span class="life__what">Invoice 0041 sent to Example Bakery</span><i class="status">Sent</i></li>
<li><span class="fig life__date">26 Sep</span><span class="life__what">Due date passes, £960.00 owed</span><i class="status status--late">Overdue</i></li>
<li><span class="fig life__date">29 Sep</span><span class="life__what">Reminder 1 goes out</span><i class="status status--late">Chasing</i></li>
<li><span class="fig life__date">30 Sep</span><span class="life__what">Reply logged: “Paying this week.”</span><i class="status">Reply logged</i></li>
<li><span class="fig life__date">3 Oct</span><span class="life__what">Marked paid</span><i class="status status--done">Paid</i></li>
</ol>
</div>
</section>
<section class="band" id="cost" aria-labelledby="q5">
<div class="container band__grid">
<div class="band__text">
<h2 id="q5">What does it cost?</h2>
<p class="price">£8 a month.</p>
<p class="band__line">Start with your next invoice.</p>
</div>
<form class="signup" id="start" data-endpoint="" novalidate>
<label for="email">Email address</label>
<div class="signup__row">
<input id="email" name="email" type="email" autocomplete="email" inputmode="email" required aria-describedby="email-help">
<button class="btn btn--invert" type="submit">Start for £8 a month</button>
</div>
<p class="signup__help" id="email-help" aria-live="polite"></p>
</form>
</div>
</section>
</main>
<footer class="mast">
<div class="container">
<p class="mast__mark">Tilly</p>
<div class="mast__row">
<nav class="mast__links" aria-label="Footer">
<a href="#receive">What clients get</a>
<a href="#replies">Replies</a>
<a href="#cost">Pricing</a>
<a href="#start">Sign up</a>
</nav>
<p class="mast__legal">© 2026 Tilly. Invoicing for freelancers.</p>
</div>
<p class="mast__credit" data-credits>Photograph: <a href="https://commons.wikimedia.org/wiki/File:Florist_working.jpg">direct2Florist</a>, CC&nbsp;BY&nbsp;2.0, on Wikimedia Commons.</p>
</div>
</footer>
<script>
window.hallmarkSlots = (m) => { for (const [k, v] of Object.entries(m)) { const s = document.querySelector(`[data-slot="${k}"]`); if (!s) continue; const im = new Image(); im.src = typeof v === 'string' ? v : v.src; im.alt = (typeof v === 'object' && v.alt) || s.dataset.alt || ''; s.querySelectorAll(':scope > img').forEach((o) => o.remove()); s.prepend(im); } };
document.querySelectorAll('[data-slot] > img').forEach((i) => { if (i.complete && !i.naturalWidth) i.remove(); else i.addEventListener('error', () => i.remove(), { once: true }); });
document.querySelectorAll('form[data-endpoint]').forEach((form) => {
const input = form.querySelector('input'), help = form.querySelector('[aria-live]'), button = form.querySelector('button');
form.addEventListener('submit', (e) => {
e.preventDefault();
const ok = input.checkValidity();
input.toggleAttribute('aria-invalid', !ok);
if (!ok) { help.textContent = 'That address looks incomplete. Write it as name@example.com.'; input.focus(); return; }
if (!form.dataset.endpoint) { help.textContent = 'Nothing was sent: this form is not connected yet.'; return; }
button.setAttribute('aria-busy', 'true');
fetch(form.dataset.endpoint, { method: 'POST', body: new FormData(form) })
.then((r) => { help.textContent = r.ok ? 'Thanks. Tilly will write to ' + input.value.trim() + '.' : 'That did not go through. Try again in a minute.'; })
.catch(() => { help.textContent = 'That did not go through. Try again in a minute.'; })
.finally(() => button.removeAttribute('aria-busy'));
});
});
</script>
</body>
</html>
@@ -0,0 +1,353 @@
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The Boiler Room, Hull: this month’s gigs and tickets</title>
<meta name="description" content="The Boiler Room is a 200-capacity music venue in Hull. Doors 7pm, first band 8pm. This month’s gigs and tickets.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Anybody:wdth,wght@100..150,900&family=Archivo:wght@400;600&family=Archivo+Narrow:wght@600&display=swap" rel="stylesheet">
<style>
/* Hallmark · job: visit · shape: Photographic · genre: playful · theme: Overprint (by request)
* hero: Poster · nav: slab, the ink bar with the wordmark in stock colour, three links and a knocked-out Tickets outline · footer: mast, the wordmark across the container over the bar rule · imagery: photographs, library 6, mono pulled through one pass each · signature: the bill knocked out of a gig photograph printed in the orange pass · overprint: newsprint
* axes: light/grotesk-heavy/cool · posture: full-palette · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R4 V4 · weakest: S, the brief names no acts, so the listing is one honest slot and the photographs and the two times carry the night */
/* Hallmark · hero-review: in-thread · fix · 2 findings · 1 resolved 1 partial (the stage act is a laptop duo; the library holds no band shot with a dark foot, so the handoff asks for the venue's own) · finish-review: in-thread · fix · 1 finding · 1 resolved (the bill's room under the Poster raised to 96px) · gap: the two passes never cross on this page, so the moss shows nowhere */
:root {
color-scheme: light;
--space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
--text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
--text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
--text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
--ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
--dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
--color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150);
--container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
--z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
--color-paper: oklch(91.5% 0.014 92); --color-paper-2: oklch(88% 0.017 90); --color-paper-3: oklch(84% 0.02 88);
--color-ink: oklch(17% 0.008 60); --color-ink-2: oklch(29% 0.01 60); --color-muted: oklch(43% 0.012 70);
--color-rule: oklch(79% 0.02 85);
--color-accent: oklch(69% 0.105 213); --color-accent-ink: oklch(17% 0.008 60); --color-focus: oklch(44% 0.1 220);
--color-accent-2: oklch(72% 0.185 52); --color-accent-2-ink: oklch(17% 0.008 60);
--color-mix: oklch(40% 0.106 129);
--blend: multiply; --texture-opacity: 0.05;
--font-display: "Anybody", ui-sans-serif, sans-serif; --font-body: "Archivo", ui-sans-serif, sans-serif;
--font-outlier: "Archivo Narrow", ui-sans-serif, sans-serif;
--radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 3px;
--shadow-card: none;
--tracking-display: -0.01em; --display-stretch: 140%;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent-2) 40%, transparent); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); }
[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
/* photographs: mono con=30 */
[data-slot] > img { filter: grayscale(1) contrast(1.3); }
:root {
--nav-h: 72px;
--text-bill: clamp(2.125rem, 6vw, 5.75rem);
--grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 -4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
h1, h2, h3 { font-weight: 900; font-stretch: var(--display-stretch); text-transform: uppercase; line-height: 1.02; }
/* the skip link */
.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); }
.skip:focus-visible { top: var(--space-md); outline-color: var(--color-accent); }
/* controls: the pass-1 fill beside an inset ink outline; the press changes a fill at once */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--space-lg); border: 0; border-radius: 0; background: none; font: 600 var(--text-sm)/1 var(--font-outlier); text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background: color-mix(in oklab, var(--color-accent) 78%, var(--color-ink)); }
.btn--primary:active { background: color-mix(in oklab, var(--color-accent) 62%, var(--color-ink)); }
.btn--secondary { box-shadow: inset 0 0 0 2px var(--color-ink); color: var(--color-ink); }
.btn--secondary:hover { background: var(--color-ink); color: var(--color-paper); }
.btn--secondary:active { background: var(--color-ink-2); color: var(--color-paper); }
.btn--knock { box-shadow: inset 0 0 0 2px var(--color-paper); color: var(--color-paper); }
.btn--knock:hover { background: var(--color-paper); color: var(--color-ink); }
.btn--knock:active { background: var(--color-paper-3); color: var(--color-ink); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
/* the two passes: flat fills, multiplied, a photograph pulled through one of them */
.pass-1 { background: var(--color-accent); color: var(--color-accent-ink); mix-blend-mode: var(--blend); }
.pass-2 { background: var(--color-accent-2); color: var(--color-accent-2-ink); mix-blend-mode: var(--blend); }
.pass-1 > img, .pass-2 > img { mix-blend-mode: var(--blend); }
.grain { isolation: isolate; }
.grain::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: var(--texture-opacity); background: var(--grain) 0 0 / 200px; }
/* nav: the slab */
.slab { background: var(--color-ink); color: var(--color-paper); }
.slab__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: var(--nav-h); }
.wordmark { font: 900 1.375rem/1 var(--font-display); font-stretch: var(--display-stretch); text-transform: uppercase; letter-spacing: var(--tracking-display); color: var(--color-paper); text-decoration: none; white-space: nowrap; }
.slab__nav { display: flex; align-items: center; gap: var(--space-xl); }
.slab__links { display: flex; gap: var(--space-lg); margin: 0; padding: 0; list-style: none; }
.slab__links a { font: 600 var(--text-sm)/1 var(--font-outlier); color: var(--color-paper); text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 0.35em; white-space: nowrap; }
.slab__links a:hover { text-decoration-color: var(--color-accent); }
.slab :focus-visible, .hero :focus-visible, .wordmark:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
/* hero: Poster, the bill knocked out to the stock over the photograph's darkest third */
.hero { position: relative; isolation: isolate; display: grid; align-items: end; min-height: calc(100dvh - var(--nav-h)); background: var(--color-ink); color: var(--color-paper); }
.hero__photo { position: absolute; inset: 0; margin: 0; z-index: 0; mix-blend-mode: normal; }
.hero__photo > img { object-position: 50% 40%; }
.hero__scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, color-mix(in oklab, var(--color-ink) 62%, transparent), transparent 58%); }
.hero__inner { position: relative; z-index: 3; display: grid; justify-items: start; gap: var(--space-lg); padding-block: var(--space-3xl); }
.hero__head { max-width: none; font-size: var(--text-bill); color: var(--color-paper); }
.hero__lead { max-width: 34ch; color: var(--color-paper); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
/* photographs: square, no frame, each printed through one pass */
.photo { position: relative; margin: 0; }
.photo--tall { aspect-ratio: 4 / 5; }
.photo--wide { aspect-ratio: 21 / 9; width: 100%; }
.photo--hull { aspect-ratio: 4 / 3; }
.caption { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-ink-2); }
.fill { padding: 0 0.25em; border: 1px dashed color-mix(in oklch, var(--color-muted) 70%, transparent); border-radius: 3px; color: var(--color-muted); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* this month: the listing beside a photograph in the teal pass */
.listing { padding-top: var(--section-gap); }
.listing__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: center; }
.listing__text { grid-column: 1 / 8; display: grid; justify-items: start; }
.listing__text .lead { margin-top: var(--space-md); max-width: 44ch; }
.listing__shot { grid-column: 8 / 13; margin: 0; }
.bill { width: 100%; margin-block: var(--space-2xl) var(--space-xl); border-collapse: collapse; border-top: var(--rule-bar) solid var(--color-ink); font-variant-numeric: tabular-nums; }
.bill th { padding: var(--space-sm) var(--space-md) var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); font: 600 var(--text-sm)/1.2 var(--font-outlier); text-align: left; white-space: nowrap; }
.bill td { padding: var(--space-lg) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
/* the room: the stage before doors, full bleed, then the night in two */
.room { padding-top: var(--section-gap-l); }
.room h2 { margin-bottom: var(--space-2xl); }
.room__pair { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); margin-top: var(--space-2xl); }
.room__shot { margin: 0; }
.room__shot--doors { grid-column: 1 / 5; }
.room__shot--doors .photo { aspect-ratio: 6 / 7; }
.room__shot--band { grid-column: 5 / 13; }
.room__shot--band .photo { aspect-ratio: 16 / 9; }
/* hull: the photograph on the other side, the facts as a list under the bar rule */
.hull { padding-block: var(--section-gap) var(--section-gap-s); }
.hull__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: center; }
.hull__grid > .photo { grid-column: 1 / 7; }
.hull__text { grid-column: 8 / 13; }
.facts { margin: var(--space-2xl) 0 0; border-top: var(--rule-bar) solid var(--color-ink); }
.facts > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-md); padding-block: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.facts dt { font: 600 var(--text-sm)/1.5 var(--font-outlier); }
.facts dd { margin: 0; }
/* tickets: the ink band, stock type, the on-sale field */
.tickets { padding-block: var(--section-gap-s); background: var(--color-ink); color: var(--color-paper); }
.tickets__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: end; }
.tickets__text { grid-column: 1 / 8; }
.tickets__text .lead { margin-top: var(--space-md); max-width: 40ch; }
.onsale { grid-column: 8 / 13; }
.onsale label { display: block; margin-bottom: var(--space-xs); font: 600 var(--text-sm)/1.2 var(--font-outlier); }
.onsale__row { display: flex; gap: var(--space-xs); }
.onsale input { flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--space-md); border: 0; border-radius: 0; background: var(--color-ink); color: var(--color-paper); box-shadow: inset 0 0 0 2px var(--color-paper); font: 400 var(--text-md) var(--font-body); outline: 2px solid transparent; outline-offset: 2px; }
.onsale input:focus-visible { outline-color: var(--color-accent); }
.onsale input[aria-invalid] { box-shadow: inset 0 0 0 2px var(--color-error); }
.onsale__help { min-height: 1lh; margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-paper-3); }
.tickets :focus-visible { outline-color: var(--color-accent); }
/* footer: the mast */
.mast { padding-block: var(--section-gap-s) var(--space-2xl); }
.mast__word { margin: 0; font: 900 clamp(1.5rem, 6.85vw, 6.15rem)/1.02 var(--font-display); font-stretch: var(--display-stretch); text-transform: uppercase; letter-spacing: var(--tracking-display); white-space: nowrap; }
.mast__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-lg); margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: var(--rule-bar) solid var(--color-ink); }
.mast__links { display: flex; flex-wrap: wrap; gap: var(--space-lg); margin: 0; padding: 0; list-style: none; }
.mast__links a { font: 600 var(--text-sm)/1.2 var(--font-outlier); text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.mast__links a:hover { text-decoration-color: var(--color-ink); }
.mast__note { margin: 0; font-size: var(--text-sm); color: var(--color-ink-2); }
.mast__credits { max-width: none; margin: var(--space-xl) 0 0; font-size: var(--text-sm); line-height: 1.6; color: var(--color-ink-2); }
.mast__credits span { white-space: nowrap; }
.mast__credits a { color: inherit; text-decoration: underline; text-decoration-color: var(--color-rule); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.mast__credits a:hover { text-decoration-color: var(--color-ink); }
@media (max-width: 60rem) {
.slab__links { display: none; }
.hero { min-height: calc(92dvh - var(--nav-h)); }
.listing__text, .listing__shot, .hull__grid > .photo, .hull__text, .tickets__text, .onsale { grid-column: 1 / -1; }
.listing__shot, .hull__text, .onsale { margin-top: var(--space-2xl); }
.room__shot--doors, .room__shot--band { grid-column: 1 / -1; }
.room__shot--band { margin-top: var(--space-xl); }
}
@media (max-width: 40rem) {
.wordmark { font-size: 1.0625rem; }
.slab__nav { gap: var(--space-md); }
.hero__inner { padding-block: var(--space-2xl) var(--space-xl); }
.bill th:nth-child(n+3) { display: none; }
.onsale__row { flex-direction: column; }
}
</style>
</head>
<body>
<a class="skip" href="#main">Skip to content</a>
<header class="slab">
<div class="container slab__inner">
<a class="wordmark" href="#main" aria-label="The Boiler Room, home">The Boiler Room</a>
<nav class="slab__nav" aria-label="Main">
<ul class="slab__links">
<li><a href="#this-month">This month</a></li>
<li><a href="#the-room">The room</a></li>
<li><a href="#hull">Hull</a></li>
</ul>
<a class="btn btn--knock" href="#tickets">Tickets</a>
</nav>
</div>
</header>
<main id="main">
<section class="hero" aria-labelledby="hero-head">
<figure class="hero__photo pass-2 grain" data-slot="hero" data-alt="A gig night at the Boiler Room: the crowd from behind, hands up, the stage lit, with a dark lower half for the bill">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/Lights_%282011-04-24_by_Ian_T._McFarland%29.jpg/1280px-Lights_%282011-04-24_by_Ian_T._McFarland%29.jpg" width="3198" height="2555" fetchpriority="high" alt="Two guitarists in silhouette on a small stage, lit through smoke" style="object-position: 55% 40%">
</figure>
<div class="hero__scrim" aria-hidden="true"></div>
<div class="container hero__inner">
<h1 id="hero-head" class="hero__head">Doors&nbsp;7pm.<br>First&nbsp;band 8pm.</h1>
<p class="lead hero__lead">A 200-capacity music venue in Hull, with this month’s gigs below.</p>
<div class="hero__actions">
<a class="btn btn--primary" href="#this-month">This month’s gigs</a>
<a class="btn btn--knock" href="#tickets">How tickets work</a>
</div>
</div>
</section>
<section id="this-month" class="listing" aria-labelledby="month-head">
<div class="container listing__grid">
<div class="listing__text">
<h2 id="month-head">This month</h2>
<p class="lead">Every gig goes up here with its night, its price and a link to its tickets.</p>
<table class="bill">
<caption class="visually-hidden">Gigs at the Boiler Room this month</caption>
<thead>
<tr><th scope="col">Night</th><th scope="col">Band</th><th scope="col">Price</th><th scope="col">Tickets</th></tr>
</thead>
<tbody>
<tr><td colspan="4"><span class="fill" data-fill="line-up">This month’s line-up to be announced</span></td></tr>
</tbody>
</table>
<a class="btn btn--secondary" href="#tickets">Hear when tickets go on sale</a>
</div>
<figure class="listing__shot">
<div class="photo photo--tall pass-1 grain" data-slot="month" data-alt="A gig at the Boiler Room from the floor: a fan with both arms up, the band behind in the stage haze">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Energetic_guitarist_performs_on_stage_during_a_lively_music_festival_at_night%2C_surrounded_by_vibrant_lights_and_excited_fans.jpg/1280px-Energetic_guitarist_performs_on_stage_during_a_lively_music_festival_at_night%2C_surrounded_by_vibrant_lights_and_excited_fans.jpg" width="2300" height="1530" loading="lazy" alt="A long-haired guitarist playing under the stage lights in haze" style="object-position: 45% 55%">
</div>
</figure>
</div>
</section>
<section id="the-room" class="room" aria-labelledby="room-head">
<div class="container">
<h2 id="room-head">Room for two hundred</h2>
</div>
<div class="photo photo--wide pass-1 grain" data-slot="room" data-alt="The Boiler Room before doors: the stage, the drum kit and the microphone, wide, from the floor">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Ansambel_SkaMeika%C2%B4.jpg/1280px-Ansambel_SkaMeika%C2%B4.jpg" width="5760" height="2880" loading="lazy" alt="The shadows of a band, horns and all, thrown on a lit screen behind the stage" style="object-position: 50% 55%">
</div>
<div class="container room__pair">
<figure class="room__shot room__shot--doors">
<div class="photo pass-1 grain" data-slot="doors" data-alt="People coming in at the Boiler Room as the doors open">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Man_playing_an_acoustic_brazilian_guitar_%28Viol%C3%A3o%29_on_Marco_Zero_Square%2C_Refice%2C_Pernambuco%2C_Brazil.jpg/1280px-Man_playing_an_acoustic_brazilian_guitar_%28Viol%C3%A3o%29_on_Marco_Zero_Square%2C_Refice%2C_Pernambuco%2C_Brazil.jpg" width="1920" height="1280" loading="lazy" alt="A weathered hand picking the strings of a resonator guitar" style="object-position: 30% 45%">
</div>
<figcaption class="caption">Doors open at 7pm.</figcaption>
</figure>
<figure class="room__shot room__shot--band">
<div class="photo pass-2 grain" data-slot="band" data-alt="The first band of the night on the Boiler Room stage">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Kratzen_at_Puch_Open_Air_2024_02.jpg/1280px-Kratzen_at_Puch_Open_Air_2024_02.jpg" width="5472" height="3648" loading="lazy" alt="A bass player and a keyboard player on stage under the lights" style="object-position: 50% 40%">
</div>
<figcaption class="caption">The first band is on at 8pm.</figcaption>
</figure>
</div>
</section>
<section id="hull" class="hull" aria-labelledby="hull-head">
<div class="container hull__grid">
<div class="photo photo--hull pass-2 grain" data-slot="bar" data-alt="The Boiler Room on a gig night, the bar and the room from inside">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Cure_cocktail_bar_New_Orleans_2011.jpg/1280px-Cure_cocktail_bar_New_Orleans_2011.jpg" width="4752" height="3168" loading="lazy" alt="A dim bar with lit shelves of bottles and a bartender at work" style="object-position: 25% 35%">
</div>
<div class="hull__text">
<h2 id="hull-head">Find us in Hull</h2>
<dl class="facts">
<div><dt>Where</dt><dd>Hull, <span class="fill" data-fill="address">street address to be announced</span></dd></div>
<div><dt>Room</dt><dd>200 capacity</dd></div>
<div><dt>Tickets</dt><dd>Sold on this page, gig by gig</dd></div>
</dl>
</div>
</div>
</section>
<section id="tickets" class="tickets" aria-labelledby="tickets-head">
<div class="container tickets__grid">
<div class="tickets__text">
<h2 id="tickets-head">Tickets, gig by gig</h2>
<p class="lead">They go on sale here as each night is booked. Leave an email to hear first.</p>
</div>
<form class="onsale" data-endpoint="" novalidate>
<label for="onsale-email">Email address</label>
<div class="onsale__row">
<input id="onsale-email" name="email" type="email" inputmode="email" autocomplete="email" required>
<button class="btn btn--primary" type="submit">Send me on-sales</button>
</div>
<p class="onsale__help" id="onsale-help" aria-live="polite"></p>
</form>
</div>
</section>
</main>
<footer class="mast">
<div class="container">
<p class="mast__word">The Boiler Room</p>
<div class="mast__row">
<nav aria-label="Footer">
<ul class="mast__links">
<li><a href="#this-month">This month</a></li>
<li><a href="#the-room">The room</a></li>
<li><a href="#hull">Hull</a></li>
<li><a href="#tickets">Tickets</a></li>
</ul>
</nav>
<p class="mast__note">A music venue in Hull. © 2026 The Boiler Room</p>
</div>
<p class="mast__credits" data-credits>Photographs: <a href="https://commons.wikimedia.org/wiki/File:Lights_(2011-04-24_by_Ian_T._McFarland).jpg">Ian T. McFarland</a> <span>(CC BY-SA 2.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Energetic_guitarist_performs_on_stage_during_a_lively_music_festival_at_night,_surrounded_by_vibrant_lights_and_excited_fans.jpg">Shixart1985</a> <span>(CC BY 2.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Ansambel_SkaMeika%C2%B4.jpg">Enel Lepik</a> <span>(CC BY-SA 4.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Man_playing_an_acoustic_brazilian_guitar_(Viol%C3%A3o)_on_Marco_Zero_Square,_Refice,_Pernambuco,_Brazil.jpg">Wilfredor</a> <span>(CC0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Kratzen_at_Puch_Open_Air_2024_02.jpg">Kritzolina</a> <span>(CC BY-SA 4.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Cure_cocktail_bar_New_Orleans_2011.jpg">Chelsea Marie Hicks</a> <span>(CC BY 2.0)</span>, all via Wikimedia Commons.</p>
</div>
</footer>
<script>
document.querySelectorAll('form[data-endpoint]').forEach((form) => {
const input = form.querySelector('input'), help = form.querySelector('[aria-live]');
form.addEventListener('submit', (e) => {
e.preventDefault();
const ok = input.checkValidity();
input.toggleAttribute('aria-invalid', !ok);
if (!ok) { input.setAttribute('aria-describedby', help.id); help.textContent = 'That address looks incomplete. Write it as name@example.com.'; input.focus(); return; }
if (!form.dataset.endpoint) { help.textContent = 'Nothing was sent: this form is not connected yet.'; return; }
fetch(form.dataset.endpoint, { method: 'POST', body: new FormData(form) })
.then((r) => { help.textContent = r.ok ? 'Thanks. On-sales go to ' + input.value.trim() + '.' : 'That did not go through. Try again in a minute.'; })
.catch(() => { help.textContent = 'That did not go through. Try again in a minute.'; });
});
});
window.hallmarkSlots = (m) => { for (const [k, v] of Object.entries(m)) { const s = document.querySelector(`[data-slot="${k}"]`); if (!s) continue; const im = new Image(); im.src = typeof v === 'string' ? v : v.src; im.alt = (typeof v === 'object' && v.alt) || s.dataset.alt || ''; s.querySelectorAll(':scope > img').forEach((o) => o.remove()); s.prepend(im); } };
document.querySelectorAll('[data-slot] > img').forEach((i) => { if (i.complete && !i.naturalWidth) i.remove(); else i.addEventListener('error', () => i.remove(), { once: true }); });
</script>
</body>
</html>
@@ -0,0 +1,118 @@
<!doctype html>
<!--
Gate 54 fixture: MUST FAIL, six times.
Every case here was invisible to the pre-1.3 detector, which keyed on
`grid-template-columns` in the CSS and so only ever saw one geometry.
Assertion (run from this directory):
node ../../sloplint.mjs . --json | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log(JSON.parse(s).findings.filter(f=>f.gate==='54'&&f.grade==='FAIL').length))"
# expected: 6
Scoped to gate 54 on purpose: this file is deliberately slop in other ways too.
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Gate 54 eyebrow fixture (must fail)</title>
<style>
/* Hallmark · macrostructure: fixture · tone: n/a · anchor hue: 250 · hero: Settled/H1 */
/* Hallmark · pre-emit critique: P3 H3 E3 S3 R3 V3 · weakest: all - this is a fixture */
:root {
--color-paper: oklch(97% 0.006 250); --color-ink: oklch(20% 0.02 250);
--color-muted: oklch(52% 0.015 250);
--font-display: "Fraunces", serif; --font-body: "Public Sans", sans-serif;
--font-label: "Geist Mono", monospace;
--text-xs: 0.75rem; --tracking-label: 0.12em;
}
html, body { overflow-x: clip; }
body { background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); }
/* 1: flex column. No grid anywhere; the old check could not see this. */
.a__head { display: flex; flex-direction: column; gap: 0.5rem; }
.a__eyebrow { font-family: var(--font-label); text-transform: uppercase;
letter-spacing: var(--tracking-label); font-size: var(--text-xs); color: var(--color-muted); }
/* 2: plain block stack, and a class name outside the label vocabulary.
Caught by resolved CSS alone: uppercase + tracking + small size. */
.b__strand { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem;
color: var(--color-muted); }
/* 3: the classic side-by-side grid. Regression guard for the old behaviour. */
.c__head { display: grid; grid-template-columns: minmax(0, 0.4fr) minmax(0, 1fr); gap: 2rem; }
/* 4: multi-column head declared ONLY inside a max-width block. The old check
skipped every max-width rule, so this shape was a free pass. */
@media (max-width: 48rem) {
.d__head { display: grid; grid-template-columns: 1fr 2fr; }
}
/* 5: class-less heading. The old check required a semantic match on the head
wrapper's own classes to even look. */
.e__mark { font-family: var(--font-label); text-transform: uppercase;
letter-spacing: 0.1em; font-size: 0.75rem; }
/* 6: "overline" was not in the old vocabulary at all. */
.overline { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; }
</style>
</head>
<body>
<!-- 1 · flex column stack -->
<section>
<div class="a__head">
<p class="a__eyebrow">01 · The tour</p>
<h2>Everything in one pass</h2>
</div>
<p>Body copy.</p>
</section>
<!-- 2 · plain block stack, non-vocabulary class, CSS signals only -->
<section>
<div>
<p class="b__strand">Weather and tides</p>
<h2>Read the water before you launch</h2>
</div>
<p>Body copy.</p>
</section>
<!-- 3 · side-by-side grid (the only shape the old gate caught) -->
<section>
<div class="c__head">
<span class="eyebrow">02 / Features</span>
<h2>What it does</h2>
</div>
<p>Body copy.</p>
</section>
<!-- 4 · two-column head hidden inside a max-width query -->
<section>
<div class="d__head">
<span class="kicker">Chapter three</span>
<h2>The long crossing</h2>
</div>
<p>Body copy.</p>
</section>
<!-- 5 · class-less heading under a labelled span -->
<section>
<div>
<span class="e__mark">Introducing</span>
<h2>A quieter way to ship</h2>
</div>
<p>Body copy.</p>
</section>
<!-- 6 · the word the old vocabulary never knew -->
<section>
<div>
<p class="overline">Pricing</p>
<h2>Pay for what you send</h2>
</div>
<p>Body copy.</p>
</section>
</body>
</html>
@@ -0,0 +1,137 @@
<!doctype html>
<!--
Gate 54 fixture: MUST NOT FAIL.
Ten shapes that look like an eyebrow to a naive detector and are not one.
Each carries a fact, a destination, or an identifier the reader would
otherwise lack: the exceptions gate 54 lists in references/gates.md.
Assertion (run from this directory):
node ../../sloplint.mjs . --json | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log(JSON.parse(s).findings.filter(f=>f.gate==='54').length))"
# expected: 0
Scoped to gate 54: this file makes no claim to be clean on the other gates.
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Gate 54 carve-out fixture (must pass)</title>
<meta name="description" content="Fragments that sit near a heading without announcing it; gate 54 must stay quiet on every one.">
<style>
/* Hallmark · shape: fixture · genre: editorial · theme: fixture (by request)
* hero: Settled · nav: none · footer: none · enrichment: none · signature: none, this is a gate 54 fixture
* axes: light/roman-serif/cool · posture: restrained · contrast: pass · fold: n/a · v2.0.0 */
/* Hallmark · pre-emit critique: P3 H3 E3 S3 R3 V3 · weakest: all, this is a fixture */
/* Hallmark · answered F21 · unrelated fragments in one file, not a single document outline */
:root {
--color-paper: oklch(97% 0.006 250); --color-ink: oklch(20% 0.02 250);
--color-muted: oklch(52% 0.015 250); --color-accent: oklch(52% 0.14 250); --color-accent-ink: oklch(98% 0.005 250);
--font-display: "Fraunces", serif; --font-body: "Public Sans", sans-serif;
--font-label: var(--font-body);
--text-xs: 0.8125rem;
}
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); }
body { background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
a:active, button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; }
.label { font-family: var(--font-label); font-size: var(--text-xs); color: var(--color-muted); }
.steps { list-style: none; counter-reset: step; padding: 0; }
.steps li { counter-increment: step; }
.steps li h3::before { content: counter(step, decimal-leading-zero) " "; color: var(--color-muted); }
</style>
</head>
<body>
<!-- 1 · figcaption. Identifier, and it names something that is present. -->
<figure>
<figcaption class="label">Plate 4 · letterpress proof</figcaption>
<h3>Off the grid</h3>
</figure>
<!-- 2 · table column header. Identifier. -->
<table>
<thead><tr><th class="label">Weight</th><th class="label">Optical size</th></tr></thead>
<tbody><tr><td>240</td><td>14 pt</td></tr></tbody>
</table>
<!-- 3 · form field label. Identifier, bound to its control. -->
<form>
<div>
<label class="label" for="email">Email</label>
<h3>Where should the proofs go?</h3>
<input id="email" type="email">
</div>
</form>
<!-- 4 · nav label. Destination. -->
<nav>
<div>
<span class="label">Sections</span>
<h2 hidden>Navigation</h2>
<a href="/work">Work</a>
</div>
</nav>
<!-- 5 · dateline. Fact: the date appears nowhere else. -->
<article>
<p class="label"><time datetime="2026-03-14">14 March 2026</time> · Marta Silveira</p>
<h2>Notes from the second crossing</h2>
</article>
<!-- 6 · unit label AFTER the figure it labels. Order is the discriminator. -->
<section>
<div>
<p class="stat__num">42B</p>
<p class="label">events metered</p>
</div>
<h3>Throughput</h3>
</section>
<!-- 7 · code filename tab. Identifier: a real path. -->
<section>
<div>
<span class="label">server.ts</span>
<h4>Wire the handler</h4>
</div>
<pre><code>export default handler;</code></pre>
</section>
<!-- 8 · linked announcement chip. Destination, and it goes somewhere real. -->
<header>
<div>
<a class="label" href="/changelog/v2">Read the launch post</a>
<h1>Ship the whole crossing</h1>
</div>
</header>
<!-- 9 · live telemetry above a headline. Fact, and the digits prove it. -->
<section>
<div>
<p class="label">Live · 2,318 watching the drop</p>
<h1>Winter capsule, one hour left</h1>
</div>
</section>
<!-- 10 · a real <ol>. The numbers come from counter(), not from typed labels;
a genuine per-step identifier rides along without becoming a kicker. -->
<ol class="steps">
<li>
<span class="label">Tue</span>
<h3>Arrive</h3>
<p>Collect the key from the harbour office.</p>
</li>
<li>
<span class="label">Wed</span>
<h3>Cross</h3>
<p>Six hours under sail, weather permitting.</p>
</li>
</ol>
</body>
</html>
@@ -0,0 +1,27 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kept fixture, the page after</title>
<meta name="description" content="A careless redesign: one link, one field, one handler, one test hook and one script hook are gone, and one heading is reworded.">
<style>
/* Hallmark · shape: fixture · genre: editorial · theme: fixture (by request) · redesign: full */
/* Hallmark · dropped mailto:desk@example.com · the desk address is retired and the form replaces it */
body { font-family: sans-serif; }
</style>
</head>
<body>
<nav id="site-nav"><a href="#rates">Rates</a> <button id="menu-button" type="button">Menu</button></nav>
<h1>Rooms by the harbour</h1>
<h2 id="rates">What it costs</h2>
<p>From $120 a night. Breakfast until 10:30.</p>
<form action="https://example.com/api/book" method="post">
<input name="email" type="email">
<button type="submit">Book</button>
</form>
<script>
document.getElementById('nav-toggle').addEventListener('click', function () { document.querySelector('#site-nav').classList.toggle('is-open'); });
</script>
</body>
</html>
@@ -0,0 +1,26 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kept fixture, the page before</title>
<meta name="description" content="The page a redesign starts from; after.html drops one of everything the record holds.">
<style>
body { font-family: sans-serif; }
</style>
</head>
<body>
<nav id="site-nav"><a href="#rates">Rates</a> <a href="rooms.html">Rooms</a> <a href="mailto:desk@example.com">Email the desk</a> <button id="nav-toggle" type="button">Menu</button></nav>
<h1>Rooms by the harbour</h1>
<h2 id="rates">Rates</h2>
<p>From $120 a night. Breakfast until 10:30.</p>
<form action="https://example.com/api/book" method="post">
<input name="email" type="email">
<input name="nights" type="number">
<button type="submit" onclick="track('book')" data-testid="book-button">Book</button>
</form>
<script>
document.getElementById('nav-toggle').addEventListener('click', function () { document.querySelector('#site-nav').classList.toggle('is-open'); });
</script>
</body>
</html>
@@ -0,0 +1,145 @@
<!doctype html>
<!--
slopped.html - deliberately bad fixture for sloplint self-test.
Intended trips:
1 Poppins as display font
2 gradient text headline (FAIL) + purple-to-blue gradient (WARN)
4 card nested inside a card
7 pure #ffffff paper and #000000 ink tokens
10 transition: all
14 keyframes animating width
15 focus ring that transitions in
19 "Jane Doe" placeholder testimonial
20 no Hallmark stamp comment anywhere
22 zero-chroma oklch neutral
24 padding: 17px (off the 4px scale)
26 no :active and no :disabled styling (WARNs; :focus-visible exists for 15)
27 keyframes with no prefers-reduced-motion block
30 emoji feature icon
33 decorative svg without aria-hidden / aria-label
34 overflow-x: hidden instead of clip (WARN)
37 four font families (Poppins, Inter, JetBrains Mono, Playfair Display)
38a italic h2
46 "Trusted by 50,000+ teams" invented metric
48 inline hex colour outside the token block
50 bare 1fr grid track holding an img
51 display header with a long unbroken word, no overflow-wrap
54 an eyebrow before an h2 (the two-column head is incidental now)
55 uppercase h2 at line-height 0.94
56 two position:sticky top:0 elements
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nexus - Unleash Seamless Workflows</title>
<style>
:root {
--color-paper: #ffffff; /* gate 7: pure white base */
--color-ink: #000000; /* gate 7: pure black base */
--color-gray: oklch(55% 0 0); /* gate 22: zero chroma */
--font-display: 'Poppins', sans-serif; /* gate 1 */
--font-body: 'Inter', sans-serif;
--font-mono: 'JetBrains Mono', monospace;
--font-quote: 'Playfair Display', serif; /* gate 37: fourth family */
}
html { overflow-x: hidden; } /* gate 34: hidden, not clip */
body {
margin: 0;
background: var(--color-paper);
color: var(--color-ink);
font-family: var(--font-body);
}
.nav {
position: sticky; top: 0; /* gate 56: sticky #1 */
background: var(--color-paper);
padding: 17px; /* gate 24: off-scale */
}
.section-head {
position: sticky; top: 0; /* gate 56: sticky #2 */
background: var(--color-gray);
}
h1 {
font-family: var(--font-display);
background: linear-gradient(90deg, #8b5cf6, #3b82f6); /* gate 2 WARN + 48 */
-webkit-background-clip: text; /* gate 2 FAIL: gradient text */
background-clip: text;
color: transparent;
}
h2 {
font-family: var(--font-display);
font-style: italic; /* gate 38a */
text-transform: uppercase;
line-height: 0.94; /* gate 55 */
}
.quote { font-family: var(--font-quote); }
.mono-label { font-family: var(--font-mono); }
.card {
transition: all 0.3s ease; /* gate 10 */
border: 1px solid var(--color-gray);
}
.promo { color: #e91e63; } /* gate 48: inline hex outside tokens */
.cta:focus-visible {
outline: 2px solid var(--color-ink);
transition: outline 200ms ease; /* gate 15: focus ring fades in */
}
.features__head {
display: grid;
grid-template-columns: 1fr 2fr; /* the eyebrow itself is gate 54; see the markup */
}
.gallery {
display: grid;
grid-template-columns: 1fr 1fr; /* gate 50: bare 1fr tracks hold imgs */
}
.bar { animation: grow 2s ease infinite; }
@keyframes grow {
from { width: 0; } /* gate 14: animating width */
to { width: 100%; }
}
/* gate 27: no prefers-reduced-motion block anywhere */
/* gate 26: no :active, no :disabled styling anywhere */
</style>
</head>
<body>
<header class="nav">
<span class="mono-label">NEXUS</span>
<button class="cta">Get started</button>
</header>
<main>
<section class="hero">
<h1>Unleash hyperproductivity-supercharged workflows</h1>
<p class="promo">Trusted by 50,000+ teams shipping 10x faster.</p>
<svg width="120" height="40" viewBox="0 0 120 40">
<circle cx="20" cy="20" r="16" fill="var(--color-gray)"></circle>
</svg>
</section>
<div class="features__head">
<span class="eyebrow">01 / FEATURES</span>
<h2>Everything, seamlessly</h2>
</div>
<section class="features">
<div class="card">
<div class="feature__icon">✨</div>
<h3>Magic sync</h3>
<div class="card">
<p>A card inside a card, as the template gods intended.</p>
</div>
</div>
<div class="bar"></div>
</section>
<section class="gallery">
<img src="shot-1.png" alt="Product screenshot one">
<img src="shot-2.png" alt="Product screenshot two">
</section>
<section class="voices">
<blockquote class="quote">"It changed everything for our team."</blockquote>
<p>Jane Doe, Head of Operations</p>
</section>
</main>
</body>
</html>
@@ -0,0 +1,14 @@
<template>
<article class="rounded-2xl p-6">
<span class="text-xs uppercase tracking-widest">Field kit</span>
<img :src="photo" alt="A deckhand logging a reading" class="rounded-xl hover:scale-110" />
<button type="button" class="rounded-md px-4 py-2 transition-all" @click="open = !open">Log a reading</button>
<div aria-hidden="true" :class="{ 'animate-bounce': pulse }" class="h-4 w-4 rounded-full"></div>
<div aria-hidden="true" class="absolute -right-10 top-0 h-40 w-40 bg-gradient-to-br from-violet-500 to-sky-400 blur-[60px]"></div>
</article>
</template>
<script setup lang="ts">
defineProps<{ photo: string; pulse: boolean }>();
const open = ref(false);
</script>
@@ -0,0 +1,33 @@
import Link from "next/link";
import { cva } from "class-variance-authority";
import { cn } from "./cn";
const badge = cva("rounded-full px-2 py-1 text-xs uppercase tracking-widest", {
variants: { tone: { loud: "font-semibold", calm: "font-normal" } },
});
type HeroProps = { active: boolean; items: Array<{ id: string; label: string }> };
export function Hero({ active, items }: HeroProps) {
const count = items.length;
if (count < 1) return null;
return (
<section className="hero min-h-screen bg-slate-950 px-6">
<p className={cn("text-sm font-semibold", active && "text-violet-600")}>Release notes</p>
<h1 className="bg-gradient-to-r from-purple-500 to-pink-500 bg-clip-text text-5xl text-transparent">
Logs that sail with you
</h1>
<span className="font-mono text-xs">Kept by the crew</span>
<Link href="/docs" className={`rounded-md px-3 py-2 ${active ? "bg-violet-600" : ""} transition-all`}>
Read the docs
</Link>
<span className={badge({ tone: "loud" })}>New</span>
<div aria-hidden="true" className="absolute inset-0 -z-10 bg-[#1a1033]" />
<ul>
{items.map((item) => (
<li key={item.id} className="animate-bounce">{item.label}</li>
))}
</ul>
</section>
);
}
@@ -0,0 +1,74 @@
<!doctype html>
<!-- Tailwind fixture: MUST FAIL. Fires 67, 54, 64, 10a, 12, 11, 2a, 2b, 29, 6a, 34, 48, 74 and 3 from utility classes, one tell per element. -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tailwind fail fixture</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="style.css">
</head>
<!-- 34: overflow-x-hidden on body -->
<body class="overflow-x-hidden bg-slate-950 text-slate-100">
<!-- 29: glass nav -->
<nav class="sticky top-0 bg-white/10 backdrop-blur-md px-6 py-4">
<a href="/" class="font-semibold">Fieldnote</a>
<!-- 67: tracked caps nav link -->
<a href="/docs" class="text-sm uppercase tracking-wider">Docs</a>
</nav>
<!-- 6a: the first section is the hero, sized in vh -->
<section class="relative min-h-screen px-6 py-24">
<!-- 29: blurred orb -->
<div aria-hidden="true" class="absolute left-1/3 top-0 h-72 w-72 rounded-full bg-fuchsia-500 blur-3xl"></div>
<!-- 54: accent eyebrow before the h1 -->
<p class="text-sm font-semibold text-indigo-600">Fewer handoffs</p>
<h1 class="text-6xl font-bold">
<!-- 2b: gradient text in another hue -->
<span class="bg-gradient-to-r from-amber-400 to-orange-600 bg-clip-text text-transparent">Field notes</span> for crews at sea
</h1>
<!-- 64: mono as costume on a meta line -->
<p class="font-mono text-xs text-slate-400">Updated weekly by the crew</p>
<!-- 10a: transition-all -->
<a href="/start" class="rounded-lg bg-indigo-600 px-4 py-2 transition-all">Start a log</a>
<!-- 29: coloured zero-offset glow -->
<button type="button" class="rounded-lg px-4 py-2 shadow-[0_0_40px_var(--color-glow)]">Preview</button>
<!-- 12: bounce -->
<div aria-hidden="true" class="mt-12 h-6 w-6 animate-bounce rounded-full border"></div>
</section>
<!-- 2a: purple-to-blue band -->
<div aria-hidden="true" class="h-2 bg-gradient-to-r from-purple-500 to-blue-500"></div>
<section class="px-6 py-24">
<h2 class="text-3xl font-semibold">What the crew gets</h2>
<!-- 3: three icon tiles above h3s; 11: hover scale on three elements -->
<div class="mt-12 grid gap-8 md:grid-cols-3">
<div class="rounded-xl p-6 hover:scale-105">
<div class="flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600"><svg aria-hidden="true" viewBox="0 0 24 24" class="h-5 w-5"><path d="M4 12h16"/></svg></div>
<h3 class="mt-4 font-semibold">Tide tables</h3>
<p class="mt-2 text-slate-400">Every reading lands on the same chart.</p>
</div>
<div class="rounded-xl p-6 hover:scale-105">
<div class="flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600"><svg aria-hidden="true" viewBox="0 0 24 24" class="h-5 w-5"><path d="M12 4v16"/></svg></div>
<h3 class="mt-4 font-semibold">Crew logs</h3>
<p class="mt-2 text-slate-400">One log per watch, signed by whoever kept it.</p>
</div>
<div class="rounded-xl p-6 hover:scale-105">
<div class="flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600"><svg aria-hidden="true" viewBox="0 0 24 24" class="h-5 w-5"><path d="M4 4l16 16"/></svg></div>
<h3 class="mt-4 font-semibold">Weather</h3>
<p class="mt-2 text-slate-400">Forecasts pinned to the hour you sail.</p>
</div>
</div>
</section>
<section class="px-6 py-24">
<!-- 11: the image itself scales on hover -->
<img src="harbour.jpg" alt="The harbour at dawn" class="rounded-2xl hover:scale-110">
<!-- 48: literal colour and family in classes -->
<p class="mt-6 bg-[#0b0b12] font-['Inter'] p-4">Logs stay on the boat until you sync them.</p>
</section>
</body>
</html>
@@ -0,0 +1,6 @@
/* Hallmark · fixture: tailwind-fail · every utility tell, one per element */
:root {
--color-paper: oklch(18% 0.02 270);
--color-ink: oklch(95% 0.01 270);
--color-glow: oklch(62% 0.25 300 / 0.6);
}
@@ -0,0 +1,33 @@
import { useState } from "react";
type HeroProps = { onStart?: () => void; readings: Array<{ id: string; label: string }> };
export function Hero({ onStart, readings }: HeroProps) {
const [sent, setSent] = useState<boolean>(false);
const start = () => {
setSent(true);
if (onStart && readings.length > 0) onStart();
};
return (
<section className="mx-auto grid min-h-dvh max-w-6xl items-center gap-12 px-6 md:grid-cols-2">
<div>
<h1 className="font-display text-5xl text-ink">Logbooks your crew will keep</h1>
<p className="mt-4 text-lg text-muted">Write a reading once and the whole crew sees it.</p>
<button
type="button"
onClick={start}
disabled={sent}
className="mt-8 h-12 rounded-md bg-accent px-5 text-accent-ink transition-colors hover:bg-accent-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent active:translate-y-px disabled:cursor-not-allowed motion-reduce:transition-none"
>
Start a log
</button>
<ul className="mt-8 space-y-2">
{readings.map((r) => (
<li key={r.id} className="text-sm text-muted">{r.label}</li>
))}
</ul>
</div>
<figure data-slot="hero" className="aspect-[4/3] rounded-lg bg-well" />
</section>
);
}
@@ -0,0 +1,57 @@
<!doctype html>
<!-- Tailwind fixture: MUST PASS clean (0 FAIL, 0 REFLEX, 0 WARN) with theme token classes, sentence case labels, focus-visible rings, motion-reduce fallbacks, themed selection and caret, overflow-x-clip on html and body. -->
<html lang="en" class="overflow-x-clip [scrollbar-color:var(--color-muted)_var(--color-paper)]">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tailwind pass fixture</title>
<meta name="description" content="A Tailwind page written to pass every gate the static tier reads from utility classes.">
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<link rel="stylesheet" href="style.css">
</head>
<body class="overflow-x-clip bg-paper font-body text-ink selection:bg-accent selection:text-accent-ink">
<header class="mx-auto flex max-w-6xl items-center justify-between px-6 py-5">
<a href="/" class="font-display text-lg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent">Fieldnote</a>
<nav aria-label="Main" class="flex gap-6">
<a href="/pricing" class="text-sm text-muted hover:text-ink focus-visible:outline-2 focus-visible:outline-accent">Pricing</a>
<a href="/docs" class="text-sm text-muted hover:text-ink focus-visible:outline-2 focus-visible:outline-accent">Docs</a>
</nav>
</header>
<main>
<section class="mx-auto grid min-h-dvh max-w-6xl items-center gap-12 px-6 md:grid-cols-2">
<div>
<h1 class="font-display text-5xl">Logbooks your crew will keep</h1>
<p class="mt-4 text-lg text-muted">Write a reading once and the whole crew sees it.</p>
<form class="mt-8 flex gap-3">
<label for="email" class="sr-only">Email</label>
<input id="email" type="email" class="h-12 rounded-md border border-line bg-paper px-4 caret-accent focus-visible:outline-2 focus-visible:outline-accent">
<button type="submit" class="h-12 rounded-md bg-accent px-5 text-accent-ink transition-colors hover:bg-accent-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent active:translate-y-px disabled:cursor-not-allowed disabled:bg-line motion-reduce:transition-none">Start a log</button>
</form>
</div>
<figure data-slot="hero" class="aspect-[4/3] rounded-lg bg-well">
<figcaption class="sr-only">Your product screenshot</figcaption>
</figure>
</section>
<section class="mx-auto max-w-6xl px-6 py-32">
<h2 class="font-display text-3xl">One log per watch</h2>
<p class="mt-3 max-w-prose text-muted">Each watch signs its own page, and the next watch reads it first.</p>
<ul class="mt-10 grid gap-8 md:grid-cols-2">
<li class="border-t border-line pt-4">
<h3 class="font-display text-xl">Readings</h3>
<p class="mt-2 text-sm text-muted">Wind, swell and heading, in the units your boat uses.</p>
</li>
<li class="border-t border-line pt-4">
<h3 class="font-display text-xl">Handover notes</h3>
<p class="mt-2 text-sm text-muted">What changed since the last watch, in plain sentences.</p>
</li>
</ul>
<a href="/tour" class="mt-10 inline-block text-accent underline underline-offset-4 transition-transform hover:translate-x-0.5 focus-visible:outline-2 focus-visible:outline-accent motion-reduce:transition-none motion-reduce:hover:translate-x-0">Take the tour</a>
</section>
</main>
<script>window.hallmarkSlots = (m) => { for (const [k, v] of Object.entries(m)) { const s = document.querySelector(`[data-slot="${k}"]`); if (!s) continue; const im = new Image(); im.src = typeof v === 'string' ? v : v.src; im.alt = (typeof v === 'object' && v.alt) || s.dataset.alt || ''; s.prepend(im); } };</script>
</body>
</html>
@@ -0,0 +1,15 @@
/* Hallmark · fixture: tailwind-pass · theme: fixture (by request) · posture: restrained · nav: N1 · footer: none · hero: Settled */
@import "tailwindcss";
@theme {
--color-paper: oklch(97.5% 0.006 240);
--color-well: oklch(93% 0.012 240);
--color-line: oklch(86% 0.015 240);
--color-ink: oklch(22% 0.025 250);
--color-muted: oklch(46% 0.02 250);
--color-accent: oklch(48% 0.15 255);
--color-accent-strong: oklch(42% 0.15 255);
--color-accent-ink: oklch(98.5% 0.005 255);
--font-display: "Fraunces", serif;
--font-body: "Public Sans", sans-serif;
}
@@ -0,0 +1,54 @@
<!doctype html>
<!--
Waiver fixture. Five waivers are claimed on a deliberately expressive page:
four are honoured, one is refused because it names a Floor gate, and the build
ships. There is no cap, so the page is not blocked for being expressive; what
it gets instead is a NOTE saying four waivers is a house style, not exceptions.
Assertion (run from this directory):
node ../../sloplint.mjs . --json | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{const j=JSON.parse(s);console.log(JSON.stringify(j.summary))})"
# expected: fails 0, reflex 0, waived 5, rejected 2, answered 1, notes 1
# (waived counts findings, not gates: gate 1 fires on both the token and the
# h1 rule, and gate 7 on both the token and the body background)
Case by case:
waive 40 -> refused, Floor is never waivable, and gate 40 still binds
waive 7b -> honoured; the guard (surface: absolute in the stamp) holds
waive 22 -> honoured
waive 25 -> honoured (no finding to downgrade on this page)
waive 1 -> honoured, and trips the >3 house-style NOTE
answered F3 -> honoured; the Finish finding reports ANSWERED instead of WARN
answered 40 -> refused; 40 is Floor, and Floor findings are fixed, not answered
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Waiver fixture</title>
<style>
/* Hallmark · macrostructure: Manifesto · tone: austere · anchor hue: 250 · surface: absolute · nav: N9 · footer: Ft2 · hero: Poster/H1 */
/* Hallmark · pre-emit critique: P5 H4 E5 S4 R5 V4 · weakest: E - fixture, not a real build */
/* Hallmark · waive 40 · contrast measured on the stage · the manifesto is printed white on black */
/* Hallmark · waive 7b · surface: absolute declared, 40-41 pass · the manifesto stage is printed on black paper */
/* Hallmark · waive 22 · neutrals achromatic throughout · the manifesto rules are pure grey by intent */
/* Hallmark · waive 25 · measure runs to 96ch · the manifesto sets long declarative lines */
/* Hallmark · waive 1 · two families declared · the manifesto pairs a display serif with a grotesque */
/* Hallmark · answered F3 · the manifesto head is one word and cannot wrap, so balance has nothing to balance */
/* Hallmark · answered 40 · contrast is fine here honestly */
:root {
--color-paper: #000;
--color-ink: oklch(96% 0 250);
--font-display: Inter, sans-serif;
--font-body: "Public Sans", sans-serif;
}
html, body { overflow-x: clip; }
body { background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); }
h1 { font-family: var(--font-display); }
</style>
</head>
<body>
<h1>A manifesto printed on a black stage</h1>
<p>The manifesto sets long declarative lines and lets the paper do the shouting.</p>
</body>
</html>
@@ -0,0 +1,85 @@
#!/usr/bin/env node
import { createHash } from "node:crypto";
import { mkdirSync, existsSync, writeFileSync, readFileSync } from "node:fs";
import { join, dirname, basename } from "node:path";
const ENDPOINT = "https://api.together.xyz/v1/images/generations";
const DEFAULT_MODEL = "black-forest-labs/FLUX.1.1-pro";
function parseArgs(argv) {
const a = { _: [] };
for (let i = 0; i < argv.length; i++) {
const t = argv[i];
if (t.startsWith("--")) {
const k = t.slice(2);
if (k === "force" || k === "json") a[k] = true;
else a[k] = argv[++i];
} else a._.push(t);
}
return a;
}
function out(obj, code = 0) {
if (args.json) process.stdout.write(JSON.stringify(obj) + "\n");
else if (obj.path) console.log(obj.path);
else if (obj.message || obj.error) console.error(obj.message || obj.error);
process.exit(code);
}
const args = parseArgs(process.argv.slice(2));
const prompt = args._.join(" ").trim();
if (!prompt) out({ error: 'usage: node imagegen.mjs "<prompt>" [--model ...] [--size WxH] [--out path]' }, 2);
const model = args.model ?? DEFAULT_MODEL;
const size = args.size ?? "1024x1024";
const [w, h] = size.split("x").map((n) => parseInt(n, 10));
if (!w || !h) out({ error: `bad --size ${size} (want WxH, e.g. 1536x1024)` }, 2);
const steps = parseInt(args.steps ?? "4", 10);
const n = Math.max(1, parseInt(args.n ?? "1", 10) || 1);
const hash = createHash("sha256").update([model, prompt, size, steps, n].join("|")).digest("hex").slice(0, 16);
const cacheDir = args.out ? dirname(args.out) : join(process.cwd(), ".hallmark", "img-cache");
const cachePath = args.out ?? join(cacheDir, `${hash}.png`);
const stem = cachePath.replace(/\.png$/, "");
const metaPath = stem + ".json";
const pathFor = (i) => (n === 1 ? cachePath : `${stem}-${i + 1}.png`);
const sameRequest = () => { if (!args.out) return true; try { return JSON.parse(readFileSync(metaPath, "utf8")).hash === hash; } catch { return false; } };
if (!args.force && existsSync(cachePath) && sameRequest()) {
out({ path: cachePath, cached: true, model, prompt });
}
const key = process.env.TOGETHER_API_KEY;
if (!key) {
out({
error: "no-key",
message:
"TOGETHER_API_KEY not set. Image generation is opt-in; falling back to CSS-art / a labelled placeholder. " +
"Set TOGETHER_API_KEY to generate real imagery, or keep the typography-only / placeholder path.",
}, 3);
}
try {
const res = await fetch(ENDPOINT, {
method: "POST",
headers: { "content-type": "application/json", authorization: `Bearer ${key}` },
body: JSON.stringify({ model, prompt, width: w, height: h, steps, n, response_format: "b64_json" }),
signal: AbortSignal.timeout(180000),
});
if (!res.ok) {
const detail = (await res.text()).slice(0, 300);
out({ error: `together ${res.status}`, message: `image API ${res.status}: ${detail}` }, 1);
}
const data = await res.json();
const images = (data?.data ?? []).map((d) => d?.b64_json).filter(Boolean);
if (!images.length) out({ error: "no-image", message: "image API returned no b64_json payload" }, 1);
mkdirSync(cacheDir, { recursive: true });
const paths = [];
images.forEach((b64, i) => { const p = pathFor(i); writeFileSync(p, Buffer.from(b64, "base64")); paths.push(p); });
const provenance = { model, prompt, size, steps, n, hash, files: paths.map((p) => basename(p)), generatedVia: "together", note: "generated asset; post-process before shipping; verify licensing", at: new Date().toISOString().slice(0, 10) };
writeFileSync(metaPath, JSON.stringify(provenance, null, 2) + "\n");
out({ path: paths[0], paths, cached: false, model, prompt, provenance });
} catch (e) {
out({ error: "fetch-failed", message: `image generation failed: ${String(e?.message ?? e)}. Falling back to placeholder.` }, 1);
}
@@ -0,0 +1,70 @@
#!/usr/bin/env node
import { readFileSync, writeFileSync, mkdirSync, existsSync, renameSync, realpathSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
import { homedir } from "node:os";
const HERE = dirname(fileURLToPath(import.meta.url));
const HOOK_CMD = `node "${join(HERE, "lint-hook.mjs")}"`;
const MATCHER = "Write|Edit|MultiEdit";
const args = process.argv.slice(2);
const has = (f) => args.includes(f);
const settingsPath = has("--global")
? join(homedir(), ".claude", "settings.json")
: join(process.cwd(), ".claude", "settings.json");
const hookEntry = {
matcher: MATCHER,
hooks: [{ type: "command", command: HOOK_CMD, timeout: 10 }],
};
function readSettings() {
if (!existsSync(settingsPath)) return {};
try { return JSON.parse(readFileSync(settingsPath, "utf8")); } catch {
console.error(`refusing to overwrite unparseable ${settingsPath}; fix or delete it first.`);
process.exit(1);
}
}
const ourHook = (h) => typeof h?.command === "string" && /hallmark[\\/]scripts[\\/]lint-hook\.mjs/.test(h.command);
const withoutOurs = (list) => list.flatMap((e) => {
if (!Array.isArray(e?.hooks) || !e.hooks.some(ourHook)) return [e];
const rest = e.hooks.filter((h) => !ourHook(h));
return rest.length ? [{ ...e, hooks: rest }] : [];
});
if (has("--print")) {
console.log(`# add to ${settingsPath} :`);
console.log(JSON.stringify({ hooks: { PostToolUse: [hookEntry] } }, null, 2));
process.exit(0);
}
if (has("--remove") && !existsSync(settingsPath)) {
console.log(`no ${settingsPath}; nothing to remove`);
process.exit(0);
}
const settings = readSettings();
if (!settings || typeof settings !== "object" || Array.isArray(settings)) { console.error(`refusing to rewrite ${settingsPath}: it is not a JSON object`); process.exit(1); }
settings.hooks ??= {};
settings.hooks.PostToolUse ??= [];
if (!Array.isArray(settings.hooks.PostToolUse)) { console.error(`refusing to rewrite ${settingsPath}: hooks.PostToolUse is not a list`); process.exit(1); }
// Write beside the file and rename over it, so a crash never leaves settings.json half written.
// A symlinked settings.json (a dotfiles repo) keeps its link: the write lands on the file it points at.
const save = () => { const dest = existsSync(settingsPath) ? realpathSync(settingsPath) : settingsPath; const tmp = `${dest}.hallmark-tmp`; writeFileSync(tmp, JSON.stringify(settings, null, 2) + "\n"); renameSync(tmp, dest); };
settings.hooks.PostToolUse = withoutOurs(settings.hooks.PostToolUse);
if (has("--remove")) {
save();
console.log(`removed the Hallmark lint hook from ${settingsPath}`);
process.exit(0);
}
settings.hooks.PostToolUse.push(hookEntry);
mkdirSync(dirname(settingsPath), { recursive: true });
save();
console.log(`installed the Hallmark edit-time lint hook into ${settingsPath}`);
console.log(`it lints Hallmark .html and .css files, and .jsx, .tsx, .vue, .svelte and .astro files inside a project with a .hallmark folder, on write; it advises and never blocks. Remove with --remove.`);
+141
View File
@@ -0,0 +1,141 @@
#!/usr/bin/env node
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { homedir } from "node:os";
const HERE = path.dirname(fileURLToPath(import.meta.url));
const SKILL_ROOT = path.dirname(HERE);
const HOME = homedir();
const PAYLOAD = ["SKILL.md", "LICENSE", "references", "scripts", "agents"];
const TARGETS = {
claude: {
label: "Claude Code",
dir: path.join(HOME, ".claude", "skills", "hallmark"),
detect: () => fs.existsSync(path.join(HOME, ".claude")),
},
codex: {
label: "Codex CLI and Cursor",
dir: path.join(HOME, ".agents", "skills", "hallmark"),
detect: () => [".codex", ".agents", ".cursor"].some((d) => fs.existsSync(path.join(HOME, d))),
legacy: path.join(HOME, ".codex", "skills", "hallmark"),
},
opencode: {
label: "OpenCode",
dir: path.join(HOME, ".config", "opencode", "skills", "hallmark"),
detect: () => fs.existsSync(path.join(HOME, ".config", "opencode")) || fs.existsSync(path.join(HOME, ".opencode")),
},
};
const args = process.argv.slice(2);
const has = (f) => args.includes(f);
const FLAGS = ["--claude", "--codex", "--opencode", "--cursor", "--copy", "--dry-run", "--force", "--remove", "--help", "-h"];
const unknown = args.filter((a) => !FLAGS.includes(a));
if (has("--help") || has("-h") || unknown.length) {
if (unknown.length) console.log(`Unknown option: ${unknown.join(" ")}\n`);
console.log(`node install.mjs [--claude] [--codex] [--cursor] [--opencode] [--copy] [--dry-run] [--force] [--remove]
Installs Hallmark for every harness it finds (or only the ones named), after checking every theme and reference.
--dry-run print what would be copied and change nothing
--copy give OpenCode its own copy instead of reading the Claude Code or Codex one
--force install even if the checks find a problem
--remove delete every installed copy`);
process.exit(unknown.length ? 2 : 0);
}
const DRY = has("--dry-run");
function copyDir(src, dest) {
fs.mkdirSync(dest, { recursive: true });
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
if (entry.name === ".DS_Store" || entry.name === ".hallmark" || entry.name === "node_modules" || entry.name === "fixtures") continue;
if (entry.isSymbolicLink()) continue; // never follow a link out of the skill into the install
const s = path.join(src, entry.name);
const d = path.join(dest, entry.name);
if (entry.isDirectory()) copyDir(s, d);
else fs.copyFileSync(s, d);
}
}
function installTo(dir) {
if (DRY) return console.log(` would install -> ${dir}`);
const tmp = dir + ".tmp-install";
fs.rmSync(tmp, { recursive: true, force: true });
fs.mkdirSync(tmp, { recursive: true });
for (const item of PAYLOAD) {
const src = path.join(SKILL_ROOT, item);
if (!fs.existsSync(src)) continue;
const dest = path.join(tmp, item);
if (fs.statSync(src).isDirectory()) copyDir(src, dest);
else { fs.mkdirSync(path.dirname(dest), { recursive: true }); fs.copyFileSync(src, dest); }
}
fs.rmSync(dir, { recursive: true, force: true });
fs.mkdirSync(path.dirname(dir), { recursive: true });
fs.renameSync(tmp, dir);
console.log(` installed -> ${dir}`);
}
function removeAt(dir) {
if (!fs.existsSync(dir)) return;
if (DRY) return console.log(` would remove ${dir}`);
fs.rmSync(dir, { recursive: true, force: true });
console.log(` removed ${dir}`);
}
if (has("--remove")) {
console.log("Removing Hallmark from every known install location:");
for (const t of Object.values(TARGETS)) removeAt(t.dir);
removeAt(TARGETS.codex.legacy);
process.exit(0);
}
const explicit = ["claude", "codex", "opencode"].filter((k) => has("--" + k) || (k === "codex" && has("--cursor")));
const picked = explicit.length ? explicit : Object.keys(TARGETS).filter((k) => TARGETS[k].detect());
if (!picked.length) {
console.log("No harness detected (~/.claude, ~/.codex, ~/.agents, ~/.cursor, ~/.config/opencode all absent).");
console.log("Pick explicitly: node install.mjs --claude --codex --opencode");
process.exit(1);
}
const { execFileSync } = await import("node:child_process");
try {
if (!DRY) execFileSync(process.execPath, [path.join(HERE, "theme.mjs"), "index"], { stdio: "inherit" });
} catch {
console.log(" (theme index not rebuilt; run node scripts/theme.mjs index)");
}
const gate = (label, argv) => {
try { execFileSync(process.execPath, argv, { stdio: "pipe" }); return true; }
catch (e) { console.log(`\n${label} failed:\n${String(e.stdout || "").trim()}`); return false; }
};
const themeFiles = fs.readdirSync(path.join(SKILL_ROOT, "references", "themes")).filter((f) => f.endsWith(".md")).map((f) => path.join(SKILL_ROOT, "references", "themes", f));
const clean = gate("refcheck", [path.join(HERE, "refcheck.mjs"), "--errors"]) & gate("theme validate", [path.join(HERE, "theme.mjs"), "validate", ...themeFiles]);
if (!clean && !has("--force")) {
console.log("\nNothing installed. Fix the findings above, or pass --force to install anyway.");
process.exit(1);
}
console.log(`Hallmark installer${DRY ? " (dry run)" : ""} · payload: ${PAYLOAD.join(", ")}`);
for (const key of picked) {
const t = TARGETS[key];
console.log(`\n${t.label}:`);
if (key === "opencode" && !has("--copy")) {
const willHaveCompat = picked.includes("claude") || picked.includes("codex") ||
fs.existsSync(TARGETS.claude.dir) || fs.existsSync(TARGETS.codex.dir);
if (willHaveCompat) {
console.log(` skipped: OpenCode auto-discovers the Claude Code / Codex copy via its compatibility paths.`);
console.log(` (force an explicit copy with: node install.mjs --opencode --copy)`);
continue;
}
}
installTo(t.dir);
if (key === "codex" && fs.existsSync(t.legacy)) {
console.log(` an older copy sits at ${t.legacy}; Codex may list Hallmark twice. Remove it with: node install.mjs --remove, then install again.`);
}
}
console.log(`\nDone. Invoke as: /hallmark (Claude Code) · $hallmark (Codex) · /hallmark (Cursor, OpenCode).`);
@@ -0,0 +1,49 @@
#!/usr/bin/env node
import { readFileSync, existsSync } from "node:fs";
import { execFileSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
const OK = (obj = {}) => { process.stdout.write(JSON.stringify(obj)); process.exit(0); };
function main() {
let raw = "";
try { raw = readFileSync(0, "utf8"); } catch { return OK(); }
let payload;
try { payload = JSON.parse(raw); } catch { return OK(); }
const filePath = payload?.tool_input?.file_path;
if (typeof filePath !== "string" || !filePath) return OK();
const lower = filePath.toLowerCase();
const markup = /\.(html|css)$/.test(lower);
const component = /\.(jsx|tsx|vue|svelte|astro)$/.test(lower);
if (!markup && !component) return OK();
let src = "";
try { src = readFileSync(filePath, "utf8"); } catch { return OK(); }
if (src.length === 0) return OK();
const inHallmarkProject = () => { let d = dirname(filePath); for (let i = 0; i < 8; i++) { if (existsSync(join(d, ".hallmark"))) return true; const up = dirname(d); if (up === d) break; d = up; } return false; };
const looksHallmark = markup ? /\/\*\s*Hallmark/.test(src) : inHallmarkProject();
if (!looksHallmark) return OK();
const gm = src.match(/genre:\s*(editorial|modern-minimal|atmospheric|playful)/i);
const args = [filePath, "--json", "--tier", "floor"];
if (gm) args.push("--genre", gm[1].toLowerCase());
if (/·\s*component:/i.test(src) || lower.endsWith(".preview.html")) args.push("--scope", "component");
const sloplint = join(dirname(fileURLToPath(import.meta.url)), "sloplint.mjs");
let out = "";
try {
out = execFileSync(process.execPath, [sloplint, ...args], { encoding: "utf8", timeout: 4000, stdio: ["ignore", "pipe", "ignore"] });
} catch (e) {
out = e?.stdout?.toString?.() ?? "";
}
if (!out) return OK();
let report;
try { report = JSON.parse(out); } catch { return OK(); }
const fails = (report?.findings ?? []).filter((f) => f.grade === "FAIL");
if (fails.length === 0) return OK();
const name = filePath.split("/").pop();
const lines = fails.slice(0, 10).map((f) => `- gate ${f.gate} (line ${f.line}): ${f.evidence} -> ${f.fix}`);
const more = fails.length > 10 ? `\n (+${fails.length - 10} more)` : "";
const ctx = `Hallmark Floor check on ${name}: ${fails.length} FAIL${fails.length === 1 ? "" : "s"}.\n${lines.join("\n")}${more}\nFix these now; the Reflex and Finish tiers run at Step 7.`;
return OK({ hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: ctx } });
}
try { main(); } catch { OK(); }
File diff suppressed because one or more lines are too long
@@ -0,0 +1,71 @@
#!/usr/bin/env node
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
import { join, dirname, resolve } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { createRequire } from 'node:module';
const HERE = dirname(fileURLToPath(import.meta.url));
const THEMES = join(HERE, '..', 'references', 'themes');
const [slug, pageArg, yArg] = process.argv.slice(2);
if (!slug || !pageArg) {
console.error('usage: node picture.mjs <theme slug> <page index.html> [y of the lower screen at 1440x900]');
process.exit(2);
}
if (!/^[a-z0-9][a-z0-9-]*$/.test(slug)) { console.error(`not a theme slug: ${slug}`); process.exit(2); }
const page = resolve(pageArg);
const themeFile = join(THEMES, `${slug}.md`);
if (!existsSync(themeFile)) { console.error(`no theme at ${themeFile}`); process.exit(1); }
if (!existsSync(page)) { console.error(`no page at ${page}`); process.exit(1); }
let puppeteer = null;
const roots = [process.env.HALLMARK_PUPPETEER, process.cwd(), HERE].filter(Boolean);
try { const { execSync } = await import('node:child_process'); roots.push(dirname(execSync('npm root -g', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim())); } catch {}
for (const root of roots) {
for (const name of ['puppeteer-core', 'puppeteer']) {
try { puppeteer = (await import(pathToFileURL(createRequire(join(root, 'noop.js')).resolve(name)).href)).default; } catch {}
if (puppeteer) break;
}
if (puppeteer) break;
}
if (!puppeteer) { console.error('picture.mjs needs puppeteer-core or puppeteer (local, global or HALLMARK_PUPPETEER)'); process.exit(1); }
const CHROMES = [process.env.CHROME_PATH, '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '/Applications/Chromium.app/Contents/MacOS/Chromium', '/usr/bin/google-chrome', '/usr/bin/google-chrome-stable', '/usr/bin/chromium', '/usr/bin/chromium-browser', '/snap/bin/chromium', 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'];
const findChrome = () => { const c = CHROMES.find((x) => x && existsSync(x)); if (c) return c; try { const b = typeof puppeteer.executablePath === 'function' ? puppeteer.executablePath() : null; if (typeof b === 'string' && existsSync(b)) return b; } catch {} return null; };
const chrome = findChrome();
if (!chrome) { console.error('no Chrome or Chromium found; set CHROME_PATH to its executable'); process.exit(1); }
const browser = await puppeteer.launch({ executablePath: chrome, headless: true });
const p = await browser.newPage();
await p.emulateMediaFeatures([{ name: 'prefers-reduced-motion', value: 'reduce' }]);
await p.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
await p.goto(pathToFileURL(page).href, { waitUntil: 'networkidle0', timeout: 45000 }).catch(() => {});
await p.evaluate(async () => { document.documentElement.classList.add('hallmark-shot'); await document.fonts.ready; for (const i of document.querySelectorAll('img[loading="lazy"]')) i.loading = 'eager'; for (let y = 0; y < document.documentElement.scrollHeight; y += 700) { window.scrollTo(0, y); await new Promise((r) => setTimeout(r, 40)); } window.scrollTo(0, 0); const waiting = [...document.images].filter((i) => !i.complete); await Promise.race([Promise.all(waiting.map((i) => new Promise((r) => { i.addEventListener('load', r, { once: true }); i.addEventListener('error', r, { once: true }); }))), new Promise((r) => setTimeout(r, 15000))]); await Promise.all([...document.images].map((i) => (i.complete && i.naturalWidth && i.decode ? i.decode().catch(() => {}) : null))); });
await new Promise((r) => setTimeout(r, 800));
// the viewport itself, not a clip: a clipped capture re-lays the page out and drops content sized in container units
await p.bringToFront();
const first = await p.screenshot({ type: 'png' });
let y = Number(yArg);
if (!yArg || Number.isNaN(y)) y = await p.evaluate(() => { const s = [...document.querySelectorAll('section')].map((e) => e.getBoundingClientRect().top + scrollY).filter((t) => t > 700); return s.length ? Math.round(s[0] - 40) : 1800; });
await p.evaluate((v) => { window.scrollTo(0, v); for (const el of document.querySelectorAll('body *')) { const cs = getComputedStyle(el); if (/fixed|sticky/.test(cs.position) && el.getBoundingClientRect().top < 120) el.style.visibility = 'hidden'; } }, y);
await new Promise((r) => setTimeout(r, 700));
const lower = await p.screenshot({ type: 'png' });
const stamp = await p.evaluate(() => [...document.querySelectorAll('style')].map((s) => s.textContent.slice(0, 600)).join('\n'));
const cssPath = join(dirname(page), 'style.css');
const head = (existsSync(cssPath) ? readFileSync(cssPath, 'utf8').slice(0, 600) : '') + '\n' + stamp;
const shape = (/shape:\s*([^·*\n]+?)\s*[·*\n]/.exec(head) || [])[1];
const hero = (/hero:\s*([^·*\n]+?)\s*[·*\n]/.exec(head) || [])[1];
const c = await browser.newPage();
await c.setViewport({ width: 960, height: 1208, deviceScaleFactor: 1 });
await c.setContent(`<body style="margin:0;background:#8a8a8a"><img src="data:image/png;base64,${first.toString('base64')}" style="display:block;width:960px;height:600px"><div style="height:8px"></div><img src="data:image/png;base64,${lower.toString('base64')}" style="display:block;width:960px;height:600px"></body>`, { waitUntil: 'load' });
const out = join(THEMES, `${slug}.jpg`);
writeFileSync(out, await c.screenshot({ type: 'jpeg', quality: 80, clip: { x: 0, y: 0, width: 960, height: 1208 } }));
await browser.close();
if (shape && hero) {
let src = readFileSync(themeFile, 'utf8');
const short = shape.trim().split(/\s*[(;,:]/)[0].replace(/,\s*$/, '');
const way = (new RegExp(`\\b${slug}:\\s*([a-z][a-z-]*)`).exec(head) || [])[1];
const fallback = (/`([a-z][a-z-]*)`\s*\(default\)/.exec(src) || [])[1];
const line = `pictured: ${short}, ${hero.trim().split(/[ ,(]/)[0]} hero${way && fallback && way !== fallback ? `, in the ${way} colourway` : ''}`;
src = /^pictured:.*$/m.test(src) ? src.replace(/^pictured:.*$/m, line) : src.replace(/^(material:.*)$/m, `$1\n${line}`);
writeFileSync(themeFile, src);
try { const { execFileSync } = await import('node:child_process'); execFileSync(process.execPath, [join(HERE, 'theme.mjs'), 'index'], { stdio: 'ignore' }); } catch {}
}
console.log(`${out} (lower screen at y ${y}${shape ? `; ${shape.trim()}, ${hero ? hero.trim() : '?'} hero` : ''})`);
@@ -0,0 +1,352 @@
#!/usr/bin/env node
import { readFileSync, readdirSync, statSync, existsSync, mkdtempSync, copyFileSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, dirname, relative, basename, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { spawnSync } from 'node:child_process';
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const args = process.argv.slice(2);
const AS_JSON = args.includes('--json');
const ONLY_ERRORS = args.includes('--errors');
function walk(dir, out = []) {
for (const name of readdirSync(dir)) {
if (name === 'node_modules' || name === '.hallmark' || name.startsWith('.')) continue;
const p = join(dir, name);
const st = statSync(p);
if (st.isDirectory()) { if (name !== 'fixtures') walk(p, out); }
else out.push(p);
}
return out;
}
const FILES = walk(ROOT);
const MD = FILES.filter((f) => f.endsWith('.md'));
const TEXT = FILES.filter((f) => /\.(md|mjs|json|yaml|css|html)$/.test(f));
const BY_BASE = new Map();
for (const f of FILES) { const b = basename(f); if (!BY_BASE.has(b)) BY_BASE.set(b, []); BY_BASE.get(b).push(f); }
const read = (f) => readFileSync(f, 'utf8');
const findings = [];
const add = (level, file, line, rule, msg) => findings.push({ level, file: relative(ROOT, file), line, rule, msg });
const lineAt = (src, i) => src.slice(0, i).split('\n').length;
const SKILL = join(ROOT, 'SKILL.md');
const VERSION = (/^version:\s*([\d.]+)/m.exec(read(SKILL)) || [])[1];
const gatesSrc = read(join(ROOT, 'references', 'gates.md'));
const GATES = new Map();
for (const m of gatesSrc.matchAll(/^\|\s*(\d{1,2}(?:[a-d]|i{1,3})?)\s*\|\s*(Floor|Reflex|Ledger)\s*\|/gm)) GATES.set(m[1], m[2].toLowerCase());
const FCHECKS = new Set([...gatesSrc.matchAll(/\b(F\d{1,2})\s/g)].map((m) => m[1]));
const retiredLine = (/Retired numbers stay retired:\*\*\s*([\d, and]+) are never reused/.exec(gatesSrc) || [])[1] || '';
if (!retiredLine) findings.push({ level: 'error', file: 'references/gates.md', line: 1, rule: 'gate', msg: 'the retired-numbers sentence is missing or reworded; refcheck reads it' });
const RETIRED = new Set((retiredLine.match(/\d+/g) || []));
const NUMBERS = new Set([...GATES.keys()].map((k) => k.match(/^\d+/)[0]));
function gateProblem(id) {
if (/^F\d+$/.test(id)) return FCHECKS.has(id) ? null : `F-check ${id} does not exist`;
const num = id.match(/^\d+/)[0];
if (RETIRED.has(num)) return `gate ${num} is retired`;
if (GATES.has(id)) return null;
if (id === num && NUMBERS.has(num)) return null;
if (!NUMBERS.has(num)) return `gate ${num} does not exist`;
return `gate ${num} has no clause ${id.slice(num.length)}`;
}
const ID = String.raw`(?:F\d{1,2}|\d{1,2}(?:[a-d]|i{1,3})?)`;
const GATE_LIST = new RegExp(String.raw`\b(?:gates?|waive|answered)\s+(${ID}(?:(?:\s*,\s*|\s+and\s+|\s+to\s+|\s+or\s+)${ID})*)`, 'gi');
const PAREN_LIST = new RegExp(String.raw`\((${ID}(?:,\s*${ID})*)\)`, 'g');
for (const f of MD) {
const src = read(f);
const isGates = f.endsWith(join('references', 'gates.md'));
const seen = new Set();
const check = (list, at) => {
for (const id of list.split(/\s*,\s*|\s+and\s+|\s+to\s+|\s+or\s+/)) {
const key = `${id}@${at}`;
if (!id || seen.has(key)) continue;
seen.add(key);
const p = gateProblem(id);
if (p) add('error', f, lineAt(src, at), 'gate', p);
}
};
for (const m of src.matchAll(GATE_LIST)) {
if (isGates && /were merged|stay retired|Retired numbers/.test(src.slice(Math.max(0, m.index - 200), m.index + 200))) continue;
check(m[1], m.index);
}
for (const m of src.matchAll(PAREN_LIST)) {
if (/[\w-]/.test(src[m.index - 1] || '')) continue;
if (/^\d+$/.test(m[1]) && Number(m[1]) > 99) continue;
check(m[1], m.index);
}
}
const PROJECT_FILES = new Set(['design.md', 'DESIGN.md', 'brand-spec.md', 'AGENTS.md', 'CLAUDE.md', 'brief.md', 'README.md', 'prompts.md', 'notes.md']);
const CODE_EXT = /\.(md|mjs)$/;
for (const f of MD) {
const src = read(f);
for (const m of src.matchAll(/\]\(([^)\s]+)\)/g)) {
const raw = m[1];
if (/^(https?:|mailto:|#)/.test(raw)) continue;
const target = raw.split('#')[0];
if (!target) continue;
const p = resolve(dirname(f), target);
if (!existsSync(p)) add('error', f, lineAt(src, m.index), 'link', `dead link ${raw}`);
}
for (const m of src.matchAll(/`([\w./-]+\.(?:md|mjs))`/g)) {
const name = m[1];
if (name.includes('<') || name.includes('*')) continue;
const b = basename(name);
if (PROJECT_FILES.has(b) && !name.includes('references/')) continue;
if (!CODE_EXT.test(b)) continue;
const found = BY_BASE.has(b) || existsSync(resolve(dirname(f), name)) || existsSync(join(ROOT, name));
if (!found) add('error', f, lineAt(src, m.index), 'mention', `names ${name}, which does not exist`);
}
}
const headingsOf = new Map();
function headings(file) {
if (!headingsOf.has(file)) {
const src = read(file);
const hs = [...src.matchAll(/^(#{1,4})\s+(.+)$/gm)].map((m) => m[2].replace(/[*`]/g, '').trim());
const bold = [...src.matchAll(/^\s*(?:[-*]\s+|\d+\.\s+)?\*\*([^*]+)\*\*/gm)].map((m) => m[1].trim());
headingsOf.set(file, { hs, bold });
}
return headingsOf.get(file);
}
const norm = (s) => s.toLowerCase().replace(/[^a-z0-9 ]+/g, ' ').replace(/\s+/g, ' ').trim();
for (const f of MD) {
const src = read(f);
for (const m of src.matchAll(/§\s*([^\n§]{1,60})/g)) {
const lineStart = src.lastIndexOf('\n', m.index) + 1;
const back = src.slice(lineStart, m.index);
const mentions = [...back.matchAll(/([\w-]+(?:\/[\w-]+)*\.md)/g)];
const fm = mentions.length ? mentions[mentions.length - 1] : null;
let target = f;
if (fm) {
const cands = BY_BASE.get(basename(fm[1])) || [];
if (!cands.length) continue;
target = cands.find((c) => c.endsWith(fm[1])) || cands[0];
}
const rest = m[1].trim();
const { hs, bold } = headings(target);
const num = /^(\d+)\b/.exec(rest);
if (num) {
if (!hs.some((h) => new RegExp(`^${num[1]}[.\\s]`).test(h))) add('error', f, lineAt(src, m.index), 'section', `${relative(ROOT, target)} has no § ${num[1]}`);
continue;
}
const words = norm(rest.split(/[,.;:()]|\s(?:and|to|or|for|on|in|when|is|binds|says|owns)\s/)[0]).split(' ').slice(0, 3).join(' ');
if (!words || words.length < 3) continue;
const pool = [...hs, ...bold].map(norm);
const first = words.split(' ')[0];
if (!pool.some((h) => h.includes(words) || h.startsWith(first) || h.includes(` ${first}`))) add('warn', f, lineAt(src, m.index), 'section', `${relative(ROOT, target)} has no section like "§ ${rest.split(/[,.;:)]/)[0].trim()}"`);
}
for (const m of src.matchAll(/\bStep (\d+(?:\.\d+)?)\b/g)) {
const n = m[1];
if (n.includes('.') || Number(n) > 7) add('error', f, lineAt(src, m.index), 'step', `SKILL.md has no Step ${n} (steps run 0 to 7)`);
}
}
const theme = read(join(ROOT, 'scripts', 'theme.mjs'));
const tokenNames = (s) => new Set([...s.matchAll(/(--[a-z][\w-]*)\s*:/g)].map((m) => m[1]));
const CANON = new Set();
for (const block of ['SCALE', 'CUSTOM_TOKENS']) {
const m = new RegExp(`const ${block} = \`([\\s\\S]*?)\`;`).exec(theme);
if (m) for (const t of tokenNames(m[1])) CANON.add(t);
}
const THEME_DIR = join(ROOT, 'references', 'themes');
const themeFiles = MD.filter((f) => dirname(f) === THEME_DIR && basename(f) !== 'README.md');
const themeCount = new Map();
for (const f of themeFiles) for (const t of tokenNames(read(f))) themeCount.set(t, (themeCount.get(t) || 0) + 1);
for (const [t, n] of themeCount) if (n >= Math.ceil(themeFiles.length * 0.9)) CANON.add(t);
for (const t of ['--banner-height', '--i', '--texture-opacity', '--logo-count']) CANON.add(t);
const PHANTOM = new Map(Object.entries({
'--page-gutter': '--gutter', '--page-max': '--container', '--ease-standard': '--ease-out', '--dur-mid': '--dur-long',
'--dur-fast': '--dur-micro', '--dur-base': '--dur-short', '--dur-slow': '--dur-long', '--banner-h': '--banner-height',
'--bar-h': 'a min-height', '--font-mono': '--font-outlier', '--font-label': '--font-body', '--font-wordmark': '--font-outlier',
'--tracking-label': 'nothing (labels are untracked, gate 67)', '--display': '--font-display', '--rule-fine': '--rule-bar',
}));
const codeOf = (src) => [...src.matchAll(/```[a-z]*\n([\s\S]*?)```/g)].map((m) => ({ text: m[1], at: m.index + m[0].indexOf(m[1]) })).concat([...src.matchAll(/`([^`\n]+)`/g)].map((m) => ({ text: m[1], at: m.index })));
for (const f of MD) {
const src = read(f);
const isTheme = dirname(f) === THEME_DIR;
const local = tokenNames(src);
for (const { text, at } of codeOf(src)) {
for (const m of text.matchAll(/var\(\s*(--[a-z][\w-]*)\s*(,)?/g)) {
const t = m[1];
const line = lineAt(src, at + m.index);
if (PHANTOM.has(t) && !local.has(t)) add('error', f, line, 'token', `${t} does not exist; use ${PHANTOM.get(t)}`);
else if (!m[2] && !CANON.has(t) && !local.has(t) && !isTheme) {
const n = themeCount.get(t) || 0;
add('warn', f, line, 'token', n ? `${t} exists only in ${n} theme(s); a shared file cannot rely on it` : `${t} is not in the token vocabulary (export-formats.md § The token set)`);
}
}
}
}
const stampRe = /Hallmark · (macrostructure|studied):/g;
for (const f of TEXT) {
const src = read(f);
if (/[\u2014\u2013]/.test(src)) for (const m of src.matchAll(/[\u2014\u2013]/g)) add('error', f, lineAt(src, m.index), 'dash', 'em or en dash');
for (const m of src.matchAll(stampRe)) add('error', f, lineAt(src, m.index), 'stamp', `old stamp field "${m[1]}:"; the stamp opens with shape, genre, theme`);
for (const m of src.matchAll(/(?:Hallmark[^\n]{0,200}|\*\/[^\n]{0,0})\bv(\d+\.\d+\.\d+)\b/g)) {
if (VERSION && m[1] !== VERSION && !/v0\.|v1\./.test(`v${m[1]}`)) add('error', f, lineAt(src, m.index), 'version', `v${m[1]} where the skill is v${VERSION}`);
}
}
const themeVersion = (/const VERSION = '([\d.]+)'/.exec(theme) || [])[1];
if (themeVersion !== VERSION) add('error', join(ROOT, 'scripts', 'theme.mjs'), 1, 'version', `theme.mjs VERSION ${themeVersion} where SKILL.md says ${VERSION}`);
for (const f of MD) {
const src = read(f);
for (const m of src.matchAll(/```html\n([\s\S]*?)```/g)) {
const html = m[1].replace(/<!--[\s\S]*?-->/g, '').replace(/<(script|style)[\s\S]*?<\/\1>/g, '');
for (const t of html.matchAll(/>([^<>]*)</g)) {
const text = t[1];
const line = lineAt(src, m.index + m[0].indexOf(m[1]) + t.index);
if (/[←→↗↘↩]|-->|->/.test(text)) add('error', f, line, '63', `arrow in sample copy: "${text.trim().slice(0, 50)}"`);
if (/\S\s·\s\S/.test(text) && !/marquee|ticker/i.test(html)) add('warn', f, line, '63', `middle-dot string in sample copy: "${text.trim().slice(0, 50)}"`);
}
}
for (const m of src.matchAll(/```css\n([\s\S]*?)```/g)) {
for (const r of m[1].matchAll(/([^{}]+)\{([^}]*)\}/g)) {
const sel = r[1].trim(); const body = r[2];
const ls = /letter-spacing:\s*(-?[\d.]+)em/.exec(body);
if (/uppercase/.test(body) && ls && Number(ls[1]) > 0.04 && /label|caption|meta|tag|chip|eyebrow|kicker|th\b|nav|link|small|note/i.test(sel) && !/wordmark|logo|brand/i.test(sel)) add('error', f, lineAt(src, m.index + m[0].indexOf(m[1]) + r.index + r[0].length - r[0].trimStart().length), '67', `${sel} sets tracked capitals (${ls[1]}em)`);
if (/small-caps|smcp/.test(body)) add('error', f, lineAt(src, m.index + m[0].indexOf(m[1]) + r.index + r[0].length - r[0].trimStart().length), '67', `${sel} sets small caps`);
}
}
}
const sloplint = read(join(ROOT, 'scripts', 'sloplint.mjs'));
const tiersBlock = (/const TIERS = new Map\(Object\.entries\(\{([\s\S]*?)\}\)\)/.exec(sloplint) || [])[1] || '';
const TIERS = new Map([...tiersBlock.matchAll(/'([\w]+)':\s*'(\w+)'/g)].map((m) => [m[1], m[2]]));
for (const [id, tier] of GATES) {
const t = TIERS.get(id);
if (t && t !== tier) add('error', join(ROOT, 'scripts', 'sloplint.mjs'), 1, 'tier', `sloplint tiers ${id} as ${t}; gates.md says ${tier}`);
}
const index = JSON.parse(read(join(THEME_DIR, 'index.json')));
const indexed = new Set(index.themes.map((t) => t.slug));
for (const f of themeFiles) if (!indexed.has(basename(f, '.md'))) add('error', f, 1, 'index', 'theme missing from index.json (run theme.mjs index)');
for (const t of index.themes) if (!existsSync(join(ROOT, t.file))) add('error', join(THEME_DIR, 'index.json'), 1, 'index', `index lists ${t.file}, which does not exist`);
const fontsSrc = read(join(ROOT, 'references', 'fonts.md'));
const unusedTable = fontsSrc.slice(fontsSrc.indexOf('## Display faces the catalog does not use'), fontsSrc.indexOf('## Body faces'));
const pairTable = fontsSrc.includes('## Pairings by tone') ? fontsSrc.slice(fontsSrc.indexOf('## Pairings by tone'), fontsSrc.indexOf('## The wordmark')) : '';
const catalogFaces = index.themes.map((t) => ({ name: t.name, face: t.display.face.toLowerCase().replace(/ italic$/, '') }));
for (const [label, table] of [['the faces-the-catalog-does-not-use table', unusedTable], ['the display column of the pairings table', pairTable.split('\n').map((l) => l.split('|')[2] || '').join('\n')]]) {
for (const { name, face } of catalogFaces) {
if (new RegExp(`(^|[\\s,|])${face.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?=[\\s,|(]|$)`, 'im').test(table.toLowerCase())) add('error', join(ROOT, 'references', 'fonts.md'), lineAt(fontsSrc, fontsSrc.toLowerCase().indexOf(face)), 'fonts', `${label} offers ${face}, which ${name} already sets as its display face`);
}
}
const reach = new Set([SKILL]);
const queue = [SKILL];
while (queue.length) {
const f = queue.shift();
const src = read(f);
const names = new Set([...src.matchAll(/([\w-]+\.(?:md|mjs|json))/g)].map((m) => m[1]));
for (const n of names) for (const c of BY_BASE.get(n) || []) if (!reach.has(c)) { reach.add(c); if (c.endsWith('.md')) queue.push(c); }
}
for (const f of themeFiles) reach.add(f);
for (const f of [...reach]) {
if (!f.endsWith('.md')) continue;
for (const m of read(f).matchAll(/([\w-]+)\/<[\w-]+>\.md/g)) for (const c of MD) if (basename(dirname(c)) === m[1]) reach.add(c);
}
for (const f of MD) if (!reach.has(f) && basename(f) !== 'README.md') add('warn', f, 1, 'orphan', 'no file reachable from SKILL.md names this file');
const skillBytes = Buffer.byteLength(read(SKILL));
const front = /^---\n([\s\S]*?)\n---\n/.exec(readFileSync(SKILL, 'utf8'));
const fm = front ? Object.fromEntries(front[1].split('\n').map((l) => /^([a-z-]+):\s*(.*)$/.exec(l)).filter(Boolean).map((m) => [m[1], m[2]])) : {};
if (!fm.name || !fm.description) add('error', SKILL, 1, 'frontmatter', 'SKILL.md needs name and description in its frontmatter, or installers find no skill');
else if (!/^"(?:[^"\\]|\\.)*"$/.test(fm.description) || fm.description.length > 1026) add('error', SKILL, 2, 'frontmatter', 'the description must be one double-quoted line of 1,024 characters or fewer; an unquoted colon breaks strict YAML parsers');
if (skillBytes > 19000) add('error', SKILL, 1, 'size', `SKILL.md is ${skillBytes} bytes; keep it at 19,000 or under so the 5,000 tokens a harness re-attaches after compaction still hold Step 7`);
for (const f of themeFiles) {
const src = read(f);
const hint = /## Build hint[\s\S]*?```css\n([\s\S]*?)```/.exec(src);
if (!hint) continue;
const at = src.indexOf(hint[1]);
for (const m of hint[1].matchAll(/(?:^|[{;])\s*(?!--)([a-z-]+)\s*:([^;{}]*)/g)) {
if (/oklch\(|#[0-9a-fA-F]{3,8}\b|rgba?\(|hsla?\(/.test(m[2])) add('error', f, lineAt(src, at + m.index), 'literal', `build hint sets ${m[1]} with a colour literal; route it through a token (48)`);
}
}
const exemplarDir = join(ROOT, 'scripts', 'fixtures', 'exemplars');
const clean = [...(existsSync(exemplarDir) ? readdirSync(exemplarDir).filter((n) => n.endsWith('.html')).map((n) => join(exemplarDir, n)) : []),
...['eyebrow-pass', 'tailwind-pass'].map((n) => join(ROOT, 'scripts', 'fixtures', n)).filter(existsSync)];
for (const target of clean) {
const run = spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), target, '--json'], { encoding: 'utf8' });
let s = null;
try { s = JSON.parse(run.stdout).summary; } catch {}
if (!s) add('error', target, 1, 'lint', 'sloplint did not run on this file');
else if (s.fails || s.reflex || s.warns) add('error', target, 1, 'lint', `must lint clean, has ${s.fails} FAIL, ${s.reflex} REFLEX, ${s.warns} WARN`);
}
const FIX = join(ROOT, 'scripts', 'fixtures');
const lintJson = (t) => { const r = spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), t, '--json'], { encoding: 'utf8' }); try { return JSON.parse(r.stdout); } catch { return null; } };
const gatesOf = (j) => new Set(j.findings.map((x) => String(x.gate)));
const expectations = [
['eyebrow-fail', (j) => j.findings.filter((x) => x.gate === '54' && x.grade === 'FAIL').length === 6, 'gate 54 must FAIL six times'],
['eyebrow-pass', (j) => !j.findings.some((x) => x.gate === '54'), 'gate 54 must not fire'],
['waiver', (j) => ['fails:0', 'reflex:0', 'waived:5', 'rejected:2', 'answered:1', 'notes:1'].every((kv) => { const [k, v] = kv.split(':'); return j.summary[k] === Number(v); }), 'must report fails 0, reflex 0, waived 5, rejected 2, answered 1, notes 1'],
['slopped.html', (j) => ['1', '2a', '4', '7b', '10a', '15', '19', '20', '22', '46a', '48', '54'].every((g) => gatesOf(j).has(g)), 'must fire 1, 2a, 4, 7b, 10a, 15, 19, 20, 22, 46a, 48 and 54'],
['tailwind-fail', (j) => ['67', '54', '64', '10a', '12', '11', '2a', '2b', '29', '6a', '34', '48', '74', '3'].every((g) => gatesOf(j).has(g)), 'must fire 67, 54, 64, 10a, 12, 11, 2a, 2b, 29, 6a, 34, 48, 74 and 3'],
];
for (const [name, ok, msg] of existsSync(FIX) ? expectations : []) {
const target = join(FIX, name);
if (!existsSync(target)) { add('error', target, 1, 'fixture', 'missing'); continue; }
const j = lintJson(target);
if (!j) add('error', target, 1, 'fixture', 'sloplint did not run on this fixture');
else if (!ok(j)) add('error', target, 1, 'fixture', msg);
}
const keptDir = join(FIX, 'kept');
if (existsSync(keptDir)) {
const tmp = mkdtempSync(join(tmpdir(), 'hallmark-kept-'));
try {
const run = (flag) => spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), 'index.html', flag, '--json'], { encoding: 'utf8', cwd: tmp });
copyFileSync(join(keptDir, 'before.html'), join(tmp, 'index.html'));
run('--before');
copyFileSync(join(keptDir, 'after.html'), join(tmp, 'index.html'));
let j = null;
try { j = JSON.parse(run('--kept').stdout); } catch {}
const kept = j ? j.findings.filter((x) => x.gate === 'kept') : [];
const fails = kept.filter((x) => x.grade === 'FAIL').map((x) => x.evidence).join(' | ');
const warns = kept.filter((x) => x.grade === 'WARN').map((x) => x.evidence).join(' | ');
const want = [[fails, 'rooms.html'], [fails, 'nights'], [fails, "track('book')"], [fails, 'book-button'], [fails, '#nav-toggle'], [warns, 'nav-toggle']];
if (!j) add('error', keptDir, 1, 'fixture', 'sloplint --kept did not run on the kept fixture');
else if (!want.every(([hay, needle]) => hay.includes(needle))) add('error', keptDir, 1, 'fixture', 'the kept check must fail the lost link, field, handler, test hook and script hook, and warn on the lost id');
else if (fails.includes('mailto:')) add('error', keptDir, 1, 'fixture', 'a link recorded as dropped in the stamp must not fail');
} finally { rmSync(tmp, { recursive: true, force: true }); }
}
const REPO = resolve(ROOT, '..', '..');
const pkgFile = join(REPO, 'package.json');
if (existsSync(pkgFile)) {
let pkg = null;
try { pkg = JSON.parse(read(pkgFile)); } catch {}
if (pkg && pkg.name === 'hallmark') {
if (pkg.version !== VERSION) add('error', pkgFile, 1, 'version', `package.json says ${pkg.version} where SKILL.md says ${VERSION}`);
const docs = ['README.md', 'ROADMAP.md', ...(existsSync(join(REPO, 'docs')) ? readdirSync(join(REPO, 'docs')).filter((n) => n.endsWith('.md')).map((n) => join('docs', n)) : [])].map((n) => join(REPO, n)).filter(existsSync);
for (const f of docs) {
const src = read(f);
for (const m of src.matchAll(/\]\(([^)\s]+)\)/g)) {
const t = m[1].split('#')[0].split('?')[0];
if (!t || /^(https?:|mailto:|data:)/.test(m[1])) continue;
if (!existsSync(resolve(dirname(f), t))) add('error', f, lineAt(src, m.index), 'link', `${m[1]} does not resolve`);
}
}
}
}
const shown = ONLY_ERRORS ? findings.filter((x) => x.level === 'error') : findings;
const errors = findings.filter((x) => x.level === 'error').length;
const warns = findings.length - errors;
if (AS_JSON) console.log(JSON.stringify({ errors, warns, findings: shown }, null, 1));
else {
shown.sort((a, b) => (a.level === b.level ? a.file.localeCompare(b.file) || a.line - b.line : a.level === 'error' ? -1 : 1));
for (const x of shown) console.log(`${x.level === 'error' ? 'ERROR' : 'warn '} ${x.file}:${x.line} [${x.rule}] ${x.msg}`);
console.log(errors || warns ? `refcheck: ${errors} error(s), ${warns} warning(s) across ${MD.length} reference files` : `refcheck: clean across ${MD.length} reference files`);
}
process.exit(errors ? 1 : 0);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+650
View File
@@ -0,0 +1,650 @@
#!/usr/bin/env node
import { readFileSync, writeFileSync, readdirSync, existsSync, mkdirSync, renameSync } from 'node:fs';
import { join, dirname, basename, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { createHash, randomBytes } from 'node:crypto';
const HERE = dirname(fileURLToPath(import.meta.url));
const THEMES = join(HERE, '..', 'references', 'themes');
const INDEX = join(THEMES, 'index.json');
const VERSION = '2.0.0';
const PHOTOS = join(HERE, 'photos.json');
const args = process.argv.slice(2);
const cmd = args[0];
const flag = (k, d = null) => { const i = args.indexOf('--' + k); const v = i >= 0 ? args[i + 1] : undefined; return v !== undefined && !String(v).startsWith('--') ? v : d; };
const has = (k) => args.includes('--' + k);
const VALUED = new Set(['genre', 'prompt', 'brief', 'log', 'n', 'reroll', 'dealt', 'dir', 'axes', 'face', 'hue', 'entry', 'redesign', 'theme', 'orient', 'save', 'avoid', 'material', 'seed', 'job']);
const positional = () => { const out = []; for (let i = 1; i < args.length; i++) { const a = args[i]; if (a.startsWith('--')) { if (VALUED.has(a.slice(2))) i++; continue; } out.push(a); } return out; };
const GENRES = ['editorial', 'modern-minimal', 'atmospheric', 'playful'];
// A theme slug names a file in references/themes, so it is a plain name, never a path.
const isSlug = (s) => /^[a-z0-9][a-z0-9-]*$/.test(s);
function usage() {
console.error(`usage:
node theme.mjs deal --genre <g> --prompt "<prompt>" [--log .hallmark/log.json] [--n 3] [--reroll 0] [--json]
node theme.mjs scaffold <slug> [--dealt "<n>/3, seed <seed>"] [--redesign polish|restyle|full] [--scope app] [--dir <beside the stylesheet>] [--force]
node theme.mjs scaffold --custom | --brand [--redesign polish|restyle|full] [--scope app] [--dir <beside the stylesheet>] [--force]
node theme.mjs check [--axes "<paper>/<display>/<accent>"] [--face "<display face>"] [--hue <accent hue>] [--log .hallmark/log.json]
paper: light | mid | dark · accent: warm | cool | neutral | chromatic-<hue name>
display: roman-serif | high-contrast-serif | slab-serif | grotesk-sans | grotesk-heavy | geometric-sans | rounded-sans | display-condensed | display-heavy | mono | pixel | handwritten | blackletter
node theme.mjs draw --material photo|product|words --job <subscribe|book|visit|attend|buy|try|sign up|hire|join|listen> [--theme <slug>] [--log .hallmark/log.json] [--seed <hex>]
node theme.mjs photos "<subject>" ["<subject>" ...] [--theme <slug>] [--n 3] [--orient landscape|portrait|square] [--log .hallmark/log.json] [--avoid <file naming photos>] [--save <dir>] [--json]
node theme.mjs log --entry '<one JSON object>' [--log .hallmark/log.json]
node theme.mjs index
node theme.mjs list
node theme.mjs validate <files...>`);
}
function parseHeader(src, file) {
const m = /^---\n([\s\S]*?)\n---/.exec(src);
if (!m) throw new Error(`${file}: no header block`);
const h = {};
for (const line of m[1].split('\n')) {
const mm = /^([a-z]+):\s*(.*)$/.exec(line.trim());
if (mm) h[mm[1]] = mm[2].trim();
}
const need = ['name', 'slug', 'genre', 'paper', 'display', 'accent', 'posture', 'keywords', 'material'];
for (const k of need) if (!h[k]) throw new Error(`${file}: header is missing "${k}"`);
const [pband, pL, phue] = h.paper.split(/\s+/);
const [dclass, ...dface] = h.display.split(/\s+/);
const [aband, ahue] = h.accent.split(/\s+/);
return {
name: h.name, slug: h.slug, genre: h.genre, posture: h.posture,
paper: { band: pband, L: Number(pL), hue: Number(phue) },
display: { class: dclass, face: dface.join(' ') },
accent: { band: aband, hue: Number(ahue) },
keywords: h.keywords.split(',').map((s) => s.trim().toLowerCase()).filter(Boolean),
material: h.material, file: `references/themes/${basename(file)}`,
...(h.photo ? { photo: h.photo } : {}),
...(h.pictured ? { pictured: h.pictured } : {}),
...(existsSync(join(THEMES, basename(file).replace(/\.md$/, '.jpg'))) ? { picture: `references/themes/${basename(file).replace(/\.md$/, '.jpg')}` } : {}),
};
}
function buildIndex() {
const files = readdirSync(THEMES).filter((f) => f.endsWith('.md') && f !== 'README.md').sort();
const entries = files.map((f) => parseHeader(readFileSync(join(THEMES, f), 'utf8'), f));
const slugs = new Set();
for (const e of entries) {
if (slugs.has(e.slug)) throw new Error(`duplicate slug ${e.slug}`);
slugs.add(e.slug);
}
writeFileSync(INDEX, JSON.stringify({ built: new Date().toISOString().slice(0, 10), themes: entries }, null, 1) + '\n');
return entries;
}
function loadIndex() {
if (!existsSync(INDEX)) return buildIndex();
return JSON.parse(readFileSync(INDEX, 'utf8')).themes;
}
function addLog() {
const file = resolve(flag('log', '.hallmark/log.json'));
let entry;
try { entry = JSON.parse(flag('entry', '')); } catch { entry = null; }
if (!entry || Array.isArray(entry) || typeof entry !== 'object') { console.error('--entry takes one JSON object, the build\'s log entry'); process.exit(2); }
if (!entry.date) entry.date = new Date().toISOString().slice(0, 10);
if (!entry.mode) entry.mode = 'build';
if (!['build', 'redesign'].includes(entry.mode)) { console.error('mode is build or redesign'); process.exit(2); }
if (entry.mode === 'redesign' && !['polish', 'restyle', 'full'].includes(entry.depth)) { console.error('a redesign entry names its depth: polish, restyle or full'); process.exit(2); }
const composed = entry.scope !== 'app' && (entry.mode === 'build' || entry.depth === 'full');
if (!entry.imagery && entry.enrichment) entry.imagery = entry.enrichment;
if (!entry.prompt && entry.brief) { entry.prompt = entry.brief; delete entry.brief; }
const missing = [...(composed ? ['shape', 'axes', 'hero', 'nav', 'footer', 'imagery', 'entry', 'fingerprint', 'sections', 'signature'] : []), ...(entry.depth === 'polish' ? [] : ['theme']), 'prompt'].filter((k) => !entry[k]);
if (entry.photos && !Array.isArray(entry.photos)) { console.error('photos is the list of photo ids the page used'); process.exit(2); }
if (existsSync(file)) { try { JSON.parse(readFileSync(file, 'utf8')); } catch { console.error(`${file} is not valid JSON; fix it or move it aside, nothing was written`); process.exit(1); } }
const next = [entry, ...readLog(file)].slice(0, 20);
mkdirSync(dirname(file), { recursive: true });
const tmp = `${file}.${process.pid}.tmp`;
writeFileSync(tmp, JSON.stringify(next, null, 1) + '\n');
renameSync(tmp, file);
console.log(`logged ${entry.mode === 'redesign' ? `a ${entry.depth} redesign` : entry.shape || '?'} in ${entry.theme || '?'} at the top of ${file} (${next.length} of 20)${missing.length ? `; missing ${missing.join(', ')}, which Rotation reads, so log them` : ''}`);
}
function readLog(p) {
if (!p || !existsSync(p)) return [];
try { const j = JSON.parse(readFileSync(p, 'utf8')); return Array.isArray(j) ? j : (j.runs || []); } catch { return []; }
}
function contrastOf(f, b) {
const rgb = ([L, C, H]) => { const h = H * Math.PI / 180, x = C * Math.cos(h), y = C * Math.sin(h); const l = (L + 0.3963377774 * x + 0.2158037573 * y) ** 3, m = (L - 0.1055613458 * x - 0.0638541728 * y) ** 3, s2 = (L - 0.0894841775 * x - 1.2914855480 * y) ** 3; return [4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s2, -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s2, -0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s2].map((c) => Math.min(1, Math.max(0, c))); };
const Y = (c) => 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
const a = Y(rgb(f)), c = Y(rgb(b));
return (Math.max(a, c) + 0.05) / (Math.min(a, c) + 0.05);
}
const triple = (t) => `${t.paper.band}/${t.display.class}/${t.accent.band}`;
const words = (s) => (s || '').toLowerCase().replace(/[^a-z0-9\s-]/g, ' ').split(/\s+/).filter((w) => w.length > 2);
const ASK = new Set(['build', 'make', 'create', 'design', 'need', 'want', 'please', 'page', 'site', 'website', 'landing', 'called', 'for', 'and', 'the', 'with', 'that', 'this', 'our', 'your']);
const promptWords = (s) => words(s).filter((w) => !ASK.has(w));
const stem = (w) => { let x = w.replace(/(?:ing|ed)$/, ''); if (x.length < 3) x = w; return x.endsWith('ss') ? x : x.replace(/s$/, ''); };
const hueGap = (a, b) => { const d = Math.abs(((a - b) % 360 + 360) % 360); return Math.min(d, 360 - d); };
function seededRand(key) {
let h = createHash('sha256').update(key).digest();
let i = 0;
return () => { if (i >= h.length - 4) { h = createHash('sha256').update(h).digest(); i = 0; } const v = h.readUInt32BE(i); i += 4; return v / 0xffffffff; };
}
function pickFrom(pool, n, exclude) {
const avail = pool.filter((s) => !exclude.has(s.t.slug));
const picked = [];
const tripleOf = (s) => triple(s.t);
if (!avail.length) return picked;
picked.push(avail[0]);
const rest = () => avail.filter((s) => !picked.includes(s));
if (n >= 2 && rest().length) {
const best = rest()[0];
const other = rest().find((s) => s.t.paper.band !== picked[0].t.paper.band && s.fit >= best.fit - 2 && tripleOf(s) !== tripleOf(picked[0]));
picked.push(other || rest().find((s) => tripleOf(s) !== tripleOf(picked[0])) || best);
}
while (picked.length < n && rest().length) {
const cand = rest().find((s) => picked.every((p) => tripleOf(p) !== tripleOf(s))) || rest()[0];
picked.push(cand);
}
return picked;
}
// A project's own salt, so two projects dealing the same prompt on the same day get different hands;
// one project still gets the same deal back (reroll moves it on).
function projectSalt() {
const f = resolve(dirname(resolve(flag('log', '.hallmark/log.json'))), 'salt');
try { if (existsSync(f)) return readFileSync(f, 'utf8').trim(); mkdirSync(dirname(f), { recursive: true }); const salt = randomBytes(4).toString('hex'); writeFileSync(f, salt + '\n'); return salt; } catch { return 'nosalt'; }
}
// The draw: the structural decisions a model converges on when left alone, dealt fresh for every build
// against the log and the theme's own picture, so two builds of one prompt in one theme come out as
// different pages. The model takes it unless the prompt's material refuses a pick, and says so.
const DRAW = {
shapes: {
photo: ['Photographic', 'Marquee Hero', 'Split Studio', 'Catalogue', 'Narrative Workflow', 'Bento Grid', 'Conversational FAQ', 'Letter', 'Feature Stack'],
product: ['Workbench', 'Feature Stack', 'Bento Grid', 'Narrative Workflow', 'Marquee Hero', 'Split Studio', 'Conversational FAQ', 'Map / Diagram', 'Stat-Led'],
words: ['Long Document', 'Manifesto', 'Letter', 'Index-First', 'Conversational FAQ', 'Marquee Hero', 'Narrative Workflow'],
},
heroes: { photo: ['Poster', 'Stage', 'Ledge', 'Settled', 'Poster', 'Stage'], product: ['Stage', 'Settled', 'Banner', 'Corridor', 'Stage'], words: ['Corridor', 'Ledge', 'Banner', 'Settled'] },
navs: ['edge-aligned', 'floating pill', 'masthead', 'slab', 'search-led bar', 'banner over a retracting bar'],
footers: ['mast', 'statement', 'colophon block', 'newsletter-first', 'letter close', 'index columns'],
openers: ['Split', 'Showcase', 'Grid', 'Bento', 'Rows', 'Table', 'Steps', 'Statement', 'Rail', 'Pinned', 'Switcher', 'Index', 'Schedule', 'Offer'],
jobs: {
subscribe: { sections: ['an example issue set as it arrives (a sample)', 'the archive as an Index of past issues (sample titles)', 'who writes it, with a picture slot', 'the contents of one issue, as rows'], close: ['a second subscribe field under the archive', 'the archive itself, ending on the latest issue'], open: ['Index', 'Rail', 'Statement', 'Split'], heroes: ['Counter', 'Corridor', 'Index', 'Banner'], action: ['the subscribe field in the hero, beside the latest issue', 'the subscribe field in the hero and once more under the issues'] },
book: { sections: ['the menu as a Switcher by lunch and dinner (sample dishes, no prices unless given)', 'the room as a full-bleed photograph with no head', 'hours and the address as a section of their own', 'the next free times as buttons'], close: ['hours, the address and the booking again', 'the booking beside one last photograph'], open: ['Switcher', 'Index', 'Schedule', 'Split', 'Showcase'], heroes: ['Counter', 'Poster', 'Stage', 'Index'], action: ['a sticky booking bar', 'the booking times in the hero', 'the booking beside the menu or the rooms'] },
visit: { sections: ['what is on now as the lead picture', 'what is coming as dated rows', 'the shelves or the rooms as a Rail', 'getting there, with the hours'], close: ['visit information and the address', 'what is on next'], open: ['Showcase', 'Schedule', 'Rail', 'Split'], heroes: ['Poster', 'Ledge', 'Stage'], action: ['hours and the address in the hero', 'hours, the map and the way in at the close', 'a sticky bar with today\'s hours'] },
attend: { sections: ['the days as a Schedule', 'the lineup as an Index, set large', 'ticket tiers as rows', 'the place and how to get there', 'questions as rows'], close: ['tickets again', 'the questions', 'the mailing list for the next edition'], open: ['Schedule', 'Index', 'Rail', 'Showcase'], heroes: ['Index', 'Poster', 'Counter', 'Ledge'], action: ['tickets in the hero', 'tickets beside the lineup', 'a sticky ticket bar'] },
buy: { sections: ['the range as an Offer or a Rail (sample names; no prices unless given)', 'the thing in use, close and large', 'how it is made, as a Pinned run', 'delivery and care as plain facts'], close: ['the offer again', 'delivery and the guarantee as plain facts'], open: ['Offer', 'Rail', 'Showcase', 'Switcher'], heroes: ['Counter', 'Stage', 'Poster'], action: ['the offer as the hero', 'a sticky buy bar', 'the offer after the product close up'] },
try: { sections: ['features as named moments in screens (Pinned or Switcher)', 'a before and after', 'the platforms and what it needs'], close: ['the download beside one last screen'], open: ['Pinned', 'Switcher', 'Showcase', 'Rail'], heroes: ['Counter', 'Stage', 'Settled'], action: ['the download beside the screen in the hero', 'the download in the hero and at the close'] },
'sign up': { sections: ['the product at work as a Pinned run', 'a code sample or the integration', 'pricing as a table with its period switch', 'questions as rows'], close: ['the hero\'s action in a short band', 'the code sample'], open: ['Pinned', 'Switcher', 'Showcase', 'Bento', 'Table'], heroes: ['Stage', 'Settled', 'Banner', 'Counter'], action: ['sign up in the hero', 'sign up in the hero and beside the price'] },
hire: { sections: ['the work as an Index of projects with pictures', 'one project opened as a case', 'what the studio does, as a short list', 'where it is'], close: ['contact details per office', 'a plain email and phone'], open: ['Index', 'Rail', 'Showcase', 'Statement'], heroes: ['Index', 'Poster', 'Corridor', 'Ledge'], action: ['the enquiry after the work', 'a contact line in the nav and at the close'] },
join: { sections: ['what a session is like, shown', 'when and where as a Schedule', 'membership options as rows', 'first-visit guidance'], close: ['the first visit', 'the membership options'], open: ['Schedule', 'Grid', 'Split', 'Showcase'], heroes: ['Counter', 'Poster', 'Corridor'], action: ['join in the hero', 'join beside the schedule'] },
listen: { sections: ['the record with its tracks as an Index (sample titles unless given)', 'dates as rows with ticket links', 'earlier work as covers in a Rail', 'a live photograph or the video'], close: ['the dates', 'more of the catalogue', 'the mailing list'], open: ['Index', 'Rail', 'Showcase', 'Schedule'], heroes: ['Poster', 'Index', 'Counter', 'Ledge'], action: ['the player or the record in the hero', 'listen in the hero and the dates beside it'] },
},
leads: { photo: ['the place', 'the thing itself, close', 'the making', 'the offer and its price', 'the season or the date', 'the people at work'], product: ['the job it does', 'the screen at work', 'the speed or the limit', 'the material it handles', 'the price', 'the before and after'], words: ['the claim', 'the question', 'the first line of the argument', 'the date and the place', 'the list itself'] },
};
function draw() {
const material = flag('material', 'photo');
if (!DRAW.shapes[material]) { console.error('--material is photo, product or words'); process.exit(2); }
const seed = flag('seed', '') || randomBytes(3).toString('hex');
const rand = seededRand(`draw·${seed}`);
const log = readLog(flag('log', '.hallmark/log.json'));
const low = (x) => String(x || '').toLowerCase();
let pictured = [];
const slug = flag('theme', '');
if (slug && isSlug(slug) && existsSync(join(THEMES, `${slug}.md`))) pictured = low(parseHeader(readFileSync(join(THEMES, `${slug}.md`), 'utf8'), slug).pictured).split(/,\s*/).map((x) => x.replace(/ hero$/, ''));
const recent = (k, n) => log.slice(0, n).map((r) => low(r[k]));
const near = (opts, n, k, extra = []) => { const bad = new Set([...recent(k, n), ...extra]); const ok = opts.filter((o) => ![...bad].some((b) => b && b.includes(low(o)))); return ok.length ? ok : opts; };
const take = (opts, m = 1) => { const pool = [...new Set(opts)]; const out = []; while (out.length < m && pool.length) out.push(pool.splice(Math.floor(rand() * pool.length), 1)[0]); return out; };
const shapes = take(near(DRAW.shapes[material], 3, 'shape', pictured), 1);
const jobName = low(flag('job', '')).replace(/download|app/, 'try').replace(/software|saas/, 'sign up').replace(/newsletter|waitlist/, 'subscribe').replace(/watch|read/, 'listen');
const job = DRAW.jobs[jobName] || null;
const [hero] = take(near(job ? [...job.heroes, ...job.heroes, ...DRAW.heroes[material].filter((h) => !/settled|stage/i.test(h) || job.heroes.includes(h))] : DRAW.heroes[material], 1, 'hero', pictured));
const [nav] = take(near(DRAW.navs, 3, 'nav'));
const [footer] = take(near(DRAW.footers.filter((f) => f !== 'newsletter-first' || /subscribe/.test(jobName)), 3, 'footer'));
const [action] = job ? take(job.action) : [null];
const native = job ? take(job.sections, 3) : [];
const [close] = job ? take(job.close) : [null];
const lastOpen = low((log[0] && (Array.isArray(log[0].sections) ? log[0].sections[0] : String(log[0].sections || '').split(/[,>·]/)[0])) || '');
const [opener] = take((job ? job.open : DRAW.openers).filter((o) => !lastOpen.includes(low(o))));
const skip = take(['Split', 'Grid', 'Band', 'Statement', 'Steps', 'Figures'].filter((o) => o !== opener), 2);
const [lead] = take(DRAW.leads[material]);
if (has('json')) { console.log(JSON.stringify({ seed, material, job: jobName || null, shapes, hero, nav, footer, opener, skip, lead, action, native, close })); return; }
console.log(`draw ${seed} (fresh each build; --seed ${seed} repeats it)${pictured.length ? ` · clear of the theme picture's ${pictured.join(' and ')}` : ''}`);
console.log(`shape: ${shapes[0]} · hero: ${hero} · nav: ${nav} · footer: ${footer}`);
console.log(`${job ? '' : `first section after the hero: ${opener} · `}leave out this time: ${skip.join(' and ')} · the hero leads with ${lead}, if the prompt has it`);
console.log(job ? `job: ${jobName} · the action: ${action}\nbuild these, in the order the shape suits (the first right after the hero): ${native.join('; ')} · close on: ${close} (anatomy.md § ${jobName})` : 'no --job given: name the page\'s job (subscribe, book, visit, attend, buy, try, sign up, hire, join, listen) and draw again with --job');
console.log(`photos: pass --seed ${seed} to every theme.mjs photos call, so this build's picks are its own, and take its first fitting pick for the hero rather than hunting for the library's single best frame`);
console.log('take the draw unless the prompt\'s material refuses a pick; name any swap in the Picks block, and stamp draw: ' + seed);
}
function deal() {
const genre = flag('genre', 'editorial');
if (!GENRES.includes(genre)) { console.error(`unknown genre "${genre}" (valid: ${GENRES.join(', ')})`); process.exit(2); }
const prompt = flag('prompt', flag('brief', '')); // --brief is the older name
const n = Number(flag('n', 3));
const reroll = Number(flag('reroll', 0));
const log = readLog(flag('log', '.hallmark/log.json'));
const themes = loadIndex();
const recent = log.slice(0, 3);
const recentNames = new Set(recent.map((r) => String(r.theme || '').toLowerCase()));
const lastAxes = recent[0] && recent[0].axes ? String(recent[0].axes) : null;
const occupiedAxes = new Set(recent.map((r) => r.axes).filter(Boolean));
const bw = new Set(promptWords(prompt).map(stem));
const slug = `${promptWords(prompt).slice(0, 4).join('-') || 'prompt'}-${createHash('sha1').update(prompt.trim().toLowerCase()).digest('hex').slice(0, 4)}`;
const seedBase = `${slug}·${projectSalt()}·${new Date().toISOString().slice(0, 10)}`;
const seedKey = `${seedBase}·r${reroll}`;
const rand = seededRand(seedBase);
const df = new Map();
for (const t of themes) for (const k of new Set(t.keywords.map((k) => k.toLowerCase()))) df.set(k, (df.get(k) || 0) + 1);
const scored = themes.map((t) => {
let fit = 0; const hits = [];
for (const k of t.keywords) { const kw = k.toLowerCase().split(/\s+/).map(stem); if (kw.every((w) => bw.has(w))) { const d = df.get(k.toLowerCase()); fit += d <= 2 ? 3 : d <= 4 ? 2 : 1; hits.push(k); } }
if (t.genre === genre) fit += 2; else fit -= 1;
const blocked = recentNames.has(t.name.toLowerCase()) || (lastAxes && lastAxes === triple(t));
const sibling = occupiedAxes.has(triple(t));
if (sibling && !blocked) fit -= 1;
return { t, fit, hits, blocked, sibling, r: rand() };
});
const pool = scored.filter((s) => !s.blocked).sort((a, b) => b.fit - a.fit || a.r - b.r);
const previously = new Set();
for (let r = 0; r < reroll; r++) for (const p of pickFrom(pool, n, previously)) previously.add(p.t.slug);
const picked = pickFrom(pool, n, previously);
if (!picked.length) { console.error(`nothing left to deal at reroll ${reroll}; use a lower --reroll`); process.exit(1); }
if (has('json')) { console.log(JSON.stringify({ seed: seedKey, genre, deal: picked.map((s) => ({ ...s.t, fit: s.fit, hits: s.hits })), avoided: [...recentNames] })); return; }
console.log(`deal: ${seedKey} · genre ${genre}${reroll ? ` · reroll ${reroll}` : ''}`);
picked.forEach((s, i) => {
const why = s.hits.length ? `fits: ${s.hits.slice(0, 4).join(', ')}` : (s.t.genre === genre ? 'genre fit' : 'adjacent genre');
console.log(`${i + 1}. ${s.t.name} (${s.t.slug}) · ${triple(s.t)} · ${s.t.material} · ${why}${s.t.picture ? ` · ${s.t.picture}` : ''}${s.t.pictured ? `, pictured as ${s.t.pictured}` : ''}`);
});
if (recent.length) console.log(`avoid: ${recent.map((r) => `${r.theme || '?'} (${r.axes || 'no axes'})`).join(' · ')}`);
console.log(`next: look at the pictures, pick the material this prompt wants, read references/themes/<slug>.md, then theme.mjs scaffold <slug> --dealt "<n>/${picked.length}, seed ${seedKey}"`);
}
const PAPER_BANDS = new Set(['light', 'mid', 'dark']);
const DISPLAY_CLASSES = new Set(['roman-serif', 'high-contrast-serif', 'slab-serif', 'grotesk-sans', 'grotesk-heavy', 'geometric-sans', 'rounded-sans', 'display-condensed', 'display-heavy', 'mono', 'pixel', 'handwritten', 'blackletter']);
const ACCENT_BAND = /^(warm|cool|neutral|chromatic-[a-z-]+)$/;
const listOf = (set) => [...set].join(', ');
function check() {
const axes = flag('axes');
if (!axes && !flag('face') && flag('hue') == null) { usage(); process.exit(2); }
const [pb, dc, ab] = (axes || '//').split('/').map((s) => s.trim());
const unknown = !axes ? null : !PAPER_BANDS.has(pb) ? `paper band "${pb}" (valid: ${listOf(PAPER_BANDS)})`
: !DISPLAY_CLASSES.has(dc) ? `display class "${dc}" (valid: ${listOf(DISPLAY_CLASSES)})`
: !ACCENT_BAND.test(ab || '') ? `accent band "${ab}" (valid: warm, cool, neutral, chromatic-<hue name>)` : null;
if (unknown) { console.error(`unknown ${unknown}`); process.exit(2); }
const face = (flag('face', '') || '').toLowerCase().trim();
const hue = flag('hue') != null ? Number(flag('hue')) : null;
const themes = loadIndex();
const log = readLog(flag('log', '.hallmark/log.json'));
let bad = 0, near = 0;
const named = new Set();
const look = (t) => `look at references/themes/${t.slug}.jpg beside your plan and move an axis only if the two would read alike`;
if (axes) for (const t of themes) {
if (t.paper.band === pb && t.display.class === dc && t.accent.band === ab) { near++; named.add(t.slug); console.log(`near: ${t.name} sits on ${triple(t)} · ${look(t)}`); }
}
const toks = (x) => x.split(/[\s-]+/).filter(Boolean);
const sameFamily = (a, b) => { const A = toks(a), B = toks(b), n = Math.min(A.length, B.length); return n > 0 && A.slice(0, n).join(' ') === B.slice(0, n).join(' '); };
if (face) for (const t of themes) {
const tf = t.display.face.toLowerCase();
if (sameFamily(tf, face)) { bad++; console.log(`collision: ${t.name} already sets its display in ${t.display.face} · pick a face no theme uses (fonts.md)`); }
}
if (hue != null) for (const t of themes) {
// with axes: themes on the same paper and display class within 20 degrees; hue alone: any theme within 10
if (named.has(t.slug)) continue;
if (axes ? t.paper.band === pb && t.display.class === dc && hueGap(t.accent.hue, hue) <= 20 : hueGap(t.accent.hue, hue) <= 10) { near++; console.log(`near: ${t.name} is ${triple(t)} at hue ${t.accent.hue} · ${look(t)}`); }
}
const recent = axes ? log.slice(0, 3).filter((r) => r.axes === axes) : [];
for (const r of recent) { near++; console.log(`recent: ${r.theme || 'a build'} on ${r.date || '?'} used ${axes} · vary another decision (the shape, the pictures, the type scale)`); }
if (!bad && !near) { console.log(axes ? `clear: ${axes}${face ? ` in ${face}` : ''}${hue != null ? ` at hue ${hue}` : ''} lands on no catalog theme and no recent build` : [face && `clear: no catalog theme sets its display in ${flag('face')}`, hue != null && `clear: no catalog theme's accent sits within 10 degrees of hue ${hue}`].filter(Boolean).join('\n')); return; }
if (bad) process.exitCode = 1;
}
function list() {
for (const t of loadIndex()) console.log(`${t.name.padEnd(12)} ${triple(t).padEnd(38)} ${t.genre.padEnd(15)} ${t.material}`);
}
const TREATMENTS = { natural: {}, warm: { sepia: 0.28, saturate: 0.94 }, muted: { saturate: 0.65, contrast: 0.97 }, mono: { grayscale: 1, contrast: 1.18 } };
const ADJUST = { con: ['contrast', (n) => 1 + n / 100], sat: ['saturate', (n) => Math.max(0, 1 + n / 100)], vib: ['saturate', (n) => 1 + n / 200], exp: ['brightness', (n) => 1 + n / 100], high: ['brightness', (n) => 1 + n / 300], shad: ['brightness', (n) => 1 + n / 400], sepia: ['sepia', (n) => n / 100], blur: ['blur', (n) => n / 20] };
const r2 = (n) => Math.round(n * 100) / 100;
// A theme's photo: line as CSS on every picture in a slot: filter functions, and for duotone or tint a
// multiply plate under the photo and a lighten plate over it, both in the theme's own tokens.
function treatmentOf(spec, tokens) {
const parts = String(spec || 'natural').trim().split(/\s+/);
const f = new Map(), bad = [];
let duo = null;
const tok = (n) => { if (!tokens[`--color-${n}`]) bad.push(`no --color-${n} token`); return `var(--color-${n})`; };
for (let i = 0; i < parts.length; i++) {
const p = parts[i];
if (p in TREATMENTS) for (const [k, v] of Object.entries(TREATMENTS[p])) f.set(k, v);
else if (p === 'duotone') { duo = [tok(parts[++i]), tok(parts[++i])]; f.set('grayscale', 1); if (!f.has('contrast')) f.set('contrast', 1.08); }
else if (p === 'tint') { const t = tok(parts[++i]); const dark = (tokens['--color-paper'] || [1])[0] < 0.4; duo = dark ? ['var(--color-paper)', t] : [`color-mix(in oklab, ${t}, black 55%)`, `color-mix(in oklab, ${t}, white 82%)`]; f.set('grayscale', 1); }
else if (/^[a-z]+=-?\d+$/.test(p) && p.split('=')[0] in ADJUST) { const [k, n] = p.split('='); const [fn, v] = ADJUST[k]; f.set(fn, k === 'vib' && f.has(fn) ? f.get(fn) * v(Number(n)) : v(Number(n))); }
else bad.push(`"${p}" is not a treatment (natural, warm, muted, mono, duotone <dark> <light>, tint <token>, or con|sat|vib|exp|high|shad|sepia|blur=<n>)`);
}
const filter = [...f].map(([k, v]) => `${k}(${k === 'blur' ? `${r2(v)}px` : r2(v)})`).join(' ');
const css = !filter && !duo ? '' : duo
? `[data-slot]:has(> img) { isolation: isolate; background: ${duo[1]}; outline: 1px solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; }\n[data-slot] > img { z-index: 0; filter: ${filter}; mix-blend-mode: multiply; }\n[data-slot]:has(> img)::before { content: ""; position: absolute; inset: 0; z-index: 1; background: ${duo[0]}; mix-blend-mode: lighten; pointer-events: none; }`
: `[data-slot] > img { filter: ${filter}; }`;
return { css, bad };
}
function tokensOf(src, file) {
const tok = {};
for (const m of tokenBlockOf(src, file).matchAll(/(--color-[\w-]+):\s*oklch\(\s*([\d.]+)%\s+([\d.]+)\s+([\d.]+)\s*\)/g)) tok[m[1]] = [Number(m[2]) / 100, Number(m[3]), Number(m[4])];
return tok;
}
const SYNONYMS = { cafe: ['coffee'], coffee: ['cafe', 'espresso'], restaurant: ['dining', 'dish'], bakery: ['bread', 'pastry'], bread: ['bakery', 'loaf'], wine: ['vineyard', 'grape'], cider: ['apple', 'orchard'], gin: ['botanical', 'spirit', 'distillery'], beer: ['brewery'], ski: ['snow', 'slope'], snow: ['winter'], sea: ['coast', 'ocean'], beach: ['coast', 'sea'], hotel: ['room', 'lobby'], office: ['desk', 'workspace'], studio: ['workshop'], workshop: ['studio', 'craft'], pottery: ['ceramic', 'clay'], ceramic: ['pottery', 'clay'], weaving: ['loom', 'textile'], textile: ['fabric'], fabric: ['textile'], tailor: ['sewing', 'fabric'], fashion: ['clothing'], garden: ['plant', 'flower'], farm: ['field', 'farmland'], city: ['street', 'urban'], train: ['railway', 'station'], concert: ['music', 'stage'], music: ['concert', 'record'], book: ['library', 'reading'], print: ['printing', 'press'], skate: ['skateboard', 'skatepark'], running: ['runner', 'marathon'], gym: ['fitness'], yoga: ['wellness'], lab: ['science', 'laboratory'], doctor: ['clinic', 'medical'], kid: ['child', 'children'], dog: ['pet'], cat: ['pet'] };
async function photos() {
if (!existsSync(PHOTOS)) { console.error(`no photo library at ${PHOTOS}`); process.exit(1); }
const lib = JSON.parse(readFileSync(PHOTOS, 'utf8')).photos;
const subjects = positional();
if (!subjects.length) { usage(); process.exit(2); }
const n = Math.max(1, Number(flag('n', 3)) || 3);
const orient = flag('orient', '');
const slug = flag('theme', '');
let header = null, treat = { css: '', bad: [] };
if (slug) {
const file = join(THEMES, `${slug}.md`);
if (!isSlug(slug) || !existsSync(file)) { console.error(`no theme at ${file}`); process.exit(1); }
const src = readFileSync(file, 'utf8');
header = parseHeader(src, file);
treat = treatmentOf(header.photo, tokensOf(src, file));
if (treat.bad.length) console.error(`${slug}'s photo: line: ${treat.bad.join('; ')}`);
}
const recent = new Set(readLog(flag('log', '.hallmark/log.json')).slice(0, 5).flatMap((r) => Array.isArray(r.photos) ? r.photos : []));
const avoidText = flag('avoid', '') && existsSync(flag('avoid', '')) ? readFileSync(flag('avoid', ''), 'utf8') : '';
const avoid = { has: (id) => !!avoidText && (avoidText.includes(id) || avoidText.includes(id.replace(/ /g, '_'))) };
const shape = (p) => { const r = p.w / p.h; return r > 1.18 ? 'landscape' : r < 0.85 ? 'portrait' : 'square'; };
const PHOTO_STOP = new Set(['seen', 'from', 'with', 'into', 'onto', 'over', 'under', 'behind', 'above', 'below', 'beside', 'near', 'close', 'view', 'shot', 'photo', 'image', 'picture', 'some', 'very', 'one', 'two', 'three', 'each', 'every', 'its', 'their', 'his', 'her', 'who', 'where', 'while', 'up', 'down', 'out']);
const docs = lib.map((p) => { const t = new Set(); for (const x of p.tags) for (const w of words(x)) t.add(stem(w)); for (const w of words(p.subject)) t.add(stem(w)); t.add(stem(p.cat)); return t; });
const df = new Map(); for (const d of docs) for (const w of d) df.set(w, (df.get(w) || 0) + 1);
const idf = (w) => Math.log((lib.length + 1) / ((df.get(w) || 0) + 1)) + 0.3;
// Close scores rotate from build to build, so two pages on one subject rarely share their photographs; --seed repeats a pick.
const jitter = seededRand(`photos·${flag('seed', '') || randomBytes(3).toString('hex')}`);
const used = new Set();
const result = [];
for (const subject of subjects) {
const q = [...new Set(promptWords(subject).map(stem))].filter((w) => !PHOTO_STOP.has(w));
const total = q.reduce((a, w) => a + idf(w), 0) || 1;
const wantFace = /\b(portrait|face|person|people)\b/i.test(subject);
const scored = lib.map((p, i) => {
if (used.has(p.id) || avoid.has(p.id) || (orient && shape(p) !== orient)) return null;
const d = docs[i]; let got = 0; const missing = [];
for (const w of q) {
if (d.has(w)) got += idf(w);
else if ((SYNONYMS[w] || []).some((x) => d.has(stem(x)))) got += 0.7 * idf(w);
else if ([...d].some((x) => { let k = 0; while (k < x.length && k < w.length && x[k] === w[k]) k++; return k >= 5 || (k >= 4 && Math.max(x.length, w.length) <= 6 && k >= 0.8 * Math.min(x.length, w.length)); })) got += 0.8 * idf(w);
else missing.push(w);
}
const cov = got / total;
if (cov < 0.45) return null;
let s = cov * 10;
for (const t of p.tags) if (t.includes(' ') && subject.toLowerCase().includes(t)) s += 1;
if (p.q === 3) s += 0.8;
if (p.tags.includes('overused')) s -= 0.8;
if (p.people === 'face' && !wantFace) s -= 3;
if (recent.has(p.id)) s -= 4;
s += jitter() * (flag('seed', '') ? 4 : 2.5);
if (header) { if (header.paper.band === 'dark' && p.tone !== 'light') s += 0.3; if (header.paper.band === 'light' && p.tone !== 'dark') s += 0.15; if ((header.accent.band === 'warm') === (p.temp === 'warm')) s += 0.2; }
return { p, s, cov, missing };
}).filter(Boolean).sort((a, b) => b.s - a.s).slice(0, n);
for (const { p } of scored) used.add(p.id);
result.push({ subject, picks: scored.map(({ p, s, cov, missing }) => ({ ...p, orient: shape(p), score: Math.round(s * 10) / 10, match: cov >= 0.75 ? 'close' : 'partial', ...(missing.length ? { missing } : {}), sizes: widthsOf(p), credit: creditOf(p) })) });
}
const saveDir = flag('save', '');
if (saveDir) {
mkdirSync(resolve(saveDir), { recursive: true });
for (const r of result) for (const p of r.picks) {
const w = p.sizes[p.sizes.length - 1];
const file = join(resolve(saveDir), `${savedName(p.id)}-${w}.jpg`);
try {
const url = thumbOf(p, w);
if (!url.startsWith('https://upload.wikimedia.org/')) throw new Error('not a Wikimedia Commons file');
let res;
for (let t = 0; t < 4; t++) { res = await fetch(url, { headers: { 'User-Agent': 'Hallmark/2.0 (https://github.com/Nutlope/hallmark; theme.mjs photos --save)' }, signal: AbortSignal.timeout(60000) }); if (res.status !== 429) break; await new Promise((ok) => setTimeout(ok, 10000 * (t + 1))); }
if (!res.ok) throw new Error(`HTTP ${res.status}`);
if (!/^image\//.test(res.headers.get('content-type') || '')) throw new Error(`not an image (${res.headers.get('content-type') || 'no content-type'})`);
writeFileSync(file, Buffer.from(await res.arrayBuffer())); p.saved = file;
} catch (e) { p.saved = null; p.error = String(e.message || e); }
}
}
if (has('json')) { console.log(JSON.stringify({ theme: slug || null, treatment: header ? header.photo || 'natural' : null, subjects: result })); return; }
if (header) console.log(`treatment: ${header.photo || 'natural'} (${slug})${treat.css ? '. It is CSS on every picture in a slot, written into base.css by the scaffold; a page built without it adds:\n' + treat.css : ', no filter'}`);
for (const r of result) {
console.log(`\n"${r.subject}"${r.picks.length ? '' : ': nothing in the library fits; try other words (the place, the material, the action), or leave a slot for the user\'s photo'}`);
for (const p of r.picks) {
const src = p.saved || thumbOf(p, p.sizes.includes(1280) ? 1280 : p.sizes[p.sizes.length - 1]);
const set = p.saved ? '' : ` srcset="${p.sizes.map((w) => `${thumbOf(p, w)} ${w}w`).join(', ')}"`;
const pos = p.fp ? ` style="object-position: ${Math.round(p.fp[0] * 100)}% ${Math.round(p.fp[1] * 100)}%"` : '';
console.log(` ${p.subject} · ${p.w}x${p.h} ${p.orient} · ${p.tone}, ${p.temp}${p.people !== 'none' ? `, ${p.people}` : ''}${p.match === 'partial' ? ` · partial match, no ${p.missing.join(', ')}` : ''}${p.error ? ` · not saved: ${p.error}` : ''}`);
const [iw, ih] = p.saved ? [p.sizes[p.sizes.length - 1], Math.round(p.h * p.sizes[p.sizes.length - 1] / p.w)] : [p.w, p.h];
console.log(` <img src="${src}"${set}${p.saved ? '' : ' sizes="100vw"'} width="${iw}" height="${ih}" alt="${p.subject}"${pos}>`);
console.log(` credit: ${p.credit}`);
}
}
console.log('\nset sizes to the layout (50vw for a half, 100vw full-bleed) and crop with the frame (aspect-ratio and object-fit: cover; object-position keeps the subject). Every photo carries its credit on the page: one line in the footer, "Photographs: <credit>, <credit>", each linked to its page (imagery.md § 2). Log the ids in the entry\'s photos list.');
}
const WIDTHS = [960, 1280, 1920];
// The file name --save writes, which sloplint maps back to the library entry for its credit.
function savedName(id) { return id.replace(/\.[a-z]+$/i, '').normalize('NFKD').replace(/[\u0300-\u036f]/g, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 60) || `photo-${createHash('sha1').update(id).digest('hex').slice(0, 10)}`; }
// Commons serves thumbnails at standard widths only, and none at or past the original's width.
function widthsOf(p) { const w = WIDTHS.filter((x) => x < p.w); return w.length ? w : [WIDTHS[0]]; }
function thumbOf(p, w) {
const name = p.file.split('/').pop();
return `${p.file.replace('/wikipedia/commons/', '/wikipedia/commons/thumb/')}/${w}px-${p.thumbName || name}`;
}
function creditOf(p) { return `<a href="${p.page}">${p.author}</a> (${p.license}, Wikimedia Commons)`; }
function tokenBlockOf(src, file) {
const m = /```css\s*\n:root\s*\{([\s\S]*?)\n\}\s*\n```/.exec(src);
if (!m) throw new Error(`${file}: no :root block in a css fence`);
return m[1].replace(/\/\*[\s\S]*?\*\//g, '').split('\n').map((l) => l.replace(/\s+$/, '')).filter((l) => l.trim()).join('\n');
}
const SCALE = ` --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
--text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
--text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
--text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
--ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
--dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
--color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150);
--container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
--z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;`;
const CUSTOM_TOKENS = ` --color-paper: FILL ME; --color-paper-2: FILL ME; --color-paper-3: FILL ME;
--color-ink: FILL ME; --color-ink-2: FILL ME; --color-muted: FILL ME;
--color-rule: FILL ME;
--color-accent: FILL ME; --color-accent-ink: FILL ME; --color-focus: FILL ME;
--font-display: "FILL ME", ui-serif, serif; --font-body: "FILL ME", ui-sans-serif, system-ui, sans-serif; --font-outlier: var(--font-body);
--radius-card: 4px; --radius-pill: 999px; --rule-hair: 1px; --shadow-card: none;
--tracking-display: -0.02em;`;
const BASE = `*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); }
[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }`;
// A custom run sets its own type: its base keeps the Floor's rules and drops the heading sizes, weight, leading and measure.
const BASE_CUSTOM = BASE.replace(/^h1, h2, h3 \{[^}]*\}$/m, 'h1, h2, h3 { margin: 0; font-family: var(--font-display); font-synthesis: none; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }').replace(/^h1 \{ max-width[^\n]*\n/m, '').replace(/^\.lead \{[^\n]*\n/m, '');
const SLOTS_JS = `window.hallmarkSlots = (m) => { for (const [k, v] of Object.entries(m)) { const s = document.querySelector(\`[data-slot="\${k}"]\`); if (!s) continue; const im = new Image(); im.src = typeof v === 'string' ? v : v.src; im.alt = (typeof v === 'object' && v.alt) || s.dataset.alt || ''; s.querySelectorAll(':scope > img').forEach((o) => o.remove()); s.prepend(im); } };\ndocument.querySelectorAll('[data-slot] img').forEach((i) => { if (i.complete && !i.naturalWidth) i.remove(); else i.addEventListener('error', () => i.remove(), { once: true }); });`;
function scaffold() {
const brand = has('brand');
const custom = has('custom') || brand;
const depth = flag('redesign', '');
if (depth && !['polish', 'restyle', 'full'].includes(depth)) { console.error('--redesign takes polish, restyle or full'); process.exit(2); }
const tail = depth ? ` · redesign: ${depth}` : '';
const slug = custom ? null : positional()[0];
if (!custom && !slug) { usage(); process.exit(2); }
const app = flag('scope', '') === 'app';
const sheet = ['src/index.css', 'src/app/globals.css', 'app/globals.css', 'src/styles/globals.css', 'styles/globals.css', 'src/styles/global.css', 'src/main.css', 'src/styles.css', 'src/global.css', 'src/app.css', 'src/App.css', 'app/app.css'].find((f) => existsSync(f));
const dir = resolve(flag('dir', sheet ? dirname(sheet) : '.'));
let name = 'custom world';
let tokens = CUSTOM_TOKENS;
let header = null;
if (!custom) {
const file = join(THEMES, `${slug}.md`);
if (!isSlug(slug) || !existsSync(file)) { console.error(`no theme at ${file}; run \`theme.mjs list\` for the slugs`); process.exit(1); }
const src = readFileSync(file, 'utf8');
header = parseHeader(src, file);
name = header.name;
tokens = tokenBlockOf(src, file);
}
const out = join(dir, 'tokens.css');
const baseOut = join(dir, 'base.css');
for (const f of [out, baseOut]) if (existsSync(f) && !has('force')) { console.error(`${f} exists; pass --force to overwrite it`); process.exit(1); }
mkdirSync(dir, { recursive: true });
const dark = header && header.paper.band === 'dark';
const sized = app ? SCALE.replace(/ --text-xs:[^\n]*\n --text-display-s:[^\n]*\n --text-section:[^\n]*\n/, ' --text-xs: 0.75rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.2rem; --text-xl: 1.44rem; --text-2xl: 1.728rem; --text-3xl: 2.074rem;\n --text-display-s: 1.44rem; --text-display: 1.728rem; --text-section: 1.2rem; --text-title: 1rem; --text-lead: 1rem;\n') : SCALE;
const scale = dark ? sized.replace('--color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150);', '--color-error: oklch(72% 0.15 27); --color-success: oklch(76% 0.13 150);') : sized;
const sheetSrc = sheet ? readFileSync(sheet, 'utf8') : '';
const tw = /@import\s+["']tailwindcss/.test(sheetSrc);
const tw3 = !tw && /@tailwind\s+(?:base|utilities)\b/.test(sheetSrc);
const scheme = header ? ` color-scheme: ${dark ? 'dark' : 'light'};\n` : '';
const decls = `${scale}\n${tokens}`.split(/;(?![^()]*\))(?=(?:[^"]*"[^"]*")*[^"]*$)/).map((d) => d.trim()).filter(Boolean);
const themed = decls.filter((d) => /^--(color|font|text|tracking|radius|shadow|ease)-/.test(d));
const css = tw
? `@theme static {\n${themed.map((d) => ` ${d};`).join('\n')}\n}\n:root {\n${scheme}${decls.filter((d) => !themed.includes(d)).map((d) => ` ${d};`).join('\n')}\n}\n`
: `:root {\n${scheme}${scale}\n${tokens}\n}\n`;
writeFileSync(out, css);
const own = !custom && /## Build hint[\s\S]*?(::selection\s*\{[^}]*\})/.exec(readFileSync(join(THEMES, `${slug}.md`), 'utf8'));
const base = own ? BASE.replace(/::selection \{[^}]*\}/, own[1].replace(/\s+/g, ' ')) : custom && !brand ? BASE_CUSTOM : BASE;
const steps = base.split('\n').filter((l) => /^@media[^{]*\{\s*:root/.test(l));
const photo = custom ? '' : treatmentOf(header.photo, tokensOf(readFileSync(join(THEMES, `${slug}.md`), 'utf8'), slug)).css;
writeFileSync(baseOut, (tw ? base.split('\n').filter((l) => !steps.includes(l)).join('\n') : base) + (photo ? `\n/* photographs: ${header.photo} */\n${photo}` : '') + '\n');
if (tw) writeFileSync(out, readFileSync(out, 'utf8') + steps.join('\n') + '\n');
const src = custom ? '' : readFileSync(join(THEMES, `${slug}.md`), 'utf8');
const dial = /stated in the stamp \(`([a-z0-9-]+):/.exec(src);
const theme = brand ? 'brand' : custom ? 'custom' : `${name} (${flag('dealt', '') ? `deal ${flag('dealt', '')}` : 'by request'})`;
const made = custom ? `\n * paper: oklch(<>) · accent: oklch(<>) · display: <face> · body: <face>` : '';
const axes = custom ? '<paper>/<display>/<accent> · posture: <posture>' : `${triple(header)} · posture: ${header.posture}`;
const kept = depth ? ', or kept' : '';
const stamp = app
? `/* Hallmark · shape: app screen · genre: ${header ? header.genre : '<genre>'} · theme: ${theme}${tail}${made}\n * nav: <the shell${kept}> · signature: <the one object${kept}> · states: <the ones the screens have>${dial ? ` · ${dial[1]}: <the dials>` : ''}\n * axes: ${axes} · contrast: pass · v${VERSION} */`
: brand
? `/* Hallmark · shape: <shape, or kept> · genre: <genre> · theme: brand${tail}${made} · hero: <posture, or kept> · nav: <shape, or kept> · footer: <shape, or kept> · signature: <the one move, or kept>\n * axes: ${axes} · contrast: pass · fold: pass · v${VERSION} */`
: custom
? `/* Hallmark · shape: <your name for the structure> · genre: <genre> · theme: custom${tail} · job: <subscribe|book|visit|attend|buy|try|sign up|hire|join|listen> · idea: "<one sentence>" · vibe: "<4 to 8 words>"${made} · hero: <in your own words> · nav: <shape> · footer: <shape> · imagery: <photographs, the product, or none> · signature: <the one thing a visitor remembers>\n * axes: ${axes} · contrast: pass · fold: pass · v${VERSION} */`
: `/* Hallmark · shape: <shape${kept}> · genre: ${header.genre} · theme: ${theme}${tail}${depth ? '' : ' · job: <subscribe|book|visit|attend|buy|try|sign up|hire|join|listen> · draw: <seed>'}\n * hero: <posture${kept}> · nav: <shape${kept}> · footer: <shape${kept}> · imagery: <photographs, the product, or none> · signature: <the one move>${dial ? ` · ${dial[1]}: <the dials>` : ''}\n * axes: ${axes} · contrast: pass · fold: pass · v${VERSION} */`;
console.log(`wrote ${out} (${brand ? 'the shared scale; fill every --color-* and --font-* from the palette and faces the pre-flight found' : custom ? 'a starting scale, yours to rewrite; fill every --color-* and --font-* before building' : `${name} tokens plus the shared scale`}) and ${baseOut} (the base rules the Floor already decided)${sheet && !flag('dir', '') ? `, beside ${sheet}` : ''}`);
if (!custom && !flag('dealt', '')) {
const pic = join(THEMES, `${slug}.jpg`);
if (existsSync(pic)) console.log(`look at ${pic}: the material at full size${header.pictured ? `, from a page built as ${header.pictured}` : ''}. Take its palette balance, type voice and surfaces, never its layout; the room and the sections are layout.md.`);
}
console.log('');
console.log('start the page\'s stylesheet with these lines, then write only the page:');
console.log(stamp);
console.log('/* Hallmark · pre-emit critique: P_ H_ E_ S_ R_ V_ · weakest: _, <what you did about it> */');
console.log(tw || tw3 ? '@import "./tokens.css";' : '@import url("./tokens.css");');
console.log(tw || tw3 ? '@import "./base.css" layer(base);' : '@import url("./base.css");');
if (tw3) console.log('Tailwind 3: the stamp and both imports go above the @tailwind directives; an @import below them is dropped without an error.');
if (tw) console.log('Tailwind 4: both imports go below @import "tailwindcss". tokens.css is written as an @theme block, so every colour, face, size, radius, shadow and ease is a utility (bg-paper, font-display, rounded-card); export-formats.md § Tailwind v4 has the names it shares with Tailwind.');
if (app) return;
console.log('');
console.log('and, only if the page has data-slot containers, once before </body>:');
console.log(`<script>${SLOTS_JS}</script>`);
console.log('');
console.log(`pictures (imagery.md): node ${join(HERE, 'theme.mjs')} photos "<subject>" ["<subject>" ...]${slug ? ` --theme ${slug}` : ''}`);
}
function validate(files) {
let bad = 0;
for (const f of files) {
try {
const src = readFileSync(f, 'utf8');
const e = parseHeader(src, f);
const problems = [];
if (!PAPER_BANDS.has(e.paper.band)) problems.push(`paper band ${e.paper.band}`);
if (!DISPLAY_CLASSES.has(e.display.class)) problems.push(`display class ${e.display.class}`);
if (!ACCENT_BAND.test(e.accent.band)) problems.push(`accent band ${e.accent.band}`);
if (!['editorial', 'modern-minimal', 'atmospheric', 'playful'].includes(e.genre)) problems.push(`genre ${e.genre}`);
if (!['restrained', 'committed', 'full-palette', 'drenched'].includes(e.posture)) problems.push(`posture ${e.posture}`);
if (e.keywords.length < 8) problems.push(`only ${e.keywords.length} keywords`);
if (/[\u2014\u2013]/.test(src)) problems.push('contains an em or en dash');
if (Buffer.byteLength(src) > 8000) problems.push(`${Buffer.byteLength(src)} bytes, over 8,000`);
for (const sec of ['Tokens', 'Type', 'Surfaces', 'Range', 'Controls', 'Motion', 'Voice', 'Do-nots', 'Build hint']) if (!new RegExp(`^## ${sec}\\b`, 'm').test(src)) problems.push(`missing the ${sec} section`);
if (!/^photo:/m.test(src)) problems.push('no photo: line in the header (natural, warm, muted, mono, duotone <dark> <light> or tint <token>, imagery.md § 5)');
else { const t = treatmentOf(/^photo:\s*(.*)$/m.exec(src)[1], tokensOf(src, f)); if (t.bad.length) problems.push(`photo: ${t.bad.join('; ')}`); }
if (/\b(?:hand-built|hand-drawn|drawn) (?:svg|illustration|object|figure)|\bsvg (?:illustration|drawing|figure)/i.test(src)) problems.push('prescribes a drawn illustration (imagery.md § 7, gate 80)');
for (const m of src.matchAll(/https:\/\/api\.fontshare\.com\/v2\/css\?[^"'\s>]*/g)) if ((m[0].match(/f\[\]=/g) || []).length > 1) problems.push('a Fontshare link loading more than one family (Fontshare may drop all but the first; use one link per family)');
if (/^signature:/m.test(src)) problems.push('a signature: line in the header (a theme is a material; the page finds its signature in the prompt)');
if (/object family|the one object|signature object|signature move/i.test(src)) problems.push('names an object or a signature move (a theme carries no components)');
if (/\b(?:generous|plenty of) (?:air|whitespace|white space)|(?:air|whitespace|white space|space) (?:carr(?:y|ies)|doing|does) (?:the|every)/i.test(src)) problems.push('a rule about space (layout.md owns room and density)');
if (/--tracking-label/.test(src)) problems.push('declares --tracking-label (labels are untracked, gate 67)');
if (/font-variant(-caps)?:\s*[a-z-]*small-caps|small caps|small capitals|small-caps/i.test(src)) problems.push('prescribes small caps (gate 67)');
if (/eyebrow|kicker|overline/i.test(src)) problems.push('names an eyebrow (gate 54)');
if (/→|Learn more/.test(src)) problems.push('arrow or Learn-more copy (gate 63)');
for (const m of src.matchAll(/^[^\n]*text-transform:\s*uppercase[^\n]*$/gm)) {
const line = m[0];
const ls = /letter-spacing:\s*(-?[\d.]+)em/.exec(line);
const isDisplay = /\.display|h1|h2|\.marquee|wordmark/.test(line);
if (ls && parseFloat(ls[1]) > 0.045) problems.push(`uppercase tracked ${ls[1]}em in the build hint (gate 67)`);
else if (!isDisplay && /label|caption|meta|\bth\b|small|tag|chip|badge|nav|count/.test(line)) problems.push(`uppercase label rule in the build hint: ${line.trim().slice(0, 60)} (gate 67)`);
}
const hint = (/## Build hint[\s\S]*?```css\n([\s\S]*?)```/.exec(src) || [])[1] || '';
for (const m of hint.matchAll(/(?:transition|animation)[^;{}]*?\b(\d{2,3})ms\b/g)) problems.push(`raw duration ${m[1]}ms in the build hint (use --dur-micro, --dur-short or --dur-long)`);
if (/(?:transition|animation)[^;{}]*(?<![-\w])ease(?:-in-out|-in|-out)?\b/.test(hint)) problems.push('bare ease keyword in the build hint (use --ease-out, --ease-in or --ease-in-out)');
for (const m of hint.matchAll(/(?<![-\w])(black|white)\b(?!-)/g)) problems.push(`named colour ${m[1]} in the build hint (route it through a token)`);
for (const m of hint.matchAll(/\b(?:padding|margin|gap|row-gap|column-gap)(?:-[a-z-]+)?\s*:\s*([^;{}]+)/g)) {
const raw = m[1].replace(/var\([^)]*\)/g, ' ').replace(/calc\([^)]*\)/g, ' ');
for (const px of raw.match(/(?<![\w.-])(\d+)px\b/g) || []) if ([2, 4, 8, 12, 16, 24, 40, 64, 96, 144].includes(parseInt(px, 10))) problems.push(`raw ${px} spacing in the build hint where a --space-* token exists (24a)`);
}
const fence = tokenBlockOf(src, f);
if (/\/\*/.test(fence)) problems.push('comment inside the token block');
if (!existsSync(f.replace(/\.md$/, '.jpg'))) console.log(`${f}: note, no picture yet (scripts/picture.mjs)`);
if (!/waive 22/.test(src)) for (const m of fence.matchAll(/(--color-(?:paper|paper-2|paper-3|ink|ink-2|muted|rule|rule-2)):\s*oklch\(\s*[\d.]+%\s+([\d.]+)/g)) if (Number(m[2]) < 0.005) problems.push(`${m[1]} chroma ${m[2]} is under the 0.005 floor (gate 22), or the file names waive 22`);
for (const k of ['--color-paper', '--color-ink', '--color-muted', '--color-rule', '--color-accent', '--color-accent-ink', '--color-focus', '--font-display', '--font-body', '--radius-card', '--tracking-display', '--display-weight']) if (!fence.includes(k + ':')) problems.push(`token block lacks ${k}`);
const tok = {};
for (const m of fence.matchAll(/(--color-[\w-]+):\s*oklch\(\s*([\d.]+)%\s+([\d.]+)\s+([\d.]+)\s*\)/g)) tok[m[1]] = [Number(m[2]) / 100, Number(m[3]), Number(m[4])];
const pairs = [['--color-ink-2', '--color-paper'], ['--color-muted', '--color-paper'], ['--color-muted', '--color-paper-2'], ['--color-accent-ink', '--color-accent']];
for (const [fg, bg] of pairs) if (tok[fg] && tok[bg]) { const r = contrastOf(tok[fg], tok[bg]); if (r < 4.5) problems.push(`${fg} on ${bg} is ${r.toFixed(2)}:1, under 4.5 (gate 40)`); }
if (problems.length) { bad++; console.log(`${f}: ${problems.join('; ')}`); } else console.log(`${f}: ok (${e.name}, ${triple(e)}, ${src.length} bytes)`);
} catch (err) { bad++; console.log(`${f}: ${err.message}`); }
}
process.exitCode = bad ? 1 : 0;
}
try {
if (cmd === 'deal') deal();
else if (cmd === 'draw') draw();
else if (cmd === 'check') check();
else if (cmd === 'scaffold') scaffold();
else if (cmd === 'log') addLog();
else if (cmd === 'photos') await photos();
else if (cmd === 'index') { const e = buildIndex(); console.log(`indexed ${e.length} themes into ${INDEX}`); }
else if (cmd === 'list') list();
else if (cmd === 'validate') {
const files = args.slice(1).filter((a) => !a.startsWith('--') && basename(a) !== 'README.md');
if (!files.length) { usage(); process.exit(2); }
validate(files);
}
else { usage(); process.exit(2); }
} catch (e) {
console.error(String(e.message || e)); process.exit(1);
}