*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fdfcfb;
  --text: #111;
  --muted: #666;
  --border: #ddd;
  --font-sans: ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
}

html {
  font-size: 17px;
}

body {
  font-family: var(--font-serif);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Skip link */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Focus */

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Links */

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #aaa;
  transition: text-decoration-color 0.1s;
}

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

/* Nav */

header {
  margin-bottom: 4rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

nav a {
  text-decoration: none;
  color: var(--muted);
}

nav a.site-title {
  color: var(--text);
  font-weight: 600;
  margin-right: auto;
  font-size: 1rem;
}

nav a:hover {
  color: var(--text);
}

nav a.active {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text);
}

/* Footer */

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--font-sans);
}

/* Home */

.tagline {
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

main > section {
  margin-bottom: 3rem;
}

main > section h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1rem;
  font-family: var(--font-sans);
}

main > section h2 a {
  color: inherit;
  text-decoration: none;
}

main > section h2 a:hover {
  color: var(--text);
}

/* Post list */

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-description {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.post-list a {
  text-decoration: none;
  display: block;
  padding: 0.5rem 0.65rem;
  margin: -0.5rem -0.65rem;
  border-radius: 6px;
  transition: background-color 0.15s;
}

.post-list a:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

/* Single / article */

article .post-header {
  margin-bottom: 2.5rem;
}

article h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.tags {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

/* Content prose */

.content > * + * {
  margin-top: 1.25rem;
}

.content h2 {
  font-size: 1.2rem;
  margin-top: 2rem;
}

.content h3 {
  font-size: 1rem;
  margin-top: 1.5rem;
}

.content ul,
.content ol {
  padding-left: 1.5rem;
}

.content li + li {
  margin-top: 0.25rem;
}

.content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--muted);
}

.content pre {
  background: #f4f4f4;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: #f4f4f4;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.content hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* Post nav */

.post-nav {
  margin-top: 3rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.post-nav a {
  text-decoration: none;
  color: var(--muted);
}

.post-nav a:hover {
  color: var(--text);
}

/* List page */

main > h1 {
  font-size: 1.4rem;
  margin-bottom: 2rem;
}

/* Responsive */

@media (max-width: 480px) {
  html { font-size: 16px; }
  body { padding: 2rem 1rem; }
  header { margin-bottom: 2.5rem; }
  nav { gap: 1rem; }
}
