:root {
  --ink: #1b1b19;
  --paper: #f7f7f5;
  --muted: #656560;
  --line: #dedede;
  --accent: #3c5a67;
  --code-bg: #eeeeec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e6e0;
    --paper: #16181a;
    --muted: #9a9a92;
    --line: #33352f;
    --accent: #8bb2c0;
    --code-bg: #1f2123;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Iowan Old Style, Palatino Linotype, URW Palladio L, P052, serif;
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ---------- header / nav ---------- */

header.site-header {
  margin-bottom: 3rem;
}

.name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.name-row h1 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.name-row h1 a {
  color: var(--ink);
  text-decoration: none;
}

nav.main-nav {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 0.85rem;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

nav.main-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.now-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.6rem 0 0;
}

.now-line::before {
  content: "now — ";
  color: var(--accent);
}

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

/* ---------- typography ---------- */

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.25;
}

h2 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1.1rem;
}

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

a:hover {
  color: var(--ink);
}

ul, ol {
  padding-left: 1.3rem;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
}

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

img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
}

figure {
  margin: 1.5rem 0;
}

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- lists (projects / blog index) ---------- */

.entry-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.entry-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.entry-list li:first-child {
  padding-top: 0;
}

.entry-list h3 {
  margin: 0 0 0.25rem;
}

.entry-list h3 a {
  color: var(--ink);
  text-decoration: none;
}

.entry-list h3 a:hover {
  color: var(--accent);
}

.entry-list .meta {
  margin-bottom: 0.4rem;
}

.entry-list .summary {
  color: var(--muted);
  margin: 0.3rem 0 0;
}

.tags {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.tags span::after {
  content: ", ";
}

.tags span:last-child::after {
  content: "";
}

/* ---------- footer ---------- */

footer.site-footer {
  margin-top: 3.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

footer.site-footer a {
  color: var(--muted);
}

footer.site-footer a:hover {
  color: var(--ink);
}

/* ---------- accessibility ---------- */

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

@media (max-width: 480px) {
  body {
    font-size: 17px;
  }
  .name-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
