/* Gradients all the way down — a fractal-looking carpet from one repeating-conic-gradient laid at four scales, each
   a power of two (16, 32, 64, 128 px), so every square sits inside a square twice its size. Not a single image file;
   the text sits on solid panels.
   Designed by machine for the Slopwright. */
:root {
  color-scheme: dark;
  --deep: #120a2a;
  --panel: #fbf7ee;
  --ink: #1a1230;
  --muted: #4c4466;
  --hot: #ff5fa2;
  --gold: #ffc94d;
  --teal: #3fd0c9;
  /* the same checker at four scales: Sierpinski-carpet-ish nesting */
  --carpet:
    repeating-conic-gradient(rgba(255, 95, 162, .55) 0 25%, transparent 0 50%) 0 0 / 16px 16px,
    repeating-conic-gradient(rgba(63, 208, 201, .45) 0 25%, transparent 0 50%) 0 0 / 32px 32px,
    repeating-conic-gradient(rgba(255, 201, 77, .4) 0 25%, transparent 0 50%) 0 0 / 64px 64px,
    repeating-conic-gradient(rgba(120, 90, 255, .5) 0 25%, transparent 0 50%) 0 0 / 128px 128px,
    var(--deep);
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body { margin: 0; min-width: 320px; background: var(--carpet); color: var(--ink); font: 17px/1.6 "Trebuchet MS", "Segoe UI", Arial, sans-serif; }
a { color: #5a1b9a; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #b0115a; }
a:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: 10px; top: -80px; z-index: 10; padding: 10px 14px; background: var(--panel); color: var(--ink); }
.skip:focus { top: 10px; }
.main:focus { outline: none; }

.page { max-width: 1060px; 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: 10px 18px; background: var(--panel); box-shadow: 8px 8px 0 var(--hot), 16px 16px 0 var(--teal); }
.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-left: 12px; border-left: 2px solid var(--ink); color: var(--ink); font-weight: 700; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* the title: a solid square in the middle of the carpet, framed by a smaller copy of the carpet */
.title-block { position: relative; margin: 50px auto 40px; max-width: 760px; padding: 36px 32px; text-align: center; background: var(--panel); border: 16px solid transparent; border-image: repeating-conic-gradient(var(--hot) 0 25%, var(--ink) 0 50%) 16; }
.edition { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.title { margin: 0; font: 900 clamp(36px, 7vw, 76px)/1 "Trebuchet MS", Arial, sans-serif; letter-spacing: -.02em; }
.subtitle { margin: 12px auto 0; max-width: 40ch; color: var(--muted); }

.contents { margin: 0 auto 30px; max-width: 760px; padding: 16px 22px; background: var(--panel); }
.contents-title { margin: 0 0 6px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.contents-list { margin: 0; padding-left: 22px; columns: 2 200px; }
.contents-list a { display: inline-block; min-height: 28px; }

/* chapters: each panel steps in by a power of two, like the next level down */
.chapter { position: relative; margin: 28px 0; padding: 26px clamp(18px, 4vw, 40px); background: var(--panel); }
.chapter::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: repeating-conic-gradient(var(--hot) 0 25%, var(--teal) 0 50%) 0 0 / 8px 8px; }
.chapter:nth-of-type(2n) { margin-left: 32px; }
.chapter:nth-of-type(4n) { margin-left: 64px; }
.chapter-title { margin: 6px 0 12px; font: 800 clamp(24px, 3.2vw, 34px)/1.1 "Trebuchet MS", Arial, sans-serif; }
.chapter-num { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin-right: 10px; background: var(--ink); color: #fff; box-shadow: 0 0 0 4px var(--panel), 0 0 0 8px var(--hot); font-size: .55em; vertical-align: .25em; }
.chapter-body { max-width: 66ch; }
.first { font-size: 19px; }
.plate { margin: 20px 0 0; padding: 8px; background: repeating-conic-gradient(var(--ink) 0 25%, var(--hot) 0 50%) 0 0 / 16px 16px; }
.plate img { display: block; width: 100%; }
.plate figcaption { margin-top: 8px; padding: 6px 10px; background: var(--panel); font-size: 14px; color: var(--muted); }
.tools { padding-left: 0; list-style: none; }
.tools li { position: relative; margin: 8px 0; padding-left: 28px; }
.tools li::before { content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; background: repeating-conic-gradient(var(--hot) 0 25%, var(--ink) 0 50%) 0 0 / 8px 8px; }
.note { margin: 18px 0; padding: 14px 18px; background: var(--ink); color: #fff3dc; border-left: 8px solid var(--gold); }
.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); font-size: 14px; }
th, td { padding: 9px 10px; border-bottom: 1px solid #ddd2e8; text-align: left; vertical-align: top; }
thead th { background: var(--ink); color: #fff3dc; }
.rules { padding-left: 26px; }
.rules li { margin: 8px 0; }
.rules li::marker { color: #b0115a; font-weight: 800; }
.saying { margin: 22px 0 0; padding: 18px 22px; background: var(--ink); color: #fff3dc; box-shadow: 8px 8px 0 var(--teal); }
.saying p { margin: 0; font-size: 20px; font-weight: 700; }
.saying footer { margin-top: 6px; font-size: 14px; color: #e3d9ff; }
.hazards { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.hazard { padding: 12px 14px; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--hot); }
.hazard dt { font-weight: 800; }
.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 20px; padding: 26px clamp(18px, 4vw, 40px); background: var(--panel); }
.outfits-title { margin: 0; font: 800 clamp(24px, 3.2vw, 34px)/1.1 "Trebuchet MS", Arial, sans-serif; }
.outfits-lede { color: var(--muted); }
.outfit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.outfit { padding: 10px 12px; border: 1px solid #cfc3de; font-size: 14px; }
.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-fractal { border: 6px solid transparent; border-image: repeating-conic-gradient(var(--hot) 0 25%, var(--ink) 0 50%) 6; background: #fff; }
#th-fractal .outfit-link::after { content: " · wearing now"; font-weight: 400; }
#th-fractal .outfit-by, #th-fractal .outfit-note { display: block; font-size: 13px; margin-top: 4px; }

.site-foot { padding: 16px 20px; background: var(--panel); font-size: 14px; color: var(--muted); }
.site-foot p { margin: 0 0 6px; }
.extra { display: none; }

@media (max-width: 600px) {
  .chapter:nth-of-type(2n), .chapter:nth-of-type(4n) { margin-left: 0; }
  .title-block { padding: 24px 16px; }
  .site-head { box-shadow: 4px 4px 0 var(--hot), 8px 8px 0 var(--teal); }
}

@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; } }
