/* Society of Machines: the component stylesheet.
   Reads ./tokens.css (generated from ../tokens.json). Fonts are local (../fonts/, SIL OFL). No network, no framework.
   Paper is the default ground; set data-theme="night" on <html> for the night print.
   Every class is listed, with its states, in ../design.md section 7 and shown live on the design-system page
   (brand/system/site/).

   Three rules hold the whole file together:
   1. Plain controls, printed content. A control is a clean shape on a hairline; the print (plates, dots, stamps,
      the display plate) lives in content. Texture never goes on a control.
   2. What is chosen is printed. The pink plate lands under exactly three things: the primary action, a checked
      control (box, radio, switch thumb, the chosen segment or tab) and a focused field. Nothing else carries it.
   3. At night the machines light up. --glow-* is transparent by day; at night the printed plate blooms pink and
      a light (a working dot, the sun glyph, the lights in a picture) blooms warm. Day has no glow at all. */
@import url("tokens.css");

@font-face { font-family: "Archivo"; src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../fonts/CourierPrime-Regular.ttf") format("truetype");
  font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../fonts/CourierPrime-Bold.ttf") format("truetype");
  font-weight: 700; font-display: swap; }

/* ================================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background-color: var(--bg); color: var(--label); }
body {
  margin: 0; background: var(--bg); color: var(--label); overflow-x: hidden;
  font: var(--weight-body) var(--size-body)/var(--leading-body) var(--font-ui); font-stretch: var(--stretch-ui);
  letter-spacing: var(--tracking-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--ink-pink) 32%, transparent); }
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
:focus:not(:focus-visible) { outline: none; }
/* The theme change: page colours ease together (js sets .theming for the length of the change). */
.theming, .theming *:not(img):not(canvas) {
  transition: color var(--dur-theme) var(--ease-in-out), background-color var(--dur-theme) var(--ease-in-out),
    border-color var(--dur-theme) var(--ease-in-out), fill var(--dur-theme) var(--ease-in-out), stroke var(--dur-theme) var(--ease-in-out),
    box-shadow var(--dur-theme) var(--ease-in-out) !important;
}
/* Dusk, then the lights (the theme change). The page colours ease to night over --dur-theme (the .theming rule above);
   as they settle, everything that gives light comes on, one after another in no fixed order: every pink plate and
   warm light on the page (their glow tokens are scaled by --lit, 0 to 1), and the lights in the pictures. Each one
   flickers once and blooms past its mark before it settles (light-on). Back to day, the lights go out first, then
   dawn. js/lights.js runs it; with reduced motion everything changes at once. */
@property --lit { syntax: "<number>"; inherits: true; initial-value: 1; }
/* A light that is coming on carries the glow tokens itself (the same values as the night tokens), so its own --lit,
   not the root's, scales them; the root keeps --lit 0 until the last one has settled. */
[data-theme="night"] .light-on { --glow-light: 0 0 calc(22px * var(--lit)) calc(4px * var(--lit)) rgba(255, 181, 17, calc(.30 * var(--lit)));
  --glow-pink: 0 0 calc(26px * var(--lit)) calc(2px * var(--lit)) rgba(255, 72, 176, calc(.38 * var(--lit))); --glow-ink: rgba(255, 201, 74, calc(.95 * var(--lit))); }
.light-on { animation: lit-on var(--lights-bloom) var(--light-delay, 0ms) var(--ease-out) both; }
.theming .light-on, .light-on { transition: box-shadow 0s, background-color 0s !important; }
@keyframes lit-on { from { --lit: 0; } 28% { --lit: .3; } 40% { --lit: .08; } 62% { --lit: 1.45; } to { --lit: 1; } }

/* ================================================================ layout */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: calc(var(--wrap-narrow) + 2 * var(--gutter)); }
.section { padding-block: var(--sect) 0; position: relative; }
.section:last-child { padding-bottom: var(--sect); }
.section-head { max-width: 44em; margin: 0 0 var(--after-head); }
.section-head.centred { margin-inline: auto; text-align: center; }
.section-head.centred .lede { margin-inline: auto; }
.grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min)), 1fr)); }
.grid-2 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-top: var(--stack, var(--space-5)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.reading { max-width: var(--measure); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--space-4); top: -80px; z-index: var(--z-skip); background: var(--tint); color: var(--on-tint);
  padding: 10px 16px; border-radius: var(--radius-pill); font-weight: var(--weight-button); text-decoration: none; }
