/* Latin Modern: the LaTeX typeface (GUST Font License) */
@font-face { font-family: "LM"; src: url("assets/fonts/LM-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "LM"; src: url("assets/fonts/LM-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "LM"; src: url("assets/fonts/LM-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "LM"; src: url("assets/fonts/LM-bold-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --bg: #0b0b0c;
  --text: #dcdbd5;
  --muted: #8a8984;
  --rule: #2c2c2c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 19px/1.55 "LM", "Latin Modern Roman", "Computer Modern", Georgia, serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  counter-reset: sec fig tab;
}
main { max-width: 640px; margin: 0 auto; padding: 88px 22px 96px; }
a { color: inherit; text-decoration: underline; text-decoration-color: #555; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--text); }
p { margin: 0 0 14px; text-align: justify; hyphens: auto; }
.muted { color: var(--muted); }

/* header */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin-bottom: 40px; }
.head h1 { font-size: 36px; font-weight: 400; margin: 0 0 2px; letter-spacing: 0.005em; line-height: 1.15; }
.head .affil { color: var(--muted); font-style: italic; margin: 0 0 14px; }
.head .links { font-size: 17px; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.head img { width: 116px; height: 140px; object-fit: cover; flex-shrink: 0; filter: grayscale(1) contrast(1.05); border: 1px solid var(--rule); }
.about p { margin-bottom: 12px; }

/* numbered sections with a hairline rule */
h2 { counter-increment: sec; font-size: 22px; font-weight: 700; margin: 46px 0 18px; display: flex; align-items: baseline; gap: 14px; }
h2::before { content: counter(sec); }
h2::after { content: ""; flex: 1; border-bottom: 1px solid var(--rule); transform: translateY(-6px); }
h3 { font-size: 19px; font-weight: 700; margin: 26px 0 8px; }

/* CV-style entries: date column + content */
.entry { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 0 22px; margin: 0 0 22px; }
.entry .date { color: var(--muted); font-style: italic; font-size: 16.5px; padding-top: 2px; }
.entry .what > b, .entry .what > a { font-weight: 700; }
.entry .role { font-style: italic; color: var(--muted); }
.entry p { margin: 4px 0 0; text-align: left; }
.entry .tools { font-style: italic; color: var(--muted); font-size: 16.5px; margin-top: 4px; }
.run { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 0 22px; margin: 0 0 8px; text-align: left; }
.run b { font-weight: 400; font-style: italic; color: var(--muted); font-size: 16.5px; padding-top: 2px; }

/* figures and tables */
figure { margin: 26px 0; counter-increment: fig; }
figure img { width: 100%; display: block; }
figcaption { font-size: 16.5px; margin-top: 8px; color: var(--muted); }
figcaption::before { content: "Figure " counter(fig) ": "; }
table { counter-increment: tab; border-collapse: collapse; margin: 10px 0 22px; font-size: 17.5px; border-top: 1.5px solid var(--text); border-bottom: 1.5px solid var(--text); }
caption { caption-side: top; font-size: 16.5px; padding-bottom: 8px; text-align: left; color: var(--muted); }
caption::before { content: "Table " counter(tab) ": "; }
th { font-weight: 400; border-bottom: 0.8px solid var(--text); }
th, td { padding: 5px 16px; text-align: left; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
ul { padding-left: 22px; margin: 0 0 14px; }
li { margin: 5px 0; }

/* project page header */
.back { font-size: 16px; color: var(--muted); }
.ptitle { margin: 36px 0 30px; }
.ptitle h1 { font-size: 32px; font-weight: 400; margin: 0 0 8px; line-height: 1.2; }
.ptitle p { color: var(--muted); font-style: italic; margin: 0; font-size: 17px; text-align: left; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 16px; color: var(--muted); }
footer { margin-top: 64px; font-size: 15px; color: var(--muted); }

@media (max-width: 560px) {
  body { font-size: 18px; }
  main { padding-top: 48px; }
  p { text-align: left; }
  .head img { width: 84px; height: 102px; }
  .head h1 { font-size: 30px; }
  .entry, .run { grid-template-columns: 1fr; }
  .entry .date { padding-top: 0; }
}
