/* workshop.css. The title's stop is this page's one red, as on every other page; nothing below it is red. */

html:not(.js) .js-only { display: none; }

/* the experiments */
section.entry { padding-bottom: 0; }
section.entry::before { margin-bottom: 0; height: 0; }

/* The opening: the title and its lead, then FETCHING THE GARDAN, whose photograph is the page's first wide thing. */
.page-head .lead { text-wrap: balance; }  /* as on Home and Research: "retroactively." no longer stands alone */
/* The posts: real things, no toy. Photographs at uneven sizes, words between them. */
#gardan { margin-top: calc(var(--space-16) * 2); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6); }
#gardan .sec-head, #gardan .g-air { grid-column: 1 / -1; }
.g-text { grid-column: 1 / 8; margin-top: var(--space-10); }
.g-nest { grid-column: 9 / 13; margin-top: var(--space-10); }
.g-night { grid-column: 1 / 7; margin-top: 72px; }
.g-dusk { grid-column: 8 / 12; margin-top: 136px; }
#walk-signal { margin-top: calc(var(--space-16) * 2); }
.walk { display: grid; grid-template-columns: minmax(0, 1fr) 240px; column-gap: var(--space-10); align-items: start; }
.px { display: block; width: 100%; height: auto; background: #141414; }
/* how the crossing goes: the drawing, then its button and the line that says what is happening */
/* the photograph, with the walk-through beside it on a wide screen */
.cross-row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--space-10); align-items: start; margin-top: var(--space-10); }
.cross-photo { margin: 0; }
.cross-photo img { display: block; width: 100%; height: auto; }
.cross { margin-top: 0; }
.canvas-box.cross-box { aspect-ratio: 2.4 / 1; }
.cross-ctl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-6); align-items: center; margin-top: var(--space-4); }
.cross-say { margin: 0; max-width: 62ch; min-height: 3.2em; }
@media (max-width: 960px) {
  .cross-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .cross-photo { width: min(78%, 360px); }
}
@media (max-width: 760px) {
  .canvas-box.cross-box { aspect-ratio: 1.25 / 1; }
  .cross-ctl { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .cross-ctl .btn { justify-self: start; }
}
.px .off { fill: #2a2a2a; }
.px .on { fill: #ececec; }
@media (max-width: 760px) {
  #gardan { display: block; }
  .g-nest { width: 58%; margin: var(--space-10) 0 0 auto; }
  .g-night { margin-top: var(--space-10); }
  .g-dusk { width: 62%; margin-top: var(--space-10); }
  .walk { display: block; }
  .walk-px { width: 200px; margin-top: var(--space-6); }
}
#eqe-oil { margin-top: calc(var(--space-16) * 1.5); }
.entry .sec-head { max-width: 46em; margin-bottom: var(--space-10); }
#walk-signal .sec-head, #hat .sec-head { margin-bottom: var(--space-4); }

.canvas-box { position: relative; width: 100%; }
.canvas-box > canvas { display: block; width: 100%; height: 100%; -webkit-tap-highlight-color: transparent; }
.canvas-box.sq { aspect-ratio: 1 / 1; }
.canvas-box.em-box { aspect-ratio: 1 / 1.08; }   /* the box above, the plot under it */
#electron-emission { margin-top: calc(var(--space-16) * 2); }
#electron-emission .ctl { margin-top: var(--space-4); }
.em-live { min-height: 2.6em; }
.canvas-box.hood { aspect-ratio: 1.8 / 1; touch-action: pan-y; }
.canvas-box.pour { aspect-ratio: 4 / 1; }

.ctl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-4); align-items: baseline; }
.ctl > .label { grid-column: 1; }
.ctl > input { grid-column: 1 / -1; grid-row: 2; }

/* Electron emission (once Brownian motion): the box left, the words to its right */
.bm { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--space-16); align-items: center; }
.bm-words { min-width: 0; }
.code-quote { font-size: 13px; line-height: 20px; }
.code-quote code { font-size: inherit; overflow-wrap: anywhere; }

/* the EQE of oil */
.entry .btns { margin-top: var(--space-2); }
.eqe-msg:empty { display: none; }
.verdict { margin-top: var(--space-16); max-width: 30em; }
/* Frame 7 (March 2014): a white triangle with a vertical base, pointing right, the wedge's own shape in light on black.
 * It hangs from the verdict's cap line against the column's right edge, under the experiment and clear of it.
 * 160px is the 158px image (sizes="158px") plus the keyline. The verdict's 64px margin collapses through .eqe-end. */
