/* Machine Spirits prototype theme: a bare stage. See next/SPEC.md, section 5.
   Paper, typefaces, terracotta and the walking line are taken from the Techne pages. */
@font-face { font-family: "DM Sans"; font-weight: 300 600; font-display: swap; src: url("fonts/dm-sans-latin.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-display: swap; src: url("fonts/instrument-serif-latin.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-display: swap; src: url("fonts/instrument-serif-italic-latin.woff2") format("woff2"); }
:root {
  --paper: #f9f9f8;   /* off-white, no warmth (draft 3; draft 2 used the Techne beige #f7f4ef) */
  --ink: #262626;     /* dark grey */
  --grey: #5f5f5f;    /* stage directions, notes, the comparison arm */
  --rule: #dcdcda;
  --accent: #c4654a;  /* Techne terracotta: the one lit thing */
  --line: #6b6b6b;    /* the walking line */
  --dark: #141414;    /* the stage with the house lights down */
  --dark-ink: #e6e6e4;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 7vw, 7rem);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 9; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.5vw, 5.2rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-top: 2.2em; }
h3 { font-size: 1.4rem; margin-top: 1.6em; }
/* A stage direction: italic serif, grey. */
.direction, .billing, .lede, .sub { font: italic 400 1.3rem/1.35 var(--serif); color: var(--grey); margin: 0 0 1rem; }
.lede { max-width: 34ch; margin-bottom: 3rem; }
.billing a { color: inherit; }
.quiet { color: var(--grey); }
.btn { font: 500 .95rem/1 var(--sans); background: none; color: inherit; border: 1px solid currentColor; border-radius: 0; padding: .75em 1.2em; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; background: none; color: inherit; }
.btn-quiet { border-color: transparent; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; padding-inline: 0; }
.btn-quiet:hover { background: none; color: var(--accent); border-color: transparent; }

/* House chrome: a name, five words, and space. */
.house-head { display: flex; flex-wrap: wrap; gap: .4rem 2.5rem; align-items: baseline; justify-content: space-between; padding: 1.6rem var(--gutter); }
.house-name { font: 400 1.35rem/1 var(--serif); text-decoration: none; display: inline-flex; gap: .6rem; align-items: center; }
.house-name::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 .28rem var(--paper), 0 0 0 calc(.28rem + 1px) var(--accent); margin: 0 .35rem 0 .3rem; }
.house-head nav { display: flex; flex-wrap: wrap; gap: .2rem 2rem; }
.house-head nav a { font: 400 .95rem/1.6 var(--sans); text-decoration: none; text-transform: lowercase; }
main { padding: 0 var(--gutter) 7rem; }
.house-foot { margin: 0 var(--gutter); padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: .5rem 3rem; justify-content: space-between; font-size: .875rem; color: var(--grey); }
.house-foot p { margin: 0; }
.house-foot a + a { margin-left: 1.5rem; }
.mode-switch { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0 1.5rem; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.mode-switch:hover { color: var(--accent); }

/* Home: an empty stage. A direction at the top, nothing in the middle, one line across the floor,
   one sentence under it, and the ways in. */
/* (draft 2 hid the nav on home; draft 3 shows it, since home no longer lists the ways in) */
.bare { min-height: calc(100vh - 4.6rem); display: grid; grid-template-rows: auto 1fr auto auto auto; padding: 5vh 0 2.5rem; }
.bare .direction { grid-row: 1; margin: 0; font-size: 1.15rem; }
.floor { grid-row: 3; margin: 0 calc(-1 * var(--gutter)); height: 7rem; }
.floor svg { width: 100%; height: 100%; display: block; overflow: visible; }
.floor path { fill: none; stroke: var(--line); stroke-width: 1; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.bare h1 { grid-row: 4; font-size: clamp(calc(3.4rem * var(--headline, 1)), calc(11.5vw * var(--headline, 1)), calc(12rem * var(--headline, 1))); line-height: .88; letter-spacing: -.03em; margin: 2rem 0 0 -.04em; max-width: 22ch; }
.bare.has-text { min-height: 0; padding-top: 9vh; }
.bare.has-text h1 { line-height: .98; letter-spacing: -.02em; }
.doors { grid-row: 5; display: flex; flex-wrap: wrap; gap: .4rem 3.5rem; margin-top: 4.5rem; }
.doors a { font: 400 1.05rem/1.6 var(--sans); text-transform: lowercase; text-decoration: none; color: var(--grey); }
.doors a:hover, .doors a:focus-visible { color: var(--ink); }
.home-prose { margin: 4rem 0 0 clamp(0rem, 12vw, 12rem); max-width: 38rem; font-size: 1.15rem; }

/* Reading pages: no sheet, no box. A wide left margin and one rule. */
.sheet { max-width: 62rem; padding-top: 9vh; min-width: 0; }
.sheet-head { border-bottom: 1px solid var(--ink); padding-bottom: 2.2rem; margin-bottom: 3rem; }
.sheet-head h1 { max-width: 16ch; }
.sheet .credit { font-size: .875rem; color: var(--grey); margin: 1.2rem 0 0; }
.sheet > .prose, .sheet > nav { margin-left: clamp(0rem, 12vw, 12rem); }
.prose { max-width: 38rem; overflow-wrap: break-word; }
.prose img { max-width: 100%; height: auto; }
.prose pre, .prose table { display: block; max-width: 100%; overflow-x: auto; }
.prose a { text-decoration-color: var(--accent); }
.prose blockquote { margin: 1.5em 0; padding-left: 1.5em; border-left: 1px solid var(--ink); font: italic 400 1.3rem/1.4 var(--serif); }
.prose strong { font-weight: 500; }

/* Course and lecture */
.programme-cols { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(0, 38rem); gap: 4rem; }
.programme-cols h2 { margin-top: 0; font: 500 1.05rem var(--sans); }
.programme-cols .prose h2 { font: 400 1.9rem/1.1 var(--serif); margin-top: 1.6em; }
.nights { list-style: none; padding: 0; margin: 0; }
.nights a { display: grid; grid-template-columns: 4.5rem 1fr; gap: .5rem; padding: .9rem 0; border-top: 1px solid var(--rule); text-decoration: none; align-items: baseline; }
.night-n { font-size: .875rem; color: var(--grey); }
.night-t { font: 400 1.3rem/1.2 var(--serif); }
.script-tools { display: flex; gap: 1.5rem; align-items: center; font-size: .875rem; color: var(--grey); margin: 2rem 0 0; }
.scene { display: grid; grid-template-columns: clamp(0rem, 12vw, 12rem) minmax(0, 38rem); padding: 2.5rem 0; border-top: 1px solid var(--rule); min-width: 0; }
.scene-n { font: italic 400 1.05rem var(--serif); color: var(--grey); text-decoration: none; }
.scene h2, .scene h4 { margin-top: 0; }
.scene h4 { font: 500 1.05rem var(--sans); }
.speaker-notes { color: var(--grey); font: italic 400 1.15rem/1.45 var(--serif); margin: 1.5rem 0; padding-left: 1.5rem; border-left: 1px solid var(--accent); }
.speaker-notes .note-kind { display: none; }
.turn { display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--ink); margin-top: 1rem; padding-top: 1.2rem; font-size: .95rem; }
body.slides .house-head, body.slides .house-foot, body.slides .turn, body.slides .billing, body.slides .sheet-head h1, body.slides .speaker-notes { display: none; }
body.slides main { padding: 0; }
body.slides .sheet { max-width: none; padding: 0; }
body.slides .sheet-head { position: fixed; right: 1.5rem; top: 1rem; border: 0; margin: 0; padding: 0; z-index: 5; }
body.slides .script-tools { margin: 0; }
body.slides .scene { min-height: 100vh; grid-template-columns: 1fr; align-content: center; gap: 1.5rem; padding: 8vh var(--gutter); font-size: clamp(1.15rem, 2vw, 1.7rem); border-top: 0; border-bottom: 1px solid var(--ink); }
body.slides .scene h2 { font-size: clamp(2.4rem, 6vw, 5rem); }
body.slides .scene .prose { max-width: 58rem; }

/* Indexes: courses, papers */
.season, .library, .promptbook, .lab { padding-top: 9vh; }
.productions, .spines { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ink); }
.library h2 { font: 500 1.05rem var(--sans); margin: 3.5rem 0 1rem; }
.productions a, .spines a { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: .2rem 3rem; padding: 1.6rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; align-items: baseline; }
.productions .billing, .spine-status { font: italic 400 1.1rem var(--serif); color: var(--grey); margin: 0; grid-row: span 3; }
.prod-title, .spine-title { font: 400 clamp(1.6rem, 3.2vw, 2.6rem)/1.08 var(--serif); max-width: 28ch; }
a:hover .prod-title, a:hover .spine-title { color: var(--accent); }
.prod-sub, .prod-n, .spine-authors { grid-column: 2; font-size: .95rem; color: var(--grey); }
.titlepage .sheet-head h1 { max-width: 22ch; font-size: clamp(2.2rem, 4.6vw, 3.8rem); }

/* Dark pages: house lights down. Which pages are dark is set in content/site.yaml. */
html.dark { --paper: var(--dark); --ink: var(--dark-ink); --rule: #303030; --grey: #a3a3a3; --line: var(--dark-ink); }
/* The lab: one pool of light, where the current line is spoken. */
.lab .prose { max-width: none; }
.lab .prose > h2, .lab .prose > p { max-width: 38rem; margin-left: clamp(0rem, 12vw, 12rem); }
.stage { margin: 2rem calc(-1 * var(--gutter)) 5rem; padding: 3rem var(--gutter); border-block: 1px solid var(--rule); position: relative; z-index: 0; overflow: hidden; }
.stage-title { font: 400 2rem/1.1 var(--serif); margin: 0; }
.stage-meta { font: italic 400 1.15rem/1.4 var(--serif); color: var(--grey); margin: .4rem 0 3.5rem; max-width: 44ch; }
.stage-meta:has(+ .handout) { margin-bottom: 1.5rem; }
.handout { margin: 0 0 3.5rem; max-width: 44rem; font-size: .95rem; line-height: 1.55; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: .7rem 0; }
.handout summary { cursor: pointer; color: var(--grey); font-size: .85rem; }
.handout[open] summary { margin-bottom: .8rem; }
.handout p, .handout ul { margin: 0 0 .7rem; }
.handout ul { padding-left: 1.1rem; }
.handout table { border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; margin: .4rem 0 .6rem; }
.handout th { text-align: left; font-weight: 500; color: var(--grey); padding: .25rem 1.4rem .25rem 0; border-bottom: 1px solid var(--ink); }
.handout td { padding: .25rem 1.4rem .25rem 0; border-bottom: 1px solid var(--rule); }
.beats { list-style: none; padding: 0; margin: 0; display: grid; gap: 2.6rem; }
.beat { display: none; grid-template-columns: clamp(0rem, 12vw, 12rem) minmax(0, 34rem) minmax(0, 18rem); gap: 0 3rem; align-items: start; opacity: .28; transition: opacity .6s; position: relative; }
.beat.shown { display: grid; }
.beat.current, .stage.all .beat { opacity: 1; }
.beat.current::before { content: ""; position: absolute; left: 0; right: 30%; top: -6rem; bottom: -6rem; background: radial-gradient(closest-side, rgba(230, 230, 228, .1), transparent); pointer-events: none; z-index: -1; }
.stage.all .beat.current::before { display: none; }
.line { display: contents; }
.who { font: 500 .8rem/2.6 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--grey); }
.beat-character .who { color: var(--accent); }
.line p { font: 400 clamp(1.4rem, 2.3vw, 1.9rem)/1.3 var(--serif); margin: 0; }
.note { visibility: hidden; font: italic 400 1.1rem/1.4 var(--serif); color: var(--grey); border-left: 1px solid var(--accent); padding-left: 1.2rem; }
.stage.notes-on .note { visibility: visible; }
.note p { margin: .15rem 0 0; }
.note-kind { font: 500 .75rem/1.4 var(--sans); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.stage-controls { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; margin: 4rem 0 0 calc(clamp(0rem, 12vw, 12rem) + 3rem); }
.notes-toggle, .consent { font-size: .95rem; display: flex; gap: .6rem; align-items: center; }
input[type=checkbox] { accent-color: var(--accent); width: 1rem; height: 1rem; }

/* Research: the switches as a cue sheet. A filled mark is a switch with a recommended value. */
.promptbook .prose { max-width: none; }
.promptbook .prose > p, .promptbook .prose > h2 { max-width: 38rem; }
.board-note { font-size: .875rem; color: var(--grey); max-width: 60ch; margin: 0 0 2.5rem; }
.bank { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0 3rem; border-top: 1px solid var(--ink); padding: 1.4rem 0 2.2rem; align-items: start; }
.bank h3 { margin: 0; font-size: 1.5rem; grid-column: 1; }
.bank-criterion { grid-column: 1; font: italic 400 1.05rem var(--serif); color: var(--grey); margin: .3rem 0 0; }
.bank-switches { grid-column: 2; grid-row: 1 / span 3; min-width: 0; }
.switch { border-bottom: 1px solid var(--rule); }
.switch summary { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: center; padding: .8rem 0; cursor: pointer; list-style: none; }
.switch summary::-webkit-details-marker { display: none; }
.lever { width: .7rem; height: .7rem; border-radius: 50%; border: 1px solid var(--grey); }
.lever span { display: none; }
.switch.is-on .lever { background: var(--accent); border-color: var(--accent); }
.switch-id { font: 500 .95rem var(--sans); overflow-wrap: anywhere; }
.switch-set { font-size: .95rem; color: var(--grey); overflow-wrap: anywhere; }
.switch.is-on .switch-set { color: var(--ink); }
.switch summary:hover .switch-id { color: var(--accent); }
.switch-body { padding: .5rem 0 2rem 2.6rem; }
.switch-q { font: italic 400 1.5rem/1.3 var(--serif); margin: 0 0 1.5rem; max-width: 40ch; }
.value { border-top: 1px solid var(--rule); padding: 1.1rem 0; }
.value h4 { font: 500 1rem var(--sans); margin: 0 0 .3rem; }
.value-status { font: italic 400 1.05rem var(--serif); color: var(--grey); margin-left: .6rem; }
.value-recommended .value-status { color: var(--accent); }
.value p { margin: .3rem 0; max-width: 60ch; }
.advice { color: var(--grey); }
.evidence { margin: 1.4rem 0 0; padding-left: 1.5rem; border-left: 1px solid var(--rule); max-width: 40rem; }
.evidence-head { font-size: .875rem; color: var(--grey); }
.pair { margin: 1rem 0; }
.pair figcaption { font-size: .875rem; font-weight: 500; margin-bottom: .3rem; }
.pair-row { display: grid; grid-template-columns: 5.5rem 1fr 2rem; gap: .8rem; align-items: center; font-size: .8rem; color: var(--grey); }
.pair-track { height: 1px; background: var(--rule); position: relative; }
.pair-bar { position: absolute; left: 0; top: -1px; height: 3px; min-width: 3px; }
.pair-bar.is-this { background: var(--accent); }
.pair-bar.is-against { background: var(--grey); }
.pair-n { font-weight: 500; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.gates { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; font-size: .8rem; margin: .6rem 0; }
.gate::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; border: 1px solid var(--grey); margin-right: .45rem; }
.gate-pass::before { background: var(--ink); border-color: var(--ink); }
.gate-fail { color: var(--accent); }
.gate-fail::before { border-color: var(--accent); }
.notices { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--ink); }
.notices a { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: .3rem 3rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; align-items: baseline; }
.notice-date { font: italic 400 1.05rem var(--serif); color: var(--grey); grid-row: span 2; }
.notice-title { font: 400 1.7rem/1.1 var(--serif); }
.notice-sum { grid-column: 2; font-size: .95rem; color: var(--grey); max-width: 60ch; }
a:hover .notice-title { color: var(--accent); }

@media (max-width: 760px) {
  .programme-cols, .scene, .bank, .productions a, .spines a, .notices a { grid-template-columns: 1fr; }
  .bank-switches, .prod-sub, .prod-n, .spine-authors, .notice-sum { grid-column: 1; grid-row: auto; }
  .bank-switches { margin-top: 1rem; }
  .beat { grid-template-columns: 1fr; gap: .2rem; }
  .line { display: block; }
  .note { margin-top: .8rem; }
  .stage-controls { margin-left: 0; }
  .home-prose { margin-left: 0; }
  .switch summary { grid-template-columns: 1.6rem 1fr; }
  .switch-set { grid-column: 2; }
}
@media (prefers-reduced-motion: no-preference) {
  .floor path { stroke-dasharray: 2; stroke-dashoffset: 2; animation: walk 6s cubic-bezier(.4, 0, .2, 1) .3s forwards; }
  @keyframes walk { to { stroke-dashoffset: 0; } }
  .beat.shown { animation: enter .9s ease-out; }
  @keyframes enter { from { opacity: 0; } }
}

/* ---- Blocks added in step 5: comparisons, claims, criteria, sequence, figure, embed ---- */
.pairs { max-width: 40rem; margin: 1.5rem 0 2.5rem; }
.pair-named .pair-row { grid-template-columns: minmax(6rem, 11rem) 1fr 4.5rem; }
.pair-criterion { font-weight: 400; color: var(--grey); margin-left: .5rem; }
.pair-test { font-size: .875rem; color: var(--grey); margin: .5rem 0 0; }
.pair-from { font-size: .875rem; }
.not-yet { color: var(--grey); font-style: italic; }
.table-wrap { overflow-x: auto; margin: 1.5rem 0 2.5rem; }
.claims { border-collapse: collapse; width: 100%; min-width: 44rem; font-size: .9rem; line-height: 1.45; }
.claims th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--grey); padding: .5rem .9rem .5rem 0; border-bottom: 1px solid var(--ink); }
.claims td { vertical-align: top; padding: .8rem .9rem .8rem 0; border-bottom: 1px solid var(--rule); }
.claims td:first-child { font: 400 1.15rem/1.25 var(--serif); width: 30%; }
.claims-prs { color: var(--grey); white-space: nowrap; font-variant-numeric: tabular-nums; }
.criteria { margin: 1.5rem 0 2.5rem; }
.criteria-head { font-size: .95rem; color: var(--grey); max-width: 60ch; }
.crit-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; border-top: 1px solid var(--ink); padding-top: 1rem; }
.crit-col h4 { font: 400 1.5rem/1.1 var(--serif); margin: 0 0 .8rem; }
.crit-col ul { list-style: none; margin: 0; padding: 0; }
.crit-col li { display: grid; grid-template-columns: 1fr; padding: .45rem 0; border-bottom: 1px solid var(--rule); font-size: .85rem; color: var(--grey); }
.crit-col li.is-set { color: var(--ink); }
.crit-col li.is-set .crit-value { color: var(--accent); font-weight: 500; }
.crit-switch { overflow-wrap: anywhere; }
.sequence { margin: 2rem 0 3rem; }
.seq-parts, .seq-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--parts), minmax(0, 1fr)); column-gap: 1rem; }
.seq-parts li { font: 400 1.3rem/1.2 var(--serif); padding-bottom: .6rem; border-bottom: 1px solid var(--ink); }
.seq-rows { row-gap: 1.1rem; padding-top: 1.2rem; }
.seq-msg { display: grid; gap: .25rem; padding-top: .5rem; border-top: 2px solid var(--grey); position: relative; font-size: .9rem; line-height: 1.4; }
.seq-msg::after { content: ""; position: absolute; top: -6px; border: 5px solid transparent; }
.seq-msg.to-right::after { right: 0; border-left-color: var(--grey); border-right-width: 0; }
.seq-msg.to-left::after { left: 0; border-right-color: var(--grey); border-left-width: 0; }
.seq-label { font-weight: 500; font-size: .8rem; color: var(--accent); }
.seq-text { color: var(--ink); }
.paper-figure { margin: 2rem 0 3rem; }
.paper-figure svg { display: block; width: 100%; height: auto; max-width: 52rem; }
.paper-figure figcaption, .embed figcaption { font-size: .9rem; color: var(--grey); margin-top: .8rem; max-width: 60ch; }
.figure-source { display: block; }
.embed { margin: 2rem 0 3rem; }
.embed iframe { display: block; width: 100%; border: 1px solid var(--rule); background: #fff; }
@media (max-width: 720px) {
  .crit-cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .seq-parts { display: none; }
  .seq-rows { grid-template-columns: 1fr; }
  .seq-msg { grid-column: 1 !important; }
  .seq-msg::after { display: none; }
}

/* A line of several paragraphs, and several notes beside one line */
.words p + p { margin-top: .6em; }
.notes { display: grid; gap: 1.1rem; }

/* ==== Draft 4 (12 November): the grid. The owner asked for something austere and precise, with fine detail,
   and less like a blog. Every page sits on one column grid (12 columns, 8 on a tablet, 4 on a phone).
   Three tracks are named: the margin (labels, dates, numbers), the text column, and the side.
   Neutral off-white and dark grey; terracotta is still the one lit thing. ==== */
:root {
  --cols: 12; --gap: clamp(.9rem, 1.5vw, 1.6rem); --gutter: clamp(1rem, 4vw, 4rem);
  --m: 1 / 4; --t: 4 / 10; --s: 10 / -1; --w: 4 / -1; --all: 1 / -1;
  /* More named lines, so that a finer grid (the Grid tweaks, below) can restate the layout without restating each rule:
     the menu, the folio's three parts, the home headline, the Tweaks button, and the margin track's width in columns. */
  --nav: 7 / -2; --btn: -2 / -1; --folio-n: 1 / 2; --folio-part: 2 / 4; --folio-src: 7 / -1; --slug: 2 / 7; --hero: 1 / 11; --mspan: 3;
  --major: 1; /* columns of this grid in one column of the 12 */
  --sep: var(--gap); /* the space between one track and the next, where it is not a column gap */
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --hair: color-mix(in srgb, var(--ink) 7%, transparent);
  --heavy: 2px;
  --period: calc((100% + var(--gap)) / var(--cols)); /* one column and one gap, for drawing on the grid */
}
@media (max-width: 1000px) { :root { --cols: 8; --m: 1 / 3; --t: 3 / -1; --s: 3 / -1; --w: 3 / -1; } }
@media (max-width: 620px) { :root { --cols: 4; --m: 1 / -1; --t: 1 / -1; --s: 1 / -1; --w: 1 / -1; } }

/* The grid itself, behind everything: a hairline at the start of each column and at the right edge. */
body { position: relative; }
html:not(.grid-off) body::before { content: ""; position: fixed; inset: 0 var(--gutter); pointer-events: none; z-index: -1;
  background: linear-gradient(to right, var(--hair) 0 1px, transparent 1px) 0 0 / var(--period) 100% repeat-x; border-right: 1px solid var(--hair); }
html.grid-strong { --hair: color-mix(in srgb, var(--accent) 35%, transparent); }

.mono, .folio, .colophon, .billing, .spine-status, .notice-date, .night-n, .scene-n, .prod-n, .who, .note-kind, .readings li::before, .hidden-flag, .board-note, .evidence-head, .pair-row, .gates, .claims th, .claims-prs {
  font-family: var(--mono); font-style: normal; font-size: .72rem; line-height: 1.5; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}

/* Masthead: the name in the margin track; the menu items each start on a column. */
.house-head { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gap); align-items: baseline; padding: 1.15rem var(--gutter) 1rem; border-bottom: 1px solid var(--ink); }
.house-name { grid-column: var(--m); font-size: 1.3rem; white-space: nowrap; }
.house-name::before { width: .55rem; height: .55rem; box-shadow: none; margin: 0 .15rem 0 0; }
.house-head nav { grid-column: 7 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: var(--gap); }
.house-head nav a { font-size: .9rem; color: var(--grey); justify-self: start; padding-bottom: .1rem; border-bottom: 1px solid transparent; }
.house-head nav a:hover, .house-head nav a[aria-current] { color: var(--ink); }
.house-head nav a[aria-current] { border-bottom-color: var(--accent); }
@media (max-width: 1000px) { .house-head nav { grid-column: 3 / -1; } }
@media (max-width: 620px) { .house-head nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .1rem 1.1rem; margin-top: .5rem; } }

