/* Color Variables & Themes */
:root {
  --bg: #fafafa;
  --text: #1f2328;
  --text-muted: #656d76;
  --link: #0969da;
  --link-hover: #1a7f37;
  --border: #d0d7de;
  --code-bg: #f6f8fa;
  --max-width: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --link: #58a6ff;
    --link-hover: #1f6feb;
    --border: #30363d;
    --code-bg: #161b22;
  }
}

/* Base Setup */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  padding: 3rem 1.5rem;
  margin: 0 auto;
  max-width: var(--max-width);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: monospace;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  line-height: 1.25;
}

h1 { font-size: 1.5rem; border-bottom: 1px double var(--border); padding-bottom: 0.5rem; margin-top: 0; }
h2 { font-size: 1.25rem; border-bottom: 1px dashed var(--border); padding-bottom: 0.2rem; }
h3 { font-size: 1.05rem; }

p { margin-bottom: 1.25rem; text-align: justify; }

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

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

/* Header & Nav */
header {
  margin-bottom: 3.5rem;
}

.nav-logo {
  font-family: monospace;
  font-weight: bold;
  font-size: 1.15rem;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
}

nav {
  font-family: monospace;
  font-size: 0.9rem;
}

nav a {
  margin-right: 1.2rem;
  color: var(--text-muted);
}

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

/* Lists */
ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Metadata lists (like blog lists) */
.post-list {
  list-style: none;
  padding-left: 0;
}

.post-item {
  display: flex;
  margin-bottom: 0.75rem;
  font-family: monospace;
}

.post-date {
  color: var(--text-muted);
  width: 7.5rem;
  flex-shrink: 0;
}

/* Code & Preformatted */
pre, code {
  font-family: "JetBrains Mono", SFMono-Regular, Consolas, monospace;
  font-size: 0.85rem;
}

code {
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

/* Divider block */
hr {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 2.5rem 0;
}

footer {
  margin-top: 5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}
