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

/* Base */
:root {
  --bg: #fffef9;
  --bg-alt: #f5f4ef;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #c45d35;
  --border: #e5e4df;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max-width: 680px;
}

html {
  font-size: 18px;
  line-height: 1.6;
}

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--text);
  padding: 2rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p {
  margin-bottom: 1rem;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navigation */
nav {
  font-family: var(--font-sans);
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

nav a {
  color: var(--text);
  margin-right: 1.5rem;
  font-size: 0.9rem;
}

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

/* Header/Hero */
header {
  margin-bottom: 2.5rem;
}

header h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

header .subtitle {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

/* Main content */
main {
  margin-bottom: 3rem;
}

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

li {
  margin-bottom: 0.25rem;
}

/* Blog post list */
.post-list {
  list-style: none;
  padding-left: 0;
}

.post-list li {
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.post-list .date {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Callout/Note box */
.note, blockquote {
  background: var(--bg-alt);
  border-left: 3px solid var(--border);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.note-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Code */
code {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--bg-alt);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 1.5rem 0;
}

figcaption {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

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

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

/* Math (if using MathML) */
math {
  font-size: 1.1em;
}

/* Utility */
.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.85rem;
}

/* Margin notes (like in the screenshot) */
.margin-note {
  float: right;
  clear: right;
  width: 200px;
  margin-right: -240px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
}

@media (max-width: 1000px) {
  .margin-note {
    float: none;
    width: auto;
    margin: 1rem 0;
    margin-right: 0;
  }
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  body {
    padding: 1.5rem 1rem;
  }

  nav a {
    margin-right: 1rem;
  }
}