/* Shelves — each chapter is a box on a wooden shelf, and lays itself out by its own width with container queries
   (@container), not the window's: a narrow box stacks its title over its text, a wide one puts them side by side.
   Designed by machine for the Slopwright. */
@font-face { font-family: "Archivo Black"; src: url(/fonts/archivo-black-latin.woff2) format("woff2"); font-weight: 400 1000; font-display: swap; }
:root {
  color-scheme: light;
  --wall: #e9e2d3;
  --box: #fffdf6;
  --ink: #1e1b16;
  --dim: #5b5446;
  --wood: #8a5a2b;
  --wood-dark: #5e3a17;
  --tape: #f1d36b;
  --head: "Archivo Black", "Arial Black", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  min-width: 320px; margin: 0; color: var(--ink); font: 16px/1.55 Arial, Helvetica, sans-serif;
  background: repeating-linear-gradient(90deg, transparent 0 119px, rgba(0, 0, 0, .035) 119px 120px), var(--wall);
}
a { color: var(--ink); text-underline-offset: 3px; }
:where(a, [tabindex]):focus-visible { outline: 3px solid #a24a00; outline-offset: 3px; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 10; padding: 10px 16px; background: var(--ink); color: #fff; }
.skip:focus { top: 12px; }
.extra { display: none; }
.page { max-width: 1320px; margin: auto; padding: 0 4%; }
.main:focus { outline: none; }

.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; padding: 20px 0; }
.masthead { display: flex; align-items: center; }
.masthead .brand { display: flex; align-items: center; min-height: 42px; }
.masthead .brand img { display: block; height: 26px; width: auto; }
.site-name { margin-left: 14px; padding-left: 14px; border-left: 2px solid var(--wood); font-weight: 700; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 18px; font-size: 14px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 42px; text-decoration: none; font-weight: 700; }
.site-nav a:hover { text-decoration: underline; }

