/* Catppuccin palette: Latte (light) / Mocha (dark).
   https://catppuccin.com/palette — accent is mauve; swap for peach/red/etc. */
:root {
  --bg: #eff1f5;       /* base */
  --fg: #4c4f69;       /* text */
  --muted: #6c6f85;    /* subtext0 */
  --accent: #8839ef;   /* mauve */
  --border: #ccd0da;   /* surface0 */
  --code-bg: #e6e9ef;  /* mantle */
  --code-fg: #d20f39;  /* red */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e2e;       /* base */
    --fg: #cdd6f4;       /* text */
    --muted: #a6adc8;    /* subtext0 */
    --accent: #cba6f7;   /* mauve */
    --border: #313244;   /* surface0 */
    --code-bg: #181825;  /* mantle */
    --code-fg: #eba0ac;  /* maroon */
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 0 1.25rem;
  max-width: 42rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
}

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

/* Header / footer */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1.75rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.site-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--fg);
}

.site-header nav { display: flex; gap: 1rem; }
.site-header nav a { color: var(--muted); }
.site-header nav a:hover { color: var(--accent); text-decoration: none; }

.site-footer {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0 2.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Content */
h1, h2, h3, h4 { line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 0 0 0.5rem; }
.section-title { text-transform: capitalize; }

.page-meta {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
}

.draft-badge {
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.8rem;
}

.toc {
  margin: 1.5rem 0 2rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.toc summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.toc ul { list-style: none; margin: 0.25rem 0 0; padding-left: 1rem; }
.toc li { padding: 0.1rem 0; }

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

.prose blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.prose pre {
  padding: 0.85rem 1rem;
  overflow-x: auto;
  background: var(--code-bg);
  border-radius: 6px;
  font-size: 0.9rem;
}

/* chroma's catppuccin styles set peach as the base text color, which suits
   terminals more than the web; tokens keep their colors, plain text doesn't. */
.prose .chroma {
  color: var(--fg);
  background: var(--code-bg);
}

/* Inline code — org ~code~ / =verbatim= and markdown backticks */
.prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--code-fg);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  overflow-wrap: break-word;
}

.prose pre code {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}

.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.prose th, .prose td { padding: 0.4rem 0.75rem; border: 1px solid var(--border); text-align: left; }
.prose th { background: var(--code-bg); }

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

/* Entry lists */
.entry-list { list-style: none; padding: 0; margin: 0; }
.entry-list li[hidden] { display: none; }

.filter-note { color: var(--muted); font-size: 0.9rem; margin-top: -0.5rem; }

.entry-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 0.45rem 0;
}

.entry-list time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.recent h2 { font-size: 1.2rem; margin-top: 2.5rem; }
