/*
 * Preparation board: "a work order, not a website".
 *
 * Rules: white, black, one blue, one yellow stroke per page.
 * Three voices: Instrument Sans for text, IBM Plex Mono for codes and labels,
 * Caveat in blue for Jeroen's notes (one per screen).
 * Fonts are in prep/fonts/ (SIL Open Font License, see fonts/OFL.txt). Nothing loads from the web.
 */

@font-face { font-family: "Instrument Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/caveat-latin-500-normal.woff2") format("woff2"); }

:root {
  --paper: #ffffff;
  --ink: #111111;
  --soft: #444444;
  --pen: #0000ff;
  --marker: #ffff00;
  --rule: 1.5px solid var(--ink);
  --dash: 1px dashed var(--ink);

  --sans: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 19px/1.5 var(--sans);
}

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

a { color: var(--pen); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #000080; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, .choice:focus-within {
  outline: 3px solid var(--pen);
  outline-offset: 2px;
}

h1, h2, h3 { font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: 34px; margin: 72px 0 18px; padding-top: 14px; border-top: var(--rule); }
h3 { font-size: 22px; margin: 0 0 8px; }
p { margin: 0 0 14px; max-width: 42em; }
strong, b { font-weight: inherit; }

/* the three voices */
.code, .tabs a, .head-bar, .btn, .card-row, .site-foot, .sch-time, .compare .tag, .spine .who {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pen { font-family: var(--hand); font-weight: 500; color: var(--pen); line-height: 1.1; }
mark { background: linear-gradient(transparent 52%, var(--marker) 52%, var(--marker) 90%, transparent 90%); color: inherit; }

.lede { font-size: 26px; line-height: 1.35; max-width: 32em; margin-top: 4px; }
.small { font-size: 15px; }
.soft { color: var(--soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */

.site-head { padding-top: 32px; }
.head-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  border-bottom: var(--rule);
  padding-bottom: 12px;
}
.head-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 26px 0 24px;
}
.site-head h1 { font-size: 64px; line-height: 1; margin: 0; letter-spacing: -0.02em; }
.head-note { font-size: 28px; margin: 0; transform: rotate(-2deg); transform-origin: right bottom; }

/* file tabs: the open one is filled black, like a stamp */
.tabs { display: flex; flex-wrap: wrap; border-bottom: var(--rule); }
.tabs a {
  font-size: 14px;
  text-decoration: none;
  color: var(--ink);
  padding: 12px 18px;
  border: var(--rule);
  border-bottom: 0;
  margin-right: -1.5px;
}
.tabs a:hover { background: #f2f2f2; color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }

main.wrap { padding-top: 40px; padding-bottom: 80px; }
.panel[hidden] { display: none; }

/* ---------- spine ---------- */

.spine {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: var(--rule);
  margin: 28px 0 8px;
  font-size: 17px;
}
.spine > div { padding: 12px 16px 16px; border-right: var(--rule); }
.spine > div:last-child { border-right: 0; }
.spine .tool { background: var(--ink); color: var(--paper); }
.spine .who { display: block; margin-bottom: 6px; }

/* ---------- introduction ---------- */

.ingredients { list-style: none; counter-reset: ing; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: var(--rule); border-left: var(--rule); }
.ingredients li { counter-increment: ing; border-right: var(--rule); border-bottom: var(--rule); padding: 16px 20px 6px; }
.ingredients h3::before {
  content: "0" counter(ing);
  display: block;
  font: 400 13px var(--mono);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.ingredients p { font-size: 17px; }

.compare { display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px; }
.compare > div { border: var(--rule); padding: 0 20px 6px; }
.compare .thin { border-style: dashed; }
.compare .tag { margin: 0 -20px 14px; padding: 8px 20px; border-bottom: var(--rule); }
.compare .thin .tag { border-bottom-style: dashed; }
.compare .prompt { font-family: var(--mono); font-size: 14px; line-height: 1.65; }
.compare .result { font-size: 16px; color: var(--soft); border-top: var(--dash); padding-top: 10px; }

.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.kinds > div { border: var(--rule); padding: 18px 20px 6px; }
.kinds p { font-size: 16px; }
.kinds .fit { border-top: var(--dash); padding-top: 10px; }

.checks { padding-left: 0; list-style: none; max-width: 44em; }
.checks li { padding: 10px 0 10px 34px; position: relative; border-bottom: var(--dash); }
.checks li::before { content: "☐"; position: absolute; left: 2px; top: 9px; font-size: 20px; line-height: 1; }

.next { margin-top: 48px; font-size: 22px; }

/* ---------- prepare: index ---------- */

.intro-pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; }
.intro-pair .lede { margin: 0; }
.privacy { font-size: 15px; border-top: var(--dash); padding-top: 10px; margin: 0; }
.privacy .code { font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-top: 40px; }

/* a colleague, as a crate label */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  border: var(--rule);
  background: var(--paper);
  transition: box-shadow 0.1s ease, transform 0.1s ease;
}
.card:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.card-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; }
.card-top { border-bottom: var(--rule); }
.card-foot { border-top: var(--dash); }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 14px 20px; flex-grow: 1; }
.card-name { font-size: 32px; font-weight: 600; line-height: 1.1; }
.card-project { font-size: 18px; }
.card-kind { font-size: 15px; color: var(--soft); }
.card-note { font-size: 24px; }
.card-own, .card-own .card-top { border-style: dashed; }
.card-own .card-top { border-width: 0 0 1.5px; }
.card.is-done .card-foot { background: var(--ink); color: var(--paper); border-top: var(--rule); }

/* ---------- prepare: module ---------- */