.skip:focus { top: var(--space-4); }
@media (max-width: 639.98px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* The plate head: how a section opens. A paperwork line (the plate's number and name on a hairline), then the
   display line with its lede beside it. Left-aligned in the frame; only the page header is centred (rule 9). */
.plate-head { display: grid; gap: var(--space-6); margin: 0 0 var(--after-head); }
.plate-head .plate-line { display: flex; align-items: center; gap: var(--space-4); color: var(--label-2); }
.plate-head .plate-line::after { content: ""; flex: 1; border-top: var(--border-rule) solid var(--rule-strong); }
.plate-head .plate-no { font: 700 var(--size-mono)/1 var(--font-mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent-text); }
.plate-head .plate-name { font: 700 var(--size-mono)/1 var(--font-mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.plate-head .plate-copy { display: grid; gap: var(--space-5) var(--space-9); grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; }
.plate-head .lede { margin: 0; max-width: 30em; }
@media (max-width: 859.98px) { .plate-head .plate-copy { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* ================================================================ type */
.display {
  margin: 0; font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--stretch-display);
  text-transform: uppercase; line-height: var(--leading-display); letter-spacing: var(--tracking-display);
  color: var(--display-ink); text-shadow: var(--misreg) 0 var(--display-plate); text-wrap: balance;
}
.display-xl { font-size: var(--size-display-xl); }
.display-l { font-size: var(--size-display-l); }
.display-poster { font-size: var(--size-poster); line-height: var(--leading-poster); }
.display > span { display: block; }
h1, .h1 { font-size: var(--size-h1); font-weight: var(--weight-h1); font-stretch: var(--stretch-h1); line-height: var(--leading-h1); letter-spacing: var(--tracking-h1); text-wrap: balance; }
h2, .h2 { font-size: var(--size-h2); font-weight: var(--weight-h2); font-stretch: var(--stretch-h2); line-height: var(--leading-h2); letter-spacing: var(--tracking-h1); text-wrap: balance; }
h3, .h3 { font-size: var(--size-h3); font-weight: var(--weight-h3); line-height: var(--leading-h3); letter-spacing: var(--tracking-heading); }
h4, .h4 { font-size: var(--size-h4); font-weight: var(--weight-h4); line-height: var(--leading-h3); letter-spacing: var(--tracking-heading); }
.lede { font-size: var(--size-lede); font-weight: var(--weight-lede); line-height: var(--leading-lede); color: var(--label-2); max-width: 32em; text-wrap: pretty; }
.body { font-size: var(--size-body); line-height: var(--leading-body); }
.small { font-size: var(--size-small); line-height: var(--leading-small); color: var(--label-2); }
.caption { font-size: var(--size-caption); line-height: var(--leading-small); color: var(--label-3); font-stretch: var(--stretch-caption); }
.mono, .paperwork, code, kbd { font-family: var(--font-mono); font-size: var(--size-mono); letter-spacing: .01em; }
.mono-caps { font-family: var(--font-mono); font-size: calc(var(--size-mono) - 1.5px); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.kicker { font-size: var(--size-small); font-weight: var(--weight-label); color: var(--accent-text); margin: 0 0 var(--space-4); }
strong, b { font-weight: var(--weight-strong); }
code { background: var(--fill); padding: .1em .35em; border-radius: 5px; }
kbd { border: var(--border-rule) solid var(--rule-strong); border-bottom-width: 2px; padding: 0 .4em; border-radius: 5px; }
a, .link { color: var(--link); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .18em; border-radius: 3px; }
a:hover, .link:hover, a.is-hover, .link.is-hover { color: var(--link-hover); }
a:active, .link:active, a.is-active, .link.is-active { color: var(--link-hover); text-decoration-thickness: 2.5px; }
.placeholder { background: var(--placeholder); color: var(--label); padding: 0 5px; border-radius: 4px; }
/* An ink line: a sentence set in one of the editions, for a mark or a section plate, never for reading text. */
.ink-cobalt { color: var(--ink-cobalt); } .ink-violet { color: var(--ink-violet); }

/* ================================================================ buttons
   .btn + one kind (.btn-primary, .btn-secondary, .btn-ghost, .btn-link, .btn-icon) + an optional size (.btn-sm, .btn-lg).
   States: :hover, :focus-visible (the ring), :active, :disabled or aria-disabled="true", aria-busy="true" (working).
   Only the primary is printed: the pink plate under it, 3 px right and down; at night it blooms. */
.btn {
  --btn-h: var(--h-btn);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
  min-height: var(--btn-h); padding: 0 calc(var(--btn-h) * .5); border-radius: var(--radius-pill); border: 0; cursor: pointer;
  font: var(--weight-button) var(--size-button)/1 var(--font-ui); font-stretch: var(--stretch-button); letter-spacing: .004em;
  text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast), color var(--dur-fast);
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-sm { --btn-h: var(--h-btn-sm); font-size: var(--size-button-sm); }
.btn-lg { --btn-h: var(--h-btn-lg); font-size: var(--size-button-lg); }
.btn-primary { background: var(--tint); color: var(--on-tint); box-shadow: var(--plate-btn), var(--glow-pink); }
.btn-primary:hover, .btn-primary.is-hover { background: var(--tint-hover); color: var(--on-tint); box-shadow: var(--plate-btn-hover), var(--glow-pink); transform: translate(var(--btn-lift), var(--btn-lift)); }
.btn-primary:active, .btn-primary.is-active { box-shadow: 0 0 0 var(--ink-pink), var(--glow-pink); transform: translate(var(--btn-press), var(--btn-press)); }
.btn-secondary { background: var(--raised); color: var(--label); box-shadow: inset 0 0 0 var(--border) var(--rule-strong); }
.btn-secondary:hover, .btn-secondary.is-hover { color: var(--label); background: var(--raised); box-shadow: inset 0 0 0 var(--border) var(--label); }
.btn-secondary:active, .btn-secondary.is-active { background: var(--bg-sunk); box-shadow: inset 0 0 0 var(--border) var(--label); }
.btn-ghost { background: transparent; color: var(--link); box-shadow: inset 0 0 0 var(--border) color-mix(in srgb, var(--link) 45%, transparent); }
.btn-ghost:hover, .btn-ghost.is-hover { background: var(--fill); color: var(--link-hover); box-shadow: inset 0 0 0 var(--border) var(--link-hover); }
.btn-ghost:active, .btn-ghost.is-active { background: var(--fill-2); }
.btn-link { --btn-h: auto; padding: 2px 0; min-height: 0; background: none; color: var(--link); border-radius: 4px;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
.btn-link:hover, .btn-link.is-hover { color: var(--link-hover); }
.btn-link:active, .btn-link.is-active { text-decoration-thickness: 2.5px; }
.btn-icon { --btn-h: var(--h-icon-btn); width: var(--btn-h); padding: 0; background: transparent; color: var(--label);
  box-shadow: inset 0 0 0 var(--border) var(--rule-strong); }
.btn-icon.btn-sm { width: var(--h-btn-sm); }
.btn-icon:hover, .btn-icon.is-hover { color: var(--label); box-shadow: inset 0 0 0 var(--border) currentColor; }
.btn-icon:active, .btn-icon.is-active { background: var(--fill-2); }
.btn:focus-visible, .btn.is-focus { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--bg-sunk); color: var(--label-3); box-shadow: none; transform: none; cursor: not-allowed;
}
.btn-link:disabled, .btn-link[aria-disabled="true"] { background: none; text-decoration: none; }
.btn[aria-busy="true"] { cursor: progress; }
/* Working: the two drums turn, cobalt and pink, never a grey ring. */
.btn[aria-busy="true"]::after { content: ""; width: 1em; height: 1em; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 30% 50%, var(--ink-cobalt) 0 .22em, transparent .25em), radial-gradient(circle at 70% 50%, var(--ink-pink) 0 .22em, transparent .25em);
  animation: drums 700ms linear infinite; }
@keyframes drums { to { transform: rotate(1turn); } }

/* ================================================================ fields
   .field wraps one control: <label class="label">, the control, then .help and/or .error.
   Mark an invalid control aria-invalid="true" and link .error with aria-describedby.
   A field is raised paper on a hairline; typing is printing: the focused field's hairline becomes the focus ring and
   the pink plate lands 2 px right and down behind it. */
.field { display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
.label { font-size: var(--size-small); font-weight: var(--weight-label); color: var(--label); }
.label .optional { font-weight: var(--weight-body); color: var(--label-3); }
.help { font-size: var(--size-small); line-height: var(--leading-small); color: var(--label-3); margin: 0; }
.error { font-size: var(--size-small); line-height: var(--leading-small); color: var(--danger); margin: 0; display: flex; gap: var(--space-3); align-items: baseline; font-weight: 550; }
.error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; border-radius: 50%;
  background: var(--danger); color: var(--on-accent); font-size: .8em; font-weight: 800; transform: translateY(.1em); }
.input, .select, .dropdown-trigger {
  width: 100%; min-height: var(--h-field); padding: 0 var(--space-5); background: var(--raised); color: var(--label);
  border: var(--border) solid var(--rule-strong); border-radius: var(--radius-field); font-size: var(--size-body); line-height: 1.4;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast);
}
/* The paper slot: the field's label is set in paperwork on the slot's top rule, so a form reads as a printed form.
   <div class="field slot"><label class="label">…</label><input class="input">. While you type the rule prints in the
   focus ink from the left (and the pink plate lands, as on every field). */
.field.slot { position: relative; gap: 0; padding-top: 9px; --slot-bg: var(--bg); }
.raised .field.slot, .dialog .field.slot, .card .field.slot { --slot-bg: var(--raised); }
.field.slot > .label { position: absolute; top: 0; left: 14px; z-index: 2; padding: 0 6px; background: linear-gradient(var(--slot-bg) 50%, var(--raised) 50%); color: var(--label-2);
  font: 700 11px/18px var(--font-mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; border-radius: 4px; transition: color var(--dur-fast); }
.field.slot > .input, .field.slot > .select, .field.slot > .dropdown > .dropdown-trigger { border-radius: var(--radius-item); }
.field.slot::after { content: ""; position: absolute; left: 14px; right: 14px; top: 9px; height: 2px; border-radius: 2px; background: var(--focus); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-slow) var(--ease-out); pointer-events: none; z-index: 1; }
.field.slot:focus-within::after, .field.slot.is-focus::after { transform: scaleX(1); }
.field.slot:focus-within > .label, .field.slot.is-focus > .label { color: var(--focus); }
.field.slot > .help, .field.slot > .error { margin-top: var(--space-3); }
.field.slot:has([aria-invalid="true"]) > .label { color: var(--danger); }
.field.slot:has([aria-invalid="true"])::after { background: var(--danger); transform: scaleX(1); }
.field.slot:has(:disabled) > .label { color: var(--label-3); background: linear-gradient(var(--slot-bg) 50%, var(--bg-sunk) 50%); }
textarea.input { min-height: 132px; padding: var(--space-4) var(--space-5); resize: vertical; display: block; }
.input::placeholder { color: var(--label-3); opacity: 1; }
.input:hover, .select:hover, .dropdown-trigger:hover, .input.is-hover, .select.is-hover, .dropdown-trigger.is-hover { border-color: var(--label); }
.input:focus-visible, .select:focus-visible, .dropdown-trigger:focus-visible, .dropdown-trigger[aria-expanded="true"], .input.is-focus, .select.is-focus, .dropdown-trigger.is-focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 calc(var(--focus-field-width) - var(--border) + .5px) var(--focus), var(--plate-focus);
  caret-color: var(--focus);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .dropdown-trigger[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus-visible, .input[aria-invalid="true"].is-focus { box-shadow: 0 0 0 .5px var(--danger), var(--plate-focus); }
.input:disabled, .select:disabled, .dropdown-trigger:disabled, .input[readonly] {
  background: var(--bg-sunk); color: var(--label-3); border-color: var(--rule); cursor: not-allowed;
}
.input[readonly] { cursor: default; color: var(--label-2); }
/* Native select, for long lists and phones: no browser chrome shows, the list itself is the system's. */
.select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--label-2) 50% calc(50% + 1.5px), transparent calc(50% + 1.5px)),
    linear-gradient(-45deg, transparent 50%, var(--label-2) 50% calc(50% + 1.5px), transparent calc(50% + 1.5px));
  background-size: 7px 7px, 7px 7px; background-position: calc(100% - 25px) 50%, calc(100% - 19px) 50%; background-repeat: no-repeat; }
.select option { background: var(--raised); color: var(--label); }
/* Search: the field with a leading glyph and a clear button. */
.search { position: relative; display: flex; align-items: center; }
.search > svg { position: absolute; left: var(--space-5); width: 18px; height: 18px; color: var(--label-3); pointer-events: none; }
.search .input { padding-left: 46px; padding-right: 46px; border-radius: var(--radius-pill); }
.search .input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: 6px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--label-2); cursor: pointer; display: grid; place-items: center; }
.search .clear:hover, .search .clear.is-hover { background: var(--fill); }
.search .clear[hidden] { display: none; }

/* ---------------------------------------------------------------- custom dropdown (listbox)
   <div class="dropdown"> <button class="dropdown-trigger" aria-haspopup="listbox" aria-expanded> <ul class="listbox" role="listbox">
   <li class="option" role="option" aria-selected>. Keys: Enter, Space or Down open; Up and Down move; Home and End;
   typing jumps; Enter or Space chooses; Escape closes back to the trigger; Tab closes. */
.dropdown { position: relative; }
.dropdown-trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); text-align: left; cursor: pointer; }
.dropdown-trigger .value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-trigger .value.is-empty { color: var(--label-3); }
.dropdown-trigger svg { flex: none; width: 18px; height: 18px; color: var(--label-2); transition: transform var(--dur) var(--ease-out); }
.dropdown-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
/* The slip: one printed sheet for menus, listboxes, popovers, toasts and notices. Raised paper, the hairline, the pink
   plate 3 px right and down (--plate-slip), a faint blue lift. */
