/* Course and card pages, tuned for long-form reading. Every colour, face and rule is a Ledger token
   (lab/tokens.css, lab/night.css, linked before this file; one-site §2.3): the names below are this file's
   own, kept so the standalone build's inlined copy reads the map's same-named aliases. No colour value
   appears here. Math is MathML rendered by the browser; nothing here requires scripting. */
@font-face { font-family: "STIX Two Text"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/stix-two-text-400-normal.woff2) format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/stix-two-text-400-italic.woff2) format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/stix-two-text-600-normal.woff2) format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/stix-two-text-700-normal.woff2) format("woff2"); }
@font-face { font-family: "STIX Two Math"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/stix-two-math-400-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-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-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-mono-600-normal.woff2) format("woff2"); }
:root {
  --surface-1: var(--paper-sunk); --page: var(--paper);
  --text-primary: var(--ink); --text-secondary: var(--ink-muted); --text-muted: var(--ink-faint);
  --gridline: var(--rule); --border: var(--rule);
  --good: var(--state-settled);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); }
body {
  font-family: var(--font-serif);
  background: var(--page); color: var(--text-primary);
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 20px 20px 60px 20px; }

/* @content-start — everything below is scoped to .course / .deck / .crumbs and is
   inlined verbatim into the standalone single-file build. Everything above is page
   chrome that the map already defines for itself. */
.crumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 22px;
  padding-bottom: 12px; border-bottom: 1px solid var(--gridline); }
.crumbs a { color: var(--link); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumb-sep { margin: 0 7px; }
.crumb-here { color: var(--text-primary); font-weight: 600; }

.course h1 { font-size: 27px; line-height: 1.25; margin: 0 0 18px 0; }
.course h2 { font-size: 20px; margin: 38px 0 12px 0; padding-top: 18px;
  border-top: 1px solid var(--gridline); }
.course h3 { font-size: 16.5px; margin: 28px 0 10px 0; color: var(--text-primary); }
.course h4 { font-size: 14.5px; margin: 20px 0 8px 0; }
.course p { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin: 0 0 15px 0; }
.course li { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 7px; }
.course ol, .course ul { padding-left: 24px; }
.course strong { color: var(--text-primary); }
.course a { color: var(--link); }
.course hr { border: none; border-top: 1px solid var(--gridline); margin: 30px 0; }

.course blockquote {
  margin: 0 0 15px 0; padding: 10px 0 10px 16px;
  border-left: 3px solid var(--state-settled); color: var(--text-secondary);
}
.course blockquote p { margin: 0; }

.course code {
  font-family: var(--font-mono); font-size: 13.5px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px;
}
.course pre { background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; overflow-x: auto; }
.course pre code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.55; }

.course table { border-collapse: collapse; width: 100%; margin: 0 0 18px 0; font-size: 14.5px; display: block; overflow-x: auto; }
.course th, .course td { text-align: left; vertical-align: top; padding: 9px 12px;
  border-bottom: 1px solid var(--gridline); color: var(--text-secondary); line-height: 1.6; }
.course th { color: var(--text-primary); font-size: 12.5px; text-transform: uppercase;
  letter-spacing: 0.05em; white-space: nowrap; }

/* MathML: keep display equations from overflowing on a phone */
math { font-size: 1em; }
/* an inline equation longer than a phone column scrolls inside itself, never the page (set in STIX, a long
   inline formula is wider than it was in the system sans) */
math:not([display="block"]) { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: bottom; }
math[display="block"] { display: block; overflow-x: auto; overflow-y: hidden;
  margin: 16px 0; padding-bottom: 4px; }

.graph-moved {
  background: var(--surface-1); border: 1px dashed var(--border); border-radius: 10px;
  padding: 14px 16px; margin: 18px 0; font-size: 14px; line-height: 1.6;
  color: var(--text-secondary);
}
.graph-moved strong { color: var(--text-primary); }

footer { margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--gridline);
  font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
footer a { color: var(--link); }

/* ---------------------------------------------------------------- decks
   Reveal is <details>/<summary>: no scripting, no state to lose, and the page
   prints as a plain question-and-answer list with every answer visible. */
.deck-lede { font-size: 17px; color: var(--text-secondary); margin: 0 0 20px 0; }
.deck-meta { background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; margin: 0 0 28px 0; }
.deck-meta p { font-size: 14.5px; margin: 0 0 10px 0; }
.deck-meta p:last-child { margin-bottom: 0; }
.deck-note { color: var(--text-tertiary, var(--text-secondary)); font-size: 13.5px !important; }
.deck-counts { list-style: none; padding: 0; margin: 0 0 12px 0;
  display: flex; flex-wrap: wrap; gap: 7px; }
.deck-counts li { font-size: 12px; margin: 0; padding: 3px 9px;
  border: 1px solid var(--border); border-radius: 20px; }
.deck-counts b { color: var(--text-primary); margin-left: 4px; }

.cat h2 .count { font-size: 12px; font-weight: 400; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px;
  vertical-align: middle; margin-left: 8px; }

details.card { border: 1px solid var(--border); border-radius: 10px;
  padding: 0; margin: 0 0 9px 0; background: var(--surface-0, transparent); }
details.card > summary { cursor: pointer; padding: 13px 16px; list-style: none;
  font-size: 15.5px; line-height: 1.55; color: var(--text-primary); }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "?"; display: inline-block; width: 18px;
  margin-right: 10px; text-align: center; font-size: 12px; opacity: .5; }
details.card[open] > summary::before { content: "\2713"; opacity: .8; }
details.card[open] > summary { border-bottom: 1px solid var(--gridline); }
details.card:hover { border-color: var(--link); }
details.card .a { padding: 14px 16px 4px 44px; }
details.card .a p { font-size: 15.5px; margin: 0 0 12px 0; }
details.card .prov { padding: 0 16px 12px 44px; margin: 0;
  font-size: 11.5px !important; opacity: .55; }
details.card .prov code { font-size: 11px; }

@media print {
  details.card > .a, details.card > .prov { display: block !important; }
  details.card > summary::before { content: "Q"; }
}
