:root {
  --bg: #fbfaf7;
  --text: #1f2328;
  --muted: #5f6670;
  --line: #e3e0d8;
  --accent: #1b3a5c;
  --tag-bg: #eef1f5;
  --code-bg: #f1efe9;
  --img-bg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181c;
    --text: #e6e8eb;
    --muted: #9aa3ad;
    --line: #2b3038;
    --accent: #8fb8e8;
    --tag-bg: #222831;
    --code-bg: #1f242b;
    --img-bg: #f4f2ec;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 48px 16px 64px; }
.narrow { max-width: 720px; }
header h1 { font-size: 2rem; margin: 0 0 4px; letter-spacing: -0.01em; }
header h1 a { color: inherit; text-decoration: none; }
header p.sub { margin: 0 0 16px; color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.95rem; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h2 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 48px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
h3 { font-size: 1.15rem; margin: 0 0 2px; }
p { margin: 0 0 12px; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: 0.88em; }
pre { background: var(--code-bg); padding: 12px 14px; border-radius: 6px; overflow-x: auto; font-size: 0.85rem; line-height: 1.5; }
pre code { background: none; padding: 0; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; padding: 0; list-style: none; }
.tags li { background: var(--tag-bg); border-radius: 4px; padding: 1px 8px; font-size: 0.8rem; }
.links { font-size: 0.95rem; display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Project list: picture on the left, text on the right */
.project {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.project:last-of-type { border-bottom: none; }
.project img, .hero img {
  width: 100%; height: auto; display: block;
  background: var(--img-bg); border: 1px solid var(--line); border-radius: 6px;
}
.project h3 a { color: inherit; text-decoration: none; }
.project h3 a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .project { grid-template-columns: 1fr; gap: 14px; }
  .project img { max-width: 320px; }
}

/* Project detail pages */
.back { font-size: 0.95rem; display: inline-block; margin-bottom: 24px; }
.hero { margin: 20px 0 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 8px 0 16px; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
ul.plain { padding-left: 20px; margin: 0 0 12px; }
ul.plain li { margin-bottom: 6px; }
footer { margin-top: 48px; color: var(--muted); font-size: 0.85rem; }
