/* Classic academic homepage: fixed sidebar on the left, content on the right. */
:root {
  --text: #3c4248;
  --heading: #2b2f33;
  --muted: #6f777d;
  --link: #1f4e8c;
  --venue-tag: #b0182c;
  --year-tag: #1f5fbf;
  --venue: #2e7d32;
  --rule: #e6e8ea;
  --panel: #f4f7fb;
  --oxford: #002147;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --bar: 3.4rem;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

p { margin: 0 0 0.75em; }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 20;
  padding: 0.5rem 0.75rem; background: var(--link); color: #fff;
}
.skip:focus { top: 0.5rem; }

/* Top bar */
.masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  height: var(--bar);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner {
  display: flex; align-items: center; gap: 2.5rem;
  max-width: 1240px; height: 100%; margin: 0 auto; padding: 0 1.5rem;
}
.brand { color: var(--heading); font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.masthead nav { display: flex; gap: 1.75rem; overflow-x: auto; scrollbar-width: none; }
.masthead nav::-webkit-scrollbar { display: none; }
.masthead nav a { color: var(--muted); white-space: nowrap; }
.masthead nav a:hover { color: var(--heading); text-decoration: none; }

/* Page */
.layout {
  display: grid;
  grid-template-columns: 18.5rem minmax(0, 1fr);
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: calc(var(--bar) + 2.25rem) 1.5rem 2rem;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: calc(var(--bar) + 2.25rem);
  align-self: start;
}
.avatar {
  display: block;
  width: 11rem; height: 11rem;
  object-fit: cover; object-position: 50% 30%;
  border-radius: 50%;
  border: 1px solid var(--rule);
  padding: 4px;
  background: #fff;
}
.name {
  margin: 1.1rem 0 0.2rem;
  font-size: 1.4rem; line-height: 1.25; font-weight: 700;
  color: var(--heading);
}
.roles { margin: 0 0 0.7rem; padding: 0; list-style: none; font-size: 0.92rem; }
.roles li { margin: 0 0 0.25rem; }
.roles .icon-cap { color: var(--oxford); }
img.icon { border-radius: 3px; }
/* make the FinHorizons link obviously clickable */
a.ext {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a.ext svg { width: 0.7em; height: 0.7em; margin-left: 0.2em; vertical-align: 0.05em; }
/* collaboration tag: soft blue chip, opens an email */
.collab {
  display: inline-flex; align-items: center;
  margin: 0 0 0.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  background: #e8f0fa;
  color: var(--link);
  font-size: 0.9rem; font-weight: 600;
}
.collab .icon { color: currentColor; margin-right: 0.45em; }
.collab:hover { background: #d9e6f6; text-decoration: none; }
.bio { font-size: 0.92rem; color: var(--text); }
.links { margin: 0.9rem 0 0; padding: 0; list-style: none; font-size: 0.93rem; }
.links li { margin: 0 0 0.45rem; color: var(--text); }
.links a { color: var(--text); }
.links a:hover { color: var(--link); }
.icon { width: 1em; height: 1em; margin-right: 0.55em; vertical-align: -0.14em; color: var(--muted); }
.links a[href^="https://scholar"] .icon { color: #4285f4; }
.links a[href^="https://www.linkedin"] .icon { color: #0a66c2; }
.links a[href^="https://github"] .icon { color: #24292f; }
.links a[href^="https://eng.ox"] .icon { color: var(--oxford); }

/* Main column */
main { min-width: 0; max-width: 62rem; }
main section { scroll-margin-top: calc(var(--bar) + 1rem); margin-bottom: 2.25rem; }
main h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.45rem; font-weight: 700; line-height: 1.3;
  color: var(--heading);
}
main h3 { margin: 1.4rem 0 0.6rem; font-size: 1.15rem; font-weight: 700; color: var(--heading); }
main strong { color: var(--heading); }

.interests { margin: 0 0 0.9rem; padding-left: 1.4rem; }
.interests li { margin-bottom: 0.3rem; }

.callout {
  padding: 0.6rem 0.9rem;
  background: var(--panel);
  border-left: 3px solid var(--venue-tag);
  border-radius: 0 4px 4px 0;
}
.callout strong { color: var(--venue-tag); }
div.callout { margin: 0 0 0.75em; }
div.callout p { margin: 0; }
.contacts { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.contacts li { margin: 0.15rem 0 0; }
.contacts b { color: var(--heading); }
.contacts .icon { color: var(--heading); }

.note { font-size: 0.95rem; }

/* Publication entries */
.pubs { margin: 0 0 0.5rem; padding-left: 1.8rem; }
ul.pubs { padding-left: 1.4rem; }
.pubs li { margin-bottom: 0.65rem; scroll-margin-top: calc(var(--bar) + 1rem); }
.pubs li:target { background: #fff8d6; box-shadow: 0 0 0 4px #fff8d6; }
.vtag { color: var(--venue-tag); font-weight: 700; }
.ytag { color: var(--year-tag); font-weight: 700; }
.ptitle { color: var(--heading); font-style: italic; text-decoration: underline; text-decoration-color: #9aa3ab; text-underline-offset: 0.15em; }
.ptitle:hover { color: var(--link); text-decoration-color: currentColor; }
.venue { color: var(--venue); }
.honor { color: var(--venue-tag); font-weight: 700; }
.pubs sup, .note sup { font-size: 0.7em; line-height: 0; }

/* Representative works: figure on the left, entry on the right */
.works { padding-left: 0; list-style: none; }
.works li {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.thumb {
  display: block;
  aspect-ratio: 3 / 2;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.thumb:hover { border-color: #c5ccd3; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* News and other lists */
.news, .plain { margin: 0; padding-left: 1.4rem; }
.news li, .plain li { margin-bottom: 0.45rem; }
.plain + p { margin-top: 0.7rem; }
.news em:first-child, .plain em:first-child { color: var(--heading); }

.footer {
  margin-top: 3rem; padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem; color: var(--muted);
}

/* Tablet and phone: sidebar becomes a header block */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 1.5rem; padding-top: calc(var(--bar) + 1.5rem); }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule);
  }
  .avatar { width: 7.5rem; height: 7.5rem; }
  .name { margin-top: 0.2rem; }
  .links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; }
  .links li { margin: 0; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .masthead-inner { padding: 0 1rem; gap: 1.25rem; }
  .brand { display: none; }
  .masthead nav { gap: 1.1rem; font-size: 0.9rem; }
  .layout { padding-left: 1rem; padding-right: 1rem; }
  .sidebar { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; }
  .avatar { width: 5.5rem; height: 5.5rem; }
  main h2 { font-size: 1.3rem; }
  .pubs { padding-left: 1.5rem; }
  .works { padding-left: 0; }
  .works li { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .masthead, .skip { display: none; }
  .layout { display: block; padding-top: 0; }
  .sidebar { position: static; }
}
