/* Modeled on sockpuppet.org: left-hung column, red links. Set entirely in JetBrains Mono. */

:root {
  --bg: #ffffff;
  --text: #333333;
  --muted: #777777;
  --accent: #ff0000;
  --rule: #dfdfdf;
  --code-bg: #eef4fb;
  --selection: #ffd6d3;
  --gutter: 125px;
  --measure: 500px;

  --font: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1b;
    --text: #dddddd;
    --muted: #999999;
    --accent: #ff5a4f;
    --rule: #3a3a3a;
    --code-bg: #1a2b45;
    --selection: #5c2522;
  }
}

::selection { background: var(--selection); color: var(--text); }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  padding: 0;
  border-top: 8px solid var(--text);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }

.wrap {
  max-width: calc(var(--measure) + 160px);
  padding: 0 20px 0 var(--gutter);
}

/* Header */
.site-header { padding: 50px 0 0; }
.site-header .title {
  font-weight: 800;
  font-size: 25px;
  line-height: 1.2;
}
.site-header .title a { color: var(--text); }
.site-header .title a:hover { color: var(--accent); }
.site-header .navi {
  margin-top: 0.4em;
  font-size: 13px;
}

/* Article */
article {
  max-width: var(--measure);
  margin: 4em 0 6em;
}
article header { margin: 0 0 2.5em; }
article header h1 {
  margin: 0 0 1em;
  font-weight: 800;
  font-size: 1.6em;
  line-height: 1.3;
}
article header h1 a { color: var(--text); }
article header h1 a:hover { color: var(--accent); }

.post-series { margin: 0.25em 0 0; color: var(--muted); }

h2, h3 {
  font-weight: 800;
  line-height: 1.3;
}
h2 { margin: 2em 0 0.75em; font-size: 1.1em; }
h3 { margin: 1.75em 0 0.5em; font-size: 1em; }

article p { margin: 0 0 1em; }
article p + p { text-indent: 1.3em; }
article li > p { text-indent: 0; }

article ul, article ol { padding-left: 1.3em; }
article li { margin-bottom: 0.4em; }

blockquote {
  margin: 1.5em 0 1.5em 1.3em;
  font-style: italic;
}

/* Section break: --- renders as a fleuron instead of a rule */
article hr {
  border: 0;
  margin: 1.5em 0;
  text-align: center;
  color: var(--muted);
}
article hr::after { content: "❦"; }

article img {
  max-width: 100%;
  padding: 4px;
  box-shadow: 0 0 0 1px var(--rule);
}

/* Code */
code, pre { font-family: inherit; }
code {
  padding: 0.15em 0.4em;
  font-size: 0.88em;
  background: var(--code-bg);
  border-radius: 3px;
}
pre {
  margin: 1.5em 0;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  line-height: 1.7;
  overflow: hidden;
}
pre code {
  display: block;
  background: none;
  padding: 0.8em 1em;
  border-radius: 0;
  white-space: pre;
  overflow-x: auto;
}
/* Diagrams break out of the text column into the empty space on the right */
pre.mermaid {
  width: min(calc(100vw - var(--gutter) - 40px), 900px);
  border: 0;
  background: none;
  text-align: left;
}

table { border-collapse: collapse; margin: 1.5em 0; font-size: 0.93em; }
th, td { padding: 0.3em 0.8em; border-bottom: 1px solid var(--rule); text-align: left; }

/* Post listings */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { margin: 0 0 1.25em; }
.post-list .post-title { font-weight: 800; }
.post-list .post-summary { margin: 0.2em 0 0; text-indent: 0; }

/* Footer */
.site-footer {
  max-width: var(--measure);
  padding: 2em 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1000px) {
  :root { --gutter: 9vw; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  article { margin-top: 3em; }
}
