:root {
  --text: #1a1a1a;
  --bg: #fafafa;
  --link: #1a5a8a;
  --muted: #666;
  --border: #e0e0e0;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #d4d4d4;
    --bg: #111;
    --link: #6fb3d8;
    --muted: #999;
    --border: #333;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

header {
  max-width: var(--max-width);
  margin: 2rem auto 1rem;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

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

nav a:hover {
  text-decoration: underline;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
  min-height: 60vh;
}

article {
  margin-bottom: 2.5rem;
}

.single-note time,
.single-essay time {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.8rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.4;
  margin: 0.5rem 0;
}

h2 a {
  color: var(--text);
  text-decoration: none;
}

h2 a:hover {
  color: var(--link);
}

.stream-item time {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.summary {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.note-body {
  margin-top: 0.25rem;
}

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

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

footer {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

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

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

.intro p {
  margin: 0;
}

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

pre {
  overflow-x: auto;
  padding: 0.5rem;
  background: rgba(0,0,0,0.04);
  border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  pre {
    background: rgba(255,255,255,0.05);
  }
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  header { flex-direction: column; }
  nav { gap: 0.75rem; }
}
