:root {
  --ink: #000;
  --paper: #fff;
  --hairline: #333;
  --muted: #595959;
  --mark: #a3301c;
  --hover: #f6efe4;
  color-scheme: light;
}

/* Type grows with the window so a line stays near 65 characters at any width. */
html {
  font-size: clamp(1.125rem, 0.9rem + 0.9vw, 1.45rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  line-height: 1.4;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

/* Layout: a narrow left margin for the site name, then one text column. */

.page {
  display: grid;
  grid-template-columns: 10.5em minmax(0, 27.7em);
  column-gap: 1.75em;
  justify-content: center;
  padding: 3em 1.25em 9em;
}

.masthead {
  line-height: 1.15;
}

.site-name {
  margin: 0;
  padding-bottom: 0.3em;
  border-bottom: 4px solid var(--ink);
  font-size: 1.55em;
  font-weight: 400;
}

.tagline {
  margin: 0.45em 0 0;
  font-size: 1.05em;
}

/* On post pages the site name steps back so the post title leads. */
.masthead--quiet .site-name {
  padding: 0.8em 0 0;
  border-bottom: 0;
  font-size: 1em;
}

.caps,
.masthead--quiet .site-name,
article a[href^="/"] {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
}

/* Links */

a {
  border-radius: 2px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s;
}

a:hover {
  background-color: var(--hover);
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Links to other sites carry a small mark; the second declaration hides it from screen readers. */
a[href^="http"]::after {
  margin-left: 0.04em;
  color: var(--mark);
  content: "°";
  content: "°" / "";
}

/* Homepage */

.home {
  border-top: 4px solid var(--ink);
}

.home h2 {
  margin: 1.6em 0 0.45em;
  font-size: 1.1em;
  font-weight: 700;
  line-height: 1.2;
}

.home section:first-child h2 {
  margin-top: 0.5em;
}

.home p {
  margin: 0 0 0.8em;
}

.toc {
  margin: 0;
  padding: 0 0 0 0.5em;
  line-height: 1.2;
  list-style: none;
}

.toc li {
  margin: 0 0 0.6em;
  break-inside: avoid;
}

.toc--columns {
  columns: 2;
  column-gap: 1.5em;
}

.toc time {
  margin-left: 0.4em;
  color: var(--muted);
}

/* Posts */

article h1 {
  margin: 0;
  padding: 0.1em 0 0.15em;
  border-top: 1px solid var(--hairline);
  font-size: 1.7em;
  font-style: italic;
  font-weight: 400;
  line-height: 1.1;
}

.dateline {
  margin: 0.2em 0 2em;
  color: var(--muted);
}

article p {
  margin: 0 0 1em;
  hyphens: auto;
}

.dateline + p {
  font-size: 1.15em;
}

article h2 {
  margin: 2em 0 0.5em;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.25;
}

article ul,
article ol {
  margin: 0 0 1em;
  padding-left: 2.5em;
}

article li {
  margin-bottom: 0.5em;
}

article ol {
  counter-reset: item;
  list-style: none;
}

article ol > li {
  position: relative;
  counter-increment: item;
}

article ol > li::before {
  position: absolute;
  top: 0.3em;
  left: -3.6em;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid var(--ink);
  border-radius: 50%;
  content: counter(item);
  font-size: 0.68em;
  line-height: 1.5em;
  text-align: center;
}

blockquote {
  margin: 0 0 1em;
  padding: 0 1.5em;
  font-size: 0.92em;
}

/* A rule in the text is a pause, shown as space instead of a line. */
hr {
  height: 1em;
  margin: 0;
  border: 0;
}

code,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8em;
}

pre {
  margin: 0 0 1.25em;
  padding-left: 1.875em;
  overflow-x: auto;
  line-height: 1.45;
}

pre code {
  font-size: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* Narrow screens: the margin column moves above the text. */
@media (max-width: 55em) {
  .page {
    display: block;
    padding: 1.5em 1.1em 5em;
  }

  .masthead {
    margin-bottom: 2em;
  }

  .masthead--quiet .site-name {
    padding-top: 0;
  }

  .home {
    border-top: 0;
  }
}