.ws-ph { width: 160px; }
/* Its top keyline sits on the cap height of the verdict's first line: .348 of the verdict's size (.quote in site.css),
 * 8px at 23px, so it stays within 1px down to 19px. The verdict's ink stops near x 887 at 1440, so about 170px of paper
 * lies between them. The 64px under the section keeps the frame's foot 145px above the WATTS heading at 1440; #watts
 * keeps the footer clear. */
@media (min-width: 961px) {
  .eqe-end { position: relative; }
  .ws-ph { position: absolute; top: calc(clamp(19px, 1.9vw, 23px) * .348); right: 0; margin: 0; }
  #eqe-oil { padding-bottom: var(--space-16); }
}
.entry details.working { margin-top: var(--space-10); }
.bm-words details.working, .ws-words details.working { margin-top: var(--space-6); }

/* the original posts */
.post { display: grid; gap: var(--space-4); max-width: 72ch; }
.post h3 { font-size: 22px; margin-top: var(--space-4); }
.post p { max-width: 68ch; }
.post .math { font-family: var(--font-math); font-size: 19px; line-height: 1.6; padding-left: var(--space-6); overflow-x: auto; max-width: 100%; }
.post .m { font-family: var(--font-math); font-size: 1.08em; white-space: nowrap; }
.post .tx { font-style: normal; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .15em; line-height: 1.15; }
.frac > .fn { padding: 0 .2em; border-bottom: 1px solid currentColor; }
.frac > .fd { padding: 0 .2em; }
.post sup, .post sub { font-size: .72em; line-height: 0; }
.post .refs { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.post pre.code { margin: 0; padding: 0; border: 0; background: none; max-height: 520px; overflow: auto; }
.post .figure-cap { margin: 0; }
.post a { overflow-wrap: anywhere; }
.post-links { display: flex; gap: var(--space-4); }

/* narrower */
@media (max-width: 960px) {
  /* frame 7 in flow under the verdict, at the right, across from the wedge */
  .ws-ph { margin: var(--space-10) 0 0 auto; }
}
@media (max-width: 600px) {
  .ws-ph { margin-top: var(--space-6); }
}
@media (max-width: 760px) {
  #gardan { margin-top: calc(var(--space-16) * 1.5); }
  .bm { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  #eqe-oil { margin-top: var(--space-16); }
  .canvas-box.pour { aspect-ratio: 2.4 / 1; }
  .eqe-msg { flex-basis: 100%; }
}

@media print {
  .ctl, .btns, details.working { display: none !important; }
}

/* The Christmas prime. It mirrors Brownian motion above it: words on the left, the card on the right, hanging
 * beside its heading from the heading's cap line. The second of a pair, so it sits closer (112px). */
#christmas-prime { margin-top: 112px; }
#christmas-prime .xmas { margin: 0; }
/* the strip is 11 rows of 14px whatever the word, so the page never jumps */
#christmas-prime .canvas-box.strip { height: 154px; }
#christmas-prime .prime-toy > .ctl { margin-top: var(--space-6); }
#christmas-prime .prime-toy > .strip { margin-top: var(--space-4); }
#christmas-prime .prime-result { margin-top: var(--space-2); min-height: 27px; }
/* the field: Jost capitals on a 120px underline (no line over --rule-w); a hover changes only the underline */
#christmas-prime .prime-in {
  display: block; width: var(--rule-w); max-width: 100%; margin: 0; padding: 4px 0 3px;
  font-family: var(--font-display); font-weight: var(--w-display-small); font-size: 17px; line-height: 24px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
  background: transparent; border: 0; border-bottom: var(--stroke-hair) solid var(--ink); border-radius: 0;
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--hover-t);
}
@media (hover: hover) { #christmas-prime .prime-in:hover { border-bottom-color: var(--miro-blue); } }
/* From 761px up a 12-column grid, like #gardan. The card takes columns 8 to 12 and its top sits on the cap line
 * of the heading: Jost's cap line is .2 of the h2's size below the top of its line box (8px at 40px, 6px at 30px),
 * so this repeats the h2 clamp from site.css. If that clamp changes, change it here too. */
@media (min-width: 761px) {
  #christmas-prime { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6); }
  #christmas-prime::before { display: none; }
  #christmas-prime .sec-head { grid-column: 1 / 7; grid-row: 1; }
  #christmas-prime .xmas { grid-column: 8 / 13; grid-row: 1 / 5; align-self: start; margin-top: calc(clamp(30px, 4.6vw, 40px) * .2); }
  #christmas-prime .prime-words { grid-column: 1 / 7; grid-row: 2; }
  #christmas-prime .prime-toy { grid-column: 1 / 7; grid-row: 3; margin-top: var(--space-10); min-width: 0; }
  #christmas-prime .prime-credit { grid-column: 1 / 7; grid-row: 4; margin-top: var(--space-6); }
}
/* A phone stacks it: heading, card (right-aligned, 300px at most), words, toy, credit */
@media (max-width: 760px) {
  #christmas-prime { margin-top: 96px; }
  #christmas-prime .xmas { width: min(300px, 100%); margin: 0 0 var(--space-10) auto; }
  #christmas-prime .prime-toy { margin-top: var(--space-10); }
  #christmas-prime .prime-credit { margin-top: var(--space-6); }
}
@media print {
  #christmas-prime .prime-toy { display: none !important; }
}

/* An hour on the rail: words only, the page's one entry with no figure. The story at reading size; its postscript
 * smaller and muted, stepped in to column 5 of 12 under it (the 12 columns and 24px gaps of #gardan). */
#rail { margin-top: 136px; }
.rail-main { max-width: 40em; }
.rail-ps { margin-top: var(--space-10); margin-left: calc((100% + var(--space-6)) * 4 / 12); }
#rail p { text-wrap: pretty; } /* no lone word ending a paragraph ("nothing." at 1440) */
@media (max-width: 760px) {
  #rail { margin-top: 104px; }
  .rail-ps { margin-left: 0; }
}

/* What planet is closest: the words on the left, the orrery on open paper to the right, 64px down so it starts below
 * the heading (level with the lead at 1440, with the heading's second line at 1024). The control stays with its
 * drawing, as Brownian's and Sam's do: the line, the button and the live lines sit under the square. The left column
 * runs heading, the two paragraphs, the cite; the last row takes any height the stage has over the words, so nothing
 * on the left is spread apart. On a phone the stage comes straight under the lead, then the paragraphs. Without
 * JavaScript, or without planets-core.js (.no-toy), the stage is gone and the words take the whole column. */
#closest-planet { margin-top: calc(var(--space-16) + var(--space-10)); }
.pl {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); grid-template-rows: auto auto 1fr;
  grid-template-areas: "head stage" "body stage" "cite stage"; column-gap: var(--space-16); align-items: start;
}
.pl-head { grid-area: head; }
.pl-body { grid-area: body; margin-top: var(--space-6); }
.pl-cite { grid-area: cite; margin-top: var(--space-10); }
.pl-head, .pl-body, .pl-cite { min-width: 0; }
.pl-stage { grid-area: stage; min-width: 0; margin-top: var(--space-16); }
.pl-stage .pl-ctl { margin-top: var(--space-6); }
.pl-live { display: grid; gap: var(--space-2); margin-top: var(--space-2); font-variant-numeric: tabular-nums; }
.pl-live p { max-width: 46ch; }
.pl-live p:empty { display: none; }
/* a hold runs for minutes at most: no text selection or callout under a held finger, and no scroll from the button */
#pl-run { -webkit-user-select: none; user-select: none; min-width: 15.5em; }   /* a press now pauses and resumes; the width holds as its words change */
html:not(.js) .pl, .pl.no-toy { display: block; }
html:not(.js) .pl-body, .pl.no-toy .pl-body { margin-top: var(--space-6); }
@media (max-width: 760px) {
  #closest-planet { margin-top: calc(var(--space-16) + var(--space-4)); }
  .pl { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "head" "stage" "body" "cite"; }
  .pl-stage { margin-top: var(--space-6); }
  .pl-stage .pl-ctl { margin-top: var(--space-4); }
  .pl-body { margin-top: var(--space-10); }
}

