/* aaronpeabody.dev — monospace web. No JS, one CSS file, everything on the grid. */

:root {
  --paper: #f6f4ee;
  --ink: #201d18;
  --ink-soft: #5c564c;
  --rule: #c9c3b6;
  --accent: #2b3fa8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f;
    --ink: #e6e1d5;
    --ink-soft: #98917f;
    --rule: #3a362c;
    --accent: #8b9df0;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
}

/* The grid: every line is 1.4rem tall, widths measured in ch */
body {
  margin: 0 auto;
  padding: 2.8rem 2ch 5.6rem;
  max-width: 78ch;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.4rem;
}

p { margin: 1.4rem 0; }

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

.soft { color: var(--ink-soft); }

/* Boxed masthead */
.masthead {
  border: 1px solid var(--ink);
  padding: 0.7rem 2ch;
  display: flex;
  justify-content: space-between;
  gap: 2ch;
}

.masthead .name { font-weight: 700; text-transform: uppercase; }
.masthead .name a { color: var(--ink); }
.masthead .name a:hover { background: var(--ink); color: var(--paper); }
.masthead .role { color: var(--ink-soft); }
.masthead .chip { color: var(--accent); font-weight: 700; }

/* Headings sit on the grid at body size, marked like markdown */
h1, h2, h3 {
  font-size: inherit;
  font-weight: 700;
  text-transform: uppercase;
  margin: 2.8rem 0 1.4rem;
}

h1::before { content: "# "; color: var(--ink-soft); }
h2::before { content: "## "; color: var(--ink-soft); }
h3::before { content: "### "; color: var(--ink-soft); }

/* Directory-tree work list and other preformatted blocks */
pre {
  margin: 1.4rem 0;
  font: inherit;
  overflow-x: auto;
}

/* Ruled tables (writing index, and any table in a post) */
table {
  border-collapse: collapse;
  margin: 1.4rem 0;
}

th, td {
  border: 1px solid var(--ink);
  padding: 0.35rem 2ch;
  text-align: left;
  font-weight: 400;
}

th { color: var(--ink-soft); }

td a { display: inline-block; }

/* Posts */
.post-header { margin-bottom: 2.8rem; }

.post-header time {
  color: var(--ink-soft);
  text-transform: uppercase;
}

.post-header h1 { margin: 0.7rem 0 0; }

article h1 { margin-top: 0; }

blockquote {
  margin: 1.4rem 0 1.4rem 2ch;
  padding-left: 2ch;
  border-left: 2px solid var(--rule);
  color: var(--ink-soft);
}

code {
  font: inherit;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  padding: 0 0.5ch;
}

article pre {
  padding: 0.7rem 2ch;
  border: 1px solid var(--rule);
}

pre code { background: none; padding: 0; }

hr {
  border: none;
  border-top: 1px dashed var(--rule);
  margin: 2.8rem 0;
}

img { max-width: 100%; }

/* Keycap footer */
.keys {
  margin-top: 5.6rem;
  display: flex;
  align-items: baseline;
  gap: 1ch;
  flex-wrap: wrap;
}

.key {
  display: inline-block;
  border: 1px solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 3px;
  padding: 0 1ch;
}

a.key { color: var(--ink); }
a.key:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.keys .fine { color: var(--ink-soft); margin-left: 1ch; }
