* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 660px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

a {
  color: rgb(0, 102, 222);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  line-height: 1.3;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p {
  margin: 0 0 1em;
}

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

blockquote {
  border-left: 3px solid #ccc;
  margin: 1em 0;
  padding: 0.5em 1em;
  color: #555;
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

pre {
  background: #f5f5f5;
  padding: 1em;
  overflow-x: auto;
  border-radius: 3px;
  font-size: 0.875rem;
  line-height: 1.5;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
}

:not(pre) > code {
  background: #f0f0f0;
  padding: 0.15em 0.3em;
  border-radius: 3px;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.5em 0.75em;
  text-align: left;
}

th {
  background: #f5f5f5;
}

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2em 0;
}

/* Site header */

.site-header {
  margin-bottom: 2rem;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
}

.site-title:hover {
  text-decoration: none;
  color: rgb(0, 102, 222);
}

/* Article header */

article header {
  margin-bottom: 2rem;
}

article header h1 {
  margin-top: 0;
  margin-bottom: 0.25em;
}

.meta {
  color: #888;
  font-size: 0.9rem;
}

.meta .location {
  color: #888;
}

/* Homepage */

.homepage h1 {
  margin-top: 0;
}

.link-list {
  display: flex;
  gap: 0.75em;
  font-size: 1.1rem;
}

.link-list a {
  color: #999;
}

.link-list a:hover {
  color: rgb(0, 102, 222);
  text-decoration: none;
}

/* Post list */

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

.post-list li {
  margin-bottom: 0.4em;
}

.post-list time {
  display: inline-block;
  width: 5em;
  color: #888;
  font-size: 0.9rem;
}

/* Shortcodes */

.aside {
  font-size: small;
  font-style: italic;
}

.aside a {
  color: inherit;
}

.alert {
  border: 1px solid #ccc;
  background: #fafafa;
  padding: 0.75em 1em;
  border-radius: 3px;
  margin: 1em 0;
}

.alert p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.15em;
  color: #555;
}

/* Footnotes */

.footnotes {
  font-size: small;
}

/* Site footer */

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  font-size: 0.8rem;
  color: #888;
}

.site-footer a {
  color: #888;
}

.site-footer a:hover {
  color: rgb(0, 102, 222);
}

/* Dark mode */

@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #d4d4d4;
  }

  a {
    color: rgb(70, 150, 255);
  }

  .site-title {
    color: #d4d4d4;
  }

  .site-title:hover {
    color: rgb(70, 150, 255);
  }

  blockquote {
    border-left-color: #555;
    color: #aaa;
  }

  pre {
    background: #2a2a2a;
  }

  :not(pre) > code {
    background: #2a2a2a;
  }

  th, td {
    border-color: #444;
  }

  th {
    background: #2a2a2a;
  }

  hr {
    border-top-color: #444;
  }

  .meta,
  .meta .location {
    color: #888;
  }

  .post-list time {
    color: #888;
  }

  .alert {
    border-color: #444;
    background: #222;
  }

  .lead {
    color: #aaa;
  }

  .site-footer {
    border-top-color: #333;
    color: #666;
  }

  .site-footer a {
    color: #666;
  }

  .site-footer a:hover {
    color: rgb(70, 150, 255);
  }

  .link-list a {
    color: #777;
  }

  .link-list a:hover {
    color: rgb(70, 150, 255);
  }
}
