:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5b6270;
  --line: #e4e1d8;
  --accent: #1d4e6b;
  --accent-soft: #e6eef3;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --surface: #1c2025;
    --text: #e6e3dc;
    --muted: #a3a9b3;
    --line: #2d333a;
    --accent: #8cc2e0;
    --accent-soft: #1f2e38;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; padding-bottom: 16px; max-width: 1000px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--sans); font-weight: 600; }
.brand-mark { background: var(--accent); color: var(--surface); font-size: .8rem; letter-spacing: .06em; padding: 4px 8px; border-radius: 4px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--sans); font-size: .95rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* Content */
.content { padding-top: 40px; padding-bottom: 64px; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 2.2rem; margin: 0 0 .4em; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; margin: 2em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.lede { font-size: 1.25rem; color: var(--muted); margin-top: 0; }
blockquote { margin: 1.5em 0; padding: .2em 1.2em; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .95rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
img { max-width: 100%; height: auto; }
code { font-size: .9em; background: var(--accent-soft); padding: 1px 5px; border-radius: 3px; }

/* Cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; margin: 1.2em 0; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.tag { display: inline-block; font-family: var(--sans); font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 3px; }
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.post-list a { font-size: 1.2rem; font-weight: 600; text-decoration: none; }
.post-meta { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin: 0; }
.button { display: inline-block; font-family: var(--sans); font-size: .95rem; font-weight: 500; text-decoration: none; background: var(--accent); color: var(--surface); padding: 9px 16px; border-radius: 6px; margin: 4px 8px 4px 0; }
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.footer-inner { padding-top: 20px; padding-bottom: 28px; }
.footer-inner p { margin: 4px 0; }
.site-footer a { color: var(--muted); }

@media (max-width: 600px) {
  body { font-size: 1.05rem; }
  h1 { font-size: 1.8rem; }
  .content { padding-top: 28px; }
}

/* About page portrait */
.profile { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 1em; }
.profile img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); }
.profile p { margin-top: 0; }
@media (max-width: 600px) { .profile { flex-direction: column; align-items: center; text-align: center; } }

/* CV entries */
.cv-entry { display: grid; grid-template-columns: 110px 1fr; gap: 4px 16px; margin: .8em 0; }
.cv-entry .when { font-family: var(--sans); font-size: .9rem; color: var(--muted); padding-top: 3px; }
.cv-entry p { margin: 0; }
.cv-entry .sub { color: var(--muted); }
@media (max-width: 600px) { .cv-entry { grid-template-columns: 1fr; gap: 0; } }
