:root {
  --bg: #0b0e14; --surface: #151921; --accent: #7c3aed; --accent-light: #a78bfa;
  --text-main: #e2e8f0; --text-muted: #94a3b8; --code-bg: #1e293b; --border: #2d3748;
  --ok: #34d399; --bad: #f87171;
}
* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text-main);
  line-height: 1.7; margin: 0; }
a { color: var(--accent-light); }
header.site { border-bottom: 1px solid var(--border); padding: 0.75rem 1rem; }
header.site nav { max-width: 860px; margin: 0 auto; display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: baseline; }
header.site .brand { font-weight: 700; color: var(--text-main); text-decoration: none; margin-right: auto; }
header.site nav a { text-decoration: none; }
main { max-width: 860px; margin: 0 auto; padding: 2rem 1rem 4rem; }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0.5rem 0 1rem; }
h2 { margin-top: 2.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
h3 { margin-top: 1.8rem; color: var(--accent-light); }
p, li { color: var(--text-main); }
.lead { color: var(--text-muted); font-size: 1.1rem; }
code { font-family: 'Fira Code', monospace; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
pre { font-family: 'Fira Code', monospace; background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.8rem 1rem; overflow-x: auto; font-size: 0.9rem; line-height: 1.5; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
th, td { border: 1px solid var(--border); padding: 0.35rem 0.7rem; text-align: left; vertical-align: top; }
th { background: var(--surface); }
.note { background: var(--surface); border-left: 3px solid var(--accent); padding: 0.6rem 1rem; border-radius: 0 6px 6px 0; }
.exercise { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 1.1rem 0.8rem; margin: 1.5rem 0; }
.exercise h4 { margin: 0.6rem 0 0.2rem; color: var(--accent-light); }
.exercise .goal-label { color: var(--text-muted); font-size: 0.85rem; margin: 0.4rem 0 0; }
pre.ether-expect { border-style: dashed; }
details summary { cursor: pointer; color: var(--text-muted); }
.chapter-nav { display: flex; justify-content: space-between; margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 1rem; }
/* Runnable blocks (js/ether.js) */
.ether-box { margin: 1rem 0; }
.ether-src { width: 100%; font-family: 'Fira Code', monospace; font-size: 0.9rem; line-height: 1.5;
  background: var(--code-bg); color: var(--text-main); border: 1px solid var(--border);
  border-radius: 8px 8px 0 0; padding: 0.8rem 1rem; resize: vertical; display: block; }
.ether-bar { display: flex; gap: 0.6rem; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-top: none; padding: 0.35rem 0.6rem; flex-wrap: wrap; }
.ether-run { background: var(--accent); color: white; border: none; border-radius: 5px; padding: 0.25rem 0.9rem; cursor: pointer; font-weight: 600; }
.ether-run:disabled { opacity: 0.5; }
.ether-mode { background: var(--code-bg); color: var(--text-muted); border: 1px solid var(--border); border-radius: 5px; padding: 0.15rem 0.3rem; }
.ether-note { color: var(--text-muted); font-size: 0.8rem; margin-left: auto; }
.ether-box pre.ether-out, .ether-box pre.ether-result { margin: 0; border-top: none; border-radius: 0 0 8px 8px; white-space: pre-wrap; }
.ether-box pre.ether-out::before { content: 'output'; display: block; color: var(--text-muted); font-size: 0.75rem; }
.ether-values { color: var(--text-muted); }
.ether-error { color: var(--bad); }
footer { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 2rem 1rem; border-top: 1px solid var(--border); }
/* Ether words like => and -- must show as typed, not as ligatures. */
code, pre, textarea { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
