/* Cut paper — every panel, heading and button is a polygon cut with clip-path. The edges are torn on purpose
   (the polygons sit in the padding), so the text is never cut.
   Designed by machine for the Slopwright. */
:root {
  color-scheme: light;
  --board: #2d3a3a;
  --cream: #fbf3df;
  --red: #c8412b;
  --blue: #1f4e79;
  --yellow: #f2c230;
  --green: #3f7d4e;
  --ink: #1b1b1b;
  --muted: #4a4a44;
  /* a torn edge: lots of small notches top and bottom, all inside the padding */
  --torn: polygon(0% 6px, 4% 0%, 9% 5px, 15% 1px, 21% 7px, 27% 2px, 34% 6px, 41% 0%, 48% 5px, 55% 1px, 62% 7px, 69% 2px, 76% 6px, 83% 0%, 90% 5px, 96% 1px, 100% 6px,
    100% calc(100% - 6px), 96% 100%, 90% calc(100% - 5px), 83% calc(100% - 1px), 76% calc(100% - 7px), 69% calc(100% - 2px), 62% calc(100% - 6px), 55% 100%, 48% calc(100% - 5px), 41% calc(100% - 1px), 34% calc(100% - 7px), 27% calc(100% - 2px), 21% calc(100% - 6px), 15% 100%, 9% calc(100% - 5px), 4% calc(100% - 1px), 0% calc(100% - 6px));
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0; min-width: 320px; color: var(--ink); font: 17px/1.6 "Gill Sans", "Gill Sans MT", "Trebuchet MS", Arial, sans-serif;
  background: var(--board) radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.5px) 0 0 / 6px 6px;
}
a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
a:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: 10px; top: -80px; z-index: 10; padding: 10px 14px; background: var(--yellow); color: var(--ink); }
.skip:focus { top: 10px; }
.main:focus { outline: none; }

.page { max-width: 1040px; margin: 0 auto; padding: 24px 4% 50px; }

