/* Lamplight — the workshop after dark, lit only by the lamp. The cone of light is a gradient cut to shape with a
   mask; dust motes wander under it, four small clusters of radial gradients moved by transform; the lamp's halo
   flickers by opacity. Follow a contents link and that chapter steps into the light (:target); hover lifts
   the hazards and outfits like things picked up off the bench. Reduced motion holds everything still.
   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: dark;
  --dark: #0b0907;
  --panel: #1a1510;
  --panel-2: #221b14;
  --text: #efe4cd;
  --dim: #c3b394;
  --warm: #ffcf7a;
  --link: #ffd58f;
  --lit: #f7e7c4;
  --lit-ink: #261a0c;
  --focus: #ffe08a;
  --head: "Archivo Black", "Arial Black", Arial, sans-serif;
  /* where the lamp hangs, and the shape of its light */
  --lx: 82vw;
  --cone: polygon(calc(var(--lx) - 30px) 120px, calc(var(--lx) + 30px) 120px, 100vw 100vh, 18vw 100vh);
}
* { box-sizing: border-box; }
html { overflow-x: clip; background: var(--dark); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { min-width: 320px; margin: 0; color: var(--text); font: 17px/1.7 Georgia, "Iowan Old Style", serif; background: radial-gradient(ellipse 60% 50% at var(--lx) 140px, #2a1e10, transparent 70%) fixed, var(--dark); }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #fff3d6; }
:where(a, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 3px; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--warm); color: #1a1208; font: 700 15px Arial, sans-serif; text-decoration: none; }
.skip:focus { top: 12px; }
.main:focus { outline: none; }

/* ---------------------------------------------------------------- the scene */
.extra { position: fixed; z-index: 0; pointer-events: none; }
/* 1. the lamp itself, hanging at the top right: shade, bulb, flex */
.extra-1 {
  top: 0; left: calc(var(--lx) - 70px); width: 140px; height: 130px;
  background:
    linear-gradient(#3a3026, #3a3026) 50% 0 / 3px 46px no-repeat,
    radial-gradient(ellipse 16px 12px at 50% 112px, #fffbe8 0 40%, #ffd36b 70%, transparent 74%);
}
.extra-1::before { /* the shade: a trapezoid of brass */
  content: ""; position: absolute; left: 20px; right: 20px; top: 44px; height: 64px;
  background: linear-gradient(90deg, #5c4214, #c99a3c 40%, #f0cf7a 52%, #9a7224 70%, #4a330e);
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%);
}
.extra-1::after { /* the flicker: a warm halo that breathes */
  content: ""; position: absolute; left: -110px; right: -110px; top: 0; height: 300px;
  background: radial-gradient(ellipse 50% 45% at 50% 112px, rgb(255 210 120 / .55), rgb(255 180 80 / .18) 45%, transparent 70%);
  animation: flicker 3.2s ease-in-out infinite alternate;
}
/* 2. the cone of light: a gradient, cut to a cone by clip-path and faded towards the floor by a mask */
.extra-2 {
  inset: 0;
  clip-path: var(--cone);
  background: linear-gradient(rgb(255 214 140 / .30), rgb(255 200 120 / .10) 60%, rgb(255 190 110 / .03));
  -webkit-mask: radial-gradient(ellipse 70% 95% at var(--lx) 110px, #000 30%, transparent 85%);
  mask: radial-gradient(ellipse 70% 95% at var(--lx) 110px, #000 30%, transparent 85%);
}
/* 3 and 4. the dust: four small clusters of motes (a pseudo-element each, a few radial gradients apiece) that wander
   under the lamp by transform. Small layers on purpose: one big tiled layer of dust cost a whole frame to composite */
.extra-3, .extra-4 { top: 150px; right: 4vw; width: min(56vw, 720px); height: 70vh; }
.extra-3::before, .extra-3::after, .extra-4::before, .extra-4::after {
  content: ""; position: absolute; width: 230px; height: 250px; will-change: transform;
  background:
    radial-gradient(circle at 20% 30%, rgb(255 236 190 / .95) 0 1.3px, transparent 2.2px),
    radial-gradient(circle at 70% 18%, rgb(255 236 190 / .7) 0 1px, transparent 1.8px),
    radial-gradient(circle at 45% 70%, rgb(255 236 190 / .85) 0 1.5px, transparent 2.4px),
    radial-gradient(circle at 86% 62%, rgb(255 236 190 / .6) 0 .9px, transparent 1.6px),
    radial-gradient(circle at 12% 88%, rgb(255 236 190 / .7) 0 1.1px, transparent 1.9px);
}
.extra-3::before { left: 40%; top: 0; animation: drift 19s ease-in-out infinite alternate; }
.extra-3::after { left: 8%; top: 38%; animation: drift2 27s ease-in-out infinite alternate; }
.extra-4::before { left: 62%; top: 48%; rotate: 90deg; animation: drift 23s ease-in-out infinite alternate-reverse; }
.extra-4::after { left: 30%; top: 70%; rotate: 200deg; animation: drift2 31s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-40px, 60px, 0); } to { transform: translate3d(-90px, 140px, 0); } }
@keyframes drift2 { from { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(50px, 40px, 0); } to { transform: translate3d(20px, 120px, 0); } }
@keyframes flicker { 0% { opacity: .82; } 30% { opacity: 1; } 55% { opacity: .9; } 72% { opacity: .97; } 100% { opacity: .86; } }
@media (prefers-reduced-motion: reduce) {
  .extra-1::after, .extra-3::before, .extra-3::after, .extra-4::before, .extra-4::after { animation: none; }
}

/* ---------------------------------------------------------------- the manual, in the dark */
.page { position: relative; z-index: 1; max-width: 780px; margin: 0 0 0 max(16px, 6vw); padding: 0 0 80px; }
.site-head, .title-block, .contents, .chapter, .outfits, .site-foot {
  position: relative; margin: 20px 0 0; padding: 22px 26px; border-radius: 6px;
  background: var(--panel); border: 1px solid #2e251b;
  box-shadow: 0 18px 40px rgb(0 0 0 / .55);
  transition: background-color .5s, color .5s, box-shadow .5s, translate .25s;
}
.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; padding: 10px 18px; }
.masthead { display: flex; align-items: center; }
.masthead .brand { display: flex; align-items: center; min-height: 42px; padding: 4px 10px; border-radius: 4px; background: #efe4cd; }
.masthead .brand img { display: block; width: auto; height: 24px; }
.site-name { display: inline-flex; align-items: center; min-height: 42px; margin-left: 14px; padding-left: 14px; border-left: 1px solid #4a3d2c; color: var(--text); font: 700 16px Arial, sans-serif; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 16px; font: 14px Arial, sans-serif; }
.site-nav a { display: inline-flex; align-items: center; min-height: 42px; color: var(--text); text-decoration: none; }
.site-nav a:hover { color: var(--warm); text-decoration: underline; }

.title-block { padding: 40px 28px 30px; background: radial-gradient(ellipse at 90% 0, #3a2a14, var(--panel) 70%); }
.edition { margin: 0; color: var(--warm); font: 700 12px Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: var(--head); font-weight: 1000; font-synthesis: none; line-height: 1.04; letter-spacing: -.02em; }
.title { margin-top: 10px; font-size: clamp(42px, 7vw, 86px); color: #fff1d2; text-shadow: 0 0 40px rgb(255 190 90 / .35); }
.subtitle { margin: 14px 0 0; max-width: 36ch; color: var(--dim); font-size: 20px; }

.contents-title { color: var(--warm); font: 700 12px Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.contents-list { margin: 8px 0 0; padding-left: 1.4em; columns: 2 220px; }
.contents-list a { display: inline-block; padding: 3px 0; }
.contents-list li::marker { color: var(--warm); }

.chapter { padding-top: 30px; scroll-margin-top: 30vh; }
.chapter-title { font-size: clamp(26px, 3.2vw, 36px); color: #fff1d2; }
.chapter-num { margin-right: 6px; color: var(--warm); }
.chapter-body > :first-child { margin-top: 14px; }
.first { font-size: 19px; }
.plate { margin: 20px 0 6px; }
.plate img { display: block; width: 100%; border-radius: 4px; filter: brightness(.82) sepia(.25); transition: filter .5s; }
.plate figcaption { margin-top: 6px; color: var(--dim); font-style: italic; font-size: 14px; }
.tools { padding-left: 1.1em; }
.tools li { margin: 6px 0; }
.tools li::marker { color: var(--warm); }
.note { margin: 18px 0; padding: 14px 18px; border-left: 4px solid var(--warm); background: #2a2016; }
.note p { margin: 0; }
.rules { padding-left: 1.4em; }
.rules li { margin: 8px 0; }
.saying { margin: 22px 0 0; padding-left: 18px; border-left: 3px solid var(--warm); }
.saying p { margin: 0; font-size: 22px; font-style: italic; color: #fff1d2; }
.saying footer { color: var(--dim); font: 14px Arial, sans-serif; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption { padding-bottom: 6px; color: var(--dim); font-style: italic; text-align: left; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid #3a2f22; text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid var(--warm); color: var(--warm); font: 700 13px Arial, sans-serif; }
.hazards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0; }
.hazard { padding: 12px 14px; border: 1px solid #3a2f22; border-radius: 4px; background: var(--panel-2); transition: translate .2s, box-shadow .2s, border-color .2s; }
.hazard dt { color: #fff1d2; font-weight: 700; }
.hazard dd { margin: 2px 0 0; }
/* picked up off the bench */
@media (hover: hover) { .hazard:hover, .outfit:hover { translate: 0 -4px; border-color: var(--warm); box-shadow: 0 10px 22px rgb(0 0 0 / .6), 0 0 0 1px rgb(255 207 122 / .3); } }
.glossary dt { margin-top: 10px; color: #fff1d2; font-weight: 700; }
.glossary dd { margin: 0; }
.sign-off { font-style: italic; }

/* :target — the chapter you went to steps into the light */
.chapter:target { background: var(--lit); color: var(--lit-ink); border-color: #ffd58f; box-shadow: 0 0 0 1px #ffd58f, 0 0 80px rgb(255 200 110 / .45), 0 20px 40px rgb(0 0 0 / .5); }
.chapter:target .chapter-title, .chapter:target .saying p, .chapter:target .hazard dt, .chapter:target .glossary dt { color: #1d1307; }
.chapter:target .chapter-num { color: #8a4a00; }
.chapter:target a { color: #7a3a00; }
.chapter:target :is(.note, .hazard) { background: #fff5dc; border-color: #d9b46a; }
.chapter:target .saying footer, .chapter:target caption, .chapter:target .plate figcaption { color: #5a4526; }
.chapter:target th, .chapter:target td { border-color: #d9c39a; }
.chapter:target thead th { color: #6a3c00; border-color: #8a5a10; }
.chapter:target .plate img { filter: none; }
.chapter:target .tools li::marker { color: #8a4a00; }

.outfits-title { font-size: clamp(28px, 3.4vw, 40px); color: #fff1d2; }
.outfits-lede { color: var(--dim); }
.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: 8px 12px; border: 1px solid #3a2f22; border-radius: 4px; background: var(--panel-2); font-size: 14px; transition: translate .2s, box-shadow .2s, border-color .2s; }
.outfit-link { display: inline-block; padding: 2px 0; font-weight: 700; }
.outfit-by, .outfit-note, .outfit-technique { display: none; }
#th-lamplight { background: var(--lit); border-color: var(--warm); box-shadow: 0 0 30px rgb(255 200 110 / .35); }
#th-lamplight .outfit-link { color: #4a2600; }
#th-lamplight .outfit-link::after { content: " · lit"; color: #5a3a10; font-weight: 400; }

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

@media (max-width: 720px) {
  :root { --lx: 78vw; }
  .page { margin: 0 12px; }
  .site-head, .title-block, .contents, .chapter, .outfits, .site-foot { padding: 18px 16px; }
  .extra-3, .extra-4 { width: 70vw; }
}
@media (prefers-reduced-motion: reduce) {
  .site-head, .title-block, .contents, .chapter, .outfits, .site-foot, .hazard, .outfit, .plate img { transition: none; }
}

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