/* The folio: part number, part, and the source file, as on the head of a printed page. */
.folio { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gap); padding: .45rem var(--gutter); color: var(--grey); border-bottom: 1px solid var(--hair); }
.folio-n { grid-column: var(--folio-n); color: var(--accent); }
.folio-part { grid-column: var(--folio-part); }
.folio-src { grid-column: var(--folio-src); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1000px) { .folio-part { grid-column: 2 / 3; } .folio-src { grid-column: 3 / -1; } }
@media (max-width: 620px) { .folio-part { grid-column: 2 / 3; } .folio-src { display: none; } }
.review-bar { margin: 0; padding: .45rem var(--gutter); font: .72rem/1.5 var(--mono); border-bottom: 1px solid var(--hair); color: var(--grey); }
.review-bar strong { color: var(--accent); font-weight: 500; }
.hidden-flag { display: inline-block; vertical-align: .45em; margin-left: .6rem; font-size: .62rem; color: var(--accent); border: 1px solid currentColor; padding: .15em .45em; }
.stage-gates { margin: 0 0 1.5rem; padding: .6rem .8rem; font: .72rem/1.55 var(--mono); color: var(--grey); border: 1px solid var(--hair); }
.stage-gates strong { color: var(--accent); font-weight: 500; }
.stage-gates ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* Every page's main block is a subgrid of the page grid. */
main { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gap); padding: 0 var(--gutter) 8rem; }
main > *, .sheet-head, .sheet > .prose, .programme-cols, .scene, .home-prose, .home-list, .library > ul, .library > ul > li, .library > ul > li > a, .season > ul, .season > ul > li, .season > ul > li > a,
.promptbook > header, .promptbook > .prose, .lab-head, .notices, .notices li, .notices a, .bank {
  grid-column: var(--all); display: grid; grid-template-columns: subgrid; align-content: start; min-width: 0; }