/* the manual: a bookcase. Each chapter is a box; the shelf is the box's bottom edge */
.manual {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 46px 26px; align-items: end;
  padding: 26px 26px 40px; border: 14px solid var(--wood); border-top-width: 18px;
  background: linear-gradient(rgba(0, 0, 0, .18), transparent 30px), #d9cfba;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .25), 0 10px 0 var(--wood-dark);
}
.title-block, .contents, .chapter { position: relative; container-type: inline-size; padding: 22px; border: 1px solid #cbbf9f; border-radius: 4px; background: var(--box); box-shadow: 0 2px 0 rgba(0, 0, 0, .08); }
/* the plank under each box */
.title-block::after, .contents::after, .chapter::after {
  content: ""; position: absolute; left: -26px; right: -26px; bottom: -32px; height: 18px;
  background: linear-gradient(var(--wood), var(--wood-dark)); box-shadow: 0 6px 8px rgba(0, 0, 0, .25);
}
/* the wide boxes take the whole shelf; on a wide bookcase some take two thirds, and dense packing fills the gaps */
.title-block, #welcome, #containers, #rules { grid-column: 1 / -1; }
@media (min-width: 1100px) {
  .manual { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; }
  #welcome, #rules { grid-column: span 2; }
}
.title-block { background: var(--ink); color: #f6f1e4; border-color: var(--ink); }
.edition { margin: 0; color: var(--tape); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.title { margin: 8px 0 0; font: 1000 clamp(40px, 10cqi, 110px)/.95 var(--head); letter-spacing: -.03em; }
.subtitle { margin: 14px 0 0; max-width: 34em; font-size: 19px; }

/* a strip of tape labels each box */
.chapter-title, .contents-title { display: inline-block; margin: -34px 0 14px -6px; padding: 6px 14px; background: var(--tape); color: var(--ink); font: 1000 22px/1.15 var(--head); letter-spacing: -.01em; transform: rotate(-1.5deg); box-shadow: 0 2px 3px rgba(0, 0, 0, .2); }
.chapter-num { margin-right: 6px; }
.chapter-num::after { content: "."; }
.contents-list { margin: 0; padding-left: 1.4em; columns: 2 150px; }
.contents-list a { display: inline-block; padding: 4px 0; }
.chapter-body > :first-child { margin-top: 0; }
.first { font-size: 18px; font-weight: 700; }

/* the container queries: how a box lays itself out */
@container (min-width: 620px) {
  .chapter-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .chapter-body > .first { grid-column: 1 / -1; font-size: 22px; }
  .chapter-body > .plate { grid-column: 2; grid-row: 2 / span 2; margin: 0; }
  .chapter-body > .table-wrap, .chapter-body > .note { grid-column: 1 / -1; }
  .rules { grid-column: 1; } .saying { grid-column: 2; align-self: center; }
}
@container (min-width: 900px) {
  .title { font-size: 9cqi; }
  .chapter-body { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
@container (max-width: 360px) {
  .hazards { grid-template-columns: 1fr; }
  .glossary dd { margin-left: 0; }
}

.plate { margin: 16px 0; }
.plate img { display: block; border: 6px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.plate figcaption { margin-top: 6px; color: var(--dim); font-size: 14px; }
.tools { margin: 0; padding-left: 1.2em; }
.tools li { margin-bottom: .35em; }
.note { margin: 14px 0; padding: 12px 16px; border: 2px dashed #a24a00; background: #fff3dc; }
.note p { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption { padding-bottom: 6px; color: var(--dim); text-align: left; font-style: italic; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e0d6bf; text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); }
.rules { margin: 0; padding-left: 1.4em; }
.rules li { margin-bottom: .4em; }
.saying { margin: 16px 0 0; padding: 16px; background: var(--ink); color: #f6f1e4; font: 1000 20px/1.25 var(--head); }
.saying p { margin: 0; }
.saying footer { margin-top: 8px; color: var(--tape); font: 13px Arial, sans-serif; }
.hazards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.hazard { padding: 10px; border: 1px solid #e0d6bf; background: #faf6ea; }
.hazard dt { font-weight: 700; }
.hazard dd { margin: 4px 0 0; font-size: 14px; }
.glossary dt { font-weight: 700; margin-top: 8px; }
.glossary dd { margin: 0 0 0 1em; }

.outfits { margin-top: 56px; padding: 26px; border: 14px solid var(--wood); background: var(--box); }
.outfits-title { margin: 0; font: 1000 clamp(26px, 4vw, 40px)/1.05 var(--head); }
.outfits-lede { color: var(--dim); }
.outfit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.outfit { padding: 10px 12px; border: 1px solid #e0d6bf; background: #faf6ea; font-size: 13px; }
.outfit-link { display: inline-block; min-height: 24px; font-size: 15px; font-weight: 700; }
.outfit-by, .outfit-note { display: none; }
.outfit-technique { display: block; color: var(--dim); }
#th-shelves { background: var(--tape); border-color: var(--ink); transform: rotate(-1deg); }
#th-shelves .outfit-technique { color: var(--ink); }
#th-shelves .outfit-link::after { content: " (on the shelf now)"; font-weight: 400; }

.site-foot { padding: 28px 0 60px; color: var(--dim); font-size: 14px; }
.site-foot p { margin: 0 0 6px; }

@media (max-width: 600px) {
  .manual { padding: 22px 12px 34px; border-width: 8px; gap: 46px 14px; }
  .title-block::after, .contents::after, .chapter::after { left: -12px; right: -12px; }
  .outfits { padding: 16px; border-width: 8px; }
}

/* moving between outfits: a cross-document view transition where the browser has them (Chromium did, Firefox did not, when check.mjs last ran), with the
   masthead and the title carried across; an ordinary page load elsewhere, and under reduced motion */
@view-transition { navigation: auto; }
.masthead { view-transition-name: masthead; }
.title { view-transition-name: manual-title; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