.slip, .listbox, .menu, .popover, .toast, .notice {
  background: var(--raised); border: var(--border) solid var(--rule-strong); border-radius: var(--radius-menu);
  box-shadow: var(--plate-slip), var(--lift-1); color: var(--label);
}
.listbox, .menu {
  position: absolute; left: 0; right: 0; top: calc(100% + var(--space-3)); z-index: var(--z-dropdown); margin: 0; padding: 6px; list-style: none;
  max-height: 296px; overflow: auto; overscroll-behavior: contain;
  transform-origin: top center; animation: pop-in var(--dur) var(--ease-out) both;
}
.listbox[hidden], .menu[hidden] { display: none; }
.listbox, .menu, .popover { transform-origin: top left; animation: sheet-in var(--dur) var(--ease-out) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.option, .menu-item {
  position: relative; display: flex; align-items: center; gap: var(--space-4); min-height: var(--h-menu-item); padding: 0 var(--space-4) 0 var(--space-5);
  border-radius: var(--radius-item); cursor: pointer; color: var(--label); font-size: var(--size-body); line-height: 1.25; user-select: none;
}
.option:hover, .menu-item:hover, .option.is-hover, .menu-item.is-hover { background: var(--fill); }
.option.is-active, .menu-item:focus-visible, .menu-item.is-focus { background: var(--selected); outline: none; }
.option.is-active::before, .menu-item:focus-visible::before, .menu-item.is-focus::before { content: ""; position: absolute; left: 4px; top: 9px; bottom: 9px; width: 2.5px; border-radius: 2px; background: var(--focus); }
.option[aria-selected="true"] { color: var(--selected-ink); font-weight: var(--weight-strong); }
.option .check { margin-left: auto; width: 16px; height: 16px; opacity: 0; color: var(--selected-ink); }
.option[aria-selected="true"] .check { opacity: 1; }
.option[aria-disabled="true"] { color: var(--label-3); cursor: not-allowed; background: none; }
.option .meta, .menu-item .meta { margin-left: auto; font-family: var(--font-mono); font-size: var(--size-mono); color: var(--label-3); }
.menu-group { padding: var(--space-3) var(--space-5) var(--space-2); }
.menu-sep { height: 0; margin: 6px 4px; border: 0; border-top: 2px dotted var(--rule-strong); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(var(--pop-scale)); } }

/* ---------------------------------------------------------------- checkbox, radio, switch
   Native inputs drawn by the page: <input type="checkbox" class="check">, <input type="radio" class="radio">,
   <input type="checkbox" class="switch" role="switch">, each inside <label class="choice">.
   Off: raised paper on a hairline. On: the tint, and the pink plate lands (what is chosen is printed); at night it blooms. */
.choice { display: flex; gap: var(--space-4); align-items: flex-start; cursor: pointer; font-size: var(--size-body); line-height: 1.4; }
.choice > span { padding-top: calc((var(--size-check) - 1.4em) / 2); }
.choice .help { display: block; margin-top: 2px; }
.choice:has(input:disabled) { cursor: not-allowed; color: var(--label-3); }
.check, .radio, .switch { appearance: none; -webkit-appearance: none; margin: 0; flex: none; cursor: pointer; background: var(--raised);
  border: var(--border) solid var(--rule-strong); display: inline-grid; place-items: center;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast); }
.check, .radio { width: var(--size-check); height: var(--size-check); }
.check { border-radius: var(--radius-check); }
.radio { border-radius: 50%; }
.check::after { content: ""; width: 44%; height: 24%; border: solid var(--on-tint); border-width: 0 0 2.5px 2.5px; transform: translateY(-15%) rotate(-45deg) scale(0); }
.radio::after { content: ""; width: 40%; height: 40%; border-radius: 50%; background: var(--on-tint); transform: scale(0); }
.check:hover, .radio:hover, .check.is-hover, .radio.is-hover { border-color: var(--label); }
.check:checked, .radio:checked { background: var(--tint); border-color: var(--tint); box-shadow: var(--plate-check), var(--glow-pink); }
.check:checked::after { transform: translateY(-15%) rotate(-45deg) scale(1); transition: transform var(--dur-spring) var(--ease-spring); }
.radio:checked::after { transform: scale(1); transition: transform var(--dur-spring) var(--ease-spring); }
.check:indeterminate { background: var(--tint); border-color: var(--tint); box-shadow: var(--plate-check), var(--glow-pink); }
.check:indeterminate::after { width: 50%; height: 0; border-width: 0 0 2.5px 0; transform: none; }
.check:focus-visible, .radio:focus-visible, .switch:focus-visible, .check.is-focus, .radio.is-focus, .switch.is-focus { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.check[aria-invalid="true"], .radio[aria-invalid="true"] { border-color: var(--danger); }
.check:disabled, .radio:disabled, .switch:disabled { background: var(--bg-sunk); border-color: var(--rule); cursor: not-allowed; box-shadow: none; }
.check:disabled:checked, .radio:disabled:checked { background: var(--label-3); border-color: var(--label-3); box-shadow: none; }
/* The switch: a sunk track on a hairline, the thumb raised paper. On: the track is the tint, the thumb lands on the
   spring and carries the plate. */
.switch { --gap: 3px; width: var(--switch-w); height: var(--switch-h); border-radius: var(--radius-pill); background: var(--bg-sunk); justify-items: start; padding: 0 var(--gap); }
.switch::after { content: ""; width: calc(var(--switch-h) - 2 * var(--border) - 2 * var(--gap)); height: calc(var(--switch-h) - 2 * var(--border) - 2 * var(--gap)); border-radius: 50%; background: var(--raised);
  box-shadow: inset 0 0 0 var(--border) var(--rule-strong); transition: transform var(--dur-spring) var(--ease-spring), box-shadow var(--dur-fast), background-color var(--dur-fast); }
.switch:checked { background: var(--tint); border-color: var(--tint); box-shadow: var(--glow-pink); }
.switch:checked::after { transform: translateX(calc(var(--switch-w) - var(--switch-h))); background: var(--on-tint); box-shadow: 1.5px 1.5px 0 var(--ink-pink); }
.switch:hover:not(:disabled), .switch.is-hover:not(:disabled) { border-color: var(--label); }
.switch:checked:hover:not(:disabled), .switch:checked.is-hover:not(:disabled) { background: var(--tint-hover); border-color: var(--tint-hover); }
.switch:active:not(:disabled)::after { transform: scale(.94); }
.switch:checked:active:not(:disabled)::after { transform: translateX(calc(var(--switch-w) - var(--switch-h))) scale(.94); }
.switch:disabled::after { background: var(--rule-strong); box-shadow: none; }
.choices { display: grid; gap: var(--space-4); border: 0; margin: 0; padding: 0; min-width: 0; }
.choices legend { padding: 0; margin-bottom: var(--space-4); }

/* ---------------------------------------------------------------- segmented control
   A radio group drawn as pills in one hairline capsule: <div class="segmented" role="radiogroup"> <label><input type="radio"><span>.
   Arrow keys move the choice (native radios). The chosen pill is printed: raised paper on the plate. */
.segmented { position: relative; display: inline-flex; justify-self: start; gap: 2px; padding: 3px 5px 5px 3px; border: var(--border) solid var(--rule-strong); border-radius: var(--radius-pill); background: var(--bg-sunk); max-width: 100%; isolation: isolate; }
@media (max-width: 479.98px) { .segmented { overflow-x: auto; } }
.segmented label { position: relative; flex: none; z-index: 1; }
/* The travelling pill (js/components.js keeps --x and --w on the group): it slides from the old choice to the new one
   on the spring and carries the plate; the labels only change colour. Without script each chosen span prints its own. */
.segmented.has-pill::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: var(--w, 0px); transform: translateX(var(--x, 0px)); border-radius: var(--radius-pill);
  background: var(--raised); box-shadow: var(--plate-check), var(--glow-pink); transition: transform var(--dur-spring) var(--ease-spring), width var(--dur-spring) var(--ease-spring); z-index: 0; }
.segmented.has-pill input:checked + span { background: transparent; box-shadow: none; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; min-height: calc(var(--h-control-sm) - 8px); padding: 0 var(--space-5); border-radius: var(--radius-pill);
  font-size: var(--size-small); font-weight: 550; color: var(--label-2); transition: background-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast); white-space: nowrap; }
.segmented label:hover span, .segmented label.is-hover span { color: var(--label); }
.segmented input:checked + span { background: var(--raised); color: var(--selected-ink); font-weight: var(--weight-strong); box-shadow: var(--plate-check), var(--glow-pink); }
.segmented input:focus-visible + span, .segmented input.is-focus + span { outline: var(--focus-ring); outline-offset: 1px; }
.segmented input:disabled + span { color: var(--label-3); background: none; cursor: not-allowed; box-shadow: none; }

/* ---------------------------------------------------------------- slider
   <input type="range" class="slider">; js keeps --fill (0 to 100%) on it so the tint prints up to the thumb. */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: var(--slider-thumb); margin: 0; background: transparent; cursor: pointer; --fill: 50%; }
.slider::-webkit-slider-runnable-track { height: var(--slider-track); border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--tint) var(--fill), var(--bg-sunk) var(--fill)); box-shadow: inset 0 0 0 1px var(--rule); }
.slider::-moz-range-track { height: var(--slider-track); border-radius: var(--radius-pill); background: var(--bg-sunk); box-shadow: inset 0 0 0 1px var(--rule); }
.slider::-moz-range-progress { height: var(--slider-track); border-radius: var(--radius-pill); background: var(--tint); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: var(--slider-thumb); height: var(--slider-thumb); margin-top: calc((var(--slider-track) - var(--slider-thumb)) / 2);
  border-radius: 50%; background: var(--raised); border: var(--border) solid var(--tint); box-shadow: var(--plate-check), var(--glow-pink); transition: transform var(--dur-fast) var(--ease-out); }
