:root {
  --foreground: #111;
  --background: #fff;
  --muted: #666;
  --line: #ddd;
  --code-background: #f2f2f2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground: #eee;
    --background: #111;
    --muted: #999;
    --line: #333;
    --code-background: #1c1c1c;
  }
}

* {
  box-sizing: border-box;
}

body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  color: var(--foreground);
  background: var(--background);
  font: 1.0625rem/1.65 system-ui, sans-serif;
}

a {
  color: inherit;
}

header {
  margin-bottom: 3rem;
}

.home {
  font-weight: 700;
  text-decoration: none;
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list li + li {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.post-list h2 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

.post-list h2 a {
  text-decoration: none;
}

.post-list h2 a:hover {
  text-decoration: underline;
}

time,
.meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.excerpt {
  margin: 0;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  line-height: 1.2;
}

.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 1rem;
  margin: 0 0 2rem;
}

.meta dt {
  text-transform: capitalize;
}

.meta dd {
  margin: 0;
}

.content img,
.content video {
  max-width: 100%;
  height: auto;
}

.content pre {
  padding: 1rem;
  overflow-x: auto;
  background: var(--code-background);
}

.content code {
  font-size: 0.9em;
}

.back {
  display: inline-block;
  margin-top: 3rem;
}

.error {
  color: var(--muted);
}