/* THE HAT: a still, after the Sam and planets pair and before the oil, with a longer pause in front of it.
 * Words first, then the patch left of centre (the orrery above sits right), its credit at its foot like a museum label.
 * Column 1 stays open paper, and column 12 too from 961px up. No script, no hover: it prints as it is shown.
 * The 169 hats are flat fields (--line face up, --ink face down) with --paper joints of .3 units: 1.4px at 1440
 * (a 315px figure), 1.3px at a 300px phone figure. No red. */
#hat { margin-top: calc(var(--space-16) * 2.25); }   /* 144px */
.hat-words { max-width: 40em; }
.hat-words i.m { font-family: var(--font-math); font-size: 1.08em; }
.hat-words sup { font-size: .72em; line-height: 0; }
.hat-row {
  margin-top: var(--space-10); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-6); align-items: end;
}
.hat-fig { grid-column: 2 / 6; margin: 0; }
.hat-svg { display: block; width: 100%; height: auto; }
.hat-svg use { fill: var(--line); stroke: var(--paper); stroke-width: .3; stroke-linejoin: round; }
.hat-svg use.d { fill: var(--ink); }
/* the label's box ends level with the svg's; the patch's foot sits 1.5 units (about 7px) inside it, close to the last baseline */
.hat-credit { grid-column: 7 / 12; align-self: end; margin-top: 0; }
/* between 761 and 960px columns 2 to 5 give only 214px at 768 (joints under 1px, so the hats blur to grain):
 * one more column for the patch, and the label moves out to the edge (274px at 768, 346px at 960) */
