/* CS 180 Machine Shop — the same token remap, different token names.
 *
 * The Machine Shop was written independently of the MA 261 guide, so it names
 * its own variables: --bg rather than --paper, --f-disp rather than --disp, plus
 * a set the calc guide has no equivalent for (--heap, --stack, --field for the
 * memory diagrams, and eight --c-* syntax colours for the code panes).
 *
 * Loaded after skin.css, which supplies the chrome. This file only remaps
 * pigments. No markup, no layout, no section is touched.
 */

:root {
  --bg: #f4f1ec;
  --bg-deep: #eae6df;
  --panel: #fbf9f6;
  --panel-2: #f0ece5;
  --line: #d2cec6;
  --line-soft: #e4e0d9;
  --rig-bg: #eae6df;

  --ink: #30302e;
  --ink-2: #5e5b55;
  --ink-3: #93918b;

  /* The Machine Shop's --gold-solid was already #CFB991, Purdue's gold, which
     sits three points off the site's own #c7b58a. They merge cleanly. */
  --gold: #8a6a3b;
  --gold-solid: #c7b58a;

  /* Memory diagrams: heap and stack must stay tellable apart at a glance. */
  --heap: #45687a;
  --stack: #8a6a3b;
  --field: #8a6a3b;

  --err: #a8452f;
  --ok: #55763e;

  /* Code panes are a dark surface in both themes by design — reading code on
     bone paper is worse, and every screenshot of Java anywhere is dark. */
  --code-bg: #17171a;
  --code-line: #26262a;

  --shadow: 0 1px 2px rgba(48, 48, 46, 0.05),
    0 10px 30px -20px rgba(48, 48, 46, 0.28);

  --f-disp: Geist, "Helvetica Neue", Arial, sans-serif;
  --f-body: Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* Syntax: gold for keywords, lime for strings — the site's two accents doing
     the two jobs the eye lands on first. */
  --c-key: #c7b58a;
  --c-str: #c9f45b;
  --c-num: #8fb6c7;
  --c-cmt: #7c7a74;
  --c-type: #e0c9a0;
  --c-fn: #e7e3dc;
  --c-txt: #c9c5bd;
  --c-ann: #e08a6e;
}

:root[data-theme="dark"],
:root:has(body.is-dark) {
  --bg: #161615;
  --bg-deep: #101010;
  --panel: #1e1e1c;
  --panel-2: #232320;
  --line: #383734;
  --line-soft: #2a2926;
  --rig-bg: #1e1e1c;

  --ink: #e7e3dc;
  --ink-2: #a9a59d;
  --ink-3: #85827c;

  --gold: #c7b58a;
  --gold-solid: #c7b58a;

  --heap: #8fb6c7;
  --stack: #c7b58a;
  --field: #c7b58a;

  --err: #e08a6e;
  --ok: #c9f45b;

  --code-bg: #0e0e0d;
  --code-line: #232320;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px -20px rgba(0, 0, 0, 0.8);
}

/* The page follows the system when no choice has been made; study.js always
   writes data-theme, so this only covers the first paint. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #161615;
    --bg-deep: #101010;
    --panel: #1e1e1c;
    --panel-2: #232320;
    --line: #383734;
    --line-soft: #2a2926;
    --rig-bg: #1e1e1c;
    --ink: #e7e3dc;
    --ink-2: #a9a59d;
    --ink-3: #85827c;
    --gold: #c7b58a;
    --gold-solid: #c7b58a;
    --heap: #8fb6c7;
    --stack: #c7b58a;
    --field: #c7b58a;
    --err: #e08a6e;
    --ok: #c9f45b;
    --code-bg: #0e0e0d;
    --code-line: #232320;
  }
}

/* Geist and IBM Plex Mono want more vertical room than Archivo and JetBrains
   Mono did — the same metric repair the MA 261 pages needed. */
.modnum,
.pill,
.tag,
.kicker,
.lbl {
  line-height: 1.15;
}
