/* fonts, served from the site (Latin only): no wait on Google Fonts before the first paint */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(assets/fonts/geist.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(assets/fonts/geist-mono.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Arteffects: a bar across the top, then the work, live. Monochrome: the pieces bring the colour.
   Light by default; [data-theme="dark"] swaps the tokens. */
:root {
  --wrap: 1360px;
  --gutter: clamp(16px, 3vw, 32px);
  --bg: #f4f4f3;
  --panel: #ffffff;
  --well: #ebebe9;
  --ink: #0c0c0d;
  --soft: #2f2f33;
  --grey: #5f5f65;
  --faint: #68686e; /* small text: at least 4.5:1 on the page (5.0), panels (5.5) and wells (4.6) */
  --accent: #2155d6; /* only for things you can change: prompt blanks, focus */
  --accent-wash: rgba(33, 85, 214, .08);
  --accent-line: rgba(33, 85, 214, .5);
  --line: rgba(12, 12, 13, .08);
  --line-strong: rgba(12, 12, 13, .16);
  --chip: rgba(12, 12, 13, .05);
  --chip-hover: rgba(12, 12, 13, .09);
  --glow: rgba(12, 12, 13, .06);
  --lift: 0 1px 2px rgba(12, 12, 13, .04), 0 24px 48px -28px rgba(12, 12, 13, .28);
  --on-ink: #f4f4f3;
  --code-bg: #111113;
  --code-ink: #d7d7db;
  --ui: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r: 20px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0b0c; --panel: #131315; --well: #161618; --ink: #f2f2f3; --soft: #d2d2d6; --grey: #a1a1a7; --faint: #8a8a90; --accent: #93b4ff; --accent-wash: rgba(147, 180, 255, .1); --accent-line: rgba(147, 180, 255, .5);
  --line: rgba(255, 255, 255, .07); --line-strong: rgba(255, 255, 255, .14); --chip: rgba(255, 255, 255, .06); --chip-hover: rgba(255, 255, 255, .1);
  --glow: rgba(255, 255, 255, .05); --lift: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 48px -28px rgba(0, 0, 0, .9);
  --on-ink: #0b0b0c; --code-bg: #0e0e10; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body { font-family: var(--ui); color: var(--ink); -webkit-font-smoothing: antialiased; transition: color .3s ease; }
a { color: inherit; }
h1, h2, h3, p, figure, pre, dl, dd { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; } /* hidden always wins over a component's own display */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--on-ink); text-decoration: none; }
.skip:focus { top: 12px; }
svg { flex: none; }
.btn svg, .mini svg, .icon-btn svg, .search svg, .v-btn svg, .tap-cover svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* small mono text */
.tag, .hint, .meta dt, .file, .count, .crumbs, .eyebrow, kbd { font: 400 12px/1.4 var(--mono); letter-spacing: .02em; color: var(--faint); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }

/* ---------- theme switch: the new theme grows in a circle from the button (lab.js sets --tx and --ty) ---------- */
:root:active-view-transition-type(theme)::view-transition-old(root),
:root:active-view-transition-type(theme)::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root:active-view-transition-type(theme)::view-transition-new(root) { animation: theme-in .65s var(--ease); }

/* ---------- moving between pages: a short cross-fade, with the top bar holding still ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
.top { view-transition-name: top-bar; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
@keyframes theme-in { from { clip-path: circle(0 at var(--tx, 100%) var(--ty, 0)); } to { clip-path: circle(150vmax at var(--tx, 100%) var(--ty, 0)); } }

/* ---------- top bar ---------- */
.top { position: sticky; z-index: 20; top: 0; background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 10px; width: min(var(--wrap), 100% - 2 * var(--gutter)); height: 64px; margin: 0 auto; }
.brand { flex: none; display: inline-flex; align-items: baseline; gap: 10px; font: 600 15px/1 var(--ui); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
/* The logo is the word itself in Geist: "art" heavy, "effects" light, set tight, so the pun reads at a glance */
.wordmark { font: 400 21px/1 var(--ui); letter-spacing: -.05em; color: var(--ink); }
.wordmark b { font-weight: 800; letter-spacing: -.055em; }
.brand .by { font-weight: 400; color: var(--faint); }
.links { display: flex; gap: 4px; margin-left: 18px; }
.links a { padding: 8px 12px; white-space: nowrap; border-radius: 999px; font: 400 14px/1 var(--ui); color: var(--grey); text-decoration: none; transition: color .2s ease, background-color .2s ease; }
.links a:hover { color: var(--ink); background: var(--chip); }
.hero p a { white-space: nowrap; color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color .2s ease; }
.hero p a:hover { text-decoration-color: currentColor; }
/* a plain search field on the right of the bar */
.find { position: relative; min-width: 0; margin-left: auto; width: min(260px, 28vw); } /* it shrinks before the buttons beside it get pushed off */
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--faint); background: var(--chip); transition: box-shadow .2s ease; }
.search:focus-within { box-shadow: 0 0 0 1.5px var(--accent-line), 0 0 0 5px var(--accent-wash); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: 400 14px/1 var(--ui); color: var(--ink); background: none; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { transition: opacity .2s ease; }
.search:focus-within kbd { opacity: 0; } /* the hint is for finding the box; once you're in it, it steps aside */
.results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 6px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), var(--lift); }
.results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 9px; font: 400 14px/1.3 var(--ui); text-decoration: none; }
.results a:hover, .results a[aria-selected] { background: var(--chip); }
.no-hits { padding: 10px 12px; font: 400 13.5px/1.4 var(--ui); color: var(--grey); }
.icon-btn { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink); background: var(--chip); transition: background-color .2s ease; }
.icon-btn:hover { background: var(--chip-hover); }
.icon-btn svg { grid-area: 1 / 1; transition: opacity .3s ease, rotate .5s var(--ease); }
.theme .moon { opacity: 0; rotate: -40deg; }
:root[data-theme="dark"] .theme .sun { opacity: 0; rotate: 40deg; }
:root[data-theme="dark"] .theme .moon { opacity: 1; rotate: 0deg; }
.hire { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 36px; padding: 0 14px; border-radius: 999px; font: 500 13px/1 var(--ui); text-decoration: none; color: var(--on-ink); background: var(--ink); transition: opacity .2s ease; }
.hire:hover { opacity: .88; }
.hire svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hire .live-dot { width: 6px; height: 6px; border-radius: 50%; background: #3ccf6e; box-shadow: 0 0 0 3px rgba(60, 207, 110, .25); }

.main { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin: 0 auto; }

/* ---------- home: who, what, then the work ---------- */
.hero { display: grid; gap: 18px; padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 4vw, 48px); }
.hero h1 { max-width: 15ch; text-wrap: balance; font: 500 clamp(44px, 6.4vw, 84px)/.98 var(--ui); letter-spacing: -.05em; }
.hero h1 span { color: var(--faint); }
/* the sign-off: a small sideways smiley (lab.js runs its life). Its eyes sit where a colon's dots would,
   centred on the typed mouth (lab.js measures the mouth's ink and sets --cy). Most faces keep the two dots;
   some type their eyes (^ ^, - -, > <, * *) in the same places, turned with the face so they read
   upright when it sits up. Pointed at, it sits up and winks. Smaller than the text, so it clears the line above */