main > * > *, .promptbook > .prose > * { grid-column: var(--t); min-width: 0; }

/* Type: one large title per page, set across the text and side tracks; everything else smaller than a blog would. */
h1 { font-size: clamp(2.8rem, 7vw, 6.6rem); line-height: .92; letter-spacing: -.03em; margin: 0; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); letter-spacing: -.01em; }
.lede, .sub { color: var(--ink); font: italic 400 clamp(1.2rem, 1.8vw, 1.55rem)/1.3 var(--serif); max-width: 32ch; margin: 0; }
.billing, .direction { color: var(--grey); margin: 0; }

/* Page heads: label in the margin, title from the text track, a heavy rule with a tick at every column. */
.sheet, .library, .season, .promptbook, .lab { padding-top: 0; max-width: none; }
.sheet-head, .library > h1, .season > h1, .promptbook > header, .lab-head { position: relative; padding: 9vh 0 1.6rem; margin: 0 0 2.6rem; border-bottom: var(--heavy) solid var(--ink); }
.sheet-head::after, .library > h1::after, .season > h1::after, .promptbook > header::after, .lab-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(-1 * var(--heavy) - 6px); height: 6px;
  background: linear-gradient(to right, var(--ink) 0 1px, transparent 1px) 0 0 / var(--period) 100% repeat-x; border-right: 1px solid var(--ink); }
.library > h1, .season > h1 { grid-column: var(--all); padding-left: calc((100% + var(--gap)) * var(--mspan) / var(--cols)); }
@media (max-width: 1000px) { .library > h1, .season > h1 { padding-left: calc((100% + var(--gap)) * 2 / var(--cols)); } }
@media (max-width: 620px) { .library > h1, .season > h1 { padding-left: 0; } }
.sheet-head > *, .promptbook > header > *, .lab-head > * { grid-column: var(--w); }
.sheet-head > .billing { grid-column: var(--m); grid-row: 1; align-self: end; padding-bottom: .5rem; }
.sheet-head h1 { max-width: 18ch; }
.sheet-head .sub { margin-top: 1.2rem; }
.sheet .credit { font: .72rem/1.5 var(--mono); color: var(--grey); margin: 1rem 0 0; }
.script-tools { margin: 1.2rem 0 0; }
.library > .lede, .season > .lede, .lab-head .lede, .promptbook > header .lede { margin: 0 0 3rem; }
.lab-head .lede, .promptbook > header .lede { margin: 1rem 0 0; }

/* Prose: numbered sections, the number hanging in the margin. */
.sheet > .prose { grid-column: var(--t); display: block; counter-reset: sec; }
.prose h2 { counter-increment: sec; position: relative; }
.prose h2::before { content: counter(sec, decimal-leading-zero); position: absolute; right: calc(100% + var(--sep)); top: .55em; font: .72rem/1 var(--mono); color: var(--grey); letter-spacing: .02em; }
@media (max-width: 620px) { .prose h2::before { position: static; display: block; margin-bottom: .6rem; } }
.prose { font-size: 1.05rem; }

/* Lists of papers, posts, courses and results: rows on the grid, label in the margin, a hairline between. */
.library > h2, .season > h2 { grid-column: var(--all); font: .72rem/1.5 var(--mono); letter-spacing: .02em; color: var(--grey); margin: 3.2rem 0 0; padding-bottom: .5rem; border-bottom: 1px solid var(--ink); }
.productions, .spines, .notices { list-style: none; margin: 0; padding: 0; border-top: 0; }
.library > h1 + .spines, .library > .lede + .spines, .library > .kinds + .spines { border-top: 1px solid var(--ink); }
.productions a, .spines a, .notices a { padding: 1.3rem 0 1.4rem; border-bottom: 1px solid var(--rule); row-gap: .35rem; transition: background-color .2s; }
.productions a:hover, .spines a:hover, .notices a:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); padding-left: 0; }
.spine-status, .productions .billing, .notice-date { grid-column: var(--m); grid-row: 1 / span 3; color: var(--ink); margin: 0; padding-top: .45rem; }
.spine-status::before, .notice-date::before { content: none; }
.spine-title, .prod-title, .notice-title { grid-column: var(--t); font: 400 clamp(1.45rem, 2.3vw, 2rem)/1.08 var(--serif); letter-spacing: -.01em; max-width: none; }
.spine-authors, .prod-sub, .notice-sum { grid-column: var(--t); font-size: .92rem; color: var(--grey); }
.prod-n { grid-column: var(--s); grid-row: 1; justify-self: end; color: var(--grey); padding-top: .45rem; }
@media (max-width: 1000px) { .spine-title, .prod-title, .notice-title, .spine-authors, .prod-sub, .notice-sum { grid-column: 3 / -1; } .prod-n { grid-column: 3 / -1; grid-row: auto; justify-self: start; padding: 0; } }
@media (max-width: 620px) { .spine-status, .productions .billing, .notice-date { grid-row: auto; padding: 0; } .spine-title, .prod-title, .notice-title, .spine-authors, .prod-sub, .notice-sum, .prod-n { grid-column: 1 / -1; } }

/* Writing: the kinds as a row of mono labels on the margin line. */
/* The Lab's transcripts: filters, then one list per world. */
.lesson-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem 1.6rem; margin: 0 0 1.4rem; }
.lesson-filters[hidden] { display: none; }
.lesson-filters .filter { display: grid; gap: .25rem; font: .72rem/1.5 var(--mono); letter-spacing: .02em; color: var(--grey); }
.lesson-filters select { font: inherit; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--rule); padding: .2rem 1.4rem .2rem 0; max-width: 100%; }
.lesson-filters select:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.lesson-filters .filter-count { margin: 0 0 0 auto; font: .72rem/1.5 var(--mono); color: var(--grey); }
.lab > .lesson-filters { grid-column: var(--w); margin-top: 3rem; }
.lab > .lesson-index, .lesson-group, .lesson-group > ul, .lesson-group > ul > li, .lesson-group > ul > li > a { grid-column: var(--all); display: grid; grid-template-columns: subgrid; align-content: start; min-width: 0; }
.lesson-group > .list-label { grid-column: var(--all); }
.lab .lesson-index .transcripts { margin-top: 0; }
.lesson-group[hidden] { display: none; }
.lesson-group .list-label { display: flex; justify-content: space-between; }
.transcripts li[hidden] { display: none; }
.beat-reply { margin-left: .6em; color: var(--grey); letter-spacing: .04em; text-transform: none; font-weight: 400; }
@media (max-width: 620px) { .lesson-filters { display: grid; grid-template-columns: 1fr; } .lesson-filters .filter-count { margin: 0; } }
.kinds { grid-column: var(--all); display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; margin: 0 0 .8rem; }
.kinds button { font: .72rem/1.5 var(--mono); letter-spacing: .02em; background: none; border: 0; padding: 0 0 .15rem; color: var(--grey); border-bottom: 1px solid transparent; cursor: pointer; }
.kinds button:hover { color: var(--ink); }
.kinds button[aria-pressed=true] { color: var(--ink); border-bottom-color: var(--accent); }
.writing-list li[hidden] { display: none; }

/* Home: the walking line across the whole page, ending in the light; the headline on the grid; then two lists. */
.bare { grid-template-rows: auto auto auto; min-height: 0; padding: 8vh 0 0; }
.bare > .direction { grid-column: var(--m); }
.floor { grid-column: var(--all); position: relative; margin: 0 calc(-1 * var(--gutter)); height: 6.5rem; }
.floor path { stroke-width: 1.25; }
.floor::after { content: ""; position: absolute; right: var(--gutter); top: 70%; width: .9rem; height: .9rem; margin: -.45rem -.45rem 0 0; border-radius: 50%; background: var(--accent); opacity: 0; animation: light .8s ease-out 6s forwards; }
@keyframes light { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .floor::after { animation: none; opacity: 1; } }
.bare h1, .bare.has-text h1 { grid-column: var(--hero); font-size: clamp(calc(3rem * var(--headline, 1)), calc(10vw * var(--headline, 1)), calc(11rem * var(--headline, 1))); line-height: .9; letter-spacing: -.035em; margin: 3rem 0 0; max-width: none; }
@media (max-width: 620px) { .bare h1, .bare.has-text h1 { grid-column: 1 / -1; } }
.home-prose { margin: 5rem 0 0; }
.home-prose > .prose { grid-column: var(--t); font-size: 1.15rem; }
.home-prose .prose p:first-child { font: 400 clamp(1.35rem, 2vw, 1.75rem)/1.32 var(--serif); }
.home-list { margin: 5.5rem 0 0; }
.home-list > h2 { grid-column: var(--all); font: .72rem/1.5 var(--mono); letter-spacing: .02em; margin: 0; padding-bottom: .5rem; border-bottom: 1px solid var(--ink); }
.home-list > h2 a { text-decoration: none; color: var(--grey); }
.home-list > h2 a:hover { color: var(--accent); }
.home-list > h2 a::after { content: "  \2192"; }
.home-list > ul, .home-list > ul > li, .home-list > ul > li > a { grid-column: var(--all); display: grid; grid-template-columns: subgrid; list-style: none; margin: 0; padding: 0; }
.home-list > ul > li > a { padding: 1.3rem 0 1.4rem; text-decoration: none; }

