@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/courier-prime/courier-prime-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/courier-prime/courier-prime-bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Courier Prime';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/courier-prime/courier-prime-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Courier Prime';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/courier-prime/courier-prime-bold-italic.woff2') format('woff2');
}

:root {
  --color-text: #111;
  --color-text-muted: #555;
  --color-text-faint: #999;
  --color-accent: #dc3545;
  --color-bg: #f8f8f8;
  --color-surface: #ebebeb;
  --color-surface-hover: #e2e2e2;
  --font-family-mono: 'Courier Prime', monospace;
  --max-width: 720px;
}

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

body {
  font-family: var(--font-family-mono);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--color-surface);
  padding: 1rem 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
}

.brand-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.brand-bold {
  font-weight: 700;
}

.brand-italic {
  font-style: italic;
  font-size: 0.8em;
  color: var(--color-accent);
  margin-left: 0.15em;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-text);
}

/* Main */

main.wrap {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.section-heading {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Featured post + stacked list */

.post-featured {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-surface);
}

.post-featured h2 {
  font-size: 1.6rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.post-featured h2 a {
  text-decoration: none;
  color: var(--color-text);
}

.post-featured time,
.post-stack time,
.archive-list time,
.post-meta time {
  color: var(--color-text-faint);
  font-size: 0.85rem;
}

.post-featured .summary {
  margin: 0.9rem 0;
  font-size: 0.95rem;
}

.post-featured .summary p {
  margin-bottom: 0.75rem;
}

.read-more {
  display: inline-block;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.read-more:hover {
  text-decoration: underline;
}

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

.post-stack li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--color-surface);
}

.post-stack a {
  text-decoration: none;
  font-weight: 700;
}

.post-stack a:hover {
  color: var(--color-accent);
}

/* Archive */

.archive-year {
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  font-size: 1rem;
  color: var(--color-accent);
}

.archive-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.archive-list li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.archive-list time {
  min-width: 3em;
}

.archive-list a {
  text-decoration: none;
}

.archive-list a:hover {
  color: var(--color-accent);
}

/* Post / page */

.post h1 {
  font-size: 1.6rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.post-body {
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote,
.post-body pre {
  margin-bottom: 1rem;
}

.post-body h2 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.6rem;
}

.post-body h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}

.post-body ul,
.post-body ol {
  padding-left: 1.4rem;
}

.post-body a {
  color: var(--color-accent);
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 0.5rem 0;
  display: block;
}

.post-body blockquote {
  border-left: 3px solid var(--color-surface-hover);
  padding-left: 1rem;
  color: var(--color-text-muted);
}

.post-body code {
  background: var(--color-surface);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.post-body pre {
  background: var(--color-surface);
  padding: 0.8rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.back-link {
  margin-top: 2rem;
  font-size: 0.85rem;
}

.back-link a {
  color: var(--color-accent);
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}

/* Tags / categories */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag-pill,
.category-badge {
  font-size: 0.8rem;
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.tag-pill {
  color: var(--color-accent);
  background: transparent;
  border: 1px solid var(--color-surface-hover);
  padding: 0.1rem 0;
  background: none;
}

.category-badge:hover,
.tag-pill:hover {
  color: var(--color-text);
}

/* Pagination */

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  font-size: 0.85rem;
}

.pagination a {
  color: var(--color-accent);
  text-decoration: none;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-surface);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.site-footer .wrap {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-faint);
}

.site-footer a {
  color: var(--color-text-faint);
}

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

/* Mobile */

@media (max-width: 640px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-featured h2 {
    font-size: 1.35rem;
  }
  .post-stack li {
    flex-direction: column;
    gap: 0.15rem;
  }
}
