:root {
  --bg: #fbfbf9;
  --fg: #1d1f21;
  --muted: #6b6f76;
  --rule: #e3e3de;
  --accent: #0b7a5b;
  --code-bg: #f1f1ec;
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111314;
    --fg: #e4e4e1;
    --muted: #8c9096;
    --rule: #2a2d30;
    --accent: #4fd1a5;
    --code-bg: #1b1e20;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0 auto;
  max-width: 48rem;
  padding: 2rem 1rem 3rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.3; margin: 2rem 0 0.75rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
h2::before { content: "## "; color: var(--muted); font-weight: 400; }

p, ul, ol { margin: 0 0 1rem; }
ul { padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--muted); }

hr { border: 0; border-top: 1px dashed var(--rule); margin: 2rem 0; }

code, pre { background: var(--code-bg); border-radius: 3px; }
code { padding: 0.1em 0.3em; }
pre { padding: 1rem; overflow-x: auto; }

blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

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

table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.9rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

/* header / footer */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.brand { color: var(--fg); font-weight: 700; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-header nav a { color: var(--muted); }
.site-header nav a:hover,
.site-header nav a[aria-current] { color: var(--fg); }
.site-header nav a[aria-current]::before { content: "> "; color: var(--accent); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--muted); }

/* shared bits */
.prompt { color: var(--muted); margin: 2rem 0 0.5rem; }
.prompt::first-letter { color: var(--accent); }
.meta { color: var(--muted); font-size: 0.9rem; }
.note {
  border: 1px dashed var(--rule);
  padding: 0.75rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1rem 0 2rem;
}
.back { margin-top: 3rem; }

/* home */
.intro {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-top: 2rem;
}
.intro img {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  flex-shrink: 0;
}
.intro h1 { margin: 0; }
.intro p { margin: 0.25rem 0 0; color: var(--muted); }

/* key/value lists (highlights, stats) */
.kv { list-style: none; padding: 0; }
.kv li { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; }
.kv .k { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* entry lists: writing, talks */
.entries { list-style: none; padding: 0; }
.entries li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; margin-bottom: 0.75rem; }
.entries .date { color: var(--muted); }
.entries .sub { display: block; color: var(--muted); font-size: 0.85rem; }

/* resume / work */
.role { margin-bottom: 2rem; }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1rem; }
.role-head h3 { margin: 0; color: var(--accent); }
.role-head .dates { color: var(--muted); font-size: 0.9rem; }
.role .company { color: var(--muted); margin: 0 0 0.5rem; }
.role .company a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.positions { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.positions li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; margin: 0; }
.positions .dates { color: var(--muted); font-size: 0.9rem; }
.tags { color: var(--muted); font-size: 0.85rem; }

.print-btn {
  font: inherit;
  font-size: 0.85rem;
  background: none;
  color: var(--accent);
  border: 1px solid var(--rule);
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}

@media (max-width: 560px) {
  .kv li, .entries li { grid-template-columns: 1fr; gap: 0; }
  .intro { flex-direction: column; align-items: flex-start; }
}

@media print {
  :root { --bg: #fff; --fg: #000; --muted: #444; --accent: #000; --rule: #bbb; }
  html { font-size: 9pt; }
  body { max-width: none; padding: 0; }
  .site-header, .site-footer, .print-btn, .no-print { display: none; }
  h1, .prompt { margin-top: 0; }
  @page { margin: 14mm 16mm; }
  .role { margin-bottom: 1rem; }
  .role-head, .company, .positions { break-after: avoid; }
  li { break-inside: avoid; }
  h2 { break-after: avoid; }
  a { color: inherit; }
}
