/* ---------- Tokens ---------- */
:root {
  --bg: #fdfdfc;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --accent: #2456c7;
  --border: #e3e3e6;
  --code-bg: #f3f3f5;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 42rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151517;
    --fg: #e8e8ea;
    --muted: #9a9aa2;
    --accent: #7ea6ff;
    --border: #2c2c30;
    --code-bg: #1f1f23;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.65 var(--font);
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

h1, h2, h3 { line-height: 1.25; margin: 2rem 0 0.75rem; }
h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p, ul, ol { margin: 0 0 1rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

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

code, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 4px; }
pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

.muted { color: var(--muted); }

/* ---------- Header / nav ---------- */
.site-header { border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.site-title {
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--fg); }
.site-nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Home ---------- */
.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.intro img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}
.intro h1 { margin: 0; }

/* ---------- CV ---------- */
.cv-list { list-style: none; padding: 0; }
.cv-item {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.cv-item:last-child { border-bottom: 0; }
.cv-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.cv-item h3 { margin: 0; }
.cv-item p { margin: 0.25rem 0 0; }

@media (max-width: 34rem) {
  .cv-item { grid-template-columns: 1fr; }
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
.tags li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.75rem;
  font-size: 0.9rem;
}

/* ---------- Blog ---------- */
.post-list { list-style: none; padding: 0; }
.post-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  padding: 0.4rem 0;
}
.post-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 6.5rem;
}

.post-meta { color: var(--muted); margin-top: -0.25rem; margin-bottom: 2rem; }
article img { border-radius: 6px; }
blockquote {
  margin: 0 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

/* ---------- Contact ---------- */
.link-list { list-style: none; padding: 0; }
.link-list li { padding: 0.35rem 0; }
.link-list span { display: inline-block; min-width: 6rem; color: var(--muted); }