.smile { position: relative; display: inline-block; margin-left: .32em; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.smile .face { display: inline-block; font-size: .8em; transition: rotate .4s cubic-bezier(.34, 1.3, .64, 1), translate .4s cubic-bezier(.34, 1.3, .64, 1), scale .4s ease, color .2s ease; }
.smile .eyes { position: relative; display: inline-block; width: .25em; height: 0; } /* empty, so its bottom is the baseline */
/* --lx/--ly: where it's looking (lab.js), a small nudge towards your pointer */
.smile .eyes b { position: absolute; left: .02em; bottom: calc(var(--cy, .34) * 1em); translate: calc(var(--lx, 0) * 1em) calc(50% + var(--ly, 0) * 1em); display: flex; flex-direction: column; gap: .2em; transition: translate .35s cubic-bezier(.22, 1, .36, 1); }
.smile .eyes i { position: relative; width: .115em; height: .115em; border-radius: 50%; background: currentColor; transition: scale .22s cubic-bezier(.34, 1.4, .64, 1); }
.smile .mouth { display: inline-block; width: calc(var(--mw, .3) * 1em); white-space: nowrap; } /* a fixed slot: lab.js lines each mouth up in it */
/* a typed eye: centred on the dot's place by its ink (--eye-d, lab.js), and turned with the face */
.smile .eyes i.typed { background: none; }
.smile .eyes i.typed::after { content: var(--e); position: absolute; left: 50%; top: 50%; font-size: calc(var(--es, .5) * 1em); font-weight: 600; line-height: 1; font-variant-emoji: text; transform: translate(-50%, -50%) rotate(-90deg) translateY(calc(var(--eye-d, 0) * 1em)); }
/* little lives of their own */
.smile[data-mood="wow"] .eyes i { scale: 1.3; }
.smile[data-mood="starry"] .eyes i { animation: twinkle 1.4s ease-in-out infinite; }
.smile[data-mood="starry"] .eyes i:last-child { animation-delay: -.7s; }
.smile[data-mood="fluster"] .face { animation: shiver .18s linear infinite; }
.smile[data-mood="fluster"] .eyes i { --es: .36; } /* small, so > and < stay two eyes */
.smile[data-mood="sleep"] .face { animation: breathe 3s ease-in-out infinite; }
@keyframes twinkle { 50% { scale: 1.25; rotate: 25deg; } }
@keyframes shiver { 25% { translate: .012em 0; } 75% { translate: -.012em 0; } }
@keyframes breathe { 50% { scale: 1.05; } }
.smile .z { position: absolute; left: 30%; bottom: 72%; font-size: .36em; font-weight: 500; color: var(--faint); pointer-events: none; }
.smile:is(:hover, :active) .face { rotate: 90deg; translate: .12em .06em; } /* turned, it's wider: the shift keeps clear of the letter before */
.smile:is(:hover, :active) span { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .smile .face, .smile .eyes b, .smile .eyes i { transition: none !important; animation: none !important; } }
.hero p { max-width: 48ch; font: 400 17px/1.55 var(--ui); color: var(--grey); text-wrap: pretty; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; }
.toolbar-end { display: flex; align-items: center; gap: 14px; }
.tabs { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--chip); }
.tabs button { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer; font: 400 13.5px/1 var(--ui); color: var(--grey); background: none; transition: color .2s ease, background-color .25s var(--ease); }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { color: var(--on-ink); background: var(--ink); }
.sort select { height: 32px; padding: 0 30px 0 12px; border: 0; border-radius: 999px; font: 500 13px/1 var(--ui); color: var(--soft); background: var(--chip) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4.5 6.5 8 10l3.5-3.5' fill='none' stroke='%2375757b' stroke-width='1.6' stroke-linecap='round'/></svg>") no-repeat right 10px center / 14px; appearance: none; cursor: pointer; }

/* ---------- home: every piece, live ---------- */
/* tiles have fixed shapes: square pieces (4:3) two to a row, wide pieces (like the reel, 3:1) a full row. Sized so
   a whole row fits on a laptop screen with the next one peeking in */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 16px; }
