:root {
  color-scheme: light;
  --ink: #222;
  --muted: #666;
  --line: #ddd;
  --link: #0645ad;
  --code-bg: #f5f5f5;
  --content-width: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 14px/1.55 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: normal;
  word-spacing: normal;
}

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

a:focus-visible {
  outline: 2px solid rgb(6 69 173 / 35%);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: .6rem;
  left: .6rem;
  z-index: 10;
  padding: .4rem .65rem;
  background: #222;
  color: #fff;
  transform: translateY(-180%);
}

.skip-link:focus { color: #fff; transform: translateY(0); }

main,
.site-header,
.site-footer {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}

.site-header .brand {
  font-size: 1.15rem;
  color: var(--ink);
}

.site-header .brand:hover { text-decoration: none; }
.site-header .brand span { color: var(--muted); font-weight: 400; }

.site-header nav a {
  margin-left: 1rem;
  font-size: .85rem;
}

main { padding-block: 1.6rem 3rem; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: .3rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

/* --- Post list (index.html) --- */

#post-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.4rem;
}

#post-list li {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: .8rem;
  /* The date is body size and the title is larger; without this the two cells
     align on their top edge and the date sits a couple of pixels high. */
  align-items: baseline;
}

#post-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-title {
  display: inline-block;
  color: var(--ink);
  font-size: 1.02rem;
}

.post-title:hover { color: var(--link); }

.post-summary {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

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

/* --- Post page (post.html) --- */

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.6rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

.post-content h2 {
  margin: 1.8rem 0 .7rem;
  font-size: 1.2rem;
}

.post-content h3 {
  margin: 1.4rem 0 .5rem;
  font-size: 1.02rem;
}

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

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

.post-content li { margin-bottom: .3rem; }

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

.post-content blockquote {
  margin-inline: 0;
  padding: .2rem 1rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.post-content code {
  padding: .1rem .3rem;
  background: var(--code-bg);
  border-radius: 3px;
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.post-content pre {
  padding: .9rem 1rem;
  background: var(--code-bg);
  border-radius: 6px;
  overflow-x: auto;
}

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

.post-content hr {
  margin: 1.8rem 0;
  border: none;
  border-top: 1px solid var(--line);
}

.back-link { display: inline-block; margin-top: 2rem; font-size: .85rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .8rem;
  padding: 1rem 0 2.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}

.site-footer p { margin-bottom: 0; }

@media (max-width: 600px) {
  #post-list li { grid-template-columns: 1fr; gap: .2rem; }
  .site-header { flex-direction: column; gap: .3rem; align-items: flex-start; }
  .site-header nav a { margin-left: 0; margin-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