.slider::-moz-range-thumb { width: var(--slider-thumb); height: var(--slider-thumb); border-radius: 50%; background: var(--raised); border: var(--border) solid var(--tint); box-shadow: var(--plate-check), var(--glow-pink); }
.slider::-webkit-slider-thumb { transition: transform var(--dur-spring) var(--ease-spring), box-shadow var(--dur-fast); }
.slider::-moz-range-thumb { transition: transform var(--dur-spring) var(--ease-spring), box-shadow var(--dur-fast); }
.slider:hover::-webkit-slider-thumb, .slider.is-hover::-webkit-slider-thumb { transform: scale(1.12); }
/* while it is held the thumb grows and a ring of the tint spreads under it; the value beside it bumps (js/components.js) */
.slider:active::-webkit-slider-thumb, .slider.is-active::-webkit-slider-thumb { transform: scale(1.22); box-shadow: 0 0 0 8px color-mix(in srgb, var(--tint) 22%, transparent), var(--plate-check), var(--glow-pink); }
.slider:active::-moz-range-thumb, .slider.is-active::-moz-range-thumb { transform: scale(1.22); box-shadow: 0 0 0 8px color-mix(in srgb, var(--tint) 22%, transparent), var(--plate-check), var(--glow-pink); }
.slider-row output.bump { animation: bump var(--dur-spring) var(--ease-spring); color: var(--link); }
@keyframes bump { 40% { transform: scale(1.25); } }
.slider:focus-visible, .slider.is-focus { outline: none; }
.slider:focus-visible::-webkit-slider-thumb, .slider.is-focus::-webkit-slider-thumb { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.slider:focus-visible::-moz-range-thumb, .slider.is-focus::-moz-range-thumb { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.slider:disabled { cursor: not-allowed; }
.slider:disabled::-webkit-slider-runnable-track { background: var(--bg-sunk); }
.slider:disabled::-webkit-slider-thumb { background: var(--bg-sunk); border-color: var(--rule); box-shadow: none; }
.slider-row { display: flex; align-items: center; gap: var(--space-5); }
.slider-row output { min-width: 4.5ch; text-align: right; font-family: var(--font-mono); font-size: var(--size-mono); color: var(--label-2); transition: color var(--dur-fast); display: inline-block; }

/* ---------------------------------------------------------------- file upload
   <label class="upload"> around a visually hidden <input type="file">; the drop zone takes focus through the input.
   The picture (.upload-art, a day print and a night print of the same drawing: sheets drifting along a string of
   lights into a tray on a terrace table) stands at the left on bare paper, no frame; the words beside it. Hover lifts
   the picture a little; a file held over the zone brings the tint to the edge and the picture forward; files added
   land a small received stamp on the picture (js/components.js). */
.upload { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--space-6); padding: var(--space-4) var(--space-7) var(--space-4) var(--space-4); cursor: pointer; text-align: left;
  border: 2px dotted var(--rule-strong); border-radius: var(--radius-card); background: var(--bg-sunk); transition: border-color var(--dur-fast), background-color var(--dur-fast); }
.upload input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.upload .upload-art { position: relative; width: 168px; aspect-ratio: 3 / 2; flex: none; border-radius: var(--radius-item); overflow: hidden; transform-origin: 50% 100%;
  transition: transform var(--dur-spring) var(--ease-spring); }
.upload .upload-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload .upload-art .n { opacity: 0; transition: opacity var(--dur-theme) var(--ease-in-out); }
[data-theme="night"] .upload .upload-art .n { opacity: 1; }
.upload .upload-art .stamp { position: absolute; right: 8px; bottom: 8px; opacity: 0; --r: 8deg; }
.upload:hover .upload-art, .upload.is-hover .upload-art { transform: translateY(-3px) rotate(-1deg); }
.upload.is-over { border-color: var(--tint); background: color-mix(in srgb, var(--tint) 6%, var(--bg-sunk)); }
.upload.is-over .upload-art { transform: scale(1.04); }
.upload.has-files .upload-art .stamp { opacity: .93; }
.upload:focus-within { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.upload .upload-text { display: grid; gap: 2px; }
.upload .upload-title { font-weight: var(--weight-h4); font-size: var(--size-h4); }
.upload .upload-title span { color: var(--link); text-decoration: underline; text-underline-offset: .18em; }
.upload .help { margin: 0; }
.upload[aria-invalid="true"] { border-color: var(--danger); }
.upload:has(input:disabled) { border-color: var(--rule); color: var(--label-3); cursor: not-allowed; }
@media (max-width: 479.98px) { .upload { grid-template-columns: 1fr; justify-items: center; text-align: center; } .upload .upload-art { width: 200px; } }
.files { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.files li { display: flex; justify-content: space-between; gap: var(--space-4); align-items: center; padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
  background: var(--raised); border: var(--border) solid var(--rule); border-radius: var(--radius-item); font-size: var(--size-small); }
.files .size { font-family: var(--font-mono); font-size: var(--size-mono); color: var(--label-3); margin-left: auto; }

/* ---------------------------------------------------------------- form layout */
.form { display: grid; gap: var(--space-7); max-width: var(--measure-wide); }
.form-row { display: grid; gap: var(--space-7); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: center; padding-top: var(--space-3); }
.form-section { display: grid; gap: var(--space-7); padding-top: var(--space-7); border-top: var(--border-rule) solid var(--rule); }

/* ================================================================ the two switches (as on the live site)
   The day/night switch: a round hairline button; the sun glyph is the one sunflower in the UI and it glows at night. */
.daynight { position: relative; width: var(--h-icon-btn); height: var(--h-icon-btn); flex: none; padding: 0; cursor: pointer; color: var(--label); background: transparent;
  border: var(--border) solid var(--rule-strong); border-radius: 50%; display: grid; place-items: center; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.daynight:hover, .daynight.is-hover { border-color: currentColor; }
.daynight:active, .daynight.is-active { transform: translateY(1px); }
.daynight svg { grid-area: 1 / 1; width: 22px; height: 22px; transition: opacity var(--dur-theme) var(--ease-in-out), transform 360ms cubic-bezier(.3, 0, .2, 1); }
.daynight .sun { opacity: 0; transform: rotate(-60deg) scale(.6); color: var(--ed-sunflower); }
[data-theme="night"] .daynight { box-shadow: var(--glow-light); border-color: color-mix(in srgb, var(--ed-sunflower) 55%, var(--rule-strong)); }
[data-theme="night"] .daynight .sun { opacity: 1; transform: none; }
[data-theme="night"] .daynight .moon { opacity: 0; transform: rotate(40deg) scale(.6); }
.langs { display: flex; gap: 2px; padding: 3px 5px 5px 3px; border: var(--border) solid var(--rule-strong); border-radius: var(--radius-pill); background: var(--bg-sunk); }
.langs button { font: inherit; font-size: 13px; font-weight: var(--weight-button); font-stretch: 85%; letter-spacing: .04em; line-height: 1;
  min-width: 36px; height: 32px; padding: 0 9px; border: 0; border-radius: var(--radius-pill); cursor: pointer; background: transparent; color: var(--label-2); transition: box-shadow var(--dur-fast), background-color var(--dur-fast); }
.langs button:hover, .langs button.is-hover { color: var(--label); }
.langs button[aria-pressed="true"] { background: var(--raised); color: var(--selected-ink); box-shadow: var(--plate-check), var(--glow-pink); }
@media (max-width: 639.98px) { .langs button { min-width: 32px; height: 30px; padding: 0 7px; } }

/* ================================================================ navigation
   The top bar follows the page. Over the header it lies bare on the sky. Once the page scrolls, the page ground
   stands behind the sections and ends under them the way the header picture ends: not a line but the halftone edge,
   fine dots thinning to nothing (edge/hero-bottom.png as a mask), so what scrolls under the bar breaks into dots and
   goes (.is-stuck, js/components.js). The sections are set in the display face; the one in view (or under the
   pointer) is printed with the pink plate off register, as the headline is. A long scroll down past the header tucks
   the bar away; any scroll up brings it back (.is-hidden). The mark tilts under the hand. On phones the menu opens
   the sections as a column. */
.topbar { position: sticky; top: 0; z-index: var(--z-sticky); isolation: isolate; transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: -44px; z-index: 0; pointer-events: none; background: var(--bg); opacity: 0; transition: opacity var(--dur);
  mask-image: linear-gradient(#000, #000), url("../edge/hero-bottom.png"); -webkit-mask-image: linear-gradient(#000, #000), url("../edge/hero-bottom.png");
  mask-size: 100% calc(100% - 44px), 176px 44px; -webkit-mask-size: 100% calc(100% - 44px), 176px 44px; mask-position: 0 0, 0 100%; -webkit-mask-position: 0 0, 0 100%;
  mask-repeat: no-repeat, repeat-x; -webkit-mask-repeat: no-repeat, repeat-x; }
.topbar.is-stuck::after { opacity: 1; }
.topbar.is-hidden { transform: translateY(-110%); opacity: 0; }
.topbar-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: var(--space-5); min-height: 68px; transition: min-height var(--dur-spring) var(--ease-spring); }
.topbar.is-stuck .topbar-inner { min-height: 60px; }
.topbar-brand { display: block; line-height: 0; flex: none; border-radius: 4px; transition: transform var(--dur-spring) var(--ease-spring); }
.topbar-brand:hover, .topbar-brand.is-hover { transform: rotate(-3deg) scale(1.05); }
.topbar-brand img { height: clamp(28px, 3vw, 36px); width: auto; transition: height var(--dur-spring) var(--ease-spring); }
.topbar.is-stuck .topbar-brand img { height: 28px; }
.topbar-nav { display: flex; gap: var(--space-1); margin-left: auto; }
.topbar-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 6px; text-decoration: none;
  color: var(--label); font: 900 16px/1 var(--font-display); font-stretch: var(--stretch-display); letter-spacing: .05em; text-transform: uppercase;
  text-shadow: 0 0 0 transparent; transition: color var(--dur-fast), text-shadow var(--dur) var(--ease-out), transform var(--dur-spring) var(--ease-spring); }
.topbar-nav a:hover, .topbar-nav a.is-hover { transform: translateY(-1px); }
.topbar-nav a.is-lit, .topbar-nav a:hover, .topbar-nav a.is-hover { color: var(--display-ink); text-shadow: .08em .07em 0 var(--display-plate); }
.topbar-tools { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.topbar-nav + .topbar-tools { margin-left: var(--space-4); }
.topbar-menu { display: none; }
@media (max-width: 859.98px) {
  .topbar-inner { flex-wrap: wrap; }
  .topbar-menu { display: inline-flex; order: 3; }
  .topbar-tools { margin-left: auto; order: 2; }
  .topbar-brand img { height: 26px; }
  .topbar-nav { display: none; order: 9; flex-basis: 100%; flex-direction: column; padding: 0 0 var(--space-4); margin: 0; }
  .topbar-nav.is-open { display: flex; animation: sheet-in var(--dur) var(--ease-out) both; }
  .topbar-nav a { min-height: 44px; font-size: 18px; }
  .topbar-nav + .topbar-tools { margin-left: auto; }
}
@media (max-width: 639.98px) { .topbar-inner { gap: var(--space-3); min-height: 60px; } .topbar-tools { gap: 6px; } }
@media (max-width: 389.98px) { .topbar-brand img { height: 22px; } }
.footer { padding: var(--space-11) 0 var(--space-12); text-align: center; position: relative; }
.footer .lines { margin: var(--space-6) 0 0; font-size: 19px; line-height: 1.45; }
.footer .lines span { display: block; }
.footer .lines span + span { color: var(--label-2); }
.footer .mail { display: inline-block; margin-top: var(--space-6); font-size: 19px; font-weight: var(--weight-strong); font-stretch: var(--stretch-button); }
.footer small { display: block; margin-top: var(--space-7); font-size: var(--size-caption); color: var(--label-3); }
.footer .brand-mark { display: inline-block; }
.footer .brand-mark img { height: 44px; width: auto; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-3); list-style: none; margin: 0; padding: 0; font-size: var(--size-small); color: var(--label-2); }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--space-3); color: var(--label-3); }
.breadcrumbs a { color: var(--label-2); text-decoration-color: transparent; }
.breadcrumbs a:hover, .breadcrumbs a.is-hover { color: var(--link); text-decoration-color: currentColor; }
.breadcrumbs [aria-current="page"] { color: var(--label); font-weight: var(--weight-label); }
/* Tabs: one strip of pills, no track, no underline; the chosen pill is printed (raised paper on the plate).
   role="tablist" > button role="tab" aria-selected aria-controls; arrow keys, Home and End move. */
.tabs { position: relative; display: flex; gap: var(--space-3); scrollbar-width: none; padding: 4px; margin: -4px; isolation: isolate; }
@media (max-width: 639.98px) { .tabs { overflow-x: auto; } }
/* The chosen tab's paper slides from the old tab to the new one (js/components.js keeps --x and --w); without script each tab prints its own. */
.tabs.has-pill::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: var(--w, 0px); transform: translateX(var(--x, 0px)); border-radius: var(--radius-pill); z-index: 0;
  background: var(--raised); box-shadow: inset 0 0 0 var(--border) var(--rule-strong), var(--plate-check), var(--glow-pink); transition: transform var(--dur-spring) var(--ease-spring), width var(--dur-spring) var(--ease-spring); }
