/* ============================================================================
   rockmage.com — "Alphabet Blocks" chrome (site-wide)
   The site's own picture-book kit: four glossy primary buttons, A–Z index tiles
   (white, blue inside, yellow outside), nested pattern-box frames, Max's handwriting
   (MaxFont) for the headings, 2px black photo borders. Theme-aware via tokens.
   Loaded by /includes/header-mini.jsp. Body carries the section class
   (Welcome / AnimalPatterns / ART / Materials / ShowAndTell / About / default).
   ============================================================================ */

@font-face {
  font-family: "MaxFont";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/max/max_1.0.1.woff2) format("woff2"),
       url(/fonts/max/max_1.0.1.woff) format("woff"),
       url(/fonts/max/max_1.0.1.ttf) format("truetype");
}

/* ---------------- tokens ---------------- */
:root {
  /* page + tiles */
  --bg: #f0e6d0; --bg-2: #e4d8bd;
  --panel: #f5f1e8; --tile: #fffaf0; --tile-ink: #1d1815; --cream: #fff4dc; --black: #141110;
  --content: #fffaf0; --content-ink: #3e362e;
  --ink: #1d1815; --text: #3e362e; --muted: #7a6c5d; --rule: #d6cab2;
  --shadow: rgba(60, 35, 10, .18); --shadow-2: rgba(60, 35, 10, .38);
  /* the four primaries + plum, at full strength (frames, fills, rules) */
  --r: #e2231a; --b: #1f45e8; --g: #22943a; --y: #ffcd00; --p: #8a2f7c;
  /* the same hues as text on the pale tiles */
  --r-ink: #b8140c; --b-ink: #1233c4; --g-ink: #176e2a; --y-ink: #a06800; --p-ink: #742465;
  /* the same hues as links on the page ground */
  --lb: #1233c4; --lg: #176e2a; --ly: #a06800;
  --velvet: #c81c14; --velvet-2: #ec3a2e;
  --focus: #1f45e8;
  --run-filter: url(#ink-b);
  --grain-op: .12; --grain-mode: multiply; --grain-filter: none;
  /* type */
  --head: "MaxFont", "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Sans MS", cursive;
  --sans: "Source Sans 3", "Trebuchet MS", system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Fraunces", "Cooper Black", "Iowan Old Style", Georgia, serif;
  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --gutter: clamp(16px, 4vw, 40px);
  /* paper tooth / velvet nap */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1815; --bg-2: #24201a; --panel: #262220; --tile: #fff7e6; --tile-ink: #1d1815; --cream: #fff4dc; --black: #0c0a09;
    --content: #262220; --content-ink: #d9cfbf;
    --ink: #f3ebdd; --text: #d9cfbf; --muted: #a59787; --rule: #3d362e;
    --shadow: rgba(0,0,0,.5); --shadow-2: rgba(0,0,0,.75);
    --r: #f0392e; --b: #3d64ff; --g: #2fae48; --y: #ffd21f; --p: #a8479a;
    --lb: #8fb0ff; --lg: #7ed092; --ly: #f0c04a;
    --velvet: #b8170f; --velvet-2: #dc3327;
    --focus: #ffd21f;
    --run-filter: url(#ink-b-dark);
    --grain-op: .08; --grain-mode: screen; --grain-filter: invert(1);
  }
}
:root[data-theme="dark"] {
  --bg: #1b1815; --bg-2: #24201a; --panel: #262220; --tile: #fff7e6; --tile-ink: #1d1815; --cream: #fff4dc; --black: #0c0a09;
  --content: #262220; --content-ink: #d9cfbf;
  --ink: #f3ebdd; --text: #d9cfbf; --muted: #a59787; --rule: #3d362e;
  --shadow: rgba(0,0,0,.5); --shadow-2: rgba(0,0,0,.75);
  --r: #f0392e; --b: #3d64ff; --g: #2fae48; --y: #ffd21f; --p: #a8479a;
  --lb: #8fb0ff; --lg: #7ed092; --ly: #f0c04a;
  --velvet: #b8170f; --velvet-2: #dc3327;
  --focus: #ffd21f;
  --run-filter: url(#ink-b-dark);
  --grain-op: .08; --grain-mode: screen; --grain-filter: invert(1);
}

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
/* page bodies were written for content-box (patterns.jsp sizes its letter tiles that way); only the chrome's own parts use border-box */
#content *, #content *::before, #content *::after { box-sizing: content-box; }
#content :is(.block, .thumbs, .hero, .spread, .intro, .prose, .side, .portrait, .run, .minor, .foot-minor, #footer, #treemenu, #submenu, .description, .notice, .comment),
#content :is(.block, .thumbs, .hero, .spread, .intro, .prose, .side, .portrait, .run, .minor, .foot-minor, #footer, #treemenu, #submenu) * { box-sizing: border-box; }
html { overflow-x: clip; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh; overflow-x: clip;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(120% 40% at 50% 0%, var(--bg-2), transparent 70%);
  font-family: var(--sans); font-size: 18px; line-height: 1.6;
  padding: 0 var(--gutter) var(--s7);
}
body::before { /* paper tooth; inverted + screened on charcoal */
  content: ""; position: fixed; inset: 0; z-index: 0;
  background-image: var(--grain); background-size: 200px 200px;
  opacity: var(--grain-op); mix-blend-mode: var(--grain-mode); filter: var(--grain-filter);
  pointer-events: none;
}
::selection { background: color-mix(in srgb, var(--y) 55%, transparent); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
img { max-width: 100%; height: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wrap { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; }

/* ---------------- the alphabet block: white tile, blue inside, yellow outside ---------------- */
.block {
  display: block; text-decoration: none; color: inherit;
  background: var(--tile); border: 3px solid var(--b); border-radius: 3px; padding: 8px;
  box-shadow: 0 0 0 3px var(--tile), 0 0 0 9px var(--y), 0 14px 26px -10px var(--shadow-2);
}
.block img {
  display: block; width: 100%; height: auto; margin: 0; object-fit: cover; background: var(--black);
  border: 2px solid var(--black); /* the site's own 2px black photo border */
}

/* ---------------- the masthead: at rest the big handwriting + buttons + the bar; once the page scrolls it
   recedes — the top row folds shut, the bar compacts with a small wordmark and stays pinned ---------------- */
#sentinel { position: absolute; top: 16px; left: 0; width: 1px; height: 48px; pointer-events: none; } /* 16–64px: the recede's deadband */
body { overflow-anchor: none; } /* the masthead changes height on purpose; scroll anchoring must not chase it */
.masthead {
  position: relative; z-index: 20;
  margin: 0 calc(50% - 50vw); padding: 0 max(var(--gutter), calc(50vw - 520px));
  background: var(--bg); border-bottom: 1px solid transparent;
  transition: box-shadow .35s ease, border-color .35s ease;
}
.top-fold { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .35s ease, opacity .2s ease; }
main { transition: padding-top .35s ease; }
.top-fold > .top { min-height: 0; overflow: hidden; margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; } /* the clip box has 12px of side room so the chips' rings and the wordmark's tail are never cut */
.mini-mark { display: none; font-family: var(--head); font-size: 30px; line-height: 1; color: var(--ink); text-decoration: none; margin-right: var(--s2); }
.mini-mark:hover { color: var(--r); }
body.no-anim, body.no-anim * { transition: none !important; }
@media (min-height: 480px) {
  .masthead { position: sticky; top: 0; }
  body.is-stuck .masthead { box-shadow: 0 10px 24px -14px var(--shadow-2); border-bottom-color: var(--rule); }
  body.is-stuck .top-fold { grid-template-rows: 0fr; opacity: 0; }
  body.is-stuck .bar { padding: 8px 0 10px; gap: var(--s2) var(--s4); }
  body.is-stuck .mini-mark { display: inline-block; }
  body.is-stuck .primary { gap: 8px 9px; }
  body.is-stuck .primary a { font-size: 14px; padding: 4px 9px 3px; box-shadow: 0 0 0 2px var(--tile), 0 0 0 4px var(--y); }
  body.is-stuck .search input, body.is-stuck .search button { height: 32px; font-size: 15px; }
  body.is-stuck .search input { width: 104px; }
  body.is-stuck .search label { display: none; }
  body.is-stuck main { padding-top: var(--head-delta, 0px); }
}
@media (min-height: 480px) and (max-width: 560px) {
  body.is-stuck .search { display: none; }
  body.is-stuck .primary { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 6px; scrollbar-width: none; }
  body.is-stuck .primary::-webkit-scrollbar { display: none; }
  body.is-stuck .primary a { white-space: nowrap; }
  body.is-stuck .mini-mark { font-size: 26px; }
}

/* ---------------- header: buttons top-left, handwriting top-right ---------------- */
.top {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s3) var(--s5); padding: var(--s6) 0 var(--s4);
}
.top nav { order: 1; }
.wordmark {
  order: 2; margin-left: auto;
  font-family: var(--head); font-size: clamp(64px, 9.5vw, 112px); line-height: 1; color: var(--ink); text-decoration: none;
  letter-spacing: -.01em; transition: color .18s ease;
}
.wordmark:hover { color: var(--r); }
.buttons { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 10px; }
.btn { /* glossy square buttons, like the site's own — lit top, dark foot, keyline */
  --c: var(--r);
  position: relative; display: block; width: 48px; height: 48px; border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 46%, rgba(255,255,255,0) 50%),
    radial-gradient(120% 90% at 50% 110%, color-mix(in srgb, var(--c) 70%, #000) 0%, var(--c) 60%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.22), 0 0 0 1px rgba(20,10,5,.22), 0 1px 2px var(--shadow);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08) saturate(1.1); box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.22), 0 0 0 1px rgba(20,10,5,.22), 0 5px 8px -4px var(--shadow-2); }
.btn:active { transform: translateY(1px); filter: brightness(.96); }
.btn.b { --c: var(--b); } .btn.g { --c: var(--g); } .btn.y { --c: var(--y); }
.btn.on::after { /* the underline under the current section's button */
  content: ""; position: absolute; left: 3px; right: 3px; bottom: -11px; height: 5px; border-radius: 3px; background: var(--c);
}

/* ---------------- section tiles: the A–Z index, in words ---------------- */
.bar {
  display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: var(--s4) var(--s6);
  padding: var(--s3) 0 var(--s5);
  transition: padding .35s ease, gap .35s ease;
}
.bar .search { margin-left: auto; }
.primary a { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, font-size .35s ease, padding .35s ease; }
.primary { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 15px; }
.primary a {
  --c: var(--ink); --fill: var(--ink);
  display: inline-block; padding: 7px 11px 6px; border-radius: 2px;
  font-family: var(--serif); font-weight: 800; font-size: 16px; line-height: 1.25; font-variation-settings: "SOFT" 100, "opsz" 24;
  color: var(--c); text-decoration: none; background: var(--tile);
  border: 2px solid var(--b); box-shadow: 0 0 0 2px var(--tile), 0 0 0 5px var(--y);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.primary a.welcome   { --c: var(--r-ink); --fill: var(--r); }
.primary a.patterns  { --c: var(--b-ink); --fill: var(--b); }
.primary a.art       { --c: var(--g-ink); --fill: var(--g); }
.primary a.materials { --c: var(--y-ink); --fill: var(--y-ink); } /* ochre, so it stays distinct from the yellow ring */
.primary a.showtell  { --c: var(--p-ink); --fill: var(--p); }
/* the current section's tile is filled; hover / keyboard focus fills any tile with its own colour and lifts it */
.primary a.on { color: #fff; background: var(--fill); border-color: var(--fill); }
.primary a:hover, .primary a:focus-visible {
  transform: translateY(-2px); color: #fff; background: var(--fill); border-color: var(--fill);
  box-shadow: 0 0 0 2px var(--tile), 0 0 0 5px var(--y), 0 6px 10px -6px var(--shadow-2);
}
.search { display: flex; align-items: center; gap: var(--s2); }
.search label { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--muted); font-variation-settings: "SOFT" 100, "opsz" 16; }
.search input {
  width: 128px; min-width: 0; height: 40px; font: inherit; font-size: 17px; color: var(--black);
  background: var(--tile); border: 2px solid var(--b); border-radius: 2px; padding: 0 10px;
  transition: box-shadow .18s ease;
}
.search input:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--y) 60%, transparent); }
.search input:focus { outline: none; box-shadow: 0 0 0 3px var(--y); }
.search button {
  height: 40px; font-family: var(--serif); font-weight: 800; font-size: 16px; font-variation-settings: "SOFT" 100, "opsz" 16; color: #fff; background: var(--r);
  border: 2px solid var(--r); border-radius: 2px; padding: 0 16px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -2px 0 rgba(0,0,0,.2);
  transition: transform .12s ease, filter .12s ease;
}
.search button:hover { filter: brightness(1.08); }
.search button:active { transform: translateY(1px); }

/* ---------------- the section nameplate: a tilted tile riding the top edge of what follows ---------------- */
.outerheader {
  position: relative; z-index: 2; display: inline-block; max-width: calc(100% - var(--s5));
  margin: var(--s4) 0 -30px var(--s5); padding: 12px 22px 4px;
  font-family: var(--head); font-size: clamp(30px, 4.2vw, 44px); line-height: 1.05; color: var(--ink);
  text-wrap: balance; overflow-wrap: anywhere;
  background: var(--tile); border: 3px solid var(--b); border-radius: 3px;
  box-shadow: 0 0 0 3px var(--tile), 0 0 0 8px var(--y), 0 10px 18px -8px var(--shadow-2);
  transform: rotate(-1.2deg);
}
.outerheader:empty { display: none; }
body.Welcome .outerheader        { color: var(--r-ink); }
body.AnimalPatterns .outerheader { color: var(--b-ink); }
body.ART .outerheader            { color: var(--g-ink); }
body.Materials .outerheader      { color: var(--y-ink); }
body.ShowAndTell .outerheader    { color: var(--p-ink); }

/* ---------------- content: every page body sits in one big block ---------------- */
#content {
  position: relative; z-index: 1;
  background: var(--content); color: var(--content-ink);
  border: 3px solid var(--b); border-radius: 3px;
  box-shadow: 0 0 0 3px var(--tile), 0 0 0 9px var(--y), 0 16px 30px -12px var(--shadow-2);
  padding: var(--s7) clamp(18px, 3.5vw, 40px) var(--s6);
  margin: 0 0 var(--s7);
}
#content > :first-child { margin-top: 0; }
main.noplate #content { padding-top: var(--s6); margin-top: var(--s4); } /* no nameplate riding the top edge */
:where(#content) { line-height: 1.55; }
:where(#content .letter span, #content .animal span) { line-height: 1.1; } /* patterns.jsp's fixed-height letter tiles */

/* Generic rules for whatever a page body contains. They are wrapped in :where() so they have
   ZERO specificity — every component rule in this file (blocks, tiles, prose, minor links…)
   wins over them without fighting. */
:where(#content > h1) {
  margin: 0 0 var(--s5);
  font-family: var(--head); font-weight: 400; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; color: var(--ink);
  text-wrap: balance; overflow-wrap: anywhere;
}
:where(#content > h1) .colons { color: var(--r); }
:where(#content > h1) a { color: inherit; font-weight: inherit; background: none; text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--y); text-underline-offset: .06em; transition: color .18s ease, text-decoration-color .18s ease; }
:where(#content > h1) a:hover { color: var(--b); text-decoration-color: var(--b); background: none; }
:where(#content h2) {
  margin: var(--s6) 0 var(--s3);
  font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 24; font-size: 24px; line-height: 1.2; color: var(--ink);
}
:where(#content p) { margin: 0 0 1em; }
:where(#content a) {
  font-weight: 600; color: var(--lb);
  text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .16em;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
  transition: color .18s ease, text-decoration-color .18s ease, background-color .18s ease;
}
:where(#content a:hover) { text-decoration-color: currentColor; background: color-mix(in srgb, var(--y) 35%, transparent); }
:where(#content a:has(> img)), :where(#content a:has(> img):hover) { text-decoration: none; background: none; }
:where(#content ul, #content ol) { padding-left: 1.4em; margin: 0 0 1em; }
:where(#content li) { margin: 0 0 .25em; }
:where(#content b, #content strong, #content .label) { font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; color: var(--ink); }
:where(#content hr) { border: 0; height: 5px; margin: var(--s6) 0; background: linear-gradient(var(--y) 0 3px, var(--b) 3px 100%); }
:where(#content pre) { overflow: auto; font-size: 14px; line-height: 1.5; padding: var(--s3) var(--s4); background: var(--panel); border: 2px solid var(--rule); border-radius: 2px; }
:where(#content pre.error) { color: var(--r-ink); border-color: var(--r); }
:where(#content .errorMessage) { color: var(--r-ink); font-weight: 600; }
:where(#content .message) { color: var(--g-ink); font-weight: 600; }

/* tables: art lists (Name / Date Created), key–value details, photo rows */
:where(#content table) { border-collapse: collapse; margin: 0 0 1em; }
:where(#content th, #content td) { text-align: left; vertical-align: top; padding: 5px 18px 5px 0; }
:where(#content th) { font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; color: var(--ink); border-bottom: 3px solid var(--y); }
:where(#content table[width="100%"]) { width: 100%; }
:where(#content table[width="100%"] td) { border-bottom: 1px solid var(--rule); }
:where(#content table[width="100%"] tr:last-child td) { border-bottom: 0; }
:where(#content td.number, #content input.number) { text-align: right; }
:where(#content td.date, #content .date) { color: var(--muted); }

/* photos in page bodies keep the site's own 2px black border; give them a little room */
:where(#content img[src*="/photo/"], #content img.rollblock, #content img[src*="patterns/"]) { display: inline-block; vertical-align: top; margin: 4px 6px 4px 0; }
:where(#content img.rollblock) { padding: 5px; border-radius: 3px; transition: background-color .18s ease, transform .18s ease; }
:where(#content a:hover img.rollblock) { background: var(--y); transform: translateY(-2px); }

/* the sub-folder / sub-material strip: little A–Z tiles */
#treemenu { display: flex; flex-wrap: wrap; gap: 12px 13px; margin: 0 0 var(--s5); padding: 0; }
#treemenu a {
  display: inline-block; padding: 5px 10px 4px; border-radius: 2px;
  font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; font-size: 15px; line-height: 1.25;
  color: var(--b-ink); background: var(--tile); text-decoration: none;
  border: 2px solid var(--b); box-shadow: 0 0 0 2px var(--tile), 0 0 0 4px var(--y);
  transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
#treemenu a:hover, #treemenu a:focus-visible { transform: translateY(-2px); color: #fff; background: var(--b); border-color: var(--b); }
body.Materials #treemenu a { color: var(--y-ink); }
body.Materials #treemenu a:hover, body.Materials #treemenu a:focus-visible { background: var(--y-ink); border-color: var(--y-ink); }

/* the admin sub-menu: quiet plum tiles, right-aligned */
#submenu { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 0 0 var(--s4); }
#submenu a {
  display: inline-block; padding: 3px 9px; border-radius: 2px;
  font-family: var(--serif); font-weight: 700; font-variation-settings: "SOFT" 100, "opsz" 12; font-size: 13px; line-height: 1.3;
  color: var(--p-ink); background: var(--tile); text-decoration: none; border: 2px solid var(--p);
  transition: background-color .18s ease, color .18s ease;
}
#submenu a:hover { color: #fff; background: var(--p); }

/* Max's descriptions: his words, set in the picture-book serif with the first letter as an alphabet block */
#content .description, #content p[style*="purple"] {
  margin: 0 0 var(--s5); padding: var(--s4) var(--s5) var(--s4) var(--s4);
  font-family: var(--serif); font-style: italic; font-weight: 500; font-variation-settings: "SOFT" 80, "opsz" 24;
  font-size: 20px; line-height: 1.5; color: var(--tile-ink);
  background: var(--tile); border: 2px solid var(--p); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--tile), 0 0 0 4px var(--y);
}
#content .description::first-letter, #content p[style*="purple"]::first-letter {
  float: left; margin: 2px 12px 0 0; padding: 2px 9px 0;
  font-style: normal; font-weight: 900; font-variation-settings: "SOFT" 100, "opsz" 72; font-size: 32px; line-height: 1;
  color: var(--r); background: var(--tile); border: 2px solid var(--b); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--tile), 0 0 0 4px var(--y);
}
#content .description a { color: var(--lb); }
.piece.featured .details .description { font-size: 19px; }
@media (max-width: 560px) {
  #content .description { font-size: 18px; padding: var(--s3) var(--s4); }
  #content .description::first-letter { font-size: 34px; padding: 3px 9px 1px; margin-right: 10px; }
}
#content .notice { padding: var(--s3) var(--s4); margin: 0 0 var(--s4); color: var(--tile-ink); background: var(--tile); border: 2px solid var(--b); border-radius: 2px; }
#content .comment { padding: var(--s2) var(--s3); margin: 0 0 var(--s3); color: var(--tile-ink); background: var(--tile); border: 2px solid var(--rule); border-radius: 2px; }
#content .downloadnow { font-family: var(--serif); font-weight: 800; font-size: 1.2em; text-align: center; }

/* forms in page bodies (search, show & tell, admin): tiles and a red Go */
:where(#content form) { display: block; margin: 0 0 var(--s4); }
:where(#content input[type="text"], #content input[type="password"], #content input[type="file"], #content input:not([type]), #content select, #content textarea) {
  font: inherit; font-size: 17px; color: var(--black); background: var(--tile);
  border: 2px solid var(--b); border-radius: 2px; padding: 6px 10px; max-width: 100%;
}
:where(#content textarea) { width: 100%; min-height: 8em; }
:where(#content input:focus, #content select:focus, #content textarea:focus) { outline: none; box-shadow: 0 0 0 3px var(--y); }
:where(#content input[type="submit"], #content input[type="button"], #content button) {
  font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; font-size: 16px; color: #fff; background: var(--r);
  border: 2px solid var(--r); border-radius: 2px; padding: 6px 16px; cursor: pointer; margin-left: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -2px 0 rgba(0,0,0,.2);
}
:where(#content input[type="submit"]:hover, #content button:hover) { filter: brightness(1.08); }

/* ---------------- the homepage: no content block; the velvet spread instead ---------------- */
body.Welcome #content { background: none; color: var(--text); border: 0; box-shadow: none; padding: 0; margin: 0; }
body.Welcome .outerheader { margin-bottom: -30px; }

/* the spread: red velvet, edge to edge */
.spread {
  position: relative; isolation: isolate;
  margin: 0 calc(50% - 50vw);
  padding: 64px max(var(--gutter), calc(50vw - 520px)) 52px;
  background-color: var(--velvet);
  background-image:
    radial-gradient(90% 70% at 18% 0%, var(--velvet-2), transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(0,0,0,.28), transparent 60%);
  color: var(--cream);
}
.spread::before { /* the nap of the velvet */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: var(--grain); background-size: 200px 200px; opacity: .22; mix-blend-mode: multiply; pointer-events: none;
}
.spread::after { /* a yellow-and-blue hem along the bottom */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  background: linear-gradient(var(--y) 0 50%, var(--b) 50% 100%);
}
.hero {
  margin: 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr); gap: clamp(28px, 4vw, 44px);
  align-items: end;
}
.hero .block { transition: transform .25s ease, box-shadow .25s ease; }
.hero .tile-a { transform: rotate(-1.4deg); }
.hero .tile-b { transform: rotate(2.2deg); margin-bottom: 18px; }
.hero .tile-a img { aspect-ratio: 3 / 2; }
.hero .tile-b img { aspect-ratio: 1 / 1; object-position: 30% 45%; }
.hero .tile-a:hover, .hero .tile-b:hover { transform: rotate(0deg) translateY(-6px); box-shadow: 0 0 0 3px var(--tile), 0 0 0 9px var(--y), 0 24px 34px -12px var(--shadow-2); }
.spread h1 {
  margin: var(--s7) 0 0;
  font-family: var(--head); font-weight: 400;
  font-size: clamp(42px, 5.9vw, 70px); line-height: 1.02; color: var(--cream);
  text-wrap: balance; overflow-wrap: anywhere;
  text-shadow: 0 2px 0 rgba(0,0,0,.18);
}
.spread h1 .colons { color: var(--y); }

/* intro */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 156px; gap: var(--s5) clamp(32px, 6vw, 80px); align-items: start; padding-top: var(--s7); }
.prose { max-width: 62ch; font-size: 19px; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose p a {
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .16em;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
  transition: color .18s ease, text-decoration-color .18s ease, background-color .18s ease;
}
.prose p a.to-patterns { color: var(--lb); }
.prose p a.to-art { color: var(--lg); }
.prose p a.to-materials { color: var(--ly); }
.prose p a:hover { text-decoration-color: currentColor; background: color-mix(in srgb, var(--y) 35%, transparent); }
.prose p.composed { /* signed in Max's own hand */
  font-family: var(--head); font-size: 27px; line-height: 1.15; color: var(--r); margin-top: 1.1em; transform: rotate(-1deg); transform-origin: left center;
}
.side { display: grid; gap: var(--s5); justify-items: start; padding-top: var(--s1); }
.portrait { width: 156px; transform: rotate(1.6deg); transition: transform .2s ease; }
.portrait:hover { transform: rotate(0deg) translateY(-4px); }
.portrait img { aspect-ratio: 4 / 5; object-position: 50% 20%; }

/* the minor links: Latest Photos · About Rockmage · Log In (beside the intro on the homepage, in the footer elsewhere) */
.minor { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.minor a {
  font-family: var(--serif); font-weight: 700; font-variation-settings: "SOFT" 100, "opsz" 16; font-size: 16px; line-height: 1.4; color: var(--ink); text-decoration: none;
  border-bottom: 3px solid var(--y); transition: border-color .18s ease, color .18s ease;
}
.minor a:hover, .minor a.on { border-bottom-color: var(--b); color: var(--b); background: none; }
.minor li.login a { color: var(--muted); border-bottom-color: var(--rule); }
.minor li.login a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.foot-minor { margin: var(--s5) 0 0; }
.foot-minor .minor { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }

/* the rule: Chase Cheeta runs across the page, cut out in blue */
.run { /* the pattern sheet's running body sits at x 13–580, y 26–203 of 600×750; the lettering is above and below that band */
  position: relative; display: block; overflow: hidden;
  width: min(100%, 700px); aspect-ratio: 567 / 177; margin: var(--s7) 0 0 auto;
}
.run img {
  position: absolute; left: -2.293%; top: -14.69%; width: 105.82%; height: auto; max-width: none; margin: 0; padding: 0;
  filter: var(--run-filter); /* black ink → blue, white paper → clear (inline SVG feColorMatrix) */
  transition: transform .3s ease;
}
.run:hover img { transform: translateX(1.5%); }
.rule { border: 0; height: 7px; margin: 0 0 var(--s6); background: linear-gradient(var(--y) 0 4px, var(--b) 4px 100%); }

/* ---------------- gallery: an index of blocks (the homepage's nine, the footer's random three) ---------------- */
.thumbs { list-style: none; margin: 0 0 var(--s8); padding: var(--s2) 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 30px; }
.thumbs .block { transition: transform .22s ease, box-shadow .22s ease; }
.thumbs .block img { aspect-ratio: 4 / 3; }
.thumbs li:nth-child(3n+1) .block:hover { transform: translateY(-5px) rotate(-1.5deg); }
.thumbs li:nth-child(3n+2) .block:hover { transform: translateY(-5px) rotate(1deg); }
.thumbs li:nth-child(3n+3) .block:hover { transform: translateY(-5px) rotate(1.6deg); }
.thumbs .block:hover { box-shadow: 0 0 0 3px var(--tile), 0 0 0 9px var(--y), 0 22px 30px -12px var(--shadow-2); }
.thumbs .block:focus-visible { outline-offset: 12px; }
.thumbs.random { margin: var(--s6) 0 0; padding-top: 0; }

/* ---------------- page bodies restyled in the block language (batch 1) ---------------- */
/* photo grids on art pages and Latest Photos: four across, lazy-loaded full-size photos */
.thumbs.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; margin-bottom: var(--s6); }
.thumbs .caption { margin: 10px 2px 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.thumbs .caption.admin { font-size: 13px; }
/* Go Newer / Go Older */
.pager { display: flex; flex-wrap: wrap; gap: 12px 13px; margin: 0 0 var(--s5); }
.pager:empty { display: none; }
.pager a {
  display: inline-block; padding: 5px 12px 4px; border-radius: 2px;
  font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; font-size: 15px; line-height: 1.25;
  color: var(--g-ink); background: var(--tile); text-decoration: none;
  border: 2px solid var(--b); box-shadow: 0 0 0 2px var(--tile), 0 0 0 4px var(--y);
  transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.pager a:hover, .pager a:focus-visible { transform: translateY(-2px); color: #fff; background: var(--g); border-color: var(--g); }
/* one photo, large, on its own page */
.photo-big { margin: var(--s2) 0 var(--s6); }
.photo-big .block { display: inline-block; max-width: 100%; }
.photo-big .block img { width: auto; max-width: 100%; }
/* the portrait on the biography page */
.portrait-float { float: right; width: 200px; max-width: 40%; margin: 4px 0 var(--s4) var(--s5); transform: rotate(1.6deg); }
.portrait-float img { width: 100%; }

/* the pattern index pages (patterns.jsp): letter tiles and animal tiles are the A–Z blocks themselves */
div.patterns { text-align: center; } /* the pattern index pages only (search.jsp uses .patterns on a heading too) */
.patterns .letter, .patterns .animal {
  display: inline-block; margin: 8px 7px; padding: 3px; text-decoration: none;
  background: var(--tile); border: 3px solid var(--y); border-radius: 3px;
  transition: transform .18s ease, background-color .18s ease;
}
.patterns .letter span, .patterns .animal span {
  display: inline-block; box-sizing: content-box;
  border: 3px solid var(--b); background: var(--tile);
  color: var(--r); font-family: "New Century Schoolbook", Schoolbook, Nimrod, "Times New Roman", serif; font-weight: bold;
  font-size: 80px; line-height: 1.1; width: 85px; height: 72px; padding: 0 0 15px 0;
  transition: background-color .18s ease, color .18s ease;
}
.patterns .animal span { font-size: 50px; width: 375px; max-width: calc(100vw - 110px); height: 60px; padding-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patterns .letter:hover, .patterns .animal:hover, .patterns .letter:focus-visible, .patterns .animal:focus-visible { transform: translateY(-3px); }
.patterns .letter:hover span, .patterns .animal:hover span, .patterns .letter:focus-visible span, .patterns .animal:focus-visible span { background: var(--b); color: var(--y); }
.patterns img.rollblock { margin: 6px; }
.patterns img[src*="patterns/"]:not(.rollblock) { max-width: 100%; height: auto; margin: var(--s3) 0 0; }
.patterns table { text-align: left; margin: 0 auto var(--s5); }
@media (max-width: 560px) {
  .thumbs.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
  .patterns .letter span { font-size: 56px; width: 58px; height: 52px; padding-bottom: 10px; }
  .portrait-float { width: 120px; }
}

/* ---------------- page bodies restyled in the block language (batch 2) ---------------- */
/* art lists on folder + material pages: Name / Date Created */
.artlist { width: 100%; }
.artlist th.when, .artlist td.when { text-align: right; white-space: nowrap; padding-right: 4px; }
.artlist td.when { color: var(--muted); font-variant-numeric: tabular-nums; }
.artlist td a { color: var(--ink); text-decoration-color: var(--y); }
.artlist tr:hover td { background: color-mix(in srgb, var(--y) 18%, transparent); }
.artlist tr:hover td a { color: var(--b); }
/* the search page's own form and its three result lists */
.search-form { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s5); }
.search-form label { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--muted); font-variation-settings: "SOFT" 100, "opsz" 16; }
.search-form input[type="text"] { height: 40px; width: 20em; max-width: 100%; }
.search-form input[type="submit"] { height: 40px; margin-left: 0; }
:where(#content h2.patterns) { color: var(--b-ink); }
:where(#content h2.art) { color: var(--g-ink); }
:where(#content h2.materials) { color: var(--y-ink); }
.results { list-style: none; margin: 0 0 var(--s5); padding: 0; display: flex; flex-wrap: wrap; gap: 12px 13px; }
.results li { margin: 0; }
.results li a, .results li {
  font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; font-size: 15px; line-height: 1.25;
}
.results li {
  --c: var(--b-ink); --fill: var(--b);
  display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px 4px; border-radius: 2px;
  color: var(--c); background: var(--tile); border: 2px solid var(--b); box-shadow: 0 0 0 2px var(--tile), 0 0 0 4px var(--y);
  transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.results.art li { --c: var(--g-ink); --fill: var(--g); }
.results.materials li { --c: var(--y-ink); --fill: var(--y-ink); }
.results li a { color: inherit; text-decoration: none; background: none; }
.results li:hover, .results li:focus-within { transform: translateY(-2px); color: #fff; background: var(--fill); border-color: var(--fill); }
/* the Show & Tell submission form */
.stform { max-width: 40em; margin: var(--s4) 0 var(--s5); }
.stform .field { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: var(--s2) var(--s4); align-items: start; margin: 0 0 var(--s4); }
.stform label { font-size: 17px; line-height: 1.4; padding-top: 6px; }
.stform label b { font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; color: var(--ink); }
.stform .hint { display: block; font-size: 14px; line-height: 1.35; color: var(--muted); font-weight: 400; }
.stform input[type="text"], .stform select { width: 100%; }
.stform .actions { display: flex; justify-content: flex-end; margin: 0; }
.stform .actions input[type="submit"] { margin-left: 0; padding: 8px 22px; }
.stthumb { display: inline-block; padding: 6px; margin: 8px 0; }
.stthumb img { display: block; }
/* the 404 page */
.errorcode { font-family: var(--head); font-size: clamp(72px, 14vw, 140px); line-height: 1; color: var(--r); margin: 0 0 var(--s3); }
@media (max-width: 560px) {
  .stform .field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .stform label { padding-top: 0; }
  .search-form input[type="text"] { width: 100%; }
}

/* ---------------- the art piece page (batch 3): hero, facts, filmstrip, neighbours ---------------- */
.piece { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s5) clamp(24px, 4vw, 44px); align-items: start; margin: 0 0 var(--s5); }
.piece.nophoto { grid-template-columns: minmax(0, 1fr); }
.piece .hero-photo { transition: box-shadow .25s ease; }
.piece .hero-photo img { aspect-ratio: 3 / 2; }
.piece .hero-photo:hover { box-shadow: 0 0 0 3px var(--tile), 0 0 0 9px var(--y), 0 24px 34px -12px var(--shadow-2); }
.piece .details { min-width: 0; }
.piece .details .description { margin-top: 0; }
.piece .facts { margin: 0 0 var(--s4); }
.piece .facts td { padding: 4px 14px 4px 0; }
.piece .facts td:first-child { white-space: nowrap; }
.piece .dims { margin: 0; }
.piece .dims th { padding-right: 16px; }
/* the piece's photos: a strip of small blocks; the shown one is lit */
.thumbs.strip { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px 16px; margin: 0 0 var(--s5); }
.thumbs.strip .block { padding: 5px; border-width: 2px; box-shadow: 0 0 0 2px var(--tile), 0 0 0 5px var(--y), 0 8px 16px -10px var(--shadow-2); }
.thumbs.strip .block img { aspect-ratio: 4 / 3; }
.thumbs.strip .block.on { border-color: var(--r); box-shadow: 0 0 0 2px var(--tile), 0 0 0 5px var(--r), 0 8px 16px -10px var(--shadow-2); }
.thumbs.strip .block:hover { box-shadow: 0 0 0 2px var(--tile), 0 0 0 5px var(--y), 0 14px 22px -10px var(--shadow-2); }
.thumbs.strip .block.on:hover { box-shadow: 0 0 0 2px var(--tile), 0 0 0 5px var(--r), 0 14px 22px -10px var(--shadow-2); }
.thumbs.strip li:nth-child(n) .block:hover { transform: translateY(-3px) rotate(0); }
.thumbs.strip .caption { font-size: 13px; margin-top: 8px; }
/* ‹ newer piece · the folder · older piece › */
.siblings { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; margin: var(--s4) 0 var(--s3); }
.siblings a {
  display: flex; align-items: center; padding: 8px 12px; border-radius: 2px; min-width: 0;
  font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; font-size: 15px; line-height: 1.25;
  color: var(--g-ink); background: var(--tile); text-decoration: none;
  border: 2px solid var(--b); box-shadow: 0 0 0 2px var(--tile), 0 0 0 4px var(--y);
  transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.siblings a:hover, .siblings a:focus-visible { transform: translateY(-2px); color: #fff; background: var(--g); border-color: var(--g); }
.siblings .prev { grid-column: 1; justify-content: flex-start; }
.siblings .up { grid-column: 2; color: var(--b-ink); }
.siblings .up:hover, .siblings .up:focus-visible { background: var(--b); border-color: var(--b); }
.siblings .next { grid-column: 3; justify-content: flex-end; text-align: right; }
.siblings a:only-child { grid-column: 2; }
.printkey { font: inherit; font-weight: 700; }

/* folder + material pages: the featured row reuses .piece; categories are photo blocks with the name as label */
.piece.featured { margin-bottom: var(--s6); }
.piece.featured .details .description { margin-bottom: 0; font-size: 19px; }
.thumbs.cats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 30px 24px; margin: 0 0 var(--s6); }
.thumbs.cats .cat { padding-bottom: 0; }
.thumbs.cats .cat img { aspect-ratio: 4 / 3; }
.thumbs.cats .cat .label {
  display: block; padding: 10px 6px 8px; text-align: center;
  font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 24; font-size: 18px; line-height: 1.2; color: var(--b-ink);
  transition: color .18s ease;
}
.thumbs.cats .cat:not(:has(img)) { display: grid; align-content: center; min-height: 120px; }
.thumbs.cats .cat:not(:has(img)) .label { font-size: 22px; padding: 18px 6px; }
.thumbs.cats .cat:hover .label { color: var(--r-ink); }
body.Materials .thumbs.cats .cat .label { color: var(--y-ink); }
body.Materials .thumbs.cats .cat:hover .label { color: var(--r-ink); }
.thumbs.gallery { margin: var(--s6) 0 0; padding-top: 0; }
@media (max-width: 560px) {
  .thumbs.cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .thumbs.cats .cat .label { font-size: 16px; }
}

/* ---------------- "More from Kaolin Fire": his apps as alphabet blocks (replaces the GUD banner) ---------------- */
.promo { margin: var(--s7) auto 0; max-width: 700px; text-align: center; }
.promo-head { margin: 0 0 var(--s4); font-family: var(--serif); font-weight: 700; font-variation-settings: "SOFT" 100, "opsz" 16; font-size: 15px; letter-spacing: .04em; color: var(--muted); }
.promo ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s5) var(--s6); }
.promo .app {
  --c: var(--b);
  display: grid; justify-items: center; gap: 10px; width: 132px; text-decoration: none; color: var(--ink);
  transition: transform .18s ease;
}
.promo .app.r { --c: var(--r); } .promo .app.g { --c: var(--g); } .promo .app.y { --c: var(--y-ink); } .promo .app.p { --c: var(--p); }
.promo .glyph { /* an A–Z block with the app's initial */
  display: grid; place-items: center; width: 84px; height: 84px; box-sizing: border-box;
  background: var(--tile); border: 3px solid var(--b); border-radius: 3px;
  box-shadow: 0 0 0 3px var(--tile), 0 0 0 8px var(--y), 0 10px 18px -8px var(--shadow-2);
  font-family: var(--serif); font-weight: 900; font-variation-settings: "SOFT" 100, "opsz" 72; font-size: 52px; line-height: 1; color: var(--r);
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.promo .name { font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 16; font-size: 17px; line-height: 1.2; margin-top: 8px; border-bottom: 3px solid var(--y); transition: border-color .18s ease, color .18s ease; }
.promo .blurb { font-size: 13px; line-height: 1.35; color: var(--muted); }
.promo .app:hover, .promo .app:focus-visible { transform: translateY(-3px); }
.promo .app:hover .glyph, .promo .app:focus-visible .glyph { background: var(--c); border-color: var(--c); color: #fff; }
.promo .app:hover .name, .promo .app:focus-visible .name { color: var(--c); border-bottom-color: var(--c); }
@media (max-width: 560px) {
  .piece { grid-template-columns: minmax(0, 1fr); }
  .thumbs.strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
  .siblings { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .siblings .up { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
  .siblings .prev { grid-column: 1; } .siblings .next { grid-column: 2; }
  .siblings a:only-child { grid-column: 1 / -1; }
  .promo .app { width: 108px; } .promo .glyph { width: 72px; height: 72px; font-size: 44px; }
}

/* ---------------- footer + banner ---------------- */
footer.site, #footer {
  position: relative; border-top: 3px solid var(--b); padding-top: var(--s4); margin-top: var(--s6);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s1) var(--s5);
  font-family: var(--serif); font-weight: 600; font-variation-settings: "SOFT" 100, "opsz" 12; font-size: 14px; line-height: 1.5; color: var(--muted);
}
footer.site::before, #footer::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 4px; background: var(--y); }
footer.site a, #footer a { color: var(--ink); font-weight: 800; text-decoration: none; border-bottom: 3px solid var(--y); transition: color .18s ease, border-color .18s ease; }
footer.site a:hover, #footer a:hover { color: var(--b); border-bottom-color: var(--b); background: none; }
.banner { margin: var(--s7) auto 0; max-width: 700px; padding: 0 12px; }
.banner a { /* the pattern box: yellow → red → blue nested frames */
  display: grid; place-items: center; min-height: 96px; padding: var(--s4) var(--s5); text-align: center;
  text-decoration: none; color: var(--tile-ink); font-family: var(--serif); font-weight: 800; font-variation-settings: "SOFT" 100, "opsz" 24; font-size: 19px; line-height: 1.35;
  background: var(--tile); border: 3px solid var(--b); border-radius: 6px;
  box-shadow: 0 0 0 3px var(--tile), 0 0 0 6px var(--r), 0 0 0 9px var(--tile), 0 0 0 12px var(--y);
  transition: color .18s ease, transform .18s ease;
}
.banner a:hover { color: var(--r-ink); transform: translateY(-2px); }

/* ---------------- responsive ---------------- */
@media (max-width: 820px) {
  .wordmark { font-size: clamp(64px, 11vw, 96px); }
  .spread { padding-top: 56px; padding-bottom: 44px; }
  .hero { gap: 28px; }
  .spread h1 { margin-top: var(--s6); }
  .intro { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s6); padding-top: var(--s2); }
  .portrait { width: 132px; }
  .thumbs { gap: 30px 24px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .top { padding-top: var(--s4); align-items: flex-end; }
  .top nav { order: 2; }
  .wordmark { order: 1; width: 100%; margin-left: 0; }
  .buttons { gap: 8px; margin-bottom: 0; }
  .btn { width: 42px; height: 42px; border-radius: 9px; }
  .bar { gap: var(--s4); padding-bottom: var(--s4); }
  .primary { gap: 12px; }
  .primary a { font-size: 15px; padding: 6px 11px 5px; }
  .search { width: 100%; }
  .search input { flex: 1 1 auto; width: auto; }
  .outerheader { font-size: clamp(26px, 8vw, 36px); margin-left: var(--s3); margin-bottom: -26px; padding: 10px 16px 3px; }
  #content { padding: var(--s7) var(--s4) var(--s5); }
  #content th, #content td { padding-right: 10px; }
  .spread { padding-top: 48px; padding-bottom: 40px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .hero .tile-a { grid-column: 1 / -1; }
  .hero .tile-b { grid-column: 2; margin-bottom: 0; margin-top: -6px; transform: rotate(2.4deg); }
  .hero .tile-b img { aspect-ratio: 4 / 5; object-position: 20% 50%; }
  .spread h1 { margin-top: var(--s5); font-size: clamp(40px, 11.5vw, 48px); }
  .intro { padding-top: var(--s6); }
  .prose { font-size: 17px; }
  .prose p.composed { font-size: 24px; }
  .side { grid-template-columns: auto minmax(0, 1fr); gap: var(--s5); }
  .portrait { width: 112px; }
  .run { margin-top: var(--s6); width: 100%; }
  .rule { margin-bottom: var(--s5); }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 22px; }
  .thumbs:not(.four) li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .thumbs:not(.four) li:last-child:nth-child(odd) .block img { aspect-ratio: 16 / 9; }
  .banner { padding: 0 10px; }
  .banner a { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .btn:hover, .primary a:hover, .thumbs .block:hover, .portrait:hover, .banner a:hover, .search button:active, #treemenu a:hover { transform: none; }
  .hero .tile-a:hover { transform: rotate(-1.4deg); }
  .hero .tile-b:hover { transform: rotate(2deg); }
}

/* ---------------- print: patterns print clean (print.css also hides .noprint and #menu) ---------------- */
@media print {
  body { background: #fff; color: #000; padding: 0; }
  body::before, .spread::before, .spread::after { display: none; }
  .top, .bar, .outerheader, .thumbs, footer.site, #footer, .banner, .foot-minor, .run, .rule { display: none !important; }
  #content { background: #fff; color: #000; border: 0; box-shadow: none; padding: 0; margin: 0; }
  #content a { color: #000; text-decoration: none; }
}
