/* Layout: single reading column (max ~880px) under a full-width masthead band;
   dates and years set in mono like timestamps in an event log. */
:root {
  --bg: #f6f5f5;
  --surface: #ffffff;
  --ink: #1e1a1b;
  --muted: #625b5d;
  --rule: #e2dcdd;
  --accent: #9b0014;          /* Padova crimson */
  --accent-soft: #f6e7e9;
  --band: #9b0014;
  --band-ink: #ffffff;
  --band-muted: #f2c9ce;
  --t-journal: #b3122d; --t-conference: #1f66b3; --t-workshop: #c98200; --t-other: #8a8288;
  --font-display: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 1100px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151213; --surface: #1e1a1b; --ink: #ede8e9; --muted: #aba2a4; --rule: #362f31;
    --accent: #f08c97; --t-journal: #f26d80; --t-conference: #6aa8ef; --t-workshop: #f0b440; --t-other: #a59ca2; --accent-soft: #3a2125; --band: #5e0a15; --band-ink: #ffffff; --band-muted: #e6b3ba;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151213; --surface: #1e1a1b; --ink: #ede8e9; --muted: #aba2a4; --rule: #362f31;
  --accent: #f08c97; --t-journal: #f26d80; --t-conference: #6aa8ef; --t-workshop: #f0b440; --t-other: #a59ca2; --accent-soft: #3a2125; --band: #5e0a15; --band-ink: #ffffff; --band-muted: #e6b3ba;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px;
}

.wrap {
  max-width: calc(var(--measure) + 2 * 24px);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Masthead ---------- */
.masthead { background: var(--band); color: var(--band-ink); }
.masthead .wrap {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding-block: 22px 18px;
}
.seal {
  width: 64px; height: 64px; border-radius: 50%; background: #ffffff;
  padding: 0; flex: none; display: block; overflow: hidden;
}
.seal img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ident { flex: 1 1 280px; min-width: 0; }
.ident .eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--band-muted); margin: 0;
}
.ident .name {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4vw, 34px);
  line-height: 1.15; margin: 2px 0 0; text-wrap: balance;
}
.ident .name a { color: inherit; text-decoration: none; }
.contact {
  margin: 0; display: grid; grid-template-columns: auto auto; gap: 2px 14px;
  font-size: 14px; flex: none;
}
.contact dt { color: var(--band-muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; align-self: center; }
.contact dd { margin: 0; font-variant-numeric: tabular-nums; }

/* Trace strip: place - transition - place, a nod to Petri nets */
.trace { display: block; width: 100%; height: 14px; color: var(--band-muted); opacity: .55; }

.sitenav { background: var(--surface); border-bottom: 1px solid var(--rule); }
.sitenav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0 4px;
}
.sitenav a {
  display: block; padding: 12px 12px 10px; color: var(--muted); text-decoration: none;
  font-size: 15px; border-bottom: 2px solid transparent;
}
.sitenav li:first-child a { padding-left: 0; }
.sitenav a:hover { color: var(--ink); }
.sitenav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }

/* ---------- Content ---------- */
main { padding-block: 40px 56px; }
main h1 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4vw, 36px);
  line-height: 1.2; margin: 0 0 20px; text-wrap: balance;
}
main h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.3;
  margin: 40px 0 14px; text-wrap: balance;
}
main h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 28px 0 8px; }
main h4 { font-size: 16px; margin: 20px 0 6px; }
main p, main li { max-width: 68ch; }
.wide p, .people p, .people li { max-width: none; }
.lede { font-size: 18px; color: var(--muted); }
.label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 4px;
}

/* Home: profile */
.profile {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start;
}
.profile .photo {
  width: 100%; aspect-ratio: 359 / 521; object-fit: cover; display: block;
  border-radius: 4px; background: var(--rule);
}
.profile .role {
  font-family: var(--font-display); font-size: 22px; font-weight: 500; line-height: 1.3; margin: 0 0 18px;
}
.profile address { font-style: normal; line-height: 1.7; }
.quote {
  margin: 28px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--accent);
  font-family: var(--font-display); font-style: italic; font-size: 17px; color: var(--ink);
}
.quote p { margin: 0 0 6px; }
.quote footer { font-family: var(--font-body); font-style: normal; font-size: 14px; color: var(--muted); }

/* Event-log style timeline */
.log { width: 100%; border-collapse: collapse; margin-top: 8px; }
.log th, .log td { text-align: left; vertical-align: top; padding: 10px 0; border-top: 1px solid var(--rule); }
.log th {
  width: 170px; padding-right: 20px; font-family: var(--font-mono); font-weight: 400; font-size: 13px;
  color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.75;
}
.log tr:last-child th, .log tr:last-child td { border-bottom: 1px solid var(--rule); }

