:root {
  --bg: #f7f7f4;
  --fg: #1c1c1c;
  --dim: #5c5c58;
  --accent: #0a5c36;
  --border: #d6d6d0;
  --code-bg: #ecece6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101410;
    --fg: #d5d8d2;
    --dim: #969b95;
    --accent: #7bc794;
    --border: #2b312b;
    --code-bg: #181e18;
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0 auto;
  max-width: 44rem;
  padding: 1.5rem 1rem 3rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--fg);
}

/* links: always underlined; hover inverts like a terminal selection */
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

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

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* headings: modest sizes, markdown-style prefixes */
h1, h2, h3 {
  line-height: 1.3;
  margin: 2em 0 0.6em;
}

h1 { font-size: 1.25rem; margin-top: 1em; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }

h1::before { content: "# " / ""; color: var(--dim); }
h2::before { content: "## " / ""; color: var(--dim); }
h3::before { content: "### " / ""; color: var(--dim); }

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

ul, ol { padding-left: 1.5em; }

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

blockquote {
  margin: 0 0 1em;
  padding-left: 1em;
  border-left: 2px solid var(--border);
  color: var(--dim);
}

code, pre {
  font-family: inherit;
  font-size: inherit;
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.3em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.75em 1em;
  overflow-x: auto;
  margin: 0 0 1em;
}

pre code {
  background: none;
  padding: 0;
}

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

table {
  border-collapse: collapse;
  margin: 0 0 1em;
  display: block;
  overflow-x: auto;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.3em 0.6em;
  text-align: left;
}

/* header / nav */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em 1.5em;
  margin-bottom: 2.5em;
  padding-bottom: 0.75em;
  border-bottom: 1px dashed var(--border);
}

.site-name {
  font-weight: bold;
  color: var(--fg);
  text-decoration: none;
}

.site-name:hover {
  background: var(--fg);
  color: var(--bg);
}

.site-header nav {
  display: flex;
  gap: 1.25em;
}

.site-header nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: none;
}

.site-header nav a[aria-current="page"]::before { content: "* " / ""; }

/* lists of posts / projects */
.post-list, .page-list {
  list-style: none;
  padding: 0;
}

.post-list li, .page-list li {
  margin-bottom: 0.4em;
}

.post-list time {
  color: var(--dim);
}

.meta {
  color: var(--dim);
  margin-top: -0.5em;
}

/* footer */
.site-footer {
  margin-top: 3.5em;
  padding-top: 0.75em;
  border-top: 1px dashed var(--border);
  color: var(--dim);
  font-size: 0.85rem;
}

/* skip link: hidden until keyboard focus */
.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  position: static;
  display: inline-block;
  margin-bottom: 1em;
}
