:root {
  --bg: #fdfdfc;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #b8410f;
  --rule: #e5e5e2;
  --code-bg: #f4f3f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --fg: #e8e6e3;
    --muted: #8a8a8a;
    --accent: #ff8a4c;
    --rule: #2a2a2e;
    --code-bg: #1f1f23;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 1rem;
  scrollbar-gutter: stable;
}

body {
  font-family: Charter, "Iowan Old Style", Palatino, Georgia, serif;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  max-width: 38rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

header.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin-bottom: 2.5rem;
}

header.site a {
  text-decoration: none;
}

header.site .title {
  font-weight: 600;
  color: var(--fg);
}

header.site nav a {
  color: var(--muted);
  margin-left: 1rem;
}

header.site nav a:hover {
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: sans-serif;
  line-height: 1.25;
  margin-top: 2rem;
}

h1 {
  font-size: 1.75rem;
  margin-top: 0;
}

h2 {
  font-size: 1.25rem;
}

h2,
h3,
h4,
h5,
h6 {
  position: relative;
}

a.anchor {
  color: var(--muted);
  text-decoration: none;
  font-weight: normal;
  opacity: 0;
  margin-left: 0.25rem;
}

h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor,
a.anchor:focus {
  opacity: 1;
}

h3 {
  font-size: 1.05rem;
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration: none;
}

p {
  margin: 1rem 0;
}

time,
.meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: sans-serif;
}

ul.posts {
  list-style: none;
  padding: 0;
}

ul.posts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--rule);
}

ul.posts li a {
  flex: 1;
  text-decoration: none;
}

ul.posts li a:hover {
  color: var(--accent);
}

ul.posts li time {
  white-space: nowrap;
}

article header {
  margin-bottom: 2rem;
}

article header time {
  display: block;
  margin-top: 0.25rem;
}

code,
pre,
kbd,
samp {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  line-height: 1.45;
}

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

blockquote {
  border-left: 3px solid var(--rule);
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

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

table {
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--rule);
}

th {
  font-family: sans-serif;
  font-weight: 600;
}

.with-aside {
  position: relative;
}

aside.side {
  position: absolute;
  top: 0;
  left: 100%;
  width: 13rem;
  margin-left: 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-family: sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
}

aside.side strong {
  display: block;
  color: var(--fg);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

aside.side p {
  margin: 0.25rem 0;
}

@media (max-width: 70rem) {
  aside.side {
    position: static;
    width: auto;
    margin: 1.5rem 0;
  }
}

details.toc {
  font-family: sans-serif;
  font-size: 0.9rem;
  background: var(--code-bg);
  border-left: 3px solid var(--rule);
  padding: 0.5rem 1rem;
  margin: 2rem 0;
}

details.toc summary {
  cursor: pointer;
  color: var(--muted);
}

details.toc[open] summary {
  margin-bottom: 0.4rem;
}

details.toc ul {
  padding-left: 1.25rem;
  margin: 0;
}

details.toc li {
  padding: 0.15rem 0;
}

details.toc a {
  text-decoration: none;
  color: var(--fg);
}

details.toc a:hover {
  color: var(--accent);
}

footer.site {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: sans-serif;
}