/* Course page: lectures in the margin, the course text beside them. Lecture: scene number in the margin. */
.programme-cols { gap: 0 var(--gap); }
.programme-cols > section { grid-column: var(--m); }
.programme-cols > .prose { grid-column: var(--t); }
@media (max-width: 1000px) { .programme-cols > section, .programme-cols > .prose { grid-column: 1 / -1; } .programme-cols > .prose { margin-top: 2.5rem; } }
.programme-cols h2 { font: .72rem/1.5 var(--mono); color: var(--grey); margin: 0 0 .5rem; letter-spacing: .02em; }
.programme-cols .prose h2 { font: 400 clamp(1.5rem, 2.3vw, 2rem)/1.1 var(--serif); color: var(--ink); margin: 2em 0 .5em; }
.programme-cols .prose > h2:first-child { margin-top: 0; }
.nights { border-top: 1px solid var(--ink); }
.nights a { grid-template-columns: 3.6rem 1fr; padding: .7rem 0; }
.night-t { font-size: 1.1rem; }
.scene { padding: 2.2rem 0; border-top: 1px solid var(--rule); }
.scene > .scene-n { grid-column: var(--m); color: var(--grey); }
.scene > .prose { grid-column: var(--t); }
.turn { grid-column: var(--t); }
.readings { border-top: 1px solid var(--ink); list-style: none; padding: 0; margin: 0 0 3rem; counter-reset: reading; }
.readings li { counter-increment: reading; display: grid; grid-template-columns: 2.4rem 1fr; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.readings li::before { content: counter(reading, decimal-leading-zero); grid-row: span 3; color: var(--grey); padding-top: .3rem; }
.reading-title { font: 400 1.25rem/1.2 var(--serif); }
.reading-by { font-size: .92rem; }
.reading-note { font-size: .85rem; color: var(--grey); }
.prose h2 + .readings { margin-top: .6rem; }

/* Research: the cue sheet on the grid. A bank's name in the margin, its switches across the rest. */
.promptbook > .prose > .switchboard, .promptbook > .prose > .notices, .promptbook > .prose > .table-wrap, .promptbook > .prose > .criteria { grid-column: var(--all); }
.switchboard { display: grid; grid-template-columns: subgrid; }
.switchboard > .board-note { grid-column: var(--t); margin: 0 0 2rem; }
.bank { border-top: var(--heavy) solid var(--ink); padding: 1.2rem 0 2rem; gap: 0 var(--gap); }
.bank > h3 { grid-column: var(--m); font-size: clamp(1.3rem, 1.8vw, 1.6rem); line-height: 1.08; margin: 0; }
.bank > .bank-criterion { grid-column: var(--m); font: .72rem/1.5 var(--mono); color: var(--grey); }
.bank > .bank-switches { grid-column: var(--w); grid-row: 1 / span 3; }
.switch summary { grid-template-columns: 1.4rem minmax(0, 1.2fr) minmax(0, 1fr); padding: .75rem 0; }
.switch-id { font: 400 1.15rem/1.2 var(--serif); }
.switch-set { font: .78rem/1.4 var(--mono); }
.lever { width: .6rem; height: .6rem; border-width: 1px; }
.notices { margin-top: 1rem; border-top: 1px solid var(--ink); }
.notices a { padding: 1.2rem 0; }
.criteria .crit-cols { border-top-width: var(--heavy); }
@media (max-width: 620px) { .bank > .bank-switches { grid-row: auto; margin-top: 1rem; } }

/* The lab keeps its own stage; its head sits on the grid like the other pages. */
.lab > .prose { grid-column: var(--all); display: block; }
.lab .prose > h2, .lab .prose > p { margin-left: calc((100% + var(--gap)) * var(--mspan) / var(--cols)); }
@media (max-width: 620px) { .lab .prose > h2, .lab .prose > p { margin-left: 0; } }
.stage { margin-inline: calc(-1 * var(--gutter)); }
.stage-title { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; }
.stage-meta { font: 400 .92rem/1.55 var(--sans); color: var(--grey); max-width: 62ch; margin-top: 1rem; }
.line p { font-size: clamp(1.4rem, 2.3vw, 2rem); }

/* Footer: the colophon in the margin and text tracks, links on the right. */
.house-foot { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gap); align-items: baseline; margin: 0; padding: 1.2rem var(--gutter) 2.4rem; border-top: var(--heavy) solid var(--ink); font-size: .85rem; color: var(--grey); }
.foot-name { grid-column: var(--m); font: 400 1.1rem var(--serif); color: var(--ink); }
.colophon { grid-column: var(--t); display: flex; flex-wrap: wrap; gap: .2rem 2.4rem; margin: 0; }
.colophon div { display: flex; gap: .6rem; }
.colophon dt { color: var(--grey); }
.colophon dd { margin: 0; color: var(--ink); }
.foot-links { grid-column: var(--s); justify-self: end; margin: 0; }
.house-foot a + a { margin-left: 1.2rem; }
@media (max-width: 1000px) { .colophon { grid-column: 3 / -1; } .foot-links { grid-column: 1 / -1; justify-self: start; margin-top: 1rem; } }
@media (max-width: 620px) { .colophon, .foot-name { grid-column: 1 / -1; } .colophon { margin-top: .6rem; } }

/* Phone and tablet: what the older rules set for narrow screens, restated for the grid. */
@media (max-width: 760px) {
  .beat { grid-template-columns: 1fr; gap: .2rem; }
  .line { display: block; }
  .note { margin-top: .8rem; }
  .stage-controls { margin-left: 0; }
}
.programme-cols .prose h2::before { content: none; }
.scene .prose h2::before { content: none; }
/* The lesson stage on the grid: speaker names in the margin track, the line in the text track, notes in the side track. */
.stage > .stage-head, .stage > .handout { margin-left: calc((100% + var(--gap)) * var(--mspan) / var(--cols)); }
.beat { grid-template-columns: calc((100% + var(--gap)) * var(--mspan) / var(--cols) - var(--sep)) minmax(0, 1fr) calc((100% + var(--gap)) * var(--mspan) / var(--cols) - var(--sep)); gap: 0 var(--sep); }
.stage-controls { margin-left: calc((100% + var(--gap)) * var(--mspan) / var(--cols)); }
@media (max-width: 760px) { .stage > .stage-head, .stage > .handout, .stage-controls { margin-left: 0; } .beat { grid-template-columns: 1fr; } }
.productions .billing { font: .72rem/1.5 var(--mono); letter-spacing: .02em; }

/* Research holds the agenda, the papers and the lab. Its head lists the sections on one line, each on a column. */
.contents { display: flex; flex-wrap: wrap; gap: .35rem 1.8rem; margin: 2.2rem 0 0; }
.contents a { font: .72rem/1.5 var(--mono); letter-spacing: .02em; color: var(--grey); text-decoration: none; border-bottom: 1px solid transparent; }
.contents a span { color: var(--accent); }
.contents a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.promptbook h2[id] { scroll-margin-top: 1.5rem; }
.promptbook > .prose > .paper-lists { grid-column: var(--all); display: grid; grid-template-columns: subgrid; }
.paper-lists > * { grid-column: var(--all); }
.paper-lists > .spines, .paper-lists > .spines > li, .paper-lists > .spines > li > a { display: grid; grid-template-columns: subgrid; grid-column: var(--all); }
.list-label { font: .72rem/1.5 var(--mono); letter-spacing: .02em; color: var(--grey); margin: 2rem 0 0; padding-bottom: .5rem; border-bottom: 1px solid var(--ink); }
.paper-lists > .list-label:first-child { margin-top: .5rem; }

