:root {
  --paper: #f2f3f1;
  --ink: #17181a;
  --ink-muted: #5b5f63;
  --accent: #2547b8;
  --accent-soft: #e7ebf7;
  --rule: #dbdad5;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  --max-width: 680px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.75rem 1.5rem;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-links a {
  display: inline-flex;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}

.social-links a:hover {
  color: var(--accent);
}

.social-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Main content */

main {
  padding: 3rem 1.5rem 4rem;
}

/* Article list (homepage) */

.empty-state {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

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

.article-list li {
  margin-bottom: 2.5rem;
}

.article-list li:last-child {
  margin-bottom: 0;
}

.meta {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.article-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.article-title a {
  color: var(--ink);
  text-decoration: none;
}

.article-title a:hover {
  color: var(--accent);
}

.article-title a::after {
  content: " \2192";
  display: inline-block;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.article-title a:hover::after {
  opacity: 1;
}

/* Article page */

article h1 {
  margin: 0 0 2rem;
  font-size: 2rem;
  line-height: 1.25;
}

article h2 {
  margin: 2.25rem 0 1rem;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
}

article h3 {
  margin: 1.75rem 0 0.9rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
}

article h4,
article h5,
article h6 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

article p,
article ul,
article ol,
article blockquote {
  margin: 0 0 1.4rem;
}

article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.15em;
  transition: text-decoration-color 0.15s ease;
}

article a:hover {
  text-decoration-color: currentColor;
}

article blockquote {
  border-left: 2px solid var(--rule);
  margin-left: 0;
  padding-left: 1.2rem;
  color: var(--ink-muted);
}

article code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--accent-soft);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

article pre {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.55;
  background: var(--accent-soft);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
}

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

article img {
  max-width: 100%;
  display: block;
}

.back-link {
  margin-top: 3rem;
}

.back-link a {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
}

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

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* Focus visibility */

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

/* Skip link */

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 3px;
  z-index: 10;
  transition: top 0.15s ease;
}

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

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Small screens */

@media (max-width: 600px) {
  body {
    font-size: 1.05rem;
  }

  main {
    padding: 2.25rem 1.25rem 3rem;
  }

  article h1 {
    font-size: 1.6rem;
  }

  .article-title {
    font-size: 1.3rem;
  }
}
