/* Palette sampled from the renders in assets/img/work:
   --accent  #3f5e8d  slate blue, from the leb3D volumetric cloud
   --accent2 #8a6a45  warm tan, from the Nyx and NBTC frames
   Both verified AA against their backgrounds in light and dark. */
:root {
  --bg: #fdfcfa;
  --fg: #1c1b19;
  --muted: #6b6862;
  --accent: #3f5e8d;
  --accent2: #8a6a45;
  --rule: #e3dfd8;
  --rule-strong: #cdc8bf;
  --code-bg: #f4f2ec;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131519;
    --fg: #e6e4e0;
    --muted: #93979c;
    --accent: #8fb0d6;
    --accent2: #c4a884;
    --rule: #272b31;
    --rule-strong: #3a3f47;
    --code-bg: #1a1d22;
  }
}
html { font-size: 17px; }
body {
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  max-width: 44rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
}
/* Hairline across the top, cool to warm, the two colours of the work below. */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
  z-index: 10;
}
a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* Chrome (nav, labels, metadata) in mono, so it reads as apparatus
   and the prose stays the only thing set in the serif. */
header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
header nav a { color: var(--fg); text-decoration: none; }
header nav a:hover { color: var(--accent); }
header nav > a:first-child { font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
header nav a[aria-current="page"] { color: var(--accent); }
.nav-links a { margin-left: 1.1rem; }
.nav-links a:first-child { margin-left: 0; }

h1, h2, h3 { line-height: 1.2; font-weight: 600; }
h1 { font-size: 2rem; margin: 0 0 0.6rem; letter-spacing: -0.015em; }
/* Section headings as small mono rules rather than big serif blocks. */
h2 {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 600;
  color: var(--muted);
  margin: 3rem 0 1.1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.05rem; margin: 1.75rem 0 0.5rem; }
article h2 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.3rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--fg);
  border-bottom: 0;
  padding-bottom: 0;
  margin: 2.25rem 0 0.6rem;
}
p { margin: 0 0 1.1rem; }
.lead { font-size: 1.18rem; line-height: 1.5; color: var(--fg); margin-bottom: 1.5rem; }
.meta, .muted { color: var(--muted); }
.meta { font-family: var(--mono); font-size: 0.8rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }
ul.plain { list-style: none; padding-left: 0; }

/* Publications, talks and software */
ul.pubs { list-style: none; padding-left: 0; }
ul.pubs li { margin-bottom: 1.6rem; }
ul.pubs li.with-thumb { display: flex; gap: 1.1rem; align-items: flex-start; }
ul.pubs li.with-thumb > a { flex: 0 0 160px; }
ul.pubs img.thumb {
  display: block;
  width: 160px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--rule-strong);
  filter: saturate(0.92);
  transition: filter 0.18s ease, border-color 0.18s ease;
}
ul.pubs li.with-thumb > a:hover img.thumb { filter: saturate(1.08) brightness(1.04); border-color: var(--accent); }
/* Link lists as small mono chips. */
ul.pubs .links a, ul.pubs .materials a {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--rule-strong);
  padding: 0.08rem 0.42rem;
  margin: 0.3rem 0.3rem 0 0;
  display: inline-block;
  white-space: nowrap;
}
ul.pubs .links a:hover, ul.pubs .materials a:hover { color: var(--accent); border-color: var(--accent); }
ul.pubs .materials { margin-top: 0.2rem; }
ul.pubs .materials .muted { font-family: var(--mono); font-size: 0.72rem; }

img.portrait {
  float: right;
  width: 200px; height: 200px;
  object-fit: cover;
  margin: 0.3rem 0 1rem 1.5rem;
  border: 1px solid var(--rule-strong);
}
@media (max-width: 480px) { img.portrait { width: 120px; height: 120px; margin-left: 1rem; } }
figure.work { margin: 1.75rem 0; }
figure.work img { display: block; width: 100%; height: auto; border: 1px solid var(--rule-strong); }
@media (max-width: 480px) { ul.pubs li.with-thumb { flex-direction: column; } }

ul.posts li { margin-bottom: 0.6rem; }
ul.posts time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  margin-right: 0.7rem;
}

/* Experience reads as a timeline with a spine. */
dl.timeline dt {
  font-weight: 600;
  margin-top: 1.6rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent);
}
dl.timeline dd {
  margin: 0.25rem 0 0;
  padding: 0 0 0.5rem 0.9rem;
  border-left: 1px solid var(--rule);
  color: var(--fg);
}

img, iframe, video { max-width: 100%; height: auto; }
article img { display: block; margin: 1.5rem auto; border: 1px solid var(--rule); }
/* Captions: kramdown puts the image and the following italic line in one paragraph,
   so img + em is the caption. A bare em:only-child also matches a single italicised
   word inside a normal sentence, which is why it is not used here. */
article img + em { display: block; text-align: center; color: var(--muted); font-size: 0.9rem; }
figure { margin: 1.5rem 0; }
figcaption { text-align: center; color: var(--muted); font-size: 0.88rem; font-family: var(--mono); line-height: 1.5; margin-top: 0.5rem; }
article video { display: block; width: 100%; height: auto; margin: 1.5rem auto; border: 1px solid var(--rule); background: var(--code-bg); }
figure.clip { margin: 1.5rem 0; }
figure.clip video { margin: 0; }
code, pre, kbd { font-family: var(--mono); font-size: 0.85rem; }
pre {
  background: var(--code-bg);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  line-height: 1.5;
}
:not(pre) > code { background: var(--code-bg); padding: 0.05rem 0.3rem; }
blockquote { margin: 1.25rem 0; padding-left: 1rem; border-left: 2px solid var(--accent2); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
table { border-collapse: collapse; width: 100%; margin: 1.25rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
footer {
  margin-top: 4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.post-nav {
  margin-top: 2.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* Rouge syntax highlighting, muted and readable in both schemes */
.highlight .c, .highlight .c1, .highlight .cm { color: #6a737d; font-style: italic; }
.highlight .k, .highlight .kt, .highlight .kd { color: #8250df; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #0a7f5a; }
.highlight .mi, .highlight .mf, .highlight .mh { color: #b35900; }
.highlight .nf { color: #1a5fb4; }
@media (prefers-color-scheme: dark) {
  .highlight .c, .highlight .c1, .highlight .cm { color: #8b949e; }
  .highlight .k, .highlight .kt, .highlight .kd { color: #c6a2ff; }
  .highlight .s, .highlight .s1, .highlight .s2 { color: #7ee2b8; }
  .highlight .mi, .highlight .mf, .highlight .mh { color: #f0b072; }
  .highlight .nf { color: #7fb2f0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media print {
  header, footer, .post-nav, .no-print { display: none; }
  body::before { display: none; }
  body { max-width: none; padding: 0; font-size: 11pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: none; }
  h2 { color: #000; }
}
