/* The look of the HTML book. Colours follow zeno-lang.org. */
:root {
  --ink: #1b2333;
  --soft: #5b6478;
  --line: #e2e5ec;
  --page: #ffffff;
  --side: #f6f7fb;
  --blue: #2f5bea;
  --code: #f4f6fb;
  --out: #fbfbf8;
  --outline: #d9dce3;
  --note: #eef2fd;
  --why: #fff7e8;
  --whyline: #e8a33d;
  --try: #f1f8f1;
  --tryline: #4c9a52;
  --kw: #1f45c4;
  --str: #2e7d32;
  --com: #7a8194;
  --num: #a0522d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7e9ee;
    --soft: #a3a9b6;
    --line: #262a33;
    --page: #0a0a0a;
    --side: #111214;
    --blue: #7d9cff;
    --code: #15171c;
    --out: #101113;
    --outline: #2c3038;
    --note: #121a2e;
    --why: #231c10;
    --whyline: #c98a2c;
    --try: #102016;
    --tryline: #4c9a52;
    --kw: #8fa8ff;
    --str: #7cc485;
    --com: #7c8496;
    --num: #e0a070;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.65 "Hanken Grotesk", system-ui, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 18px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar .brand { font-weight: 700; color: var(--ink); font-size: 18px; }
.bar .version { color: var(--soft); font-size: 14px; }
.bar .site { margin-left: auto; font-size: 14px; }
.bar .menu { display: none; background: none; border: 0; color: var(--ink); font-size: 22px; cursor: pointer; }

.layout { display: flex; }
.sidebar {
  position: sticky; top: 52px; align-self: flex-start;
  width: 300px; flex: none; height: calc(100vh - 52px); overflow-y: auto;
  padding: 18px 16px 40px; background: var(--side);
  border-right: 1px solid var(--line); font-size: 14.5px; line-height: 1.45;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar > ul > li { margin: 14px 0 4px; }
.sidebar > ul > li > a { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 12.5px; color: var(--soft); }
.sidebar ul ul li a { display: block; padding: 3px 8px; border-radius: 6px; color: var(--ink); }
.sidebar ul ul ul { display: none; }
.sidebar a.here { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.sidebar .number { color: var(--soft); margin-right: 4px; }

main { flex: 1; min-width: 0; padding: 26px 40px 60px; }
article, .cover, .contents, .pager, footer { max-width: 760px; margin-left: auto; margin-right: auto; }

h1, h2, h3, h4 { line-height: 1.25; }
h1.part { font-size: 40px; margin: 40px 0 10px; color: var(--blue); }
h2.chapter { font-size: 34px; margin: 18px 0 18px; }
h3 { font-size: 24px; margin-top: 2em; }
h4 { font-size: 19px; margin-top: 1.6em; }
h2 .number, h3 .number { color: var(--blue); margin-right: .15em; }

.cover { padding: 40px 0 10px; border-bottom: 2px solid var(--blue); margin-bottom: 20px; }
.cover .kicker { color: var(--blue); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin: 0; }
.cover .title { font-size: 52px; margin: 6px 0; }
.cover .subtitle { font-size: 22px; color: var(--soft); margin: 0 0 10px; }
.cover .author { font-weight: 600; margin: 0; }
.contents ul { padding-left: 1.1em; }
.contents > ul > li { margin-top: .6em; font-weight: 600; }
.contents ul ul { font-weight: 400; }
.contents ul ul ul { display: none; }

code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .86em; }
p code, li code, td code { background: var(--code); padding: .1em .3em; border-radius: 4px; }
pre {
  margin: .9em 0; padding: 12px 16px; overflow-x: auto;
  border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0;
  background: var(--code); line-height: 1.5; font-size: 15px;
}
pre code { background: none; padding: 0; font-size: 14px; }
pre.Output, div.sourceCode.Output, pre.output { background: var(--out); border-left-color: var(--outline); }
div.sourceCode { margin: .9em 0; }
div.sourceCode pre { margin: 0; }
.zenofile { margin: 1.1em 0 -.75em; font: 600 13px "JetBrains Mono", monospace; color: var(--blue); }
.zenofile p { margin: 0; }
.nooutput { color: var(--soft); font-style: italic; font-size: 15px; }
.nooutput p { margin: 0 0 .8em; }

code span.kw, code span.cf { color: var(--kw); font-weight: 600; }
code span.dt { color: var(--kw); }
code span.st, code span.ch { color: var(--str); }
code span.co { color: var(--com); font-style: italic; }
code span.dv, code span.fl { color: var(--num); }
code span.bu { color: var(--ink); }

.note, .why, .tryit, .summary {
  margin: 1.2em 0; padding: 10px 18px; border-radius: 0 8px 8px 0; font-size: 16px;
}
.note { background: var(--note); border-left: 3px solid var(--blue); }
.why { background: var(--why); border-left: 3px solid var(--whyline); }
.tryit { background: var(--try); border-left: 3px solid var(--tryline); }
.summary { background: var(--code); }
.note::before { content: "Note."; font-weight: 700; margin-right: .3em; float: left; }
.why::before { content: "Why."; font-weight: 700; margin-right: .3em; float: left; }
.tryit::before { content: "Things to try"; display: block; font-weight: 700; font-size: 19px; margin: 6px 0 2px; }
.summary::before { content: "What this chapter said"; display: block; font-weight: 700; margin: 6px 0 2px; }
.note pre, .why pre, .tryit pre { clear: both; }

table { border-collapse: collapse; margin: 1.1em 0; width: 100%; font-size: 15.5px; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--line); }
th { border-bottom: 2px solid var(--ink); }
td p, th p { margin: 0; }

.pager { display: flex; gap: 12px; font-size: 15px; }
.pager .next { margin-left: auto; text-align: right; }
.pager.bottom { margin-top: 50px; padding-top: 16px; border-top: 1px solid var(--line); }
footer { margin-top: 30px; color: var(--soft); font-size: 13.5px; font-style: italic; }

@media (max-width: 980px) {
  .bar .menu { display: block; }
  .sidebar { position: fixed; left: 0; top: 52px; z-index: 9; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.2); }
  body.open .sidebar { transform: none; }
  main { padding: 18px 16px 50px; }
  .bar .version { display: none; }
  h1.part { font-size: 32px; }
  h2.chapter { font-size: 28px; }
  .cover .title { font-size: 40px; }
}
@media print {
  .bar, .sidebar, .pager { display: none; }
  main { padding: 0; }
}
.prefacehead { font-size: 22px; font-weight: 700; margin: 1.6em 0 .4em; }
.prefacehead p { margin: 0; }

/* Code and output are shown as typed: no ligature turns --> into an arrow. */
pre, code { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
