:root {
  --ground: #fffcf7;
  --ink: #000;
  /* line measure in monospace characters; one grid for all text on every page */
  --measure: 49ch;
}

* { box-sizing: border-box; margin: 0; }
html, body { background: var(--ground); color: var(--ink); }

body {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 20px;
  line-height: 24px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 116px 24px 96px;
}

main { width: 100%; max-width: var(--measure); }

.wordmark {
  font-family: "Bitcount Single", system-ui, sans-serif;
  font-size: 55px;
  line-height: 66px;
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke;
  margin-left: 2.6px;
  margin-bottom: 21px;
}

nav {
  font-size: 25px;
  line-height: 30px;
  display: flex;
  gap: 18px;
  margin-bottom: 32px;
}
a, a:visited { color: #0000ee; text-decoration: none; }
a:hover { text-decoration: underline; }

#terminal { margin-bottom: 44px; }
#terminal .line { white-space: pre-wrap; }
#terminal .line .prefix { color: var(--ink); }
#terminal .line .cmd { color: #555; white-space: pre-wrap; }
#terminal .line.output,
#terminal .line.error { color: #555; }
#terminal .caret {
  display: inline-block;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

article p + p { margin-top: 24px; }

.year {
  font-weight: 700;
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke;
  font-size: 25px;
  line-height: 30px;
  margin-top: 32px;
  margin-bottom: 12px;
}
.year:first-of-type { margin-top: 0; }

.row {
  display: grid;
  grid-template-columns: 96px 1fr;
  column-gap: 24px;
  padding: 4px 0;
}

.kv {
  display: grid;
  grid-template-columns: 120px 24px 1fr;
  row-gap: 12px;
}

.post-title {
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke;
  font-size: 25px;
  line-height: 30px;
  white-space: nowrap;
  margin-bottom: 24px;
}
.post-figure {
  display: block;
  width: 100%;
  margin: 32px 0;
}
.post-body { font-family: "Times New Roman", Times, serif; }
.post-section {
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 25px;
  line-height: 30px;
  margin: 32px 0 12px;
}
.post-inline {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
}

.code-drop {
  margin: 12px 0;
  border: 1px solid var(--ink);
}
.code-drop > summary {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
  line-height: 24px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.code-drop > summary::-webkit-details-marker { display: none; }
.code-drop > summary::before { content: "[+] "; }
.code-drop[open] > summary::before { content: "[-] "; }
.code-drop[open] > summary { border-bottom: 1px solid var(--ink); }
.code-drop pre { margin: 0; }
.code-drop pre code.hljs {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 19px;
  padding: 12px;
  overflow-x: auto;
  background: transparent;
}

/* below the design measure (49ch + side padding) the fixed-width rules must yield */
@media (max-width: 640px) {
  body { padding: 64px 20px 72px; }
  .post-title { white-space: normal; }
  .row { grid-template-columns: 72px 1fr; column-gap: 16px; }
  .kv { grid-template-columns: max-content 24px 1fr; }
  a { overflow-wrap: anywhere; }
}
