/* Tokens, block colour systems and the accessibility modes. Everything in rem. */
:root {
  --o: #F59200; --k: #000; --c: #F7DEB9; --w: #fff; --y: #FFE600; --navy: #000087;
  --f-body: 'Lexend', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --lh: 1.6; --ls: 0; --ws: 0;
  --gut: clamp(1rem, 4vw, 2.5rem);
  --max: 76rem;
}
html { font-size: 100%; }
html[data-size="2"] { font-size: 125%; }
html[data-size="3"] { font-size: 150%; }
html[data-spacing="wide"] { --lh: 1.95; --ls: 0.03em; --ws: 0.12em; }

/* Block classes set semantic tokens: bg, text, heading, link, primary fill / its text,
   card bg / text / accent, border. */
.blk-o { --bg: var(--o); --fg: #000; --hd: #000; --lk: #000; --pf: #000; --pt: var(--o); --cd: #000; --cf: #fff; --ca: var(--o); --bd: #000; --rail: #000; }
.blk-k { --bg: #000; --fg: #fff; --hd: var(--o); --lk: var(--o); --pf: var(--o); --pt: #000; --cd: var(--o); --cf: #000; --ca: #000; --bd: var(--o); --rail: var(--o); }
.blk-c { --bg: var(--c); --fg: #000; --hd: #000; --lk: var(--navy); --pf: #000; --pt: var(--c); --cd: #fff; --cf: #000; --ca: var(--navy); --bd: #000; --rail: #000; }

/* High contrast: black, yellow, white. */
html[data-contrast="high"] .blk-o, html[data-contrast="high"] .blk-k, html[data-contrast="high"] .blk-c {
  --bg: #000; --fg: #fff; --hd: var(--y); --lk: var(--y); --pf: var(--y); --pt: #000;
  --cd: #000; --cf: #fff; --ca: var(--y); --bd: #fff; --rail: var(--y);
}
/* Dark: near-black grounds, white text, orange accents. */
html[data-contrast="dark"] .blk-o, html[data-contrast="dark"] .blk-k, html[data-contrast="dark"] .blk-c {
  --bg: #111; --fg: #fff; --hd: var(--o); --lk: var(--o); --pf: var(--o); --pt: #000;
  --cd: #1f1f1f; --cf: #fff; --ca: var(--o); --bd: var(--o); --rail: var(--o);
}
html[data-contrast="dark"] .blk-c, html[data-contrast="dark"] .blk-k { --bg: #1a1a1a; }
html[data-contrast="dark"] .blk-k { --bg: #000; }