.tabs.has-pill .tab { position: relative; z-index: 1; }
.tabs.has-pill .tab[aria-selected="true"] { background: transparent; box-shadow: none; }
.tab { flex: none; min-height: var(--h-control-sm); padding: 0 var(--space-5); border: 0; border-radius: var(--radius-pill); background: transparent; cursor: pointer;
  color: var(--label-2); font-size: var(--size-small); font-weight: 550; display: inline-flex; align-items: center; gap: var(--space-3); transition: background-color var(--dur-fast), box-shadow var(--dur-fast), color var(--dur-fast); }
.tab:hover, .tab.is-hover { color: var(--label); background: var(--fill); }
.tab[aria-selected="true"] { background: var(--raised); color: var(--selected-ink); font-weight: var(--weight-strong); box-shadow: inset 0 0 0 var(--border) var(--rule-strong), var(--plate-check), var(--glow-pink); }
.tab:disabled { color: var(--label-3); background: none; cursor: not-allowed; }
.tab .count { font-family: var(--font-mono); font-size: var(--size-mono); }
.tabpanel { padding-top: var(--space-7); }
.tabpanel[hidden] { display: none; }
.pagination ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; align-items: center; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 14px; color: var(--label-2); text-decoration: none; }
.pagination a:hover, .pagination a.is-hover { background: var(--fill); color: var(--label); }
.pagination [aria-current="page"] { background: var(--raised); color: var(--selected-ink); font-weight: 700; box-shadow: inset 0 0 0 var(--border) var(--rule-strong), var(--plate-check), var(--glow-pink); }
.pagination [aria-disabled="true"] { color: var(--label-3); pointer-events: none; }
.pagination .gap { min-width: 24px; }

/* ================================================================ display */
/* Pieces: items in a collection (a case, a service, a post) are prints laid on the page, not boxes. The picture
   first (its own ground, no matte), then the status in its ink, the title and one line. The whole piece is the
   link's target; hover turns its picture to the other time of day (js: a .lit[data-glow] inside .piece-media).
   .card is the same piece (older name). .slip is the one framed surface for a record that must stand apart. */
.piece, .card { position: relative; display: grid; gap: var(--space-3); align-content: start; color: var(--label); }
.piece-media, .card-media { position: relative; border-radius: var(--radius-art); overflow: hidden; aspect-ratio: 20 / 9; margin-bottom: var(--space-3); isolation: isolate; }
.piece-media img, .card-media img { width: 100%; height: 100%; object-fit: cover; }
.piece-media::after, .card-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--rule); pointer-events: none; }
.piece h3, .card h3 { font-stretch: var(--stretch-h2); font-weight: var(--weight-h2); font-size: var(--size-h3); }
.piece h3 a, .card h3 a { color: inherit; text-decoration: none; }
.piece h3 a::after, .card h3 a::after { content: ""; position: absolute; inset: -6px; border-radius: var(--radius-item); }
.piece:has(h3 a:focus-visible), .card:has(h3 a:focus-visible), .piece:has(h3 a.is-focus), .card:has(h3 a.is-focus) { outline: var(--focus-ring); outline-offset: 6px; border-radius: var(--radius-item); }
.piece h3 a:focus-visible, .card h3 a:focus-visible, .piece h3 a.is-focus, .card h3 a.is-focus { outline: none; }
.piece:has(h3 a):hover h3, .card:has(h3 a):hover h3, .piece.is-hover h3, .card.is-hover h3 { color: var(--link); }
.piece .small, .card .small { margin: 0; }
.piece-foot, .card-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-top: var(--space-2); }
/* The record slip: a printed sheet for one record (a case note, a workflow): raised paper, the hairline, the plate, the
   title, the body, and a foot where a faint cloud bank rises in the two inks (the halftone of the pictures) under the
   caption and the loud stamp. The status is the stamp; nothing else marks it.
   <article class="slip"><h3>…</h3><p class="small">…</p><div class="slip-foot"><span class="caption">…</span><span class="stamp loud green"><b>Running</b><small>since March</small></span></div> */
.slip { position: relative; padding: var(--space-7) var(--space-7) var(--space-6); display: grid; gap: var(--space-3); align-content: start; border-radius: var(--radius-item); overflow: hidden; isolation: isolate; }
.slip::before { content: ""; position: absolute; inset: auto 0 0 0; height: 96px; z-index: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(circle, var(--ink-cobalt) 1.3px, transparent 1.9px) 0 0 / 7px 7px, radial-gradient(circle, var(--ink-pink) 1.3px, transparent 1.9px) 3px 2px / 7px 7px;
  mask-image: linear-gradient(transparent, rgba(0, 0, 0, .12) 40%, rgba(0, 0, 0, .4) 100%); }
