:root {
  --bg: #fafaf8;
  --fg: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --link: #2563eb;
  --max-width: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --fg: #e8e6e3;
    --muted: #9ca3af;
    --border: #2d2d2f;
    --link: #60a5fa;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 1.0625rem;
  line-height: 1.8;
  padding: 2.5rem 1.25rem;
}

/* ── Layout ── */
header, main {
  max-width: var(--max-width);
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3.5rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

nav a:hover { color: var(--fg); }

/* ── Typography ── */
h1 { font-size: 1.75rem; line-height: 1.25; margin-bottom: 0.5rem; }
h2 { font-size: 1.3rem;  line-height: 1.3;  margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem;  line-height: 1.4;  margin: 2rem 0 0.5rem; }
h4, h5, h6 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }

p { margin-bottom: 1.25rem; }

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

ul, ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
li { margin-bottom: 0.3rem; }

blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1.1rem;
  color: var(--muted);
  margin: 1.5rem 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th { font-weight: 600; }

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
  display: block;
}

/* ── Code ── */
code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  font-size: 0.85em;
  background: #282a36;     /* dracula bg for inline code */
  color: #f8f8f2;
  padding: 0.15em 0.45em;
  border-radius: 3px;
}

/* Hugo wraps fenced code in .highlight > pre */
.highlight {
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.highlight pre {
  padding: 1.25rem 1.5rem;
  margin: 0;
  overflow-x: auto;
}

/* Don't double-style inline code inside a block */
.highlight pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
}

/* ── Post meta ── */
.post-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
}

.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.tag {
  font-size: 0.78rem;
  background: var(--border);
  color: var(--muted);
  padding: 0.1em 0.65em;
  border-radius: 999px;
  text-decoration: none;
}

.tag:hover { color: var(--fg); text-decoration: none; }

/* ── Post list ── */
.post-list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.post-list li {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child { border-top: 1px solid var(--border); }

.post-list .date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Footer ── */
footer {
  max-width: var(--max-width);
  margin: 3.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

footer nav {
  display: flex;
  gap: 1.25rem;
}

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

footer nav a:hover { color: var(--fg); }

/* ── Home intro ── */
.home-intro {
  margin-bottom: 2.5rem;
  color: var(--muted);
}
