/* Document stylesheet for lessons and reference cards.
 * Shares tokens with the deck, so the course reads as one thing.
 * Prints on white: see the print block at the foot.
 *
 * Type scale
 * ----------
 * These are documents, read on a laptop, not slides seen from the back of a
 * room. So nothing here goes below 1rem (16px). Body text is 18px; the small
 * furniture -- labels, table heads, captions, buttons -- sits on two steps:
 *   --t-label  the floor. Mono, uppercase labels and controls.
 *   --t-body   secondary prose: table cells, callouts, quiz and recall text.
 * Labels stay legible as labels through case, colour and tracking, not
 * through size. Headings keep their own sizes.
 */
@import url('tokens.css');

:root {
  --t-label: 1rem;
  --t-body: 1.05rem;
}

* { box-sizing: border-box; }

body {
  background: var(--ink-0);
  color: var(--paper);
  font-family: var(--body);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  padding: 3.5rem 1.5rem 6rem;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 42rem; margin: 0 auto; }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 1rem;
}

h1 { font-family: var(--display); font-weight: 600; font-size: 2.6rem; line-height: 1.03; letter-spacing: -0.02em; margin: 0 0 0.6rem; font-variation-settings: 'SOFT' 20, 'WONK' 1; }
h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: 2.8rem 0 0.8rem; letter-spacing: -0.01em; }
h3 { font-weight: 600; font-size: 1.05rem; margin: 1.8rem 0 0.4rem; }
.sub { color: var(--muted); font-size: 1.15rem; margin: 0 0 2.4rem; max-width: 34rem; }
p { margin: 0 0 1.05rem; }
strong { font-weight: 600; color: #fff; }
em { font-style: italic; color: var(--ember); }
a { color: var(--signal); text-underline-offset: 3px; }
ul, ol { padding-left: 1.2rem; }
li { margin-bottom: 0.5rem; }

blockquote { margin: 1.6rem 0; padding-left: 1.2rem; border-left: 2px solid var(--ember); }
blockquote p { font-family: var(--display); font-style: italic; font-size: 1.3rem; line-height: 1.3; color: #fff; margin: 0 0 0.5rem; }
cite { font-family: var(--mono); font-style: normal; font-size: var(--t-label); color: var(--muted); }

code { font-family: var(--mono); font-size: max(0.95em, 1rem); color: var(--ember); background: var(--ink-1); border: 1px solid var(--ink-2); border-radius: 3px; padding: 0.1em 0.38em; }

table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: var(--t-body); }
th, td { text-align: left; padding: 0.6rem 0.8rem 0.6rem 0; border-bottom: 1px solid var(--ink-2); vertical-align: top; }
th { font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.09em; text-transform: uppercase; color: var(--signal); font-weight: 400; }
.table-scroll { overflow-x: auto; }
/* First column is a key: a term, a path, a time range. At the 1rem floor
   these wrap mid-value, so hold them on one line and let the wrapper scroll. */
th:first-child, td:first-child { white-space: nowrap; }

.callout { background: var(--ink-1); border: 1px solid var(--ink-2); border-left: 2px solid var(--signal); border-radius: 3px; padding: 1rem 1.2rem; margin: 1.6rem 0; font-size: var(--t-body); }
.callout p:last-child { margin-bottom: 0; }

.nav { display: flex; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.07em; text-transform: uppercase; margin-top: 3.5rem; border-top: 1px solid var(--ink-2); padding-top: 1.2rem; }

/* ---- quiz component (see assets/quiz.js) ---- */
.quiz { border: 1px solid var(--ink-2); background: var(--ink-1); border-radius: 4px; padding: 1.2rem 1.3rem; margin: 1.8rem 0; }
.quiz .q { font-weight: 600; margin: 0 0 0.9rem; font-size: 1rem; }
.quiz button.opt {
  display: block; width: 100%; text-align: left; font: inherit; font-size: var(--t-body);
  background: var(--ink-0); color: var(--paper); border: 1px solid var(--wire);
  border-radius: 3px; padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; cursor: pointer;
}
.quiz button.opt:hover:not(:disabled) { border-color: var(--signal); }
.quiz button.opt:disabled { cursor: default; opacity: 0.9; }
.quiz button.opt.right { border-color: var(--ok); color: var(--ok); }
.quiz button.opt.wrong { border-color: var(--bad); color: var(--bad); }
.quiz .fb { font-size: var(--t-body); margin-top: 0.7rem; display: none; color: var(--muted); }
.quiz .fb.show { display: block; }

.recall { border: 1px dashed var(--wire); border-radius: 4px; padding: 1.2rem 1.3rem; margin: 1.8rem 0; }
.recall .q { font-weight: 600; margin: 0 0 0.7rem; font-size: 1rem; }
.recall textarea { width: 100%; min-height: 5rem; font: inherit; font-size: var(--t-body); background: var(--ink-0); color: var(--paper); border: 1px solid var(--wire); border-radius: 3px; padding: 0.6rem 0.7rem; }
.recall button.reveal { font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.07em; text-transform: uppercase; background: none; color: var(--signal); border: 1px solid var(--wire); border-radius: 3px; padding: 0.45rem 0.9rem; margin-top: 0.6rem; cursor: pointer; }
.recall button.reveal:hover { border-color: var(--signal); }
.recall .answer { display: none; margin-top: 0.9rem; font-size: var(--t-body); border-top: 1px solid var(--ink-2); padding-top: 0.8rem; color: var(--muted); }
.recall .answer.show { display: block; }
.score { font-family: var(--mono); font-size: var(--t-label); color: var(--muted); margin-top: 0.8rem; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

@media print {
  body { background: #fff; color: #111; padding: 0; font-size: 11pt; }
  h1, h2, h3, strong, blockquote p { color: #000; }
  .quiz, .recall, .nav { display: none; }
  a { color: #111; }
  code { background: #f2f2f2; border-color: #ddd; color: #7a2f0e; }
}