.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; padding: 16px 22px; background: var(--cream); clip-path: var(--torn); }
.masthead { display: flex; align-items: center; gap: 12px; }
.masthead .brand { display: inline-flex; align-items: center; min-height: 40px; }
.masthead .brand img { display: block; height: 26px; width: auto; }
.site-name { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; background: var(--red); color: #fff; font-weight: 700; text-decoration: none; clip-path: polygon(8px 0, 100% 3px, calc(100% - 6px) 100%, 0 calc(100% - 4px)); }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 15px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; background: var(--ink); color: var(--cream); text-decoration: none; clip-path: polygon(0 4px, 100% 0, calc(100% - 4px) 100%, 5px calc(100% - 2px)); }
.site-nav a:hover { background: var(--blue); }
.site-nav a:focus-visible { outline: none; background: var(--red); text-decoration: underline; }

/* the title: a big yellow cut-out with a red slab behind it */
.title-block { position: relative; margin: 40px 0 30px; padding: 40px clamp(20px, 5vw, 60px) 46px; background: var(--yellow); clip-path: polygon(0 18px, 30% 0, 100% 10px, 98% calc(100% - 22px), 60% 100%, 2% calc(100% - 8px)); }
.edition { display: inline-block; margin: 0 0 10px; padding: 6px 14px; background: var(--ink); color: var(--yellow); font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; clip-path: polygon(0 0, 100% 3px, 97% 100%, 2% calc(100% - 3px)); }
.title { margin: 0; font: 900 clamp(40px, 8vw, 96px)/.95 "Gill Sans", "Trebuchet MS", Arial, sans-serif; letter-spacing: -.02em; text-transform: uppercase; }
.subtitle { margin: 14px 0 0; max-width: 40ch; font-size: 19px; }

.contents { margin: 0 0 30px; padding: 20px 26px; background: var(--cream); clip-path: var(--torn); }
.contents-title { margin: 0 0 8px; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; }
.contents-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.contents-list a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; background: var(--blue); color: #fff; text-decoration: none; clip-path: polygon(6px 0, 100% 4px, calc(100% - 4px) 100%, 0 calc(100% - 3px)); }
.contents-list a:hover { background: var(--red); }
.contents-list a:focus-visible { outline: none; background: var(--red); text-decoration: underline; }

/* chapters: torn sheets, each cut a little differently */
.chapter { margin: 30px 0; padding: 34px clamp(20px, 4vw, 44px); background: var(--cream); clip-path: var(--torn); }
.chapter:nth-of-type(3n+1) { clip-path: polygon(0 10px, 100% 0, 100% calc(100% - 14px), 0 100%); }
.chapter:nth-of-type(3n+2) { clip-path: polygon(0 0, 100% 12px, 99% 100%, 1% calc(100% - 10px)); }
.chapter-title { display: inline-block; margin: 0 0 16px; padding: 10px 22px 12px 18px; background: var(--ink); color: var(--cream); font: 800 clamp(22px, 3vw, 32px)/1.1 "Gill Sans", "Trebuchet MS", Arial, sans-serif; text-transform: uppercase; clip-path: polygon(0 4px, 100% 0, calc(100% - 10px) 100%, 6px calc(100% - 3px)); }
.chapter-num { display: inline-block; margin-right: 10px; padding: 0 8px; background: var(--yellow); color: var(--ink); transform: rotate(-4deg); }
.chapter-body { max-width: 66ch; }
.first { font-size: 19px; }
/* the plate: cut into a hexagon-ish frame with its caption on a tag */
.plate { margin: 22px 0 0; }
.plate img { display: block; width: 100%; clip-path: polygon(4% 0, 96% 3%, 100% 50%, 95% 97%, 3% 100%, 0 48%); }
.plate figcaption { display: inline-block; margin-top: 10px; padding: 6px 16px; background: var(--green); color: #fff; font-size: 14px; clip-path: polygon(0 0, 100% 4px, 96% 100%, 3% calc(100% - 2px)); }
.tools { padding-left: 0; list-style: none; }
.tools li { position: relative; margin: 10px 0; padding-left: 30px; }
.tools li::before { content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; background: var(--red); clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.note { margin: 20px 0; padding: 22px 26px; background: var(--red); color: #fff; clip-path: polygon(0 0, 100% 8px, 98% 100%, 2% calc(100% - 6px)); }
.note a { color: #fff; }
.note p { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 15px; }
caption { text-align: left; padding-bottom: 8px; color: var(--muted); }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 2px dashed #d8c9a6; }
thead th { background: var(--blue); color: #fff; }
.rules { padding-left: 0; list-style: none; counter-reset: r; }
.rules li { counter-increment: r; position: relative; margin: 12px 0; padding-left: 50px; }
.rules li::before { content: counter(r); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 36px; height: 34px; background: var(--yellow); font-weight: 800; clip-path: polygon(10% 0, 100% 8%, 90% 100%, 0 88%); }
.saying { margin: 24px 0 0; padding: 26px 30px; background: var(--blue); color: #fff; clip-path: polygon(0 6px, 100% 0, 100% calc(100% - 20px), 14% calc(100% - 20px), 6% 100%, 7% calc(100% - 20px), 0 calc(100% - 20px)); padding-bottom: 44px; }
.saying p { margin: 0; font-size: 21px; font-weight: 700; }
.saying footer { margin-top: 6px; font-size: 14px; }
.hazards { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.hazard { padding: 18px 20px; background: #fff; clip-path: polygon(0 4px, 100% 0, 97% 100%, 3% calc(100% - 5px)); box-shadow: inset 0 0 0 2px var(--ink); }
.hazard:nth-child(even) { clip-path: polygon(3% 0, 100% 5px, 100% 100%, 0 calc(100% - 4px)); }
.hazard dt { font-weight: 800; color: var(--red); }
.hazard dd { margin: 4px 0 0; font-size: 15px; }
.glossary dt { font-weight: 800; margin-top: 10px; }
.glossary dd { margin: 2px 0 0 20px; }
.sign-off { font-weight: 700; }

.outfits { margin: 40px 0 24px; padding: 34px clamp(20px, 4vw, 44px); background: var(--cream); clip-path: var(--torn); }
.outfits-title { margin: 0; font: 800 clamp(24px, 3.2vw, 34px)/1.1 "Gill Sans", "Trebuchet MS", Arial, sans-serif; text-transform: uppercase; }
.outfits-lede { color: var(--muted); }
.outfit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.outfit { padding: 12px 14px; background: #fff; font-size: 14px; clip-path: polygon(0 3px, 100% 0, 98% 100%, 1% calc(100% - 3px)); }
.outfit-link { display: inline-block; min-height: 26px; font-weight: 700; }
.outfit-by, .outfit-note { display: none; }
.outfit-technique { display: block; color: var(--muted); font-size: 13px; }
#th-clip { background: var(--yellow); clip-path: polygon(0 0, 100% 6px, 96% 100%, 3% calc(100% - 4px)); }
#th-clip a, #th-clip .outfit-technique { color: var(--ink); }
#th-clip .outfit-link::before { content: "✂ Cut today: "; font-weight: 400; }
#th-clip .outfit-by, #th-clip .outfit-note { display: block; font-size: 13px; margin-top: 4px; }

.site-foot { padding: 22px 26px; background: var(--ink); color: #e8e1cc; font-size: 14px; clip-path: var(--torn); }
.site-foot a { color: var(--yellow); }
.site-foot p { margin: 0 0 6px; }
.extra { display: none; }

@media (max-width: 600px) {
  .page { padding: 12px 10px 30px; }
  .title-block { padding: 36px 20px 44px; }
}

@media (max-width: 600px) { table { min-width: 0; } }

/* 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; } }