.back { margin-bottom: 22px; font-size: 17px; }
.module-code { margin: 0 0 8px; }
.module-title { border-top: 0; padding-top: 0; margin: 0 0 16px; font-size: 44px; }
#module > .privacy { max-width: 42em; margin-top: 8px; }

.homework fieldset { border: 0; margin: 56px 0 0; padding: 0; min-width: 0; }
.homework legend { float: left; width: 100%; padding: 12px 0 0; border-top: var(--rule); }
.homework legend .code { display: block; margin-bottom: 8px; }
.legend-title { display: block; font-size: 30px; font-weight: 600; line-height: 1.1; margin-bottom: 6px; }
.q { margin: 26px 0 0; clear: both; max-width: 46em; }
.q-label { display: block; font-size: 18px; line-height: 1.4; margin: 0 0 6px; }
.q-num { font-size: 13px; margin-right: 4px; }
.hint { font-size: 15px; color: var(--soft); margin: 6px 0 0; }

.homework textarea, .homework input[type="text"] {
  width: 100%;
  font: 17px/1.5 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: var(--rule);
  border-radius: 0;
  padding: 8px 0;
}
.homework textarea { min-height: 96px; resize: vertical; }
.homework textarea:focus, .homework input[type="text"]:focus { outline: 0; border-bottom-color: var(--pen); box-shadow: 0 1.5px 0 var(--pen); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: var(--rule);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 16px;
}
.choice input { margin: 0; width: 16px; height: 16px; accent-color: var(--ink); }
.choice:has(input:checked) { background: var(--ink); color: var(--paper); }
.choice input:checked { accent-color: var(--paper); }

.actions {
  position: sticky;
  bottom: 0;
  margin-top: 56px;
  background: var(--paper);
  border-top: var(--rule);
  padding: 14px 0 10px;
}
.meter { margin-bottom: 10px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.saved { font-size: 15px; color: var(--soft); display: block; min-height: 1.4em; }

.btn {
  display: inline-block;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: var(--rule);
  padding: 13px 20px;
  cursor: pointer;
}
.btn:hover { color: var(--ink); background: #f2f2f2; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #333; color: var(--paper); }
.btn.quiet { border-color: transparent; text-decoration: underline; background: transparent; padding-left: 6px; padding-right: 6px; }

/* ---------- workshop ---------- */

.when-box { border: var(--rule); padding: 0 24px 10px; }
.when-box::before {
  content: "Date, time, place";
  display: block;
  margin: 0 -24px 18px;
  padding: 8px 24px;
  border-bottom: var(--rule);
  font: 400 13px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.when-box .btn { margin-bottom: 14px; }
.when-big { font-size: 34px; font-weight: 600; line-height: 1.15; }

.schedule { list-style: none; padding: 0; margin: 0; }
.schedule li { display: grid; grid-template-columns: 190px 1fr; column-gap: 24px; padding: 18px 0; border-bottom: var(--dash); }
.schedule .sch-time { grid-row: span 2; margin: 5px 0 0; }
.schedule h3 { font-size: 24px; }
.schedule p { margin-bottom: 0; }

.rules { padding-left: 0; list-style: none; counter-reset: rule; }
.rules li { counter-increment: rule; font-size: 21px; padding: 10px 0 10px 56px; position: relative; border-bottom: var(--dash); max-width: 34em; }
.rules li::before { content: "R_0" counter(rule); position: absolute; left: 0; top: 16px; font: 400 13px var(--mono); letter-spacing: 0.04em; }

/* ---------- footer ---------- */

.site-foot { padding: 0 0 40px; }
.foot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; border-top: var(--rule); padding-top: 12px; }

.print-only { display: none; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  body { font-size: 17px; }
  .site-head { padding-top: 20px; }
  .site-head h1 { font-size: 44px; }
  .head-note { font-size: 24px; }
  .tabs { flex-wrap: nowrap; }
  .tabs a { padding: 10px 10px; font-size: 12px; white-space: nowrap; }
  .ingredients, .compare, .kinds, .spine, .intro-pair { grid-template-columns: 1fr; }
  .intro-pair { gap: 20px; }
  .spine > div { border-right: 0; border-bottom: var(--rule); }
  .spine > div:last-child { border-bottom: 0; }
  .schedule li { grid-template-columns: 1fr; }
  .schedule .sch-time { grid-row: auto; margin-bottom: 6px; }
  .lede { font-size: 22px; }
  h2 { font-size: 28px; }
  .actions { position: static; }
  .module-title { font-size: 32px; }
  .rules li { font-size: 18px; }
}

/* ---------- print: A4, black and white ---------- */

@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  body { font-size: 11pt; }
  .site-head { padding: 0; }
  .head-title { margin: 8pt 0 0; }
  .site-head h1 { font-size: 22pt; }
  .head-note, .tabs, .site-foot, .actions, .back, .privacy, .homework, .next { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  main.wrap { padding-top: 12pt; }
  h2 { font-size: 15pt; margin-top: 16pt; }
  mark { background: none; }
  .ingredients li, .compare > div, .kinds > div, .card, .when-box { break-inside: avoid; }
  .print-only { display: block; }
  .print-brief h3 { font-size: 12pt; margin: 14pt 0 4pt; border-bottom: 1pt solid #000; padding-bottom: 2pt; }
  .print-brief .pq { margin: 6pt 0 0; font-size: 10pt; color: #333; }
  .print-brief .pa { margin: 2pt 0 0; white-space: pre-wrap; min-height: 1.2em; }
  .print-brief .pa.empty { border-bottom: 0.75pt solid #999; min-height: 28pt; }
  a { color: #000; text-decoration: none; }
}
