:root {
  --bg: #fdfdfc;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --border: #e4e4e7;
  --accent: #b4235a;
  --code-bg: #f3f3f4;
  --max: 42rem;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --fg: #e8e8ea;
    --muted: #9a9aa2;
    --border: #2c2c31;
    --accent: #f07ca6;
    --code-bg: #1f1f23;
  }
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* Header / nav */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.site-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
}

.site-title::before { content: "~/"; color: var(--accent); }

nav a {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.1rem;
}

nav a:first-child { margin-left: 0; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent); }

/* Typography */
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 {
  font-size: 1.15rem;
  font-family: var(--mono);
  margin: 2.75rem 0 1rem;
}
h2::before { content: "## "; color: var(--accent); }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }

a { color: var(--accent); text-underline-offset: 2px; }

p { margin: 0 0 1rem; }

.lede { font-size: 1.15rem; color: var(--muted); }

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

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

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Lists of posts / projects */
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
}
.list li:last-child { border-bottom: 0; }
.list time, .meta {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.projects { display: grid; gap: 0.9rem; }
.project {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}
.project h3 { margin: 0 0 0.2rem; font-family: var(--mono); font-size: 0.95rem; }
.project p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.links { display: flex; flex-wrap: wrap; gap: 1.1rem; font-family: var(--mono); font-size: 0.9rem; }

/* Resume */
.resume-entry { margin-bottom: 1.5rem; }
.resume-entry header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.resume-entry h3 { margin: 0; }
.resume-entry ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.skills { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }


footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

@page { size: letter; margin: 0.45in 0.55in; }

@media print {
  :root { --bg: #fff; --fg: #000; --muted: #444; --accent: #000; }
  html { font-size: 9.5pt; }
  body { line-height: 1.3; }
  nav, footer, .no-print, .site-header { display: none; }
  .wrap { padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
  h1 { font-size: 18pt; margin: 0; }
  .lede { font-size: 10.5pt; margin: 0 0 0.2rem; }
  h2 { font-size: 10.5pt; margin: 0.9rem 0 0.35rem; }
  h3 { font-size: 10pt; }
  p { margin: 0 0 0.4rem; }
  .links { gap: 0.9rem; font-size: 8.5pt; }
  .resume-entry { margin-bottom: 0.55rem; }
  .resume-entry li, .resume-entry header { break-inside: avoid; }
  h2 { break-after: avoid; }
  .resume-entry ul { margin-top: 0.15rem; }
  .resume-entry li { margin-bottom: 0.05rem; }
  .resume-entry .meta + ul { margin-bottom: 0.25rem; }
  .meta { font-size: 8.5pt; }
  .skills { gap: 0.15rem 0.8rem; }
  .print-hide { display: none; }
}

/* Markdown look: show the source syntax around rendered elements.
   Apply with <article class="md">. */
.md { font-family: var(--mono); font-size: 0.92rem; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--mono); }
.md h1 { font-size: 1.5rem; }
.md h1::before { content: "# "; color: var(--accent); }
.md h2::before { content: "## "; }
.md h3::before { content: "### "; color: var(--accent); }
.md h4::before { content: "#### "; color: var(--accent); }
.md strong::before, .md strong::after { content: "**"; color: var(--muted); font-weight: 400; }
.md em::before, .md em::after { content: "_"; color: var(--muted); }
.md code::before, .md code::after { content: "`"; color: var(--muted); }
.md code { background: none; padding: 0; }
.md pre code::before, .md pre code::after { content: none; }
.md pre { position: relative; padding-top: 1.75rem; }
.md pre::before {
  content: "```" attr(data-lang);
  position: absolute; top: 0.4rem; left: 1rem;
  color: var(--muted);
}
.md pre::after {
  content: "```";
  display: block; margin-top: 0.4rem;
  color: var(--muted);
}
.md a { text-decoration: none; }
.md a::before { content: "["; color: var(--muted); }
.md a::after { content: "](" attr(href) ")"; color: var(--muted); word-break: break-all; }
.md ul, .md ol { padding-left: 2ch; }
.md ul { list-style: none; }
.md ul > li::before { content: "- "; color: var(--accent); margin-left: -2ch; }
.md ol { list-style: decimal; }
.md ol > li::marker { color: var(--accent); }
.md blockquote { border-left: 0; padding-left: 2ch; position: relative; }
.md blockquote::before { content: ">"; position: absolute; left: 0; color: var(--accent); }
.md hr { border: 0; margin: 2rem 0; text-align: left; }
.md hr::after { content: "---"; color: var(--muted); }
.md .meta::before { content: "<!-- "; }
.md .meta::after { content: " -->"; }

.resume-entry .meta + ul { margin-bottom: 0.6rem; }

/* Imported posts: images, figures, tables, table of contents. */
img { max-width: 100%; height: auto; }
figure { margin: 1.25rem 0; }
figcaption { font-size: 0.8rem; color: var(--muted); }
.md table { border-collapse: collapse; width: 100%; font-size: 0.85rem; margin: 1rem 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
.md .toc { border: 1px dashed var(--border); border-radius: 6px; padding: 0.5rem 1rem; margin: 1rem 0 2rem; }
.md .toc::before { content: "<!-- contents -->"; color: var(--muted); }
.md .toc ul { margin: 0.25rem 0; }
.md .toc a::before, .md .toc a::after,
.md sup a::before, .md sup a::after { content: none; }
