:root {
  --ink: #66359f;
  --paper: #fafafa;
  --muted: #7b619a;
  --rule: #ddd;
  --code-bg: #f2edf8;
  --measure: 60rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #e8e8e8;
  --paper: #312440;
  --muted: #c2aeda;
  --rule: #4e366a;
  --code-bg: #3b2a4e;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  padding-inline: 1.5rem;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.6;
}

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

/* masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}
.masthead a {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}
.theme-toggle {
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); }

main {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 0;
}

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.5rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.1rem; }

.post-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
}

/* listing */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-list-item:first-child { padding-top: 0; }
.post-list-item:last-child { border-bottom: none; }
.post-list-item h2 { margin: 0 0 0.25rem; }
.post-list-item h2 a { text-decoration: none; }
.post-list-item h2 a:hover { text-decoration: underline; }
.post-list-item .post-meta { margin-bottom: 0.5rem; }
.excerpt { margin: 0.5rem 0; }
.read-more { font-size: 0.85rem; }

/* article */
.post pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
.post code {
  background: var(--code-bg);
  padding: 0.1em 0.3em;
}
.post pre code { background: none; padding: 0; }
.post blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}
.post img { max-width: 100%; height: auto; }
.post hr { border: none; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* series nav */
.series-nav {
  margin: 0 0 2.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  font-size: 0.85rem;
}
.series-nav__head {
  margin: 0 0 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
}
.series-nav__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.series-nav__item {
  padding: 0.2rem 0;
}
.series-nav__item.is-current {
  font-weight: 700;
}
.series-nav__num {
  display: inline-block;
  min-width: 4.5rem;
  color: var(--muted);
}
.series-nav__here {
  color: var(--muted);
  font-weight: 400;
}

/* post nav + pagination */
.post-nav, .pagination {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}

/* footer */
.site-footer {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}
.site-footer p { margin: 0; font-size: 0.8rem; }

/* cross-document page transitions: simple cross-fade */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
}
