:root {
  --text: #1c1c1c;
  --muted: #5a5a5a;
  --bg: #fdfdfb;
  --accent: #7a3b2e;
  --border: #ddd8d0;
  --maxw: 760px;
  --font-serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'IBM Plex Sans', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', Courier, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--accent); }

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0 1rem;
  margin-bottom: 2rem;
}

.site-title {
  font-size: 1.6rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--text);
}

.tagline {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.25rem 0 1rem;
}

.site-header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a:hover {
  text-decoration: underline;
}

main.wrap {
  min-height: 60vh;
  padding-bottom: 3rem;
}

h1, h2, h3 {
  font-family: var(--font-sans);
  line-height: 1.3;
}

.page-date {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  margin-top: -0.5rem;
}

.page-list {
  padding-left: 1.25rem;
}

.page-list li {
  margin: 0.4rem 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

/* Inline equations render as one unbreakable KaTeX span -- a long one
   (fractions, stacked terms) can be wider than a phone screen even
   though it's not a $$ display block. Making it a scrollable
   inline-block contains it instead of pushing the page wide. */
.katex {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
}

code, pre {
  font-family: var(--font-mono);
}

code {
  background: #f2efe9;
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: #f2efe9;
  padding: 0.75rem;
  overflow-x: auto;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
  font-size: 1em;
}

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