.card { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .4s var(--ease); }
.card.wide { grid-column: 1 / -1; aspect-ratio: 3 / 1; }
.card:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--lift); }
.card[hidden] { display: none; }
/* a soft light pooled behind each piece, Monolith-style */
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(55% 50% at 50% 45%, var(--glow), transparent 75%); pointer-events: none; }
.cover { position: absolute; inset: 0; z-index: 1; border-radius: var(--r); }
.cover:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.new { margin-left: 8px; padding: 1px 7px; border-radius: 999px; font: 600 12px/1.4 var(--ui); letter-spacing: .04em; text-transform: uppercase; color: var(--on-ink); background: var(--ink); }
/* play/pause for one demo: in a tile's corner (shown on hover, always on touch), on a piece's stage, in full screen */
.motion-btn { display: grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink); background: color-mix(in srgb, var(--panel) 75%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line); transition: opacity .25s ease, translate .3s var(--ease), background-color .2s ease; }
.motion-btn:hover { background: var(--panel); }
.motion-btn svg { grid-area: 1 / 1; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s ease; }
.motion-btn .i-play { fill: currentColor; opacity: 0; }
.motion-btn[aria-pressed="true"] .i-pause { opacity: 0; }
.motion-btn[aria-pressed="true"] .i-play { opacity: 1; }
.card .motion-btn { position: absolute; z-index: 2; top: 14px; right: 14px; opacity: 0; translate: 0 -4px; }
.card:hover .motion-btn, .card:focus-within .motion-btn, .card .motion-btn[aria-pressed="true"] { opacity: 1; translate: 0 0; } /* a paused tile keeps showing it can play */
.stage-acts, .v-acts { display: flex; align-items: center; gap: 8px; }
.stage-acts .motion-btn { width: 32px; height: 32px; }
/* the caption sits on frosted glass, so a piece passing behind it (the film) never hides the words */
.cap { position: absolute; z-index: 0; left: 14px; bottom: 14px; display: grid; gap: 4px; width: fit-content; max-width: min(320px, calc(100% - 28px)); padding: 12px 16px 14px; border-radius: 14px; background: color-mix(in srgb, var(--panel) 70%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.cap h2 { font: 500 26px/1.05 var(--ui); letter-spacing: -.035em; }
.cap p { max-width: 36ch; max-height: 0; overflow: hidden; font: 400 14px/1.5 var(--ui); color: var(--grey); opacity: 0; transition: max-height .4s var(--ease), opacity .3s ease; }
.card:hover .cap p, .card:focus-within .cap p { max-height: 4.5em; opacity: 1; }
.empty { display: grid; gap: 8px; padding: 72px 0; font: 400 16px/1.5 var(--ui); color: var(--grey); }
.empty-q { color: var(--ink); font-weight: 500; }
.empty-try .link { font: inherit; }
.link { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* a demo, scaled down from desktop width when its box is narrower (lab.js sets --s) */
.shot { position: absolute; inset: 0; overflow: hidden; }
.shot iframe { position: absolute; top: 0; left: 0; border: 0; display: block; width: 100%; height: 100%; background: transparent; opacity: 0; transition: opacity .5s ease; }
.shot.live iframe { opacity: 1; }
/* a small loader in the middle of the tile until the demo has drawn (demo.js says "ready"); then the piece fades in */
.loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; transition: opacity .3s ease; pointer-events: none; }
.loader i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.loader b { font: 400 12px/1 var(--mono); letter-spacing: .04em; color: var(--faint); }
.shot.live .loader { opacity: 0; }
@keyframes spin { to { rotate: 1turn; } }
.shot.scaled iframe { width: var(--cw); height: calc(100% / var(--s)); transform: scale(var(--s)); transform-origin: 0 0; }
.card .shot iframe { pointer-events: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 999px; font: 500 14px/1 var(--ui); letter-spacing: -.01em; text-decoration: none; cursor: pointer; color: var(--ink); background: var(--chip); transition: background-color .2s ease, translate .2s var(--ease), opacity .2s ease; }
.btn:hover { background: var(--chip-hover); }
.btn:active { translate: 0 1px; }
.btn.primary { color: var(--on-ink); background: var(--ink); }
.btn.primary:hover { opacity: .88; }
.mini { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; font: 500 13px/1 var(--ui); text-decoration: none; cursor: pointer; color: var(--soft); background: var(--chip); transition: background-color .2s ease; white-space: nowrap; }
.mini:hover { background: var(--chip-hover); }
.done > svg { display: none; }
/* copied: a tick takes the icon's place, the same size, so the label never moves or gets covered */
.done::before { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
  content: ""; flex: none; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat; }
.panel-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- a piece ---------- */
.crumbs { display: flex; gap: 8px; padding: 28px 0 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--soft); }
.head { display: grid; gap: 12px; padding: 4px 4px 6px; }
.head h1 { font: 500 clamp(36px, 3.4vw, 52px)/.98 var(--ui); letter-spacing: -.05em; }
.head .lede { max-width: 56ch; font: 400 15.5px/1.55 var(--ui); color: var(--grey); text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }

.stage { position: relative; border-radius: var(--r); overflow: hidden; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.stage::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 50% at 50% 50%, var(--glow), transparent 75%); pointer-events: none; }
.stage .shot { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: max(420px, calc(100svh - 140px)); } /* full width; only the height gives way, so the whole stage fits the window under the top bar */
.stage-bar { position: absolute; z-index: 1; left: 16px; right: 16px; top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
.stage-bar > * { pointer-events: auto; }
.tap-cover { position: absolute; z-index: 2; inset: 0; display: none; place-content: center; gap: 10px; justify-items: center; border: 0; font: 500 15px/1 var(--ui); color: var(--ink); background: transparent; cursor: pointer; }
.tap-cover span, .tap-cover svg { padding: 10px 16px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 80%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line), var(--lift); }
.tap-cover svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; }
.covered .tap-cover { display: grid; }
.covered .shot iframe { pointer-events: none; }
.covered .stage-bar .mini { background: color-mix(in srgb, var(--panel) 75%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line); }