@media (min-width: 761px) and (max-width: 960px) {
  .hat-fig { grid-column: 2 / 7; }
  .hat-credit { grid-column: 8 / 13; }
}
@media (max-width: 760px) {
  #hat { margin-top: calc(var(--space-16) * 1.75); }   /* 112px */
  .hat-row { display: block; }
  .hat-fig { width: min(300px, 100%); }
  .hat-credit { margin-top: var(--space-6); }
}
@media print {
  .hat-row { break-inside: avoid; }
}

/* WATTS THE PROBLEM?: the last entry. Tomi's essay, with one power-meter reading drawn for four lights set to the
 * right partway through. One grey shape: no outline, axis, tick or swatch, and nothing red, blue or yellow.
 * As the last section it keeps the footer clear (128px, 64px on a phone); #eqe-oil no longer does. */
#watts { margin-top: 112px; padding-bottom: calc(var(--space-16) * 2); }
#watts sup { font-size: .72em; line-height: 0; }
.watts-words { max-width: 40em; }
.watts-toy { margin-block: var(--space-10); }
/* with JavaScript off the toy is gone and the two halves of the essay meet: one paragraph gap, not none */
.watts-toy + .watts-words { margin-top: var(--space-4); }
.watts-line { max-width: 40em; }
.watts-row { display: grid; margin-top: var(--space-6); }
.watts-fig, .watts-panel { min-width: 0; }
.canvas-box.watts-box { aspect-ratio: 3 / 1; }
/* the window's two ends, under the shape's two edges: Space Mono, and 'nm' stays lower case */
.watts-ends {
  display: flex; justify-content: space-between; max-width: none; margin-top: var(--space-2);
  font-family: var(--font-mono); font-weight: 400; font-size: 12px; line-height: 18px; color: var(--ink-muted);
}
/* the light, then the number under it, both in Archivo like every other live line on this page (sam-result,
 * pl-now, prime-result); Space Mono stays at 12/18 for the window's two ends */
.watts-read { max-width: none; }
.watts-read .w-src { color: var(--ink); }
.watts-read .w-src, .watts-read .num { display: block; }
.watts-read .num { font-variant-numeric: tabular-nums; }
/* the two references keep their numbers, so the superscripts point at something */
.watts-refs { display: grid; gap: var(--space-2); list-style: decimal; padding-left: 1.4em; }
@media (min-width: 961px) {
  .watts-row { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6); }
  .watts-fig { grid-column: 7 / 13; grid-row: 1; }
  /* the panel sits on the drawing's foot, not the caption's: the button's foot is level with the ends line */
  .watts-panel { grid-column: 1 / 5; grid-row: 1; align-self: end; }
  .watts-credit { grid-column: 7 / 13; grid-row: 2; margin-top: var(--space-2); }
  .canvas-box.watts-box { aspect-ratio: 4 / 1; }
}
/* stacked: full width on a phone, but never so wide that daylight's grey block (about .8 of the box) becomes a
 * band across the column. Capped at 30em (510px, 170px tall) it stays near 70,000 px². */
