/* Layout follows the academic homepage template popularised by Jon Barron. */

a {
  color: #1772d0;
  text-decoration: none;
}

a:focus,
a:hover {
  color: #f09228;
  text-decoration: none;
}

body,
td,
th,
tr,
p,
li,
a {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
}

body {
  margin-bottom: 40px;
}

.container {
  margin-right: auto;
  margin-left: auto;
  max-width: 800px;
}

.name {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 32px;
  margin: 0;
}

.position {
  color: #666;
  margin: 2px 0 0 0;
}

h4 {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 22px;
  margin: 0;
}

.papertitle {
  font-weight: 700;
}

.highlight {
  color: #c1272d;
}

.common-rows {
  margin-top: 10px;
  margin-bottom: 10px;
}

.section-heading-rows {
  margin-top: 26px;
  margin-bottom: 10px;
}

/* ---- header: name and institute logos ---------------------------------- */

.institute-logos {
  /* flex, not inline images: baseline alignment would stagger two logos of different heights */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.institute-logos img {
  /* equal height: both marks devote the same share of it to their wordmark,
     so the lettering comes out the same size */
  display: block;
  height: 32px;
  width: auto;
}

.institute-logo-davian {
  margin-right: 28px;
}

/* ---- intro: text beside a circular photo -------------------------------- */

.personal-column {
  margin: auto;
}

.personal-photo {
  width: 90%;
  max-width: 100%;
  margin: auto;
  display: block;
  clip-path: circle();
}

.links {
  text-align: center;
  margin-top: 16px;
}

.links a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.links svg {
  width: 14px;
  height: 14px;
  margin-right: 0.35em;
  fill: currentColor;
  flex-shrink: 0;
}

.links .sep {
  color: #999;
  padding: 0 0.5em;
}

/* ---- publications and projects ------------------------------------------ */

.pub-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 26px;
  margin-bottom: 26px;
}

.pub-fig-col {
  display: flex;
  flex: 0 0 31%;
  max-width: 31%;
  align-items: center;
  justify-content: center;
}

.pub-text-col {
  flex: 0 0 69%;
  max-width: 69%;
  padding-left: 18px;
}

.paper-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  /* contain, not cover: these are paper figures, cropping them loses content */
  object-fit: contain;
  background: #fff;
  padding: 5px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ---- work experience and education -------------------------------------- */

.entry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0;
}

.entry-logo-col {
  display: flex;
  flex: 0 0 22%;
  max-width: 22%;
  align-items: center;
  justify-content: center;
}

.entry-text-col {
  flex: 0 0 78%;
  max-width: 78%;
  padding-left: 18px;
}

.entry-logo {
  max-width: 100%;
  max-height: 58px;
  object-fit: contain;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.entry-meta {
  color: #888;
  white-space: nowrap;
  padding-left: 0.5em;
}

.entry-text-col ul {
  margin: 0.4em 0 0 0;
  padding-left: 1.1em;
}

.footer-note {
  text-align: right;
  font-size: small;
  color: #999;
  margin-top: 36px;
}

/* ---- narrow screens ------------------------------------------------------ */

@media screen and (max-width: 576px) {
  .institute-logos {
    justify-content: center;
    margin-top: 10px;
  }

  .personal-photo {
    width: 80%;
    max-width: 200px;
    padding: 10px 0;
  }

  .pub-row,
  .entry-row {
    display: block;
  }

  .pub-fig-col,
  .pub-text-col,
  .entry-logo-col,
  .entry-text-col {
    max-width: 100%;
    flex: 0 0 100%;
    padding-left: 0;
  }

  .paper-image {
    max-width: 260px;
    margin: 0 auto 12px auto;
  }

  .entry-logo {
    margin-bottom: 10px;
  }
}

/* ---- research journey ---------------------------------------------------- */

.journey {
  --track: #ccd4dd;
  list-style: none;
  margin: 0;
  padding: 0;
}

.leg {
  margin-bottom: 26px;
}

.leg:last-child {
  margin-bottom: 0;
}

/* the year header doubles as the accordion toggle */
.leg-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.leg-title::-webkit-details-marker {
  display: none;
}

.leg-title::before {
  content: "";
  flex: none;
  width: 5px;
  height: 24px;
  border-radius: 3px;
  background: var(--leg);
}

.leg-chevron {
  flex: none;
  width: 10px;
  font-size: 13px;
  color: #a7b0ba;
  transition: transform 0.15s ease;
}

details[open] > .leg-title .leg-chevron {
  transform: rotate(90deg);
}

.leg-title:hover .leg-years,
.leg-title:focus-visible .leg-years {
  color: #f09228;
}

.leg-years {
  flex: none;
  min-width: 124px;
  color: var(--leg);
}

/* the route: one straight track down the middle, stops either side of it */
.stops {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stops::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: var(--track);
}

.stop {
  position: relative;
  padding: 0 0 22px 34px;
}

.stop:last-child {
  padding-bottom: 0;
}

.stop::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2.5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--leg);
  /* the white ring lifts the stop clear of the track */
  box-shadow: 0 0 0 3.5px #fff;
}

/* the track runs on past the newest stop: an arrowhead caps each leg */
.stops {
  padding-top: 30px;
}

.stop:first-child::after {
  content: "";
  position: absolute;
  top: -21px;
  left: 3px;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  /* two strokes rotated into a point, in the track's own grey */
  border-top: 2.5px solid var(--track);
  border-right: 2.5px solid var(--track);
  transform: rotate(-45deg);
}

/* milestones are hollow so papers stay the primary stops — shape, not colour */
.stop-mile::before {
  background: #fff;
  border: 3px solid var(--leg);
}

.stop-now::before {
  box-shadow: 0 0 0 3.5px #fff, 0 0 0 7px rgba(23, 114, 208, 0.16);
  /* the halo follows whichever leg the current stop sits in */
  box-shadow: 0 0 0 3.5px #fff, 0 0 0 7px color-mix(in srgb, var(--leg) 20%, transparent);
}

.stop-when {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--leg);
}

.stop-what {
  display: block;
}

/* every stop carries the box; only the ones I led paint it, so the
   labels stay on the same line either way */
.stop-body {
  display: inline-block;
  padding: 7px 11px 9px;
  border: 1.5px solid transparent;
  border-radius: 8px;
}

.stop-mine .stop-body {
  border-color: var(--leg);
  background: #f5f9fd;
}

.stop-lead {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid #cfe0f7;
  border-radius: 9px;
  background: #eaf1fb;
  color: #104281;
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* narrow screens: the track moves to the left edge and every stop lines up under it */
@media screen and (max-width: 576px) {
  .leg-title {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .leg-years {
    min-width: 0;
  }
}