/* Files and versions under a paper or a course: a numbered ledger like the readings, with the file kind at the end. */
.files { list-style: none; padding: 0; margin: .6rem 0 3rem; border-top: 1px solid var(--ink); counter-reset: file; }
.files li { counter-increment: file; display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 0 .8rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.files li::before { content: counter(file, decimal-leading-zero); font: .72rem/1.5 var(--mono); color: var(--grey); }
.files a { font: 400 1.15rem/1.25 var(--serif); text-decoration: none; }
.files a::after { content: attr(href); display: none; }
.files li > .reading-note { grid-column: 2 / -1; }
.files a[href$=".pdf"]::before { content: "PDF"; float: right; margin-left: 1rem; font: .62rem/2 var(--mono); color: var(--grey); letter-spacing: .04em; }
.files a[href$=".pptx"]::before { content: "PPTX"; float: right; margin-left: 1rem; font: .62rem/2 var(--mono); color: var(--grey); letter-spacing: .04em; }
.files a[href*="/artifacts/"]::before { content: "PAGE"; float: right; margin-left: 1rem; font: .62rem/2 var(--mono); color: var(--grey); letter-spacing: .04em; }

/* ==== Draft 5 (12 November): theatre and techne, as tweaks. The owner wanted the sense of theatre back, and some of the
   Techne / trash polka look of the main site, without losing the austere grid. Each layer is a tweak: an attribute
   data-tweak-<id> on <html>. The site's defaults are set in content/site.yaml; a visitor changes them in the drawer. ==== */

/* --- Theatre --------------------------------------------------------------------------------------------------- */
/* Acts and scenes: the folio names the part as an act; numbered sections are scenes. */
html[data-tweak-acts] .folio-n { font-size: 0; }
html[data-tweak-acts] .folio-n::before { content: attr(data-act); font-size: .72rem; white-space: nowrap; }
html[data-tweak-acts] .prose h2::before { content: "Sc. " counter(sec); white-space: nowrap; }

/* The curtain: on the first page of a visit, and whenever the home page opens. Three strengths; the gentlest is the curtain alone.
   Fade (the curtain alone): the house lights come up. A thin veil of the dark lifts off the page in under a second; nothing moves.
   Lift (with curtain-lift): a short curtain over the head of the page only, rising quickly, with a hem in the accent.
   Drop (with curtain-drop): the whole window dark, a lamp at the foot, and the curtain going up: the first design. */
.curtain { display: none; }
html.curtain-now .curtain { display: block; position: fixed; inset: 0; z-index: 60; pointer-events: none; background: var(--dark);
  opacity: 0; animation: curtain-fade .7s ease-out both; }
@keyframes curtain-fade { from { opacity: .42; } to { opacity: 0; } }
html.dark.curtain-now:not([data-tweak-curtain-lift], [data-tweak-curtain-drop]) .curtain { background: #000; }
html.curtain-now[data-tweak-curtain-lift] .curtain { inset: 0 0 auto; height: min(46vh, 26rem); opacity: 1; border-bottom: 1px solid var(--accent);
  animation: curtain-up .8s cubic-bezier(.6, 0, .25, 1) .15s both; }
html.curtain-now[data-tweak-curtain-drop] .curtain { inset: 0; height: auto; opacity: 1; border-bottom: 1px solid var(--accent);
  animation: curtain-up 1.15s cubic-bezier(.75, 0, .2, 1) .3s both; }
html.curtain-now[data-tweak-curtain-drop] .curtain::after { content: ""; position: absolute; left: 50%; bottom: 2.2rem; width: .55rem; height: .55rem; margin-left: -.275rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 1.5rem .3rem color-mix(in srgb, var(--accent) 45%, transparent); }
@keyframes curtain-up { to { transform: translateY(-101%); } }
@media (prefers-reduced-motion: reduce) { html.curtain-now .curtain { display: none; } }

/* The spotlight: one soft pool of light where the page's title stands. In the dark it is the only light. */
.polka { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.polka > * { display: none; position: absolute; }
html[data-tweak-spotlight] .spot { display: block; top: -12vh; left: 14%; width: 72%; height: 86vh;
  background: radial-gradient(ellipse 50% 46% at 42% 50%, color-mix(in srgb, var(--accent) calc(var(--tweak-spot, .5) * 13%), transparent), transparent 72%); }
html.dark[data-tweak-spotlight] .spot { background: radial-gradient(ellipse 50% 46% at 42% 50%, color-mix(in srgb, #fff calc(var(--tweak-spot, .5) * 11%), transparent), transparent 72%); }

/* Footlights: a lamp at the foot of every column, under the page head's rule. */
html[data-tweak-footlights] :is(.sheet-head, .library > h1, .season > h1, .promptbook > header, .lab-head)::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(-1 * var(--heavy) - 22px); height: 8px; pointer-events: none;
  background: radial-gradient(circle, var(--accent) 0 1.6px, color-mix(in srgb, var(--accent) 25%, transparent) 2.2px, transparent 4px) 0 0 / var(--period) 100% repeat-x; }

/* --- Techne / trash polka ------------------------------------------------------------------------------------- */
/* Shapes set on the column lines: on home with "polka", on every page with "polka-all". */
.polka > i { left: calc(var(--gutter) + (100% - 2 * var(--gutter) + var(--gap)) * var(--col) / 12); top: var(--top);
  width: var(--size); height: var(--size); transform: rotate(var(--turn)); transform-origin: 0 0; opacity: var(--tweak-polka-ink, .55); }
html[data-tweak-polka] body.kind-home .polka > i, html[data-tweak-polka-all] .polka > i { display: block; }
.p-outline { border: 1px solid var(--ink); }
.p-block { background: var(--ink); }
.p-block-red, .p-dot { background: var(--accent); }
.p-dot { border-radius: 50%; }
.p-ring { border: 1px solid var(--accent); border-radius: 50%; }
.p-cross { background: linear-gradient(var(--ink), var(--ink)) 50% 0 / 1px 100% no-repeat, linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 1px no-repeat; width: calc(var(--size) * .5) !important; height: calc(var(--size) * .5) !important; }
.p-line, .p-line-red { height: 1px !important; background: var(--ink); }
.p-line-red { height: 2px !important; background: var(--accent); }
.p-hatch { background: repeating-linear-gradient(45deg, var(--ink) 0 1px, transparent 1px 7px); }
@media (max-width: 1000px) { .polka > i:nth-of-type(n + 6) { display: none !important; } }

/* The cut: one red stroke across the head of the page, ending in a block. */
html[data-tweak-cuts] .cut { display: block; top: 38vh; left: calc(var(--gutter) + (100% - 2 * var(--gutter) + var(--gap)) * 10 / 12); width: 40vw; height: 1.5px; background: var(--accent); transform: rotate(-12deg); transform-origin: 0 50%; opacity: .85; }
html[data-tweak-cuts] .cut::before { content: ""; position: absolute; left: -.35rem; top: -.35rem; width: .7rem; height: .7rem; background: var(--accent); }
@media (max-width: 620px) { html[data-tweak-cuts] .cut { top: 30vh; left: 72%; } }

/* Splatter: ink thrown at the corner of the stage. */
html[data-tweak-splatter] .splat { display: block; top: 16vh; right: 6%; width: 15rem; height: 11rem; opacity: .8;
  background:
    radial-gradient(circle at 30% 40%, var(--accent) 0 2.2rem, transparent 2.25rem),
    radial-gradient(circle at 58% 30%, var(--accent) 0 .5rem, transparent .55rem),
    radial-gradient(circle at 70% 62%, var(--ink) 0 .9rem, transparent .95rem),
    radial-gradient(circle at 12% 74%, var(--accent) 0 .3rem, transparent .33rem),
    radial-gradient(circle at 86% 22%, var(--ink) 0 .22rem, transparent .25rem),
    radial-gradient(circle at 46% 84%, var(--ink) 0 .16rem, transparent .19rem),
    radial-gradient(circle at 94% 80%, var(--accent) 0 .4rem, transparent .43rem); }

/* Techne terracotta instead of the trash polka red. */
html[data-tweak-terracotta] { --accent: #c4654a !important; }

/* Registration marks at the corners of the sheet, and a register target beside the folio. */
.marks i { display: none; position: fixed; width: 14px; height: 14px; z-index: 30; pointer-events: none; border: 0 solid var(--grey); opacity: .6; }
html[data-tweak-registration] .marks i { display: block; }
.marks i:nth-child(1) { top: 8px; left: 8px; border-top-width: 1px; border-left-width: 1px; }
.marks i:nth-child(2) { top: 8px; right: 8px; border-top-width: 1px; border-right-width: 1px; }
.marks i:nth-child(3) { bottom: 8px; left: 8px; border-bottom-width: 1px; border-left-width: 1px; }
.marks i:nth-child(4) { bottom: 8px; right: 8px; border-bottom-width: 1px; border-right-width: 1px; }
html[data-tweak-registration] .folio { position: relative; }
html[data-tweak-registration] .folio::after { content: ""; position: absolute; right: calc(var(--gutter) * .5 - .35rem); top: 50%; width: .7rem; height: .7rem; margin-top: -.35rem; border: 1px solid var(--grey); border-radius: 50%;
  background: linear-gradient(var(--grey), var(--grey)) 50% 50% / 1px 100% no-repeat, linear-gradient(var(--grey), var(--grey)) 50% 50% / 100% 1px no-repeat; }

/* --- Type ------------------------------------------------------------------------------------------------------ */
html[data-tweak-drop-caps] .sheet > .prose > p:first-of-type::first-letter { float: left; font: 400 4.7em/.78 var(--serif); margin: .07em .09em 0 -.03em; }
html[data-tweak-hanging-quotes] .prose blockquote { border-left: 0; padding-left: 0; position: relative; }
html[data-tweak-hanging-quotes] .prose blockquote::before { content: "\201C"; position: absolute; right: calc(100% + .12em); top: -.12em; font: 400 2.4em/1 var(--serif); color: var(--accent); }
html[data-tweak-small-caps] :is(.folio, .billing, .spine-status, .list-label, .contents a, .home-list > h2, .library > h2, .season > h2, .programme-cols > section > h2, .colophon, .kinds button) { text-transform: uppercase; letter-spacing: .09em; font-size: .64rem; }
html[data-tweak-small-caps] .folio-n::before { font-size: .64rem; }
html[data-tweak-diamonds] .prose ul { list-style: none; padding-left: 1.2em; }
html[data-tweak-diamonds] .prose ul > li { position: relative; }
html[data-tweak-diamonds] .prose ul > li::before { content: ""; position: absolute; left: -1.05em; top: .66em; width: .34em; height: .34em; background: var(--accent); transform: rotate(45deg); }

/* --- The drawer ------------------------------------------------------------------------------------------------ */
.tweaks-btn { grid-column: var(--btn); grid-row: 1; justify-self: end; align-self: center; z-index: 40; font: .68rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
  background: var(--paper); border: 1px solid var(--ink); padding: .55rem .75rem .5rem; cursor: pointer; display: inline-flex; gap: .5rem; align-items: center; }
.tweaks-btn::before { content: ""; width: .45rem; height: .45rem; background: var(--accent); }
.tweaks-btn:hover, .tweaks-btn[aria-expanded=true] { background: var(--ink); color: var(--paper); }
.tweaks-panel { position: fixed; right: 1rem; top: 4.4rem; z-index: 40; width: min(21rem, calc(100vw - 2rem)); max-height: min(72vh, 40rem); overflow: auto;
  background: var(--paper); color: var(--ink); border: 1px solid var(--ink); box-shadow: 7px 7px 0 color-mix(in srgb, var(--accent) 30%, transparent); padding: .4rem 1rem 1rem; font: .85rem/1.35 var(--sans); }
.tweaks-panel[hidden] { display: none; }
.tweaks-panel h2 { font: .62rem/1.5 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--grey); margin: 1rem 0 .3rem; padding-bottom: .3rem; border-bottom: 1px solid var(--ink); }
.tweaks-panel h2::before { content: none !important; }
.tweaks-panel label { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: center; padding: .32rem 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.tweaks-panel input[type=checkbox] { appearance: none; width: .85rem; height: .85rem; margin: 0; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.tweaks-panel input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.tweaks-panel input[type=range] { width: 7.5rem; accent-color: var(--accent); }
.tweaks-panel select { font: .68rem/1.2 var(--mono); max-width: 9.5rem; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; padding: .2rem .3rem; }
.tweaks-panel output { font: .62rem/1 var(--mono); color: var(--grey); margin-left: .3rem; }
.tweaks-panel .swatches { display: inline-flex; gap: .35rem; align-items: center; }
.tweaks-panel .swatches button { width: 1.1rem; height: 1.1rem; padding: 0; border: 1px solid var(--ink); cursor: pointer; }
.tweaks-panel .swatches button[aria-pressed=true] { outline: 1px solid var(--ink); outline-offset: 2px; }
.tweaks-panel input[type=color] { width: 1.6rem; height: 1.1rem; padding: 0; border: 1px solid var(--ink); background: none; cursor: pointer; }
.tweaks-panel .seg { display: inline-flex; border: 1px solid var(--ink); }
.tweaks-panel .seg button { font: .62rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; background: none; color: inherit; border: 0; padding: .35rem .5rem; cursor: pointer; }
.tweaks-panel .seg button + button { border-left: 1px solid var(--ink); }
.tweaks-panel .seg button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.tweaks-panel .pick-row .seg { flex-wrap: wrap; justify-content: flex-end; max-width: 15rem; }
.tweaks-panel .pick-row .seg button { border-left: 0; border-right: 1px solid var(--ink); }
.tweaks-panel .pick-row .seg button:last-child { border-right: 0; }
.tweaks-panel .mode-row { margin-top: 0; }
.tweaks-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; font: .62rem/1.4 var(--mono); color: var(--grey); }
.tweaks-foot button { font: inherit; background: none; border: 0; color: var(--ink); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; padding: 0; }
body.slides :is(.polka, .marks, .tweaks-btn, .tweaks-panel) { display: none !important; }
@media print { .polka, .marks, .tweaks-btn, .tweaks-panel, .curtain { display: none !important; } }
/* The Tweaks button sits in the masthead's last column; the menu gives up that column. */
.house-head nav { grid-column: var(--nav); grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tweaks-btn { padding: .45rem .6rem .4rem; }
@media (max-width: 1000px) { .house-head nav { grid-column: 3 / -2; } }
@media (max-width: 620px) { .house-head { position: relative; } .tweaks-btn { position: absolute; top: 1.05rem; right: var(--gutter); } .house-head nav { grid-column: 1 / -1; } .tweaks-panel { top: 3.6rem; } }

/* ==== Draft 6 (12 November): intricacy, layering and depth, in two dimensions. No stage: the grid and the type do
   the work. Layers, from the back: hatching in the side track; crosshairs where columns meet the rows; a faint
   baseline grid under the text; the act's numeral in outline; a red plate printed slightly off register behind
   each title; the ink. Rulers number the columns. Each is a tweak. ==== */

/* Scale: titles much larger, set lower, with more air; the home headline fills the width of the text and side tracks. */
html[data-tweak-scale] .bare { padding-top: 14vh; }
html[data-tweak-scale] .bare h1, html[data-tweak-scale] .bare.has-text h1 {
  font-size: clamp(calc(3.4rem * var(--headline, 1)), calc(13vw * var(--headline, 1)), calc(15rem * var(--headline, 1))); line-height: .86; letter-spacing: -.04em; }
html[data-tweak-scale] :is(.sheet-head, .library > h1, .season > h1, .promptbook > header, .lab-head) { padding-top: clamp(6rem, 22vh, 15rem); margin-bottom: 4.5rem; }
html[data-tweak-scale] :is(.sheet-head, .promptbook > header, .lab-head) h1, html[data-tweak-scale] :is(.library, .season) > h1 { font-size: clamp(3.2rem, 9vw, 9.5rem); line-height: .88; letter-spacing: -.035em; }
html[data-tweak-scale] .titlepage .sheet-head h1 { font-size: clamp(2.6rem, 6.4vw, 6.4rem); }
html[data-tweak-scale] .prose h2 { margin-top: 3em; }
html[data-tweak-scale] :is(.spines, .productions) a { padding-block: 1.8rem 1.9rem; }
html[data-tweak-scale] .spine-title, html[data-tweak-scale] .prod-title { font-size: clamp(1.55rem, 2.7vw, 2.5rem); }

/* Rulers: the columns numbered under the folio, with a tick at every quarter column; a scale down the left gutter. */
.ruler { display: none; }
html[data-tweak-rulers] .ruler { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gap); padding: 0 var(--gutter); height: 1.15rem;
  border-bottom: 1px solid var(--hair); font: .52rem/1 var(--mono); color: var(--grey); letter-spacing: .04em; font-variant-numeric: tabular-nums;
  background: linear-gradient(to right, var(--grey) 0 1px, transparent 1px) var(--gutter) 100% / calc((100% - 2 * var(--gutter) + var(--gap)) / var(--cols) / 4) 3px repeat-x; background-clip: content-box; }
.ruler i { grid-column: span var(--major); font-style: normal; padding: .3rem 0 0 .25rem; border-left: 1px solid var(--grey); height: .9rem; }
@media (max-width: 1000px) { .ruler i:nth-child(n + 9) { display: none; } }
@media (max-width: 620px) { .ruler i:nth-child(n + 5) { display: none; } }
html[data-tweak-rulers] .vruler { display: block; top: 0; bottom: 0; left: calc(var(--gutter) * .5 - 4px); width: 8px;
  background: linear-gradient(to bottom, var(--grey) 0 1px, transparent 1px) 0 0 / 4px .5rem repeat-y, linear-gradient(to bottom, var(--grey) 0 1px, transparent 1px) 0 0 / 8px 4rem repeat-y; opacity: .55; }
@media (max-width: 620px) { html[data-tweak-rulers] .vruler { display: none; } }

/* A baseline grid under the text column: one hairline per line of text. */
html[data-tweak-baseline] :is(.sheet > .prose, .home-prose > .prose) > :first-child { margin-top: 0; }
html[data-tweak-baseline] .sheet > .prose, html[data-tweak-baseline] .home-prose > .prose, html[data-tweak-baseline] .promptbook > .prose > p {
  background: repeating-linear-gradient(to bottom, transparent 0 calc(1lh - 1px), color-mix(in srgb, var(--accent) 12%, transparent) calc(1lh - 1px) 1lh); }

/* Hatching in the side track, from the masthead down past the page head: a plate under everything else. */
html[data-tweak-hatching] .hatching { display: block; top: 7.5rem; height: clamp(22rem, 62vh, 44rem);
  left: calc(var(--gutter) + (100% - 2 * var(--gutter) + var(--gap)) * 9 / 12); right: var(--gutter);
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--ink) 9%, transparent) 0 1px, transparent 1px 7px);
  -webkit-mask: linear-gradient(to bottom, #000 60%, transparent); mask: linear-gradient(to bottom, #000 60%, transparent); }
@media (max-width: 1000px) { html[data-tweak-hatching] .hatching { left: 70%; } }

/* The act's numeral, very large in outline behind the page head, cut by the edge of the page. */
html[data-tweak-numerals] .numeral { display: block; top: 10rem; right: calc(var(--gutter) * -0.4); font: 400 clamp(16rem, 44vw, 48rem)/.78 var(--serif); letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--ink) 16%, transparent); white-space: nowrap; }
html.dark[data-tweak-numerals] .numeral { -webkit-text-stroke-color: color-mix(in srgb, var(--ink) 20%, transparent); }

/* Overprint: a red plate printed a little off register behind every title. */
html[data-tweak-overprint] :is(.bare h1, .sheet-head h1, .library > h1, .season > h1, .promptbook > header h1, .lab-head h1) {
  text-shadow: .028em .018em 0 color-mix(in srgb, var(--accent) 30%, transparent); }

/* The spotlight on paper, the dark one turned over: the house is dimmed a little and one pool of white light falls
   where the title stands (where the dark spotlight falls). The dimming fades out down the page, so there is no edge. */
html[data-tweak-spotlight]:not(.dark) .spot { top: 0; left: 0; width: 100%; height: 140vh;
  background: radial-gradient(ellipse 36vw 42vh at 44% 34vh, #fff 0, color-mix(in srgb, #fff 70%, transparent) 38%, transparent 72%),
    color-mix(in srgb, var(--ink) calc(var(--tweak-spot, .5) * 9%), transparent);
  -webkit-mask-image: linear-gradient(#000 45%, transparent 100%); mask-image: linear-gradient(#000 45%, transparent 100%); }

/* ==== Draft 7 (12 November): typography, writing and drama. The owner asked the design to lean further into these
   three. Nothing here shows until it is asked for: the type tokens fall back to the values above, and each layer is
   a tweak. The design visualizer (/design on the local server) has a preset for each of the three. ==== */

/* Type tokens (look.tokens in site.yaml): the line height of running text, the measure, and the size of prose. */
body { line-height: var(--leading, 1.65); }
.prose { max-width: var(--measure, 38rem); font-size: var(--prose-size, 1.05rem); }

/* --- Type ------------------------------------------------------------------------------------------------------ */
/* Titles in the italic of the serif. */
html[data-tweak-italic-titles] :is(.bare h1, .sheet-head h1, .library > h1, .season > h1, .promptbook > header h1, .lab-head h1) { font-style: italic; letter-spacing: -.035em; }
/* The first line of a piece in capitals, as a lead-in. */
html[data-tweak-lead-in] .sheet > .prose > p:first-of-type::first-line { text-transform: uppercase; letter-spacing: .08em; font-size: .86em; }
/* Justified text, hyphenated. */
html[data-tweak-justified] :is(.sheet, .scene, .home-prose) > .prose > p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; }

/* --- Writing --------------------------------------------------------------------------------------------------- */
/* Reading text in the serif, a size larger. */
html[data-tweak-serif-prose] :is(.sheet, .scene, .home-prose) > .prose { font-family: var(--serif); font-size: calc(var(--prose-size, 1.05rem) * 1.22); line-height: 1.42; letter-spacing: .003em; }
html[data-tweak-serif-prose] :is(.sheet, .scene) > .prose :is(h3, h4, strong) { font-family: var(--sans); font-size: .82em; }
/* The opening paragraph of a piece set large, as on the home page. */
html[data-tweak-opening] .sheet > .prose > p:first-of-type { font: 400 clamp(1.4rem, 2.1vw, 1.85rem)/1.28 var(--serif); letter-spacing: -.005em; margin-bottom: 1.4em; }
/* Quotations pulled large, out of the text column into the side track. */
html[data-tweak-pull-quotes] .prose blockquote { border-left: 0; padding-left: 0; margin: 2.4em 0; font: italic 400 clamp(1.6rem, 2.7vw, 2.5rem)/1.14 var(--serif); letter-spacing: -.012em; }
html[data-tweak-pull-quotes] .prose blockquote p { margin: 0 0 .5em; }
@media (min-width: 1001px) { html[data-tweak-pull-quotes] .sheet > .prose blockquote { width: calc(150% + var(--sep) / 2); max-width: none; } }

/* --- Drama ----------------------------------------------------------------------------------------------------- */
/* Playbill: titles in capitals. */
html[data-tweak-playbill] :is(.bare h1, .sheet-head h1, .library > h1, .season > h1, .promptbook > header h1, .lab-head h1) { text-transform: uppercase; letter-spacing: -.02em; line-height: .9; }
/* Stage directions: the line under a title, and the notes of a lesson, in italic and in brackets. */
html[data-tweak-directions] :is(.lede, .sub, .stage-meta) { font-family: var(--serif); font-style: italic; color: var(--grey); }
html[data-tweak-directions] :is(.lede, .sub, .stage-meta)::before { content: "("; }
html[data-tweak-directions] :is(.lede, .sub, .stage-meta)::after { content: ")"; }
html[data-tweak-directions] .stage-meta { font-size: 1.15rem; line-height: 1.4; }
/* Speakers named as in a printed play: capitals in the serif, with a full point. */
html[data-tweak-dialogue] .who { font: 400 1rem/2.05 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
html[data-tweak-dialogue] .who::after { content: "."; }
html[data-tweak-dialogue] .beat-character .who { color: var(--accent); }
/* Blackout: the head of every page is a dark band across the whole sheet, the title lit on it. */
html[data-tweak-blackout] :is(.sheet-head, .library > h1, .season > h1, .promptbook > header, .lab-head) {
  --ink: var(--dark-ink); --paper: var(--dark); --grey: #a3a3a3; color: var(--dark-ink); background: var(--dark);
  box-shadow: 0 0 0 100vmax var(--dark); clip-path: inset(0 -100vmax); border-bottom-color: var(--accent); }
/* With the spotlight on, the light falls on the band's title, as it does on a dark page. */
html[data-tweak-blackout][data-tweak-spotlight] :is(.sheet-head, .library > h1, .season > h1, .promptbook > header, .lab-head) {
  background: radial-gradient(ellipse 46% 120% at 46% 55%, color-mix(in srgb, #fff calc(var(--tweak-spot, .5) * 12%), transparent), transparent 75%), var(--dark); }
/* In the dark the band is turned over: a lit band of paper across a dark page, the reverse of the light theme. */
html.dark[data-tweak-blackout] :is(.sheet-head, .library > h1, .season > h1, .promptbook > header, .lab-head) {
  --band: color-mix(in srgb, #262626 calc(var(--tweak-spot, .5) * 9%), #f9f9f8);
  --ink: #262626; --paper: #f9f9f8; --grey: #5f5f5f; color: #262626; background: var(--band); box-shadow: 0 0 0 100vmax var(--band); }
html.dark[data-tweak-blackout]:not([data-tweak-spotlight]) :is(.sheet-head, .library > h1, .season > h1, .promptbook > header, .lab-head) { --band: #f9f9f8; }
html.dark[data-tweak-blackout][data-tweak-spotlight] :is(.sheet-head, .library > h1, .season > h1, .promptbook > header, .lab-head) {
  background: radial-gradient(ellipse 46% 120% at 46% 55%, #fff 0, color-mix(in srgb, #fff 60%, transparent) 40%, transparent 75%), var(--band); }
/* The title makes an entrance: it rises into place when the page opens. */
@media (prefers-reduced-motion: no-preference) {
  html[data-tweak-entrance] :is(.bare h1, .sheet-head h1, .library > h1, .season > h1, .promptbook > header h1, .lab-head h1) { animation: entrance 1.1s cubic-bezier(.2, .7, .1, 1) both; }
  @keyframes entrance { from { opacity: 0; transform: translateY(.35em); letter-spacing: .02em; } }
}

/* ==== Draft 8 (12 November): more of the theatre and the script, in the type. Each is a tweak. ==== */
/* Sluglines: the label under the menu as a screenplay's scene heading. Day on paper, night in the dark. */
html[data-tweak-sluglines] .folio-part { grid-column: var(--slug); white-space: nowrap; }
html[data-tweak-sluglines] .folio-part::before { content: "Int. "; }
html[data-tweak-sluglines] .folio-part::after { content: " \2014  Day"; }
html.dark[data-tweak-sluglines] .folio-part::after { content: " \2014  Night"; }
@media (max-width: 1000px) { html[data-tweak-sluglines] .folio-part { grid-column: 2 / -1; } html[data-tweak-sluglines] .folio-src { display: none; } }
/* Cues: a lighting cue beside each section, as a stage manager marks the prompt book. */
html[data-tweak-cues] .prose h2::after { content: "LX " counter(sec); position: absolute; left: calc(100% + var(--sep)); top: .55em; white-space: nowrap;
  font: .66rem/1 var(--mono); letter-spacing: .08em; color: var(--accent); border-left: 1px solid var(--accent); padding-left: .45rem; }
@media (max-width: 1000px) { html[data-tweak-cues] .prose h2::after { display: none; } }
/* Transitions: the line a script sets, flush right, between one section and the next. */
html[data-tweak-transitions] .prose > :is(p, ul, ol):has(+ h2)::after { content: "Cut to:"; display: block; text-align: right; margin-top: 2.2rem;
  font: .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--grey); }
/* The curtain line: the last line of every page. */
html[data-tweak-last-line] main::after { content: "Curtain."; grid-column: 1 / -1; display: block; text-align: center; margin-top: 5rem;
  font: .78rem/1 var(--mono); letter-spacing: .34em; text-transform: uppercase; color: var(--grey); }

/* ==== Draft 9 (13 November): hints. The owner asked for subtle theatrical and writerly touches. Each of these is small
   enough to miss: light at the edges, a mark where something stands or ends. Each is a tweak. ==== */
/* --- Writing --------------------------------------------------------------------------------------------------- */
/* Paragraphs as a book sets them: no space between, the first line indented, the first after a heading flush. */
html[data-tweak-book-paragraphs] .sheet > .prose > p { margin-block: 0; }
html[data-tweak-book-paragraphs] .sheet > .prose > p + p { text-indent: 1.6em; }
html[data-tweak-book-paragraphs][data-tweak-opening] .sheet > .prose > p:first-of-type + p { text-indent: 0; }
html[data-tweak-book-paragraphs] .sheet > .prose > p:not(:has(+ p)) { margin-bottom: 1.3em; }
/* A break in the text: three asterisks in place of a rule. */
html[data-tweak-asterism] .prose hr { border: 0; height: auto; margin: 2.8em 0; text-align: center; overflow: visible; background: none; }
html[data-tweak-asterism] .prose hr::before { content: "*\2003*\2003*"; font: 400 1.25rem/1 var(--serif); color: var(--accent); }
/* The end of a piece: a small square after its last word, as a magazine closes an article. */
/* (The link back to the list is not the last word.) */
html[data-tweak-end-mark] .sheet > .prose > p:nth-last-child(1 of p:not(:has(> a:only-child)))::after { content: ""; display: inline-block; width: .42em; height: .42em; margin-left: .55em; background: var(--accent); }
/* A writer's cursor after the title, as if it had just been typed. */
html[data-tweak-caret] :is(.bare h1, .sheet-head h1)::after { content: ""; display: inline-block; width: max(2px, .035em); height: .74em; margin-left: .07em; background: var(--accent); animation: caret 1.25s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html[data-tweak-caret] :is(.bare h1, .sheet-head h1)::after { animation: none; } }

/* --- Theatre --------------------------------------------------------------------------------------------------- */
/* House lights at half: the edges of the window a little darker than its middle. */
html[data-tweak-vignette] body::after { content: ""; position: fixed; inset: 0; z-index: 35; pointer-events: none;
  background: radial-gradient(ellipse 80% 72% at 50% 44%, transparent 58%, color-mix(in srgb, #000 7%, transparent) 100%); }
html.dark[data-tweak-vignette] body::after { background: radial-gradient(ellipse 80% 72% at 50% 44%, transparent 55%, color-mix(in srgb, #000 38%, transparent) 100%); }
/* Tungsten: the paper a little warm, as under stage light, and the dark a little brown. */
html[data-tweak-tungsten]:not(.dark) { --paper: #f8f5ee; --rule: #dedacf; }
html[data-tweak-tungsten] { --dark: #171513; --dark-ink: #ebe6da; }
/* A curtain's hem: fine pleats at the very top of the window, in the accent, fading down. */
html[data-tweak-valance] .marks::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 14px; z-index: 34; pointer-events: none; --fold: color-mix(in srgb, var(--accent) 30%, transparent);
  background: repeating-linear-gradient(to right, var(--fold) 0, transparent 9px, transparent 17px, var(--fold) 26px), linear-gradient(var(--fold), var(--fold));
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent); mask-image: linear-gradient(to bottom, #000, transparent); }
html.dark[data-tweak-valance] .marks::before { --fold: color-mix(in srgb, var(--accent) 26%, transparent); }
/* Spike marks: two corners of tape on the floor, where the title stands. */
html[data-tweak-spike-marks] :is(.bare h1, .sheet-head h1, .promptbook > header h1, .lab-head h1) { justify-self: start; padding: .14em .16em .1em; margin-left: -.16em;
  background: linear-gradient(var(--accent), var(--accent)) left top / 11px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) left top / 1px 11px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 11px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) right bottom / 1px 11px no-repeat; }
/* The follow spot: a soft light comes up on the row you point at. */
@property --row-light { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
html[data-tweak-follow-spot] :is(.productions a, .spines a, .notices a, .home-list > ul > li > a) { transition: --row-light .45s ease-out;
  background: radial-gradient(ellipse 38% 150% at 44% 50%, color-mix(in srgb, var(--accent) var(--row-light), transparent), transparent 72%); }
html[data-tweak-follow-spot] :is(.productions a, .spines a, .notices a, .home-list > ul > li > a):is(:hover, :focus-visible) { --row-light: 8%; }
html.dark[data-tweak-follow-spot] :is(.productions a, .spines a, .notices a, .home-list > ul > li > a) { background: radial-gradient(ellipse 38% 150% at 44% 50%, color-mix(in srgb, #fff var(--row-light), transparent), transparent 72%); }
/* The ghost light: one lamp left burning on the empty stage, beside the name in the footer. */
html[data-tweak-ghost-light] .foot-name::before { content: ""; display: inline-block; width: .38rem; height: .38rem; margin-right: .7rem; border-radius: 50%; vertical-align: .12em; background: #ffd9a0;
  box-shadow: 0 0 .5rem .12rem color-mix(in srgb, #ffb347 70%, transparent), 0 0 1.6rem .5rem color-mix(in srgb, #ffb347 22%, transparent); animation: ghost 5s ease-in-out infinite; }
@keyframes ghost { 50% { opacity: .62; } }
@media (prefers-reduced-motion: reduce) { html[data-tweak-ghost-light] .foot-name::before { animation: none; } }
@media print { html body::after, .marks::before { display: none !important; } }

/* ==== Password areas and the Lab's rooms ==== */
.access-flag { display: inline-block; vertical-align: .35em; margin-left: .6rem; font: .58rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--grey); border: 1px solid currentColor; padding: .28rem .4rem .22rem; }
.rooms { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--gap); margin-top: 2.6rem; }
.rooms a { display: grid; gap: .45rem; padding: 1rem 0 .9rem; border-top: 1px solid currentColor; text-decoration: none; color: inherit; }
.rooms .room-t { font: 400 clamp(1.5rem, 2.4vw, 2rem)/1.05 var(--serif); }
.rooms .room-n { font: .66rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--grey); }
.rooms a:hover .room-t, .rooms a:focus-visible .room-t { color: var(--accent); }
.lab .transcripts { margin-top: 3rem; }
.lab .empty, .lab .aside, .sheet .aside { color: var(--grey); font-size: .95rem; }
form.enter, form.signin { display: grid; gap: 1.1rem; justify-items: start; max-width: 24rem; margin: 1rem 0 2rem; }
form.enter label, form.signin label { display: grid; gap: .4rem; width: 100%; }
form.enter label span, form.signin label span { font: .66rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--grey); }
form.enter input[type=password], form.signin input { width: 100%; font: 400 1.2rem/1.4 var(--sans); padding: .7rem .8rem; background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; }
form.enter input[type=password]:focus, form.signin input:focus { outline: none; border-bottom-color: var(--accent); }
form.signin[hidden], form.enter[hidden] { display: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.enter-say { margin: 0; min-height: 1.2em; color: var(--accent); font-size: .95rem; }
html[data-tweak-sluglines] .folio-part:empty { display: none; }

/* The lesson as a script (next/screenplay.mjs): a second view of the stage, switched in the stage's head.
   The script sits in the text track, with each line's number in the margin track (where a shooting script numbers
   its scenes) and the notes in the side track. Indents are a screenplay page's, as shares of the track: action
   full width, dialogue from 17% to 75%, parentheticals from 27%, the cue at 37%. Learned from the lab's transcript
   (stage directions apart from speech) and the eval repo's playscript and scriptorium views (cue, speech, asides). */
.stage > .stage-views { margin-left: calc((100% + var(--gap)) * var(--mspan) / var(--cols)); display: flex; gap: 1.6rem; margin-block: -2rem 2.6rem; }
.view-btn { font: .72rem/1.5 var(--mono); letter-spacing: .02em; background: none; border: 0; border-bottom: 1px solid transparent; padding: 0 0 .15rem; color: var(--grey); cursor: pointer; }
.view-btn:hover { color: var(--ink); }
.view-btn[aria-pressed=true] { color: var(--ink); border-bottom-color: var(--accent); }
.stage .script, .stage .script-tools { display: none; }
.stage.view-script .script { display: block; }
.stage.view-script .script-tools { display: contents; }
.stage.view-script .beats, .stage.view-script [data-act=next], .stage.view-script [data-act=all] { display: none; }
.sp-row, .script > .sp-trans, .script > .sp-slug { display: grid; grid-template-columns: calc((100% + var(--gap)) * var(--mspan) / var(--cols) - var(--sep)) minmax(0, 1fr) calc((100% + var(--gap)) * var(--mspan) / var(--cols) - var(--sep)); gap: 0 var(--gap); align-items: start; }
.sp-row { margin: 0 0 1.5rem; break-inside: avoid; }
.sp-row > :is(.sp-speech, .sp-action, .sp-insert, .sp-slug), .script > :is(.sp-trans, .sp-slug) > * { grid-column: 2; }
.sp-n { grid-column: 1; justify-self: end; font: .72rem/2 var(--mono); color: var(--grey); font-variant-numeric: tabular-nums; }
.sp-row > .notes { grid-column: 3; }
.script .note { display: none; }
.stage.notes-on .script .note { display: block; visibility: visible; }
.script .notes { display: grid; gap: .9rem; }
.script p { margin: 0; }
.sp-trans { font: .78rem/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--grey); margin: 0 0 1.4rem; }
.sp-trans > span, .sp-slug > span { grid-column: 2; }
.sp-out { margin-top: 2.6rem; }
.sp-out > span { justify-self: end; }
.sp-slug { font: 500 .8rem/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 1.6rem; }
.sp-scene > span { border-bottom: 1px solid var(--rule); padding-bottom: .5rem; }
.sp-scene > span::after { content: " \2014  Day"; }
html.dark .sp-scene > span::after { content: " \2014  Night"; }
.sp-back { font-weight: 400; color: var(--grey); }
.sp-cue { margin-left: 37% !important; font: 500 .78rem/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--grey); }
.sp-character .sp-cue { color: var(--accent); }
.sp-contd { letter-spacing: .06em; }
.sp-dia { margin: 0 25% 0 17% !important; font: 400 clamp(1.2rem, 1.6vw, 1.45rem)/1.35 var(--serif); text-wrap: pretty; }
.sp-dia + .sp-dia { margin-top: .7em !important; }
.sp-paren { margin: .1rem 30% .15rem 27% !important; font: italic 400 1.1rem/1.35 var(--serif); color: var(--grey); }
.sp-repeat { display: none; }
.stage.notes-on .sp-repeat { display: block; }
.stage.notes-on .sp-strategy { color: var(--accent); }
.sp-action { font: italic 400 1.2rem/1.4 var(--serif); color: var(--grey); max-width: 46ch; }
.sp-insert { border-left: 1px solid var(--accent); padding: .1rem 0 .1rem 1.2rem; max-width: 46ch; }
.sp-insert-head { font: .72rem/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--grey); margin-bottom: .35rem !important; }
.sp-insert p:not(.sp-insert-head) { font: 400 1rem/1.5 var(--sans); }
@media (max-width: 760px) {
  .stage > .stage-views { margin-left: 0; margin-top: -1.6rem; }
  .sp-row, .script > .sp-trans, .script > .sp-slug { grid-template-columns: 1.6rem minmax(0, 1fr); column-gap: .7rem; }
  .sp-row > .notes { grid-column: 2; }
  .sp-n { line-height: 1.75; }
  .stage.notes-on .script .notes { margin-top: .8rem; }
  .sp-cue { margin-left: 22% !important; }
  .sp-dia { margin: 0 0 0 8% !important; font-size: 1.2rem; }
  .sp-paren { margin: .1rem 8% .15rem 15% !important; }
}

/* Printing the script: a white page, the script alone (with its notes if they are showing), at a script's size.
   "Print the script" marks the stage it belongs to; printing a page whose lesson is showing as a script does too. */
@media print {
  @page { margin: 2.2cm 2.2cm 2.2cm 3.2cm; }
  html:is(.printing-script, :has(.stage.view-script)) { --paper: #fff; --ink: #111; --grey: #555; --rule: #bbb; --accent: #8a3a26; --hair: transparent; }
  html:is(.printing-script, :has(.stage.view-script)) body { background: #fff; color: #111; }
  html:is(.printing-script, :has(.stage.view-script)) body::before { display: none; }
  html:is(.printing-script, :has(.stage.view-script)) :is(.house-head, .house-foot, .folio, .review-bar, .tweaks-btn, .tweaks-panel, nav, .stage-views, .stage-controls, .sequence, .skip) { display: none !important; }
  html.printing-script :is(main > :not(:has(.stage.printing)), .lab-head, .prose > :not(.stage), .stage:not(.printing)) { display: none !important; }
  html.printing-script .stage.printing .script, html:has(.stage.view-script) .stage.view-script .script { display: block; }
  html.printing-script .stage.printing :is(.beats, .handout) { display: none; }
  .stage { margin: 0; padding: 0; border: 0; overflow: visible; }
  html:is(.printing-script, :has(.stage.view-script)) .stage > .stage-head { margin: 0; break-after: page; }
  html:is(.printing-script, :has(.stage.view-script)) .stage-title { color: #111; }
  .sp-row, .script > .sp-trans, .script > .sp-slug { grid-template-columns: 2.2em minmax(0, 1fr); column-gap: 1em; }
  .sp-row > .notes { grid-column: 2; }
  .script .note { display: none; }
  .stage.notes-on .script .note { display: block; font-size: 9.5pt; margin-top: .4em; }
  .sp-dia { font-size: 12pt; line-height: 1.35; }
  .sp-paren, .sp-action { font-size: 11pt; }
  .sp-cue { break-after: avoid; }
  .sp-row { break-inside: avoid; margin-bottom: 1em; }
}

/* ==== Draft 10 (14 November): the grid, finer. The page grid is 12 columns; these tweaks put it on 24 or 60, on a screen
   wider than a tablet (a tablet keeps 8 and a phone 4). On 24 the layout is the same as on 12, on lines twice as fine.
   On 60 there is no column gap: a gap is a whole column (as in a sixty-unit grid), so the layout can be set to the
   unit, and the tracks are restated one column apart. The three layouts are on 60 columns, whatever the column tweak
   says; each places the margin, the text and the side differently, for long pages, scripts and lists. ==== */
@media (min-width: 1001px) {
  html[data-tweak-twenty-four] { --cols: 24; --major: 2; --m: 1 / 7; --t: 7 / 19; --s: 19 / -1; --w: 7 / -1; --nav: 13 / -3; --btn: -3 / -1;
    --folio-n: 1 / 3; --folio-part: 3 / 7; --folio-src: 13 / -1; --slug: 3 / 13; --hero: 1 / 21; --mspan: 6; }
  html:is([data-tweak-sixty], [data-tweak-layout-folio], [data-tweak-layout-promptbook], [data-tweak-layout-broadsheet]) {
    --cols: 60; --major: 5; --gap: 0px !important; --sep: clamp(.9rem, 1.5vw, 1.6rem);
    --m: 1 / 15; --t: 16 / 46; --s: 47 / -1; --w: 16 / -1; --nav: 31 / -6; --btn: -6 / -1;
    --folio-n: 1 / 5; --folio-part: 6 / 15; --folio-src: 31 / -1; --slug: 6 / 30; --hero: 1 / 50; --mspan: 15; }
  /* The rows of a list are subgrids with a wider gap of their own (3rem): on a finer grid that gap would be added between
     every pair of columns, so they keep the page's gap. */
  html:is([data-tweak-twenty-four], [data-tweak-sixty], [data-tweak-layout-folio], [data-tweak-layout-promptbook], [data-tweak-layout-broadsheet]) :is(.productions, .spines, .notices) a { column-gap: var(--gap); }
  /* On a finer grid the hairlines of the 12 stay as they were, and the finer columns are drawn between them, fainter. */
  html:is([data-tweak-twenty-four], [data-tweak-sixty], [data-tweak-layout-folio], [data-tweak-layout-promptbook], [data-tweak-layout-broadsheet]):not(.grid-off) body::before {
    background: linear-gradient(to right, var(--hair) 0 1px, transparent 1px) 0 0 / calc(var(--period) * var(--major)) 100% repeat-x,
      linear-gradient(to right, color-mix(in srgb, var(--hair) 40%, transparent) 0 1px, transparent 1px) 0 0 / var(--period) 100% repeat-x; }
}

/* The grid shown: every column tinted, as a designer's overlay, over the page; and the rows of the text, one per line. */
html[data-tweak-grid-overlay] body::after { content: ""; position: fixed; inset: 0 var(--gutter); z-index: 55; pointer-events: none;
  background: linear-gradient(to right, color-mix(in srgb, var(--accent) 7%, transparent) 0 calc(var(--period) - var(--gap)), transparent 0) 0 0 / var(--period) 100% repeat-x,
    linear-gradient(to bottom, color-mix(in srgb, var(--accent) 9%, transparent) 0 1px, transparent 1px) 0 0 / 100% calc(1rem * var(--leading, 1.65)) repeat; }
@media (min-width: 1001px) {
  /* With no gap, the columns are told apart by tint, every other one, and each column of the 12 is outlined. */
  html[data-tweak-grid-overlay]:is([data-tweak-sixty], [data-tweak-layout-folio], [data-tweak-layout-promptbook], [data-tweak-layout-broadsheet]) body::after {
    background: linear-gradient(to right, color-mix(in srgb, var(--accent) 22%, transparent) 0 1px, transparent 1px) 0 0 / calc(var(--period) * 5) 100% repeat-x,
      linear-gradient(to right, color-mix(in srgb, var(--accent) 7%, transparent) 0 50%, transparent 0) 0 0 / calc(var(--period) * 2) 100% repeat-x,
      linear-gradient(to bottom, color-mix(in srgb, var(--accent) 9%, transparent) 0 1px, transparent 1px) 0 0 / 100% calc(1rem * var(--leading, 1.65)) repeat; }
}

@media (min-width: 1001px) {
  /* In the three layouts the text of a piece starts on its track (the layout as now indents it a further 12vw). */
  html:is([data-tweak-layout-folio], [data-tweak-layout-promptbook], [data-tweak-layout-broadsheet]) .sheet > .prose { margin-left: 0; }
  /* --- Folio: a book's page. A narrow margin for labels; the text set off-centre on a short measure; a wide outer
     margin for what hangs beside the text: the line under the title, quotations, the lighting cues. The folio is a
     running head, its parts over the tracks they name. --------------------------------------------------------------- */
  html[data-tweak-layout-folio] { --m: 1 / 10; --t: 13 / 40; --s: 43 / -1; --w: 13 / -1; --hero: 7 / 57; --mspan: 12;
    --folio-n: 1 / 4; --folio-part: 13 / 40; --folio-src: 43 / -1; --slug: 13 / 40; }
  html[data-tweak-layout-folio] .folio-src { text-align: right; }
  html[data-tweak-layout-folio] .sheet-head > .sub { grid-column: var(--s); grid-row: 1 / span 3; align-self: end; margin: 0; padding-bottom: .4rem;
    font-size: clamp(1.05rem, 1.3vw, 1.25rem); max-width: 26ch; }
  html[data-tweak-layout-folio] .sheet-head > h1 { grid-column: 13 / 43; }
  html[data-tweak-layout-folio] .sheet-head > .credit { grid-column: var(--t); }
  html[data-tweak-layout-folio] .sheet > .prose blockquote { float: right; clear: right; width: calc(100% / 27 * 16); margin: .3em calc(-100% / 27 * 19) 1.2em 0;
    padding: 0; border: 0; font: italic 400 clamp(1.25rem, 1.7vw, 1.6rem)/1.22 var(--serif); }
  html[data-tweak-layout-folio] .sheet > .prose blockquote::before { content: ""; display: block; width: calc(100% / 16 * 2); border-top: 1px solid var(--accent); margin-bottom: .7rem; }
  html[data-tweak-layout-folio] :is(.spines, .productions, .notices) .spine-authors,
  html[data-tweak-layout-folio] :is(.spines, .productions, .notices) :is(.prod-sub, .notice-sum) { grid-column: var(--s); grid-row: 1 / span 2; padding-top: .45rem; font-size: .85rem; }
  html[data-tweak-layout-folio] .home-prose > .prose { grid-column: 13 / 40; }
  html[data-tweak-layout-folio] .bare > .direction { grid-column: 43 / -1; }

  /* --- Prompt book: a play as the stage manager keeps it. Speakers, labels and directions right-aligned in a wide
     margin against the text; the text in the middle; notes and cues in the outer margin. For lessons, transcripts
     and lectures above all. ------------------------------------------------------------------------------------------ */
  html[data-tweak-layout-promptbook] { --m: 1 / 17; --t: 19 / 45; --s: 47 / -1; --w: 19 / -1; --hero: 4 / 54; --mspan: 18;
    --folio-n: 1 / 5; --folio-part: 6 / 17; --folio-src: 19 / -1; --slug: 6 / 18; }
  html[data-tweak-layout-promptbook] :is(.sheet-head > .billing, .spine-status, .productions .billing, .notice-date, .scene > .scene-n, .bank > h3, .bank > .bank-criterion) { text-align: right; justify-self: end; }
  html[data-tweak-layout-promptbook] .sheet-head > .sub { grid-column: var(--m); grid-row: 2; text-align: right; justify-self: end; max-width: 22ch; margin: 1rem 0 0; font-size: 1.05rem; }
  html[data-tweak-layout-promptbook] .sheet-head > h1 { grid-column: 19 / -4; }
  html[data-tweak-layout-promptbook] .prose h2::before { right: auto; left: calc(-100% / 26 * 18); width: calc(100% / 26 * 16); text-align: right; }
  html[data-tweak-layout-promptbook] :is(.spines, .productions, .notices) .spine-authors,
  html[data-tweak-layout-promptbook] :is(.spines, .productions, .notices) :is(.prod-sub, .notice-sum) { grid-column: var(--s); grid-row: 1 / span 2; padding-top: .45rem; font-size: .85rem; }
  html[data-tweak-layout-promptbook] .beat { grid-template-columns: repeat(60, minmax(0, 1fr)); gap: 0; }
  html[data-tweak-layout-promptbook] .beat .who { grid-column: 1 / 17; text-align: right; justify-self: end; }
  html[data-tweak-layout-promptbook] .beat .words { grid-column: 19 / 45; }
  html[data-tweak-layout-promptbook] .beat > .notes { grid-column: 47 / -1; }
  html[data-tweak-layout-promptbook] .beat.current::before { right: calc(100% / 60 * 15); }
  html[data-tweak-layout-promptbook] :is(.sp-row, .script > .sp-trans, .script > .sp-slug) { grid-template-columns: calc(100% / 60 * 16) minmax(0, 1fr) calc(100% / 60 * 14); column-gap: calc(100% / 60 * 2); }
  html[data-tweak-layout-promptbook] .bare > .direction { grid-column: 1 / 17; text-align: right; }
  html[data-tweak-layout-promptbook] .home-prose > .prose { grid-column: 19 / 45; }

  /* --- Broadsheet: lists as the front of a paper. Each row runs across the sheet in four columns (the label, the
     title, the line under it beside the title, and a number at the far edge); the home headline across the whole
     width, the agenda off-centre under it. For the home page and the indexes. ---------------------------------------- */
  html[data-tweak-layout-broadsheet] { --m: 1 / 9; --t: 10 / 34; --s: 36 / 55; --w: 10 / -1; --hero: 1 / -1; --mspan: 9;
    --folio-n: 1 / 3; --folio-part: 10 / 34; --folio-src: 36 / -1; --slug: 10 / 34; }
  html[data-tweak-layout-broadsheet] :is(.spines, .productions, .notices) { counter-reset: row; }
  html[data-tweak-layout-broadsheet] :is(.spines, .productions, .notices) > li { counter-increment: row; }
  html[data-tweak-layout-broadsheet] :is(.spines, .productions, .notices) .spine-authors,
  html[data-tweak-layout-broadsheet] :is(.spines, .productions, .notices) :is(.prod-sub, .notice-sum) { grid-column: var(--s); grid-row: 1 / span 2; padding-top: .45rem; font-size: .88rem; }
  html[data-tweak-layout-broadsheet] :is(.spines, .notices) > li > a::after { content: counter(row, decimal-leading-zero); grid-column: 57 / -1; grid-row: 1; justify-self: end; padding-top: .45rem;
    font: .72rem/1.5 var(--mono); color: var(--grey); font-variant-numeric: tabular-nums; }
  html[data-tweak-layout-broadsheet] .prod-n { grid-column: 57 / -1; }
  html[data-tweak-layout-broadsheet] :is(.library, .season) > h1 { padding-left: calc(100% / 60 * 9); }
  html[data-tweak-layout-broadsheet] :is(.library, .season) > .lede { grid-column: 36 / 58; justify-self: start; }
  html[data-tweak-layout-broadsheet] .bare h1 { font-size: clamp(calc(3rem * var(--headline, 1)), calc(12.5vw * var(--headline, 1)), calc(14rem * var(--headline, 1))); }
  html[data-tweak-layout-broadsheet] .home-prose > .prose { grid-column: 22 / 50; }
  html[data-tweak-layout-broadsheet] .home-list > h2 { padding-left: calc(100% / 60 * 9); }
  html[data-tweak-layout-broadsheet] .sheet-head > h1 { grid-column: 10 / -1; max-width: 20ch; }
  html[data-tweak-layout-broadsheet] .sheet-head > .sub { grid-column: 36 / 58; }
  html[data-tweak-layout-broadsheet] .sheet > .prose { grid-column: 10 / 34; }
}
.oauth { display: flex; flex-wrap: wrap; gap: .6rem; margin: -1rem 0 2rem; }

/* Decorative accents sit within the reading measure. */
.site-accent {
  grid-column: var(--t);
  width: min(100%, 17rem);
  margin: 1rem 0 1.6rem;
  min-width: 0;
  aspect-ratio: 3 / 2;
}

.site-accent > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-accent--paper > img {
  mix-blend-mode: multiply;
  mask-image: radial-gradient(ellipse 73% 72% at center, black 42%, transparent 75%);
}

.dark .site-accent--paper > img {
  mix-blend-mode: normal;
  opacity: .84;
}

.site-accent--print {
  width: min(100%, 19rem);
  aspect-ratio: 4.2 / 1;
  background: #f8f6f1;
  box-shadow: 0 0 0 1px rgb(58 48 37 / 9%), 1px 2px 3px rgb(58 48 37 / 12%),
    10px 12px 22px -16px rgb(58 48 37 / 32%);
}

.site-accent--print > img {
  mix-blend-mode: multiply;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}

.site-accent--stage {
  width: min(100%, 30rem);
  aspect-ratio: 3.7 / 1;
  background: radial-gradient(ellipse at 56% 64%, rgb(211 187 154 / 13%), transparent 68%);
}

.site-accent--stage > img {
  object-position: center 85%;
  mask-image: radial-gradient(ellipse 49% 68% at 51% 54%, black 38%, transparent 100%);
}

.dark .site-accent--stage > img { mix-blend-mode: screen; }

.site-accent--warm {
  width: min(100%, 20rem);
  aspect-ratio: 3.5 / 1;
}

.site-accent--warm > img {
  filter: brightness(1.43) saturate(1.12);
  mask-image: radial-gradient(ellipse 52% 57% at center, black 46%, transparent 98%);
}

.dark .site-accent--warm > img {
  /* Reverse the paper tones while keeping the pigment warm. */
  filter: invert(1) hue-rotate(180deg) brightness(.48) contrast(1.45) saturate(1.5);
}

@media print {
  .site-accent { display: none; }
}

/* ---- A paper's own text (the lab's paper export): contents, article, figures ---- */
.paper-toc { margin: 0 0 3rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
.paper-toc ul { list-style: none; padding-left: 0; margin: 0; }
.paper-toc ul ul { padding-left: 1.4rem; }
.paper-toc li { margin: .2rem 0; }
.paper-toc a { text-decoration: none; }
.paper-article figure { margin: 2rem 0 3rem; }
.paper-article figure img { display: block; width: 100%; height: auto; max-width: 52rem; background: #fff; }
.paper-article figcaption { font-size: .9rem; color: var(--grey); margin-top: .8rem; max-width: 60ch; }
.paper-article .header-section-number { margin-right: .6em; color: var(--grey); }
.paper-article .csl-entry { margin: 0 0 .8rem; padding-left: 2em; text-indent: -2em; }
.paper-article section { min-width: 0; }
pre.cite { font-size: .8rem; white-space: pre-wrap; }
