:root {
  --text: #333;
  --muted: #777;
  --link: #1e73be;
  --border: #e5e5e5;
  --bg: #fff;
  --code-bg: #f5f5f5;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ddd;
    --muted: #999;
    --link: #6cb4ee;
    --border: #333;
    --bg: #161616;
    --code-bg: #222;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1rem;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Diagrams and schematics are often transparent with black lines, so keep them on white in dark mode */
.entry-content img {
  background: #fff;
  padding: 0.25rem;
  border-radius: 2px;
}

.site-header, .site-content, .site-footer {
  max-width: 1100px;
  margin: 0 auto;
}

.site-header {
  padding-top: 2.5rem;
  text-align: center;
}
.site-title { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.site-title a { color: var(--text); }
.site-tagline { margin: 0.25rem 0 1rem; color: var(--muted); }
.header-image { display: block; width: 100%; margin-top: 1.5rem; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 3rem;
  padding: 2rem 0;
}
@media (max-width: 800px) {
  .site-content { grid-template-columns: minmax(0, 1fr); }
}

.post { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.entry-title { margin: 0; line-height: 1.3; }
.entry-title a { color: var(--text); }
.entry-meta { margin: 0.25rem 0 1rem; color: var(--muted); font-size: 0.875rem; }
.page-title { margin-top: 0; font-size: 1.25rem; color: var(--muted); }

pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--code-bg);
  font-size: 0.875rem;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.katex-display { overflow-x: auto; overflow-y: hidden; }

.posts-navigation { display: flex; justify-content: space-between; }
.posts-navigation .nav-next { margin-left: auto; }

.sidebar { font-size: 0.9375rem; }
.sidebar h3 { margin: 0 0 0.5rem; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.widget { margin-bottom: 2rem; }

.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}
