/* Bad Computers. Set like the book: ETbb for text, IBM Plex Sans for headings
   (licences in fonts/). Headings follow the book's KOMA setup: bold sans, with
   chapter and section headings in capitals. Light only, by design. */

@font-face { font-family: "ETbb"; src: url("fonts/ETbb-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ETbb"; src: url("fonts/ETbb-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "ETbb"; src: url("fonts/ETbb-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "ETbb"; src: url("fonts/ETbb-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/IBMPlexSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --paper: #fbf9f4;
  --ink: #1d1b18;
  --link: #8b1fa9;   /* linkCh7 "violet" in book.tex */
  --rule: #d9d3c7;
  --sans: "Plex Sans", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: only light;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "ETbb", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 21px;
  line-height: 1.5;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 4.5rem 1.25rem 3rem;
}

main, footer {
  max-width: 33rem;
  margin: 0 auto;
}

p { margin: 0 0 1rem; hyphens: auto; -webkit-hyphens: auto; }

a { color: var(--link); text-decoration-thickness: 0.06em; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 0.12em; }

h1, h2 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  hyphens: manual;
  -webkit-hyphens: manual;
}

/* chapter headings: \huge bold sans capitals */
h1 {
  font-size: 1.9rem;
  margin: 0 0 1.5rem;
}

/* section headings: \Large bold sans capitals */
h2 {
  font-size: 1.05rem;
  margin: 2.75rem 0 0.9rem;
}

/* Book page masthead, after the book's title page */
header.book { margin-bottom: 2.5rem; font-family: var(--sans); }
header.book h1 { font-size: 3rem; text-transform: none; margin-bottom: 0.5rem; }
.subtitle { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin-bottom: 1.25rem; hyphens: manual; }
.byline { font-size: 1rem; margin: 0; }
.byline a, .context a { color: inherit; }

.download { margin-top: 1.75rem; }

.context { margin-bottom: 1.25rem; font-family: var(--sans); font-size: 0.85rem; }

/* Contents, set like a printed table of contents */
ol.toc { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.85rem; }
ol.toc li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}
ol.toc li:first-child { border-top: 1px solid var(--rule); }
ol.toc .n { min-width: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
ol.toc .t { flex: 1; }
ol.toc a { font-weight: 700; }
ol.toc a.pdf { font-weight: 400; white-space: nowrap; }
ol.toc .p { font-variant-numeric: tabular-nums; }

.cite { padding-left: 1.5rem; text-indent: -1.5rem; }

nav { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
nav p { margin-bottom: 0.5rem; }

footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}
footer p { margin-bottom: 0.5rem; }

@media (max-width: 600px) {
  html { font-size: 19px; }
  body { padding-top: 2.5rem; padding-left: 16px; padding-right: 16px; }
  header.book h1 { font-size: 2.4rem; }
  h1 { font-size: 1.5rem; }
  .subtitle { font-size: 1.05rem; }
}

@media print {
  :root { --paper: #fff; --ink: #000; --link: #000; }
  body { padding: 0; }
  nav, .download { display: none; }
  a { text-decoration: none; }
}

/* The preprint notice shares the book masthead’s sans-serif family. */
.status { font-family: var(--sans); }