/* a piece's page: on the left a sidebar (title, buttons, how it was made, credit) that stays in view as you
   scroll (kept short enough to fit the window, so it never scrolls inside itself); the stage, its Prompt | Code
   panel and how it was made on the right. Below 1100px it all stacks in reading order */
.piece { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; padding-top: 16px; }
.piece-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.piece-side { position: sticky; top: 80px; display: grid; gap: 16px; } /* short enough to fit the window, so it never scrolls inside itself */
.piece-side .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.piece-side .actions .primary { grid-column: 1 / -1; }
.panel.work { min-width: 0; padding: 0; overflow: clip; scroll-margin-top: 80px; } /* clip, not hidden: the code header can stick. min-width 0: a long code line scrolls inside, it doesn't widen the page */
.work-tabs { display: flex; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.work-tabs button { padding: 9px 14px; border: 0; border-radius: 999px; font: 500 14px/1 var(--ui); color: var(--grey); background: none; cursor: pointer; transition: color .2s ease, background-color .2s ease; }
.work-tabs button:hover { color: var(--ink); }
.work-tabs button[aria-selected="true"] { color: var(--ink); background: var(--chip); }
.tab-pane.prompt { padding: 16px 22px 22px; }
.prompt-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.prompt-bar .slot-note { margin: 0; }
.panel { padding: 22px; border-radius: var(--r); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.panel h2 { font: 500 15px/1.3 var(--ui); letter-spacing: -.01em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.prompt-text { white-space: pre-wrap; font: 400 13.5px/1.85 var(--mono); color: var(--soft); }
.slot-note { margin: -4px 0 16px; font: 400 13px/1.6 var(--ui); color: var(--grey); }
/* A blank in the prompt: blue ink in a dashed field, the one colour on the site, kept for things you can change */
.slot { padding: .14em .4em; margin: 0 -.05em; border-radius: 6px; font-weight: 500; color: var(--accent); background: var(--accent-wash); outline: 1px dashed var(--accent-line); outline-offset: -1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; cursor: text; transition: background-color .2s ease, outline-color .2s ease; }
.prompt-text .slot::after { content: "✎"; margin-left: .35em; font-size: .85em; opacity: .6; }
.slot:hover { outline-style: solid; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.slot:focus { outline: 2px solid var(--accent); background: var(--panel); }
.slot.edited { color: var(--ink); }
.slot.edited::after { content: "✓"; }
.slot.sample { cursor: default; }
.slot.flash { animation: slot-in .8s var(--ease); }
@keyframes slot-in { from { background: color-mix(in srgb, var(--accent) 30%, transparent); } }
.slot-note { display: grid; gap: 8px; margin: -4px 0 18px; }
.slot-note p { font: 400 13px/1.6 var(--ui); color: var(--grey); }
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.showing b { font-weight: 600; color: var(--ink); text-transform: capitalize; }
.credit-line { color: var(--faint); }
/* the credit card: how you used it picks the line; a small preview shows it at the foot of a page */
.credit-lede { margin-top: 8px; font: 400 14px/1.5 var(--ui); color: var(--grey); }
.seg { display: inline-flex; gap: 2px; margin: 12px 0 12px; padding: 3px; border-radius: 999px; background: var(--chip); }
.seg button { padding: 8px 13px; border: 0; border-radius: 999px; font: 500 13px/1 var(--ui); color: var(--grey); background: none; cursor: pointer; transition: color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .06); }
.credit-preview { position: relative; padding: 30px 14px 16px; border-radius: 12px; background: var(--well); text-align: center; }
.credit-preview::before { content: ""; position: absolute; left: 14px; right: 14px; top: 34px; height: 1px; background: var(--line-strong); opacity: .6; } /* the page's last rule */
.cp-label { position: absolute; left: 14px; top: 11px; font: 400 10.5px/1 var(--mono); letter-spacing: .04em; color: var(--faint); }
.cp-line { margin-top: 14px; font: 400 13px/1.4 var(--ui); color: var(--grey); }
.cp-line a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.credit-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.made p { margin: 12px 0 0; max-width: 60ch; font: 400 14.5px/1.6 var(--ui); color: var(--grey); text-wrap: pretty; }
/* under the code: the story on the left, the details on the right in two columns */
.piece-main .made { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 40px; align-items: start; } /* the details' height goes to the story's row, not under the title */
.piece-main .made > :not(.meta) { grid-column: 1; }
.piece-main .made .meta { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: 1fr 1fr; gap: 14px 24px; padding-top: 0; border-top: 0; }
.piece-main .made .meta > :first-child { grid-column: 1 / -1; }
.meta { display: grid; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.meta dd { margin-top: 3px; font: 400 14px/1.45 var(--ui); }
.fine { margin-top: 10px; font: 400 12.5px/1.5 var(--ui); color: var(--faint); }
.fine a:hover { color: var(--ink); }

/* the Code tab: an editor-like header that stays under the top bar while you read (file, language, size, Copy,
   Download), a gutter of line numbers, and long files shown in part until "Show all" */
.code { background: var(--code-bg); color: var(--code-ink); }
.code-bar { position: sticky; top: 64px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px 10px 20px; background: var(--code-bg); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.code-file { display: flex; align-items: center; gap: 8px; min-width: 0; }
.code-file > svg { width: 15px; height: 15px; fill: none; stroke: #85858b; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.code .file { font: 500 13px/1 var(--mono); color: var(--code-ink); }
.code .lang { padding: 4px 7px; border-radius: 6px; font: 500 11px/1 var(--mono); letter-spacing: .02em; color: #a8a8ae; background: rgba(255, 255, 255, .07); }
.code-meta { margin-right: auto; font: 400 12px/1 var(--mono); color: #85858b; }
.code-acts { display: flex; gap: 6px; }
.code .mini { color: var(--code-ink); background: rgba(255, 255, 255, .08); }
.code .mini:hover { background: rgba(255, 255, 255, .14); }
.code-tabs { display: flex; gap: 2px; }
.code-tabs button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; font: 500 12.5px/1 var(--mono); color: #9b9ba1; background: none; cursor: pointer; }
.code-tabs button[aria-selected="true"] { color: var(--code-ink); background: rgba(255, 255, 255, .1); }
.code pre code { counter-reset: ln; }
.code .ln { counter-increment: ln; }
.code .ln::before { content: counter(ln); display: inline-block; width: 4ch; margin-right: 16px; padding-right: 14px; border-right: 1px solid rgba(255, 255, 255, .07); text-align: right; color: #4f4f55; user-select: none; }
.code.clipped pre { max-height: calc(var(--clip, 40) * 1.65em + 18px); overflow-y: hidden; }
.code-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.code.clipped .code-more { position: relative; margin-top: -110px; padding-top: 70px; border-top: 0; background: linear-gradient(transparent, var(--code-bg) 62%); } /* the fade over the last lines shown */
.hljs-keyword, .hljs-built_in, .hljs-tag { color: #c4a7ff; }
.hljs-string, .hljs-attr, .hljs-template-variable { color: #9fd8a8; }
.hljs-number, .hljs-literal { color: #f3b27a; }
.hljs-comment { color: #75757b; font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-name { color: #8fc7ff; }
.hljs-property, .hljs-variable, .hljs-params { color: #e4e4e8; }
.code pre { overflow-x: auto; overflow-y: hidden; padding: 18px 22px 24px 12px; font: 400 12.5px/1.65 var(--mono); tab-size: 2; } /* long lines scroll sideways; the page does the rest */

.faq, .related { padding: 56px 8px 0; }
.faq h2, .related h2 { margin-bottom: 14px; font: 500 22px/1.2 var(--ui); letter-spacing: -.025em; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer; list-style: none; font: 500 15px/1.4 var(--ui); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); transition: rotate .3s var(--ease); }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { padding: 0 0 18px; max-width: 64ch; font: 400 14.5px/1.6 var(--ui); color: var(--grey); }
.rel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rel { display: grid; gap: 6px; padding: 20px 22px; border-radius: var(--r); text-decoration: none; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .4s var(--ease), translate .4s var(--ease); }
.rel:hover { translate: 0 -2px; box-shadow: inset 0 0 0 1px var(--line-strong), var(--lift); }
.rel strong { font: 500 18px/1.2 var(--ui); letter-spacing: -.02em; }
.rel span:last-child { font: 400 13.5px/1.5 var(--ui); color: var(--grey); }

.prose { max-width: 64ch; padding: 36px 8px 24px; }
.prose h1 { margin-bottom: 18px; font: 500 clamp(40px, 5vw, 60px)/1 var(--ui); letter-spacing: -.05em; }
.prose h2 { margin: 32px 0 8px; font: 500 18px/1.3 var(--ui); }
.prose p { font: 400 16px/1.65 var(--ui); color: var(--grey); }
.prose a { color: var(--ink); text-underline-offset: 3px; }
.changelog .day { padding-top: 28px; }
.changelog .day h2 { margin: 0 0 10px; font: 400 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.changelog ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.changelog li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font: 400 15px/1.5 var(--ui); color: var(--grey); }
.changelog li a { color: var(--ink); font-weight: 500; text-decoration: none; margin-right: 6px; }
.changelog li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.lost { display: grid; gap: 18px; padding: clamp(72px, 14vw, 160px) 8px; }
.lost h1 { max-width: 13ch; font: 500 clamp(44px, 6vw, 80px)/.98 var(--ui); letter-spacing: -.05em; }
.lost h1 span { color: var(--faint); }
.lost p:not(.eyebrow) { max-width: 44ch; font: 400 17px/1.55 var(--ui); color: var(--grey); }

/* ---------- quick actions that follow you down a long page ---------- */
.dock { position: fixed; z-index: 15; left: 50%; bottom: 18px; translate: -50% 0; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 82%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: inset 0 0 0 1px var(--line), var(--lift); animation: rise .35s var(--ease); }
.dock[hidden] { display: none; }
.dock-title { padding: 0 8px 0 12px; font: 500 14px/1 var(--ui); white-space: nowrap; } /* the padding lives on the title, so without it (phones) the pill stays even */
@keyframes rise { from { opacity: 0; translate: -50% 12px; } }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 84px; translate: -50% 12px; padding: 11px 18px; border-radius: 999px; font: 500 14px/1 var(--ui); color: var(--on-ink); background: var(--ink); box-shadow: var(--lift); opacity: 0; pointer-events: none; transition: opacity .25s ease, translate .35s var(--ease); }
.toast.on { opacity: 1; translate: -50% 0; }

/* ---------- signup + footer ---------- */
.signup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: center; gap: 24px; margin: 56px 0 16px; padding: 28px; border-radius: var(--r); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.signup h2 { font: 500 20px/1.2 var(--ui); letter-spacing: -.02em; }
.signup p { margin-top: 6px; font: 400 14.5px/1.55 var(--ui); color: var(--grey); }
.signup p a { color: var(--ink); text-underline-offset: 3px; }
.signup form { display: flex; gap: 8px; }
.signup input { flex: 1; min-width: 0; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; font: 400 14px/1 var(--ui); color: var(--ink); background: var(--chip); outline: 0; }
.signup input:focus { box-shadow: 0 0 0 1.5px var(--line-strong); }
.signup input::placeholder { color: var(--faint); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 22px 8px 28px; font: 400 13px/1.4 var(--ui); color: var(--faint); }
.foot nav { display: flex; gap: 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
body[data-item] .foot { padding-bottom: 92px; } /* room for the action bar, so it never covers the footer */

/* ---------- the fullscreen viewer: one piece, centre stage, its name huge behind it ---------- */
.viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: var(--ink); background: var(--bg); overflow: hidden; }
.viewer::backdrop { background: var(--bg); }
:root:has(.viewer[open]) { overflow: hidden; } /* full screen is one view: the page behind doesn't scroll */
.viewer { overscroll-behavior: contain; }
.viewer[open] { animation: v-in .45s var(--ease); }
@keyframes v-in { from { opacity: 0; scale: .985; } }
.viewer::before { content: ""; position: absolute; inset: 0; background: radial-gradient(45% 45% at 50% 48%, var(--glow), transparent 72%); pointer-events: none; }
.v-word { position: absolute; inset: 0; display: grid; place-items: center; font: 700 clamp(90px, 20vw, 320px)/.8 var(--ui); letter-spacing: -.07em; color: transparent; -webkit-text-stroke: 1px var(--line-strong); text-transform: uppercase; white-space: nowrap; user-select: none; pointer-events: none; }
.v-stage { position: absolute; inset: 8vh 10vw 25vh; } /* room below for the title and the demo's own controls */
.v-stage iframe { position: relative; width: 100%; height: 100%; border: 0; background: transparent; opacity: 0; transition: opacity .5s ease; }
.v-stage.live iframe { opacity: 1; }
.v-stage.live .loader { opacity: 0; }
.v-top { position: absolute; top: 22px; left: 28px; right: 22px; display: flex; justify-content: space-between; align-items: center; }
.v-info { position: absolute; left: 32px; bottom: 30px; display: grid; gap: 8px; max-width: 320px; }
@media (max-height: 760px) { .v-info p { display: none; } }
.v-info h2 { font: 500 clamp(36px, 4vw, 56px)/1 var(--ui); letter-spacing: -.045em; }
.v-info p { font: 400 15px/1.5 var(--ui); color: var(--grey); }
.v-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.v-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink); background: var(--chip); transition: background-color .2s ease; }
.v-btn:hover { background: var(--chip-hover); }

/* ---------- short windows: the sidebar can't fit, so it scrolls with the page instead of sticking ---------- */
@media (max-height: 680px) { .piece-side { position: static; } } /* the sidebar is about 580px tall, plus 80px under the top bar */

/* ---------- small screens ---------- */
@media (max-width: 600px) { /* phones: one tile per row */
  .grid, .rel-grid { grid-template-columns: minmax(0, 1fr); }
  .card.wide { aspect-ratio: 4 / 3; }
}
@media (max-width: 440px) { .card, .card.wide { aspect-ratio: 7 / 6; } } /* small phones: a little taller */
@media (max-width: 1100px) {
  /* one column in reading order: title and buttons, stage, prompt and code, how it was made, credit */
  .piece { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .piece-main, .piece-side { display: contents; }
  .piece-side > .head { order: -1; padding: 8px 0 0; }
  .piece-side > .panel { order: 1; } /* the credit comes after the stage, the code and how it was made */
  .piece-main .made { grid-template-columns: minmax(0, 1fr); }
  .piece-main .made .meta { grid-column: 1; grid-row: auto; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
  .piece-side .actions { display: flex; flex-wrap: wrap; }
  .brand .by { display: none; }
}
@media (max-width: 860px) {
  .prompt-bar { flex-direction: column; }
  .code-meta { display: none; }
  .links { display: none; }
  .find { width: auto; flex: 1; }
  .hire, .search kbd { display: none; }
  .dock-title { display: none; }
  .top-in { gap: 8px; }
  .stage .shot { aspect-ratio: 1 / 1; }
  .card .motion-btn { opacity: 1; translate: 0 0; }
  .cap p { display: none; } /* on a phone the chip keeps to the name, so it never covers the piece */
  .signup { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .changelog li { grid-template-columns: minmax(0, 1fr); }
  .v-stage { inset: 12vh 4vw 30vh; }
  .v-info { left: 20px; right: 20px; bottom: 96px; }
    }
@media (max-width: 480px) {
  .toolbar-end .count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .rel:hover { translate: none; }
}
