:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #5f6670;
  --accent: #275d38;      /* UAlberta green */
  --link: #0000ee;        /* classic browser blue */
  --visited: #551a8b;
  --rule: #e3e5e8;
  --code-bg: #f5f6f7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e6e8eb;
    --muted: #9aa1a9;
    --accent: #7cc48f;
    --link: #8ab4f8;
    --visited: #c58af9;
    --rule: #2c3035;
    --code-bg: #1e2125;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
/* links in running text: classic blue, underlined, purple once visited */
main a { text-decoration: underline; text-underline-offset: 2px; }
main a:visited { color: var(--visited); }
main .buttons > a { text-decoration: none; }
main .buttons > a:visited { color: var(--link); }

/* left-aligned, old-school: small left margin, readable max line length */
.site-header, main, footer {
  max-width: 820px;
  margin: 0;
  padding: 0 16px 0 40px;
}
@media (max-width: 600px) {
  .site-header, main, footer { padding-left: 16px; }
}
.site-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.brand { font-weight: 600; font-size: 2.1rem; line-height: 1.2; color: var(--fg); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-header nav a { color: var(--muted); }
.site-header nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

main { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 1.9rem; margin: 0 0 16px; text-transform: capitalize; }
h2 { font-size: 1.35rem; margin: 32px 0 8px; }
h4 { font-size: 1.1rem; margin: 32px 0 8px; }

footer {
  color: var(--muted);
  font-size: 0.85rem;
  padding-top: 16px;
  padding-bottom: 32px;
  border-top: 1px solid var(--rule);
}

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 2px 16px 2px 0; }
.trainees thead { display: none; }
.trainees td:first-child { color: var(--muted); white-space: nowrap; width: 4em; }

address { font-style: normal; line-height: 1.35; }
.social { margin-top: 24px; }
.note { color: var(--muted); font-size: 0.9rem; }

pre {
  background: var(--code-bg);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Publications */
.pub-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 16px 0 8px;
}
.pub-search input {
  flex: 1 1 260px;
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
}
#pub-count { color: var(--muted); font-size: 0.9rem; }
.publications ol { list-style: none; padding: 0; margin: 0; }
.pub { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.pub:last-child { border-bottom: 0; }
.pub .title { font-weight: 600; }
.pub .authors, .pub .venue { font-size: 0.95rem; }
.pub .venue { color: var(--muted); }
.pub .links { font-size: 0.85rem; margin-top: 4px; }
.pub .buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.pub .buttons > a, .pub .buttons > label {
  padding: 0 8px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  line-height: 1.6;
  white-space: nowrap;
  cursor: pointer;
  color: var(--link);
  user-select: none;
}
.pub .buttons > a:hover, .pub .buttons > label:hover {
  border-color: var(--link);
  text-decoration: none;
}
/* the checkboxes are visually hidden but stay keyboard-focusable */
.pub .links > input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.pub .t-abs:checked ~ .buttons .l-abs,
.pub .t-bib:checked ~ .buttons .l-bib {
  background: var(--link);
  border-color: var(--link);
  color: var(--bg);
}
.pub .t-abs:focus-visible ~ .buttons .l-abs,
.pub .t-bib:focus-visible ~ .buttons .l-bib {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
.pub .panel { display: none; margin-top: 8px; }
.pub .t-abs:checked ~ .p-abs,
.pub .t-bib:checked ~ .p-bib { display: block; }
.pub .panel p { font-size: 0.9rem; margin: 0; }
.pub .panel pre { margin: 0; }
.pub .p-abs + .p-bib { margin-top: 8px; }
[hidden] { display: none !important; }