[data-theme="night"] .slip::before { background-image: radial-gradient(circle, var(--tint) 1.3px, transparent 1.9px), radial-gradient(circle, var(--ink-pink) 1.3px, transparent 1.9px); opacity: .6; }
.slip > * { position: relative; z-index: 1; }
.slip h3 { font-size: var(--size-h2); font-weight: var(--weight-h2); font-stretch: var(--stretch-h2); line-height: 1.1; margin: 0 0 var(--space-2); }
.slip .slip-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); margin-top: var(--space-4); flex-wrap: wrap; }
.slip .slip-foot .caption { padding-bottom: 8px; }
.slip .slip-foot .stamp { margin: -6px -4px -10px 0; }
.slip > :last-child { margin-bottom: 0; }
@media (max-width: 639.98px) { .slip { padding: var(--space-6) var(--space-5) var(--space-5); } }

/* Lit pictures: the day print, the night print (.n) and one glow canvas (js/lights.js), as on the live site. */
.lit { position: relative; margin: 0; isolation: isolate; overflow: hidden; }
.lit > img { width: 100%; height: auto; }
.lit > .n, .lit > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lit > img, .lit > canvas { object-fit: cover; object-position: var(--p, 50% 50%); }
.lit > .n { opacity: 0; transition: opacity var(--dur-theme) var(--ease-in-out); }
.lit > canvas.glow { pointer-events: none; mix-blend-mode: screen; }
[data-theme="night"] .lit > .n, .lit.peek > .n { opacity: 1; }
[data-theme="night"] .lit.peek > .n { opacity: 0; }
/* The gallery card: hover (mouse) or tap, Enter or Space shows the scene at the other time of day. */
.gallery-card { position: relative; display: grid; gap: var(--space-4); }
.gallery-card .lit { aspect-ratio: 20 / 9; border-radius: var(--radius-art); }
.gallery-card .lit > img:first-child { position: absolute; inset: 0; height: 100%; }
.gallery-card .peek-btn { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 20 / 9; z-index: 2; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius-art); }
.gallery-card .peek-btn:focus-visible, .gallery-card .peek-btn.is-focus { outline-offset: 4px; }
.gallery-card figcaption { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; font-size: var(--size-small); line-height: var(--leading-small); }
.gallery-card .name { font-weight: var(--weight-strong); font-stretch: 88%; }
.gallery-card .hint { color: var(--label-3); }
.picture { display: block; width: 100%; height: auto; mix-blend-mode: darken; }
[data-theme="night"] .picture { mix-blend-mode: lighten; }
/* The header scene (the showcase's header model): the art stands on the foot of the header, spans its width and ends
   in the halftone edge (edge/hero-bottom.png, fine dots thinning to bare paper); the copy is one centred block above
   the art's copy zone (the sky). .hero > .hero-copy + .hero-art.lit[data-glow] > img + img.n; js/components.js keeps
   --hero-h so the copy never meets the picture (--ar 16/9, or 9/16 with a tall print on phones). */
.hero { position: relative; isolation: isolate; min-height: var(--hero-h, max(100svh, 640px)); --edge: 180px; }
.hero .hero-art { position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; aspect-ratio: var(--ar, 16 / 9); overflow: hidden; margin: 0;
  mask-image: linear-gradient(#000, #000), url("../edge/hero-bottom.png"); -webkit-mask-image: linear-gradient(#000, #000), url("../edge/hero-bottom.png");
  mask-size: 100% calc(100% - var(--edge) + 2px), calc(var(--edge) * 4) var(--edge); -webkit-mask-size: 100% calc(100% - var(--edge) + 2px), calc(var(--edge) * 4) var(--edge);
  mask-position: 0 0, 0 100%; -webkit-mask-position: 0 0, 0 100%; mask-repeat: no-repeat, repeat-x; -webkit-mask-repeat: no-repeat, repeat-x; }
.hero .hero-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 639.98px) { .hero { --edge: 120px; } }

/* Stamps close a record: received, reviewed, signed off, miss logged. One per item, never a live state.
   Needs the #rough SVG filter in the page. <span class="stamp"><b>Signed off</b><small>16 Oct 2026</small></span>
   Inks: --stamp (pink text) by default; .cobalt, .green, .ask, .danger set the ink to the outcome's. */
.stamp {
  --ink: var(--stamp);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none; align-self: flex-start;
  border: var(--border-stamp) solid var(--ink); outline: 1px solid var(--ink); outline-offset: -6px; border-radius: 5px;
  color: var(--ink); padding: 7px 12px 6px; mix-blend-mode: var(--stamp-blend); line-height: 1; user-select: none;
  transform: rotate(var(--r, -4deg)); filter: url(#rough); opacity: .93; white-space: nowrap;
  font: 900 15px/1 var(--font-display); font-stretch: var(--stretch-display); letter-spacing: var(--tracking-stamp); text-transform: uppercase;
}
.stamp b { font: 900 18px/1 var(--font-display); font-stretch: var(--stretch-display); letter-spacing: var(--tracking-stamp); text-transform: uppercase; }
.stamp small { font: 700 9.5px/1 var(--font-mono); letter-spacing: var(--tracking-caps); margin-top: 4px; text-transform: uppercase; }
.stamp.big b { font-size: 40px; } .stamp.big small { font-size: 12px; margin-top: 6px; }
/* The loud stamp: the one that carries a record's outcome on a notice, a toast or a slip. Bigger, a double rule, and
   set well off true, as a hand lands it. */
.stamp.loud { --r: -11deg; padding: 10px 16px 8px; border-width: 3px; border-radius: 7px; outline: 2px solid var(--ink); outline-offset: -8px; opacity: .95; }
.stamp.loud b { font-size: 27px; } .stamp.loud small { font-size: 10.5px; margin-top: 5px; }
.stamp.sm { padding: 5px 9px 4px; border-width: 2px; outline-offset: -5px; border-radius: 4px; }
.stamp.sm b { font-size: 13px; } .stamp.sm small { font-size: 8.5px; margin-top: 3px; }
.stamp.cobalt { --ink: var(--link); }
.stamp.green { --ink: var(--success); }
.stamp.ask { --ink: var(--ask); }
.stamp.danger { --ink: var(--danger); }
.stamp.in { animation: stamp-in var(--dur-stamp) var(--ease-stamp) both, stamp-shake 120ms var(--dur-stamp) linear; }
@keyframes stamp-in { from { transform: rotate(calc(var(--r, -4deg) + 6deg)) scale(1.3); opacity: 0; } }
@keyframes stamp-shake { 25% { translate: 1.5px 0; } 75% { translate: -1.5px 0; } }
/* Badges: a status word printed as a small stamp in its ink: paperwork caps inside a thin rule, a hair off true,
   rough-edged (the #rough filter). .badge-success, -danger, -ask, -work, -report; .badge.count is paperwork only.
   A working badge carries a light that glows at night. */
.badge { --ink: var(--label-2); display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px 3px; border: 1.5px solid var(--ink); border-radius: 3px; color: var(--ink);
  font: 700 10.5px/1 var(--font-mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; white-space: nowrap; vertical-align: middle;
  transform: rotate(var(--r, -1.5deg)); filter: url(#rough); mix-blend-mode: var(--stamp-blend); opacity: .93; }
.badge-success { --ink: var(--success); } .badge-danger { --ink: var(--danger); } .badge-ask { --ink: var(--ask); }
.badge-work { --ink: var(--link); } .badge-report { --ink: var(--tone-pink); }
.badge-work::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ed-sunflower); box-shadow: var(--glow-light); }
[data-theme="night"] .badge-work::before { background: var(--glow-ink); }
.badge.count { border: 0; padding: 0; transform: none; filter: none; font-size: var(--size-mono); color: var(--label-2); }
/* Chips and tags: a pill on a hairline. A filter chip (button aria-pressed) is printed when pressed; a removable tag has a × button.
   A tag's dot may take an edition ink (--tone). */
.chip { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--h-control-sm); padding: 0 var(--space-5); border-radius: var(--radius-pill);
  border: var(--border) solid var(--rule-strong); background: var(--raised); color: var(--label); font-size: var(--size-small); font-weight: 550; line-height: 1; white-space: nowrap;
  transition: box-shadow var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast); }
button.chip { cursor: pointer; transition: box-shadow var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast), transform var(--dur-spring) var(--ease-spring); }
button.chip:active, button.chip.is-active { transform: scale(.94); }
.tag.is-leaving { animation: tag-out 180ms var(--ease-in) both; }
@keyframes tag-out { to { transform: scale(.6); opacity: 0; } }
button.chip:hover, button.chip.is-hover { border-color: var(--label); }
.chip[aria-pressed="true"] { background: var(--raised); border-color: var(--selected-ink); color: var(--selected-ink); font-weight: var(--weight-strong); box-shadow: var(--plate-check), var(--glow-pink); }
.chip:disabled { background: var(--bg-sunk); color: var(--label-3); border-color: var(--rule); cursor: not-allowed; box-shadow: none; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--tint)); }
/* A tag is a printed label in an edition ink: the luggage-tag notch and eyelet on the left, the word in paperwork caps
   on the solid ink; the remove button its own circle. --tone on the tag sets the ink (an edition or a house ink). */
.chip.tag { --tone: var(--tint); position: relative; padding: 0 4px 0 22px; border: 0; min-height: 32px; background: var(--tone); color: #fff;
  font: 700 11.5px/1 var(--font-mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; clip-path: polygon(0 50%, 12px 0, 100% 0, 100% 100%, 12px 100%); border-radius: 0 6px 6px 0; box-shadow: none; }
.chip.tag::before { content: ""; position: absolute; left: 11px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--bg); }
.chip.tag[style*="sunflower"], .chip.tag[style*="lavender"], .chip.tag[style*="orange"] { color: var(--ink-night); }
.chip.tag .dot { display: none; }
.tag button { width: 24px; height: 24px; margin-left: 2px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; font: 15px/1 var(--font-ui); }
.tag button:hover, .tag button.is-hover { background: rgba(255, 255, 255, .25); }
.chip.tag[style*="sunflower"] button:hover, .chip.tag[style*="lavender"] button:hover, .chip.tag[style*="orange"] button:hover { background: rgba(14, 11, 61, .15); }

/* Notices: a slip with the outcome stamped over its top edge. <div class="notice notice-ask" role="status">
   <span class="stamp ask"><b>Needs you</b></span> <div><p class="notice-title">…</p><p>…</p></div> [<button class="btn btn-icon btn-sm">×</button>] </div>
   The stamp is full size, tilted and hangs over the slip's top-right corner; the slip's left edge is a perforation in
   the outcome's ink; the title is a heading. One stamp, a sentence or two, one action at most. */
.notice { --ink: var(--link); position: relative; display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-4); align-items: start;
  padding: var(--space-6) var(--space-6) var(--space-6) var(--space-8); margin-top: 22px; border-radius: var(--radius-item); overflow: visible; }
.notice::before { content: ""; position: absolute; left: 11px; top: 12px; bottom: 12px; border-left: 3px dotted var(--ink); opacity: .75; }
.notice > svg { width: 20px; height: 20px; color: var(--ink); grid-column: 1; }
.notice > .stamp { position: absolute; top: -24px; right: var(--space-5); --r: -11deg; z-index: 1; }
.notice:nth-child(even) > .stamp { --r: 8deg; }
.notice .notice-title { font-weight: var(--weight-h2); font-stretch: var(--stretch-h2); font-size: var(--size-h3); margin: 0; padding-right: 200px; line-height: 1.2; }
.notice p { margin: 4px 0 0; font-size: var(--size-small); color: var(--label-2); max-width: 44em; }
.notice > div { grid-column: 1; }
.notice-success { --ink: var(--success); } .notice-danger { --ink: var(--danger); } .notice-ask { --ink: var(--ask); }
.notice .btn-icon { --btn-h: 32px; box-shadow: none; grid-column: 2; grid-row: 1; margin: 36px -8px 0 0; }
.notice .notice-actions { grid-column: 1; margin-top: var(--space-4); }
@media (max-width: 639.98px) { .notice { padding-left: var(--space-7); } .notice .notice-title { padding-right: 0; margin-top: 14px; } .notice > .stamp { top: -26px; right: var(--space-3); } }
/* Toasts: the slip rising from the foot of the page; its stamp lands a beat after it arrives. */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: max(var(--space-6), env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: grid; gap: var(--space-5); width: min(460px, calc(100vw - 2 * var(--gutter))); pointer-events: none; }
.toast { --ink: var(--success); pointer-events: auto; position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-4); align-items: start;
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-7); margin-top: 14px; border-radius: var(--radius-item); overflow: visible; animation: toast-in var(--dur-slow) var(--ease-out) both; }
.toast::before { content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; border-left: 3px dotted var(--ink); opacity: .75; }
.toast.is-leaving { animation: toast-out var(--dur) var(--ease-in) both; }
.toast > .stamp { position: absolute; top: -24px; right: 40px; --r: -11deg; animation-delay: 160ms, calc(160ms + var(--dur-stamp)) !important; }
.toast > div { grid-column: 1; }
.toast > div > b { display: block; font-weight: var(--weight-h2); font-stretch: var(--stretch-h2); font-size: var(--size-h4); padding-right: 150px; }
.toast > div > span { display: block; font-size: var(--size-small); color: var(--label-2); }
.toast-ask { --ink: var(--ask); } .toast-danger { --ink: var(--danger); }
.toast .btn-icon { --btn-h: 32px; box-shadow: none; margin: -4px -2px 0 0; grid-column: 2; grid-row: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(calc(var(--rise) * 2)); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(var(--rise)); } }
/* Dialog: the native <dialog class="dialog"> opened with showModal(). Escape closes; focus stays inside; the scrim dims, never blurs. */
.dialog { width: min(520px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 48px); padding: 0; border: var(--border) solid var(--rule-strong);
  border-radius: var(--radius-menu); background: var(--raised); color: var(--label); box-shadow: var(--plate-surface), var(--lift-2); overflow: visible; }
.dialog[open] { animation: dialog-in var(--dur-slow) var(--ease-out) both; }
.dialog::backdrop { background: var(--scrim); animation: fade-in var(--dur-slow) var(--ease-out) both; }
.dialog-body { padding: var(--space-8) var(--space-8) var(--space-7); display: grid; gap: var(--space-4); max-height: calc(100dvh - 60px); overflow: auto; border-radius: inherit; }
.dialog-body > p { margin: 0; color: var(--label-2); }
.dialog .form-actions { justify-content: flex-end; padding-top: var(--space-5); }
.dialog .close { position: absolute; top: var(--space-4); right: var(--space-4); --btn-h: 36px; box-shadow: none; }
@keyframes dialog-in { from { opacity: 0; transform: scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
@media (max-width: 639.98px) { .dialog-body { padding: var(--space-7) var(--space-6) var(--space-6); } .dialog .form-actions { flex-direction: column-reverse; align-items: stretch; } }
/* Tooltip: a short label for an icon control. <span class="tip"> <button aria-describedby> <span role="tooltip" class="tooltip">.
   Shows on hover and keyboard focus; Escape hides it. */
.tip { position: relative; display: inline-flex; }
.tooltip { position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: var(--z-tooltip); transform: translateX(-50%); padding: 6px 10px; border-radius: var(--radius-item);
  background: var(--label); color: var(--bg); font-size: 13.5px; font-weight: 550; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-in), visibility 0s linear var(--dur-fast); }
.tip:hover .tooltip, .tip:focus-within .tooltip, .tip.is-hover .tooltip { opacity: 1; visibility: visible; transition: opacity var(--dur) var(--ease-out) 300ms, visibility 0s 300ms; }
.tip:focus-within .tooltip { transition-delay: 0s; }
.tip.is-hushed .tooltip { opacity: 0; visibility: hidden; }
.tip-start .tooltip { left: 0; transform: none; }
.tip-end .tooltip { left: auto; right: 0; transform: none; }
/* Popover: a slip tied to its trigger. button aria-expanded aria-controls > div.popover; Escape or a click outside closes. */
.popover-wrap { position: relative; display: inline-block; }
.popover { position: absolute; top: calc(100% + var(--space-3)); left: 0; z-index: var(--z-popover); width: min(320px, calc(100vw - 2 * var(--gutter)));
  padding: var(--space-6); animation: pop-in var(--dur) var(--ease-out) both; transform-origin: top left; }
.popover[hidden] { display: none; }
.popover > :last-child { margin-bottom: 0; }
/* Accordion: <details class="accordion"><summary>Question</summary><div class="accordion-body">…
   A row on the dotted line: the question as a heading, a light at the end of the row (a hairline ring; it comes on in
   sunflower and glows when the row is open, as the lights do in the pictures), and the body unfolding under a dotted
   rule (js/components.js animates the height; without script it snaps). Enter and Space open it (native). */
.accordion { position: relative; border-top: 2px dotted var(--rule-strong); }
.accordion:last-of-type { border-bottom: 2px dotted var(--rule-strong); }
.accordion summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-5); min-height: 64px; padding: var(--space-4) 0; cursor: pointer;
  list-style: none; font-weight: var(--weight-h2); font-stretch: var(--stretch-h2); font-size: var(--size-h3); line-height: 1.2; border-radius: 4px; transition: color var(--dur-fast); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: ""; width: 18px; height: 18px; margin-right: 8px; border-radius: 50%; box-shadow: inset 0 0 0 var(--border) var(--rule-strong); background: transparent;
  transition: background-color var(--dur), box-shadow var(--dur-spring) var(--ease-spring), transform var(--dur-spring) var(--ease-spring); }
.accordion summary:hover::after, .accordion summary.is-hover::after { box-shadow: inset 0 0 0 var(--border) var(--label); }
.accordion[open] summary::after { background: var(--ed-sunflower); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ed-sunflower) 25%, transparent), var(--glow-light); transform: scale(1.15); }
.accordion summary:hover, .accordion summary.is-hover { color: var(--link); }
.accordion[open] summary { color: var(--label); }
.accordion .accordion-body { padding: var(--space-2) 0 var(--space-6); color: var(--label-2); max-width: var(--measure); }
.accordion .accordion-body > :last-child { margin-bottom: 0; }
.accordion.is-animating { overflow: hidden; }
/* Table: a printed list. The head in paperwork caps in the cobalt ink over a dotted cobalt rule; rows parted by the
   dotted line; the first column leads in the label ink; figures are paperwork, tabular and right-aligned; a foot row
   under a second dotted cobalt rule; the row under the hand takes a light in the margin. Wrap in .table-scroll on
   phones. .num for figures, .quiet for a secondary cell. */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--size-body); }
.table th { text-align: left; white-space: nowrap; }
.table thead th { font: 700 11.5px/1.3 var(--font-mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent-text);
  padding: 0 var(--space-5) var(--space-3) var(--space-4); border-bottom: 2px dotted var(--ink-cobalt); }
