:root { color-scheme: light; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: #ffffff;
  color: #111111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  max-width: 54em;
  margin: 0 auto;
  padding: 2.5em 1.25em 5em;
}

a { color: #0b4fa8; }
a:visited { color: #0b4fa8; }
a:hover { color: #062f66; }
a:focus-visible { outline: 2px solid #0b4fa8; outline-offset: 2px; }

h1 {
  font-size: 1.7em;
  font-weight: 700;
  margin: 0 0 .15em;
  letter-spacing: -.01em;
}

h2 {
  font-size: 1em;
  font-weight: 700;
  margin: 2.6em 0 .2em;
  padding-bottom: .3em;
  border-bottom: 1px solid #dddddd;
}

h3 {
  font-size: 1em;
  font-weight: 600;
  margin: 1.5em 0 0;
}

p { margin: .5em 0; }

.layout {
  display: flex;
  gap: 2.5em;
  align-items: flex-start;
}

.pane { flex: 1 1 auto; min-width: 0; }

.rail {
  flex: 0 0 auto;
  align-self: stretch;
}

.photo {
  flex: 0 0 auto;
  width: 145px;
  height: auto;
  margin-top: .1em;
}

.tagline { color: #444444; margin: .35em 0 0; }

.meta { color: #666666; font-size: .9em; margin: .1em 0 .4em; }

ul { margin: .5em 0; padding-left: 1.4em; }
li { margin: .15em 0; }

ul.plain { list-style: none; padding-left: 0; }
ul.plain li { margin: .35em 0; }

ul.rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.2em;
}

.where {
  flex: 0 0 auto;
  color: #666666;
  font-size: .9em;
  white-space: nowrap;
}


ul.contact { list-style: none; padding-left: 0; margin: 1.2em 0 0; }
ul.contact + h2 { margin-top: 1.5em; }
ul.contact li { display: inline; margin: 0; }
ul.contact li::after { content: " · "; color: #999999; }
ul.contact li:last-child::after { content: ""; }
ul.contact svg {
  width: 1em;
  height: 1em;
  vertical-align: -.14em;
  margin-right: .32em;
  fill: currentColor;
}

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

/* every project image renders at the same height; widths follow the aspect ratio */
ul.projects { --shot-h: 132px; }

ul.projects li {
  display: flex;
  gap: 1em;
  align-items: flex-start;
  margin: 1.1em 0;
}

ul.projects > li:not(.wide) { flex-direction: row-reverse; }
ul.projects > li > a { flex: 0 0 auto; }
ul.projects > li > div { flex: 1 1 auto; min-width: 0; }

.thumb {
  display: block;
  height: var(--shot-h);
  width: auto;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid #e5e5e5;
}

ul.projects a { display: block; border-bottom: 0; }
ul.projects a:hover .thumb { border-color: #0b4fa8; }
ul.projects a:focus-visible { outline: 2px solid #0b4fa8; outline-offset: 2px; }

/* larger projects: text full width, image strip underneath */
ul.projects li.wide {
  flex-direction: column;
  align-items: stretch;
  gap: .5em;
  margin: 1.4em 0;
}

.pname { display: block; font-weight: 700; }

/* hover magnifies the image in place, above its neighbours */
ul.projects img { transition: transform .15s ease-out, box-shadow .15s ease-out, border-color .15s ease-out; }
ul.projects a:hover img,
ul.projects a:focus-visible img {
  position: relative;
  z-index: 3;
  transform: scale(1.55);
  box-shadow: 0 3px 16px rgba(0, 0, 0, .22);
}
/* pin the origin at the row edges so nothing grows off the page */
.shots a:first-child:hover img,
.shots a:first-child:focus-visible img { transform-origin: left center; }
ul.projects > li > a:hover img,
ul.projects > li > a:focus-visible img,
.shots a:last-child:hover img,
.shots a:last-child:focus-visible img { transform-origin: right center; }

@media (prefers-reduced-motion: reduce) {
  ul.projects img { transition: none; }
}


.shots { display: flex; gap: .5em; align-items: flex-start; }

/* one line always: the strip crops from the right rather than wrapping */
ul.projects .shots a {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e5e5;
}
ul.projects .shots a:hover,
ul.projects .shots a:focus-visible {
  overflow: visible;
  position: relative;
  z-index: 3;
  border-color: #0b4fa8;
}
.shots img {
  display: block;
  height: var(--shot-h);
  width: auto;
  max-width: none;
}
.shots a:hover img { border-color: #0b4fa8; }

figure { margin: 1.5em 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e5e5e5;
}
figure.small img { width: 256px; max-width: 100%; }
figcaption { font-size: .85em; color: #666666; margin-top: .45em; }

.note { color: #666666; }

.tabs {
  position: sticky;
  top: 1.6em;
  display: flex;
  flex-direction: column;
  gap: .3em;
  margin: 1.1em 0 0;
  font-size: .92em;
}
.tabs a { color: #555555; text-decoration: none; }
.tabs a:hover { color: #0b4fa8; }
.tabs a.active { color: #111111; font-weight: 600; }

/* first heading sits right under the bar; the rest clear it when jumped to */
h2[id] { scroll-margin-top: 3.2em; }

/* research index — one line per project, linking to its own page */
.entry { margin: .95em 0; }
.entry h3 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.2em;
}

.entry .when {
  flex: 0 0 auto;
  color: #666666;
  font-size: .88em;
  font-weight: 400;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.entry p { margin: .25em 0 0; }

.entry .pub {
  margin-top: .4em;
  font-size: .88em;
  color: #666666;
}
.entry .pub b { color: #111111; font-weight: 600; }

/* detail pages */
.back { font-size: .9em; margin: 0 0 1.6em; }
.back a { text-decoration: none; }
.back a:hover { text-decoration: underline; }

footer {
  margin-top: 3.5em;
  padding-top: 1em;
  border-top: 1px solid #dddddd;
  color: #666666;
  font-size: .9em;
}

@media (max-width: 34em) {
  body { font-size: 15px; padding: 1.75em 1em 3.5em; }
  h1 { font-size: 1.5em; }
  .layout { flex-direction: column; gap: 1em; }
  .rail { align-self: auto; }
  .tabs { position: static; }
  .photo { width: 118px; margin-top: 0; }
  .tabs { flex-direction: row; flex-wrap: wrap; gap: .2em 1.2em; margin-top: .8em; }
  ul.projects { --shot-h: 108px; }
  .shots { flex-wrap: wrap; }
}
