:root {
  --bg: #f6f1e8;
  --paper: #fffdf8;
  --ink: #1f1f1f;
  --muted: #666054;
  --line: #e4dccf;
  --accent: #8a5a2b;
  --surface: rgba(255,255,248,.84);
  --surface-strong: #fffdf8;
  --header-bg: linear-gradient(135deg, rgba(138,90,43,.06), transparent 55%);
  --font-primary: "Caecilia", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --code-bg: #111;
  --code-ink: #f7f5ef;
  --quote-border: #8a5a2b;
  --quote-ink: #43392d;
}
[data-theme="dark"] {
  --bg: #0c1117;
  --paper: #111822;
  --ink: #e8edf3;
  --muted: #a0acba;
  --line: #263041;
  --accent: #d7a15d;
  --surface: rgba(17,24,34,.9);
  --surface-strong: #111822;
  --header-bg: linear-gradient(135deg, rgba(215,161,93,.08), transparent 55%);
  --font-primary: "Caecilia", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --code-bg: #070b10;
  --code-ink: #f2f5f8;
  --quote-border: #d7a15d;
  --quote-ink: #d5dde7;
}
* { box-sizing: border-box; }
html { background: linear-gradient(180deg, var(--bg) 0%, var(--paper) 100%); color-scheme: light dark; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-primary);
  font-size: 1.3rem;
  line-height: 1.7;
  background: transparent;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
header.site {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
header.site h1 { margin: 0; font-size: clamp(2.9rem, 6vw, 4.8rem); letter-spacing: -0.03em; }
header.site p { margin: .5rem 0 0; color: var(--muted); max-width: 70ch; }
header.site .subtitle { font-size: 1.35rem; font-style: italic; }
header.site nav { flex-basis: 100%; }
header.site .title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; width: 100%; }
nav a { margin-right: 1rem; font-size: .95rem; }
main { padding: 1.75rem; }
article.post { max-width: 80ch; }
.card, .excerpt, .card h3, .card a { min-width: 0; }
.meta { color: var(--muted); font-size: 1.1rem; }
.grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.card { padding: 1rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; word-break: break-word; }
.card:first-child { border-top: 0; padding-top: 0; }
.excerpt { margin: .75rem 0 0; overflow-wrap: anywhere; font-size: 1.12rem; }
.excerpt img, .excerpt figure, .excerpt iframe, .excerpt table, .excerpt video, .excerpt embed, .excerpt object {
  max-width: 100%;
}
.excerpt img {
  height: auto;
}
.excerpt table {
  display: block;
  overflow-x: auto;
  width: 100%;
}
.excerpt figure {
  margin-left: 0;
  margin-right: 0;
}

.about-photo {
  max-width: 64px;
  margin: .75rem 0 1rem;
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .75rem 0 0;
  font-size: 1rem;
}

.social-links span {
  opacity: .6;
}

.social-icons {
  gap: .8rem;
}

.social-icons a {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.social-icons svg {
  width: 1.35rem;
  height: 1.35rem;
}

.social-icons a:hover {
  color: var(--accent);
}
img { max-width: 100%; height: auto; border-radius: 12px; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { overflow: auto; padding: 1rem; background: var(--code-bg); color: var(--code-ink); border-radius: 14px; }
blockquote { margin: 1.25rem 0; padding: 0 1rem; border-left: 4px solid var(--quote-border); color: var(--quote-ink); }
footer.site { padding: 1rem 1.5rem 1.5rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .95rem; display: flex; align-items: center; gap: .35rem; }
.love-icon { width: 1em; height: 1em; color: currentColor; flex: 0 0 auto; }
.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  border-radius: 999px;
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle:hover { border-color: var(--accent); }
