@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --text: #222;
  --bg: #fff;
  --link: #333;
  --muted: #666;
  --border: #ddd;
  --code-bg: #f4f4f4;
  --max-width: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ddd;
    --bg: #181818;
    --link: #bbb;
    --muted: #888;
    --border: #333;
    --code-bg: #262626;
  }
}

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

html {
  font-size: 18px;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
nav {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0;
}

.site-title {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
  margin-right: 1rem;
}

.nav-links {
  font-family: var(--sans);
  font-size: 0.9rem;
}

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

.nav-links a:hover {
  color: var(--text);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.3;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}

h1 { font-size: 1.7rem; margin-top: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 1rem; }

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

p {
  margin: 0 0 1.2em;
}

/* Post header */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  margin-bottom: 0.3rem;
}

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

.post-description {
  font-style: italic;
  color: var(--muted);
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
}

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

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

.post-list .post-date {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 7.5rem;
  flex-shrink: 0;
}

.post-list .post-title a {
  color: var(--text);
  text-decoration: none;
}

.post-list .post-title a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
}

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
code {
  font-family: 'SFMono-Regular', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.83em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.83rem;
  line-height: 1.5;
  margin: 1.5rem 0;
}

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

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

/* Footnotes */
.footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
}

.footnotes ol {
  padding-left: 1.5rem;
  margin: 0;
}

.footnotes li {
  margin-bottom: 0.6rem;
}

sup {
  font-size: 0.7em;
  line-height: 0;
}

sup a {
  text-decoration: none;
}

/* Lists */
ul, ol {
  padding-left: 1.5rem;
  margin: 0 0 1.2em;
}

li {
  margin-bottom: 0.3em;
}

/* Home page */
.home-tagline {
  font-style: italic;
  color: var(--muted);
  margin-top: 0.2rem;
  margin-bottom: 1.2rem;
}

.home-description {
  margin-bottom: 2.5rem;
}

/* Page title */
.page-title {
  margin-bottom: 2rem;
}

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

footer a {
  color: var(--muted);
  text-underline-offset: 2px;
}

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

  .post-list li {
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 1.1rem;
  }
}
