/* Slop of Theseus. One museum: a warm plaster wall, black frames, brass plaques. Colour lives only inside the works.
   System: one container (1240 px) with one left and one right line on every page; type 16/20/24/32/48 (body 18);
   space 4/8/12/16/24/32/48 (64 between sections). Display face: Pixelify Sans (a legible pixel face, drawn as outlines,
   so it stays sharp at any size); Micro 5 was dropped after review: its o and e could not be told apart. */
@font-face { font-family: "Pixelify Sans"; src: url("/fonts/pixelify-var-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("/fonts/worksans-var-latin.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrainsmono-latin.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --wall: #d8d4cc; --ink: #191919; --brass: #b08d57; --brass-dark: #6e5330; --shadow: #8f8a80; --ink-soft: #3a3833;
  --field: #f3efe7;
  --plate: #c9a46a; --plate-hi: #d6b47c; --plate-lo: #b8935a; --plate-in: #e8d6ad;   /* flat brass under text: ink on it is 7.6:1 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --container: 1240px;
  --edge: 48px;
  --side: max(var(--edge), (100vw - var(--container)) / 2);   /* the one left and right line */
  --display: "Pixelify Sans", system-ui, sans-serif;
  --text: "Work Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--wall); color: var(--ink); }
body { margin: 0; font-family: var(--text); font-size: 18px; line-height: 1.5; font-variant-numeric: tabular-nums;
  background: var(--wall) url("/img/plaster.webp") repeat left top / 600px auto; min-height: 100vh; overflow-x: hidden; }
img.px, .px img, canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-variant-ligatures: none; }
.px-type, .head h1, h2.title { font-family: var(--display); font-weight: 700; letter-spacing: .01em; }

/* ---------- nav: one row of four words, on the container's left line ---------- */
.nav { position: relative; z-index: 20; display: flex; gap: var(--s6); padding: var(--s5) var(--side) 0; margin: 0; list-style: none; }
.nav a { position: relative; font-size: 18px; font-weight: 500; text-decoration: none; display: inline-block; line-height: 1.6; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: transparent; }
.nav a:hover::after { background: var(--shadow); }
.nav a[aria-current="page"]::after { background: var(--brass); }

/* ---------- brass: the one surface for every label and button ---------- */
.brass { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 52px; padding: 0 var(--s4); color: var(--ink); text-decoration: none; text-align: center;
  border: 12px solid transparent; border-image: url("/img/plaque-square.webp") 62 / 12px stretch; background: var(--plate) padding-box;
  font: inherit; font-weight: 700; font-size: 16px; line-height: 1.2; box-shadow: 0 3px 0 rgba(25, 25, 25, .3);
  cursor: pointer; transition: background-color .12s ease-out, transform .08s ease-out; }
.brass img.mark { width: 22px; height: 22px; object-fit: contain; flex: none; }
a.brass:hover, button.brass:hover:not([disabled]) { background-color: var(--plate-hi); }
a.brass:active, button.brass:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(25, 25, 25, .3); background-color: var(--plate-lo); }
.brass:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.brass[aria-disabled="true"], .brass[disabled] { cursor: not-allowed; }
.brass[aria-disabled="true"] img.mark, .brass[disabled] img.mark { opacity: .55; filter: grayscale(1); }
.brass[aria-disabled="true"]:active, .brass[disabled]:active { transform: none; }

/* ---------- the plaque under a work ---------- */
.label { display: block; padding: var(--s2) var(--s5); border: 12px solid transparent; border-image: url("/img/plaque-square.webp") 62 / 12px stretch;
  background: var(--plate) padding-box; box-shadow: 0 3px 0 rgba(25, 25, 25, .3); text-align: center; color: var(--ink); }
.label .meta { display: block; font-size: 20px; font-weight: 700; line-height: 1.3; }
.label .kind { display: block; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin-bottom: var(--s1); }
.flip { display: inline-block; }
.word { white-space: nowrap; }
.flip.turn { animation: flip .32s steps(4) backwards; }
@keyframes flip { 0% { transform: scaleY(1); } 50% { transform: scaleY(0); } 100% { transform: scaleY(1); } }

/* ---------- a framed work: frame.webp with the 64x64 picture in its 14.33% window ---------- */
.work { position: relative; display: block; aspect-ratio: 1; }
.work > img.pic { position: absolute; inset: 14.33%; width: 71.34%; height: 71.34%; image-rendering: pixelated; background: var(--wall); }
.work::after { content: ""; position: absolute; inset: 0; background: url("/img/frame.webp") center / 100% 100% no-repeat; pointer-events: none; }
.work.hidden-work > img.pic { visibility: hidden; }

/* ---------- the contract plate: label | address on a light field | Copy ---------- */
.contract { display: grid; grid-template-columns: 96px minmax(0, 1fr) 88px; gap: var(--s3); align-items: center; padding: var(--s1); min-height: 64px;
  border: 12px solid transparent; border-image: url("/img/plaque-square.webp") 62 / 12px stretch; background: var(--plate) padding-box; box-shadow: 0 3px 0 rgba(25, 25, 25, .3); }
.contract .what { font-size: 16px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
.contract .addr { min-width: 0; padding: var(--s2) var(--s4); background: var(--plate-in); box-shadow: inset 0 2px 0 rgba(110, 83, 48, .45);
  font-family: var(--mono); font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; color: var(--ink); user-select: all; }
.contract .addr.empty { font-family: var(--text); user-select: none; }
.contract .copy { min-height: 44px; width: 88px; padding: 0; }
.links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }

/* ---------- page heads (gallery, archive, docs) on the container ---------- */
.page { margin: 0 var(--side); padding: var(--s7) 0 var(--s8); }
.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s5); margin-bottom: var(--s6); }
.head h1 { font-size: 96px; line-height: .9; margin: 0; }
.head p { margin: var(--s4) 0 0; max-width: 60ch; }
h2.title { font-size: 48px; line-height: 1; margin: 0 0 var(--s4); }
.note { color: var(--ink-soft); font-size: 16px; }
.err { font-size: 16px; color: #6b2a1a; }

@media (max-width: 1023px) { :root { --edge: 32px; } }
@media (max-width: 767px) {
  :root { --edge: 20px; }
  .nav { gap: var(--s4); padding-top: var(--s4); }
  .nav a { font-size: 16px; }
  .head { grid-template-columns: 1fr; }
  .head h1 { font-size: 64px; }
  h2.title { font-size: 40px; }
  .contract { grid-template-columns: minmax(0, 1fr) 96px; }
  .contract .what { grid-column: 1 / -1; }

}
@media (max-width: 480px) { .links { grid-template-columns: 1fr; } .links .brass { justify-content: flex-start; padding: 0 var(--s5); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