/* Group */
.people { display: grid; gap: 20px; margin-top: 24px; }
.person {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 20px;
}
.person img { width: 160px; aspect-ratio: 1; object-fit: cover; object-position: center top; border-radius: 4px; display: block; background: var(--rule); }
.person h3 { margin: 0 0 6px; }
.person .initials { width: 160px; aspect-ratio: 1; border-radius: 4px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-size: 44px; font-weight: 600; letter-spacing: .04em; }
@media (max-width: 680px) { .person .initials { width: 120px; font-size: 34px; } }
.person p { margin: 0 0 10px; }
.person .links { font-size: 14px; margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; }
.person .links dt { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); align-self: center; }
.person .links dd { margin: 0; overflow-wrap: anywhere; }

/* Teaching */
.years { margin-top: 8px; }
.year-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px;
  padding: 16px 0; border-top: 1px solid var(--rule);
}
.year-row:last-child { border-bottom: 1px solid var(--rule); }
.year-row h2 { margin: 0; font-family: var(--font-mono); font-weight: 400; font-size: 14px; color: var(--muted); line-height: 1.8; }
.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.courses li { margin: 0; }
.courses .course { font-weight: 500; }
.courses .meta { display: block; color: var(--muted); font-size: 15px; }

/* Publications */
.pubbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--bg); padding: 12px 0; border-bottom: 1px solid var(--rule);
  display: grid; gap: 10px;
}
.search-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-row input {
  flex: 1 1 260px; min-width: 0; font: inherit; font-size: 15px; padding: 8px 12px;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); color: var(--ink);
}
.search-row .count { font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.yearnav { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }
.yearnav a {
  display: inline-block; font-family: var(--font-mono); font-size: 13px; padding: 2px 8px;
  border: 1px solid var(--rule); border-radius: 3px; color: var(--muted); text-decoration: none;
  background: var(--surface); font-variant-numeric: tabular-nums;
}
.yearnav a:hover { color: var(--accent); border-color: var(--accent); }
.yearnav a.empty { opacity: .35; pointer-events: none; }
.pubyear { scroll-margin-top: 130px; }
.pubyear > h2 {
  font-family: var(--font-mono); font-weight: 500; font-size: 20px; color: var(--accent);
  margin: 36px 0 4px; display: flex; align-items: baseline; gap: 10px;
}
.pubyear > h2 small { font-size: 13px; color: var(--muted); font-weight: 400; }
.publist { list-style: none; margin: 0; padding: 0; }
.pub p { max-width: 90ch; }
.pub { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 12px; }
.pub > p { grid-column: 2; }
.pub > .dot { grid-row: 1; grid-column: 1; margin-top: 7px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-journal { background: var(--t-journal); }
.dot-conference { background: var(--t-conference); }
.dot-workshop { background: var(--t-workshop); }
.dot-other { background: var(--t-other); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.legend-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.tbtn {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px; cursor: pointer;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
}
.tbtn .n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbtn[aria-pressed="false"] { color: var(--muted); background: transparent; border-style: dashed; }
.tbtn[aria-pressed="false"] .dot { opacity: .3; }
.tbtn:hover { border-color: var(--muted); }
.pub { padding: 14px 0; border-top: 1px solid var(--rule); max-width: none; }
.pub:first-child { border-top: 0; }
.pub .title { font-family: var(--font-display); font-size: 17px; line-height: 1.4; margin: 0 0 4px; font-weight: 500; }
.pub .title a { color: var(--ink); text-decoration-color: var(--accent); }
.pub .title a:hover { color: var(--accent); }
.pub .authors { margin: 0 0 2px; font-size: 15px; }
.pub .authors .me { font-weight: 600; white-space: nowrap; }
.pub .venue { margin: 0; font-size: 14px; color: var(--muted); }
.pub .venue a { color: var(--muted); }
.pub .venue a:hover { color: var(--accent); }
.noresults { color: var(--muted); padding: 24px 0; }

/* Notice */
.notice {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 20px 22px;
  max-width: 68ch;
}
.notice p { margin: 0; }

/* Legacy content pages (course pages, tools) */
.legacy table { border-collapse: collapse; width: 100%; font-size: 15px; }
.legacy td, .legacy th { border: 1px solid var(--rule); padding: 10px 12px; vertical-align: top; text-align: left; }
.legacy td p:first-child { margin-top: 0; }
.legacy td ul { padding-left: 18px; margin: 6px 0; }
.table-scroll { overflow-x: auto; margin: 16px 0; }
.legacy pre, pre.code {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 14px 16px;
  overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
}
.code .hl { background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 0 2px; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 4px; background: var(--accent); color: var(--surface);
  text-decoration: none; font-weight: 500;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* ---------- Footer ---------- */
.sitefoot { border-top: 1px solid var(--rule); background: var(--surface); }
.sitefoot .wrap { padding-block: 18px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; font-size: 13px; color: var(--muted); }
.sitefoot a { color: var(--muted); }
.sitefoot .counter { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sitefoot .counter h6 { margin: 0; }
.sitefoot .stamp { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Narrow screens ---------- */
@media (max-width: 680px) {
  .contact { grid-template-columns: auto minmax(0, 1fr); }
  .profile { grid-template-columns: 1fr; }
  .profile .photo { max-width: 200px; }
  .person { grid-template-columns: 1fr; }
  .person img { width: 120px; }
  .year-row { grid-template-columns: 1fr; gap: 6px; }
  .log th { display: block; width: auto; padding: 10px 0 0; border-top: 1px solid var(--rule); }
  .log td { display: block; padding: 0 0 10px; border-top: 0; }
  .log tr { display: block; }
  .log tr:last-child th { border-bottom: 0; }
  .sitenav a { padding: 10px 8px 8px; font-size: 14px; }
  .pubbar { position: static; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Biographical sketch: dotted chart + process trace ---------- */
:root { --c-position: var(--accent); --c-service: var(--t-workshop); --c-education: var(--t-conference); }
.personal { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.creds { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cred { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; }
.cred p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.cred .label { margin-bottom: 4px; }
h3.sub { font-family: var(--font-mono); font-weight: 500; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 34px 0 10px; }
.chart-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 8px 4px; }
.dchart { display: block; width: 100%; min-width: 640px; height: auto; font-family: var(--font-mono); }
.dchart .band { fill: var(--bg); }
.dchart .band.band-eindhoven { fill: var(--accent-soft); opacity: .3; }
.dchart .band { opacity: .7; }
.dchart .band-label { font-size: 11px; fill: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.dchart .lane { stroke: var(--rule); stroke-dasharray: 2 4; }
.dchart .lane-label { font-size: 12px; fill: var(--ink); font-family: var(--font-body); }
.dchart .axis { stroke: var(--muted); }
.dchart .tick { stroke: var(--muted); }
.dchart .tick-label { font-size: 11px; fill: var(--muted); }
.dchart .bar { stroke: var(--surface); stroke-width: 1; }
.dchart .bar-position { fill: var(--c-position); }
.dchart .bar-education { fill: var(--c-education); }
.dchart .pt { stroke: var(--surface); stroke-width: 1.5; }
.dchart .pt-service { fill: var(--c-service); }
.dchart .now { fill: var(--surface); stroke: var(--c-position); stroke-width: 2; }
.dchart .now-label { font-size: 10px; fill: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.dchart a { cursor: pointer; }
.dchart a:hover .bar, .dchart a:hover .pt, .dchart a:focus-visible .bar, .dchart a:focus-visible .pt { stroke: var(--ink); stroke-width: 2; }
.chart-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.trace-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.trace-head h3.sub { margin-bottom: 0; }
.cfilter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.cbtn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; cursor: pointer; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--muted); }
.cbtn[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--muted); }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw-position { background: var(--c-position); } .sw-service { background: var(--c-service); border-radius: 50%; } .sw-education { background: var(--c-education); }

.ptrace { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.ptrace::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--rule); }
.ev { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 7px 0; scroll-margin-top: 20px; }
.ev .mark { grid-column: 1; justify-self: center; margin-top: 5px; position: relative; z-index: 1; }
.mark-place { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--ev-c); }
.mark-transition { width: 5px; height: 16px; background: var(--ev-c); border-radius: 1px; margin-top: 3px; box-shadow: 0 0 0 3px var(--bg); }
.ev-position { --ev-c: var(--c-position); } .ev-service { --ev-c: var(--c-service); } .ev-education { --ev-c: var(--c-education); }
.ev-now .mark-place { background: var(--c-position); box-shadow: 0 0 0 4px var(--accent-soft); }
.ev-meta { margin: 0 0 2px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ev-meta time { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 3px; border: 1px solid var(--ev-c); color: var(--ev-c); }
.tag-current { background: var(--c-position); border-color: var(--c-position); color: var(--surface); }
.ptrace .ev, .ptrace .ev-text, .ptrace .ev-meta, .creds p, .personal { max-width: none; }
.ev-text { margin: 0; font-size: 14px; line-height: 1.5; }
.ev-now .ev-text { font-weight: 500; }
.ev.flash .ev-body { animation: evflash 1.6s ease-out; border-radius: 4px; }
@keyframes evflash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .ev.flash .ev-body { animation: none; } }