[data-theme="night"] .table thead th { border-bottom-color: var(--tint); }
.table td { padding: var(--space-4) var(--space-5) var(--space-4) var(--space-4); border-bottom: 2px dotted var(--rule-strong); vertical-align: top; position: relative; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td:first-child, .table thead th:first-child { padding-left: 24px; }
.table td:first-child { font-weight: var(--weight-label); color: var(--label); }
.table .quiet { color: var(--label-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: calc(var(--size-body) - 2px); color: var(--label); }
.table thead th.num { font-size: 11.5px; color: var(--accent-text); }
.table td { vertical-align: middle; }
.table tbody td:first-child::before { content: ""; position: absolute; left: 4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--ed-sunflower); opacity: 0; transform: scale(.4); transition: opacity var(--dur-fast), transform var(--dur-spring) var(--ease-spring); box-shadow: var(--glow-light); }
.table tbody tr:hover td:first-child::before, .table tbody tr.is-hover td:first-child::before { opacity: 1; transform: none; }
.table tbody tr:hover td, .table tbody tr.is-hover td { color: var(--link); }
.table tfoot td { border-top: 2px dotted var(--ink-cobalt); border-bottom: 0; font-weight: var(--weight-strong); padding-top: var(--space-3); }
[data-theme="night"] .table tfoot td { border-top-color: var(--tint); }
.table tfoot td:first-child { font: 700 11.5px/1.5 var(--font-mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent-text); }
/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: var(--space-4) 0; display: flex; gap: var(--space-5); align-items: baseline; }
.list > li + li { border-top: var(--border-rule) solid var(--rule); }
.list-marks { padding-left: 1.2em; margin: 0; }
.list-marks li { padding-left: .3em; margin: .3em 0; }
.list-marks li::marker { color: var(--ink-pink); }
ol.list-marks li::marker { font-family: var(--font-mono); font-size: .85em; color: var(--label-2); }
/* Dividers: a hairline marks real structure; the dotted perforation parts groups in a menu or a record. */
.divider { border: 0; border-top: var(--border-rule) solid var(--rule); margin: var(--space-8) 0; }
.divider-dotted { border-top: 2px dotted var(--rule-strong); }
/* Loading: the fill breathes between full and half, never a sweep. Empty: a plain heading, one sentence, the one action. */
/* Loading: a little cloud bank with the string of lights over it. The bank is the two-ink dot screen drifting
   (cobalt one way, pink the other, as the plates slip) under a bottom-heavy mask; four lights sit along its crest
   and come on one after another, sunflower and pink, then go out. A skeleton is the same screen breathing. Still under
   reduced motion. */
.skeleton { display: block; border-radius: 8px; opacity: .5; animation: breathe var(--dur-skeleton) var(--ease-in-out) infinite alternate;
  background: radial-gradient(circle, var(--ink-cobalt) 1.4px, transparent 2px) 0 0 / 7px 7px, radial-gradient(circle, var(--ink-pink) 1.4px, transparent 2px) 3px 2px / 7px 7px; }
.skeleton.line { height: 1em; margin: .5em 0; mask-image: linear-gradient(90deg, #000 60%, transparent); }
.skeleton.block { aspect-ratio: 20 / 9; border-radius: var(--radius-art); mask-image: linear-gradient(transparent 8%, rgba(0, 0, 0, .25) 45%, #000 100%); }
[data-theme="night"] .skeleton { background-image: radial-gradient(circle, var(--tint) 1.4px, transparent 2px), radial-gradient(circle, var(--ink-pink) 1.4px, transparent 2px); }
@keyframes breathe { to { opacity: .22; } }
.loading { display: inline-flex; align-items: center; gap: var(--space-4); color: var(--label-2); font-size: var(--size-small); }
.loading .dots { position: relative; width: 132px; height: 30px; flex: none; }
.loading .dots::before, .loading .dots::after { content: ""; position: absolute; inset: 8px 0 0; border-radius: 4px 4px 8px 8px; background-size: 7px 7px; background-repeat: repeat;
  mask-image: linear-gradient(transparent, rgba(0, 0, 0, .35) 45%, #000 100%); }
.loading .dots::before { background-image: radial-gradient(circle, var(--ink-cobalt) 1.6px, transparent 2.2px); opacity: .55; animation: drift-a 2.4s linear infinite; }
.loading .dots::after { background-image: radial-gradient(circle, var(--ink-pink) 1.6px, transparent 2.2px); background-position: 3px 2px; opacity: .5; animation: drift-b 3.1s linear infinite; }
[data-theme="night"] .loading .dots::before { background-image: radial-gradient(circle, var(--tint) 1.6px, transparent 2.2px); }
@keyframes drift-a { to { background-position: 7px 0; } }
@keyframes drift-b { from { background-position: 3px 2px; } to { background-position: -4px 2px; } }
.loading .dots i { position: absolute; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--raised); box-shadow: inset 0 0 0 var(--border) var(--rule-strong); z-index: 1; animation: light-on 1.8s var(--ease-in-out) infinite; }
.loading .dots i:nth-child(1) { left: 14px; } .loading .dots i:nth-child(2) { left: 46px; top: 5px; animation-delay: .3s; animation-name: light-on-pink; } .loading .dots i:nth-child(3) { left: 78px; top: 1px; animation-delay: .6s; } .loading .dots i:nth-child(4) { left: 110px; top: 6px; animation-delay: .9s; animation-name: light-on-pink; }
@keyframes light-on { 0%, 62%, 100% { background: var(--raised); box-shadow: inset 0 0 0 var(--border) var(--rule-strong); transform: none; }
  18%, 34% { background: var(--ed-sunflower); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-sunflower) 30%, transparent), 0 0 14px 3px rgba(255, 181, 17, .6); transform: scale(1.15); } }
@keyframes light-on-pink { 0%, 62%, 100% { background: var(--raised); box-shadow: inset 0 0 0 var(--border) var(--rule-strong); transform: none; }
  18%, 34% { background: var(--ink-pink); box-shadow: 0 0 0 3px rgba(255, 72, 176, .3), 0 0 14px 3px rgba(255, 72, 176, .55); transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .loading .dots i, .loading .dots::before, .loading .dots::after { animation: none; } .loading .dots i { background: var(--ed-sunflower); box-shadow: none; } }
.empty { display: grid; justify-items: center; text-align: center; gap: var(--space-4); padding: var(--space-8) var(--space-6); }
.empty img { width: min(100%, 420px); border-radius: var(--radius-art); }
.empty h3 { margin-top: var(--space-3); }
.empty p { margin: 0; color: var(--label-2); max-width: 30em; }
.drums { display: inline-flex; gap: 5px; }
.drums i { width: 11px; height: 11px; border-radius: 50%; display: block; background: var(--ink-cobalt); }
.drums i:nth-child(2) { background: var(--ink-pink); }

/* ================================================================ grounds and texture
   [data-ground="foot"]: the cloud bank along a section's foot with its sky and field; [data-ground="sky"]: the sparse field.
   js/ground.js prints them once per size and theme on one canvas behind the element, clear of every word and control,
   reading the --ground-* tokens; js/ground-gl.js runs Pebble's halftone-ground.frag on WebGL for [data-ground="foot"][data-gl]
   (the bank settles for a moment, then holds). .dot-ground is the static tile for print and no script. .paper-grain adds the fibre. */
[data-ground] { position: relative; isolation: isolate; }
canvas.ground { position: absolute; inset: 0; width: 100%; height: 100%; z-index: var(--z-ground); pointer-events: none; }
.dot-ground {
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--ground-ink-a) 30%, transparent) .8px, transparent 1.1px),
    radial-gradient(circle, color-mix(in srgb, var(--ground-ink-b) 26%, transparent) .8px, transparent 1.1px);
  background-size: var(--tile-pitch) var(--tile-pitch); background-position: 0 0, var(--tile-offset);
}
.paper-grain::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: var(--z-grain);
  background: url("../patterns/grain.png") 0 0 / 256px 256px; opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend); }
/* Full-page scenes, the one framed surface and the dotted column (also used by style-guide.html). */
.scene { position: relative; display: grid; align-content: start; min-height: var(--scene-min, max(640px, min(100svh, 980px)));
  background-color: var(--bg); background-repeat: no-repeat; background-size: cover; background-position: var(--scene-pos, center bottom); }
.scene-copy { max-width: var(--sky-width, 34em); padding: var(--sky-top, clamp(96px, 16vh, 180px)) 0 0; }
.surface { background: var(--raised); border: var(--border) solid var(--rule-strong); border-radius: var(--radius-card); box-shadow: var(--plate-surface); }
.column { background-color: var(--bg); background-clip: content-box; }
.field > label:not(.choice):not(.upload) { font-size: var(--size-small); font-weight: var(--weight-label); }
.field .hint { font-size: var(--size-small); color: var(--label-3); }
.field > input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not(.input), .field > textarea:not(.input) {
  min-height: var(--h-field); padding: var(--space-4) var(--space-5); background: var(--raised); color: var(--label); border: var(--border) solid var(--rule-strong); border-radius: var(--radius-field); }

.for-night { display: none; }
[data-theme="night"] .for-paper { display: none; }
[data-theme="night"] .for-night { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .skeleton, .loading .dots i { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