@media (max-width: 960px) {
  .watts-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "fig" "panel" "credit"; }
  .watts-fig { grid-area: fig; max-width: 30em; }
  .watts-panel { grid-area: panel; margin-top: var(--space-4); }
  .watts-credit { grid-area: credit; }
}
@media (max-width: 760px) {
  #watts { margin-top: 88px; padding-bottom: var(--space-16); }
  #eqe-oil { margin-top: calc(var(--space-16) + var(--space-6)); }
}

.g-fix-h { font-family: var(--font-mono); font-size: 13px; line-height: 20px; letter-spacing: .08em; font-weight: 400; color: var(--ink-muted); }
.g-fix { grid-column: 1 / -1; margin-top: 88px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6); align-items: start; }
.g-fix-words { grid-column: 1 / 7; }
.g-fix-a { grid-column: 8 / 10; margin: 0; }
.g-fix-b { grid-column: 10 / 12; margin: 48px 0 0; }
.g-fix-c { grid-column: 7 / 12; margin: var(--space-10) 0 0; }
.g-fix figure .figure-cap { margin-top: var(--space-2); }

#drag-racing, #lunar-eclipse { margin-top: calc(var(--space-16) * 2); }
.drag-a { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-16); align-items: start; }
.drag-media figure { margin: 0; }
.drag-helmet { width: 46%; margin: var(--space-10) 0 0 auto !important; }
.drag-toy { margin-top: var(--space-16); }
.canvas-box.drag-box { aspect-ratio: 2.1 / 1; }
.drag-toy .figure-cap { margin-top: var(--space-4); }
.drag-clip video, .ecl-clip video { background: #000; }

.ecl { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-16); align-items: start; }
.ecl-clip { margin: 0; position: sticky; top: 96px; }
.ecl-setup { width: min(220px, 60%); margin: var(--space-10) 0 0; }

.hat-lsc { margin-top: 88px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6); row-gap: var(--space-16); align-items: start; }
.hat-lsc-words { grid-column: 1 / 7; }
.hat-rank { grid-column: 8 / 13; margin: 0; }
.hat-tilings { grid-column: 1 / -1; margin: 0; }
.hat-tilings .plate { background: #fff; }
.rank { display: block; width: 100%; height: auto; }
.rank .rk-tile { fill: var(--line); }
.rank .rk-bar { fill: var(--ink); }
.rank .rk-tile.hat, .rank .rk-bar.hat { fill: var(--miro-red); }
.rank text { font-family: var(--font-mono); font-size: 13.5px; fill: var(--ink); }
.rank .rk-note { font-size: 11px; fill: var(--ink-muted); }

.em-bb { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin: var(--space-10) 0 0; }
.em-bb .plate { max-width: 340px; }
.em-bb .figure-cap { margin: 0; }

@media (max-width: 1099px) {
  .g-fix-words { grid-column: 1 / 8; }
  .g-fix-a { grid-column: 9 / 11; }
  .g-fix-b { grid-column: 11 / 13; }
  .g-fix-c { grid-column: 8 / 13; }
  .hat-lsc-words { grid-column: 1 / 8; }
  .hat-rank { grid-column: 8 / 13; }
}
@media (max-width: 760px) {
  .g-fix { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-4); margin-top: var(--space-16); }
  .g-fix-words, .g-fix-c { grid-column: 1 / -1; }
  .g-fix-a { grid-column: 1; margin-top: var(--space-6); }
  .g-fix-b { grid-column: 2; margin-top: var(--space-6); }
  .g-fix-c { margin-top: var(--space-6); }
  #drag-racing, #lunar-eclipse { margin-top: calc(var(--space-16) * 1.5); }
  .drag-a, .ecl { grid-template-columns: minmax(0, 1fr); gap: var(--space-10); }
  .drag-helmet { width: 44%; margin: var(--space-6) 0 0 !important; }
  .canvas-box.drag-box { aspect-ratio: 1 / 1.05; }
  .ecl-clip { position: static; order: -1; }
  .hat-lsc { display: block; margin-top: var(--space-16); }
  .hat-rank, .hat-tilings { margin-top: var(--space-10); }
  .em-bb .plate { max-width: 100%; }
}
@media print { .drag-clip, .ecl-clip, .drag-toy { display: none; } }
