/* Colours borrow from topographic maps: water-blue links, sepia contour
   lines, and a pale marsh green. One typeface, Schibsted Grotesk. */

/* fonts:start */
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk"; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* fonts:end */

:root {
  --paper: #ffffff;
  --ink: #2a2826;
  --muted: #6b665f;
  --rule: #e6e2db;
  --water: #1f5fa3;
  --water-strong: #164a82;
  --contour: #b07d52;
  --marsh: #edf3e8;
  --marsh-ink: #3e6a37;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15191c; --ink: #e8e5df; --muted: #a39e95; --rule: #2b3035;
    --water: #8ab9ec; --water-strong: #b5d3f4; --contour: #94704f;
    --marsh: #1c261d; --marsh-ink: #a9d09b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15191c; --ink: #e8e5df; --muted: #a39e95; --rule: #2b3035;
  --water: #8ab9ec; --water-strong: #b5d3f4; --contour: #94704f;
  --marsh: #1c261d; --marsh-ink: #a9d09b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--water);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--water) 35%, transparent);
}
a:hover { color: var(--water-strong); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; border-radius: 2px; }
strong { font-weight: 600; }
img { max-width: 100%; }

/* Lets the contour lines run past the column without causing sideways scrolling. */
.wrap { overflow-x: hidden; overflow-x: clip; }
.page { max-width: 840px; margin: 0 auto; padding: 64px 28px 40px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 250px; column-gap: 44px; align-items: start; }
h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.7rem + 2.2vw, 3rem);
  line-height: 1.04;
  font-weight: 640;
  letter-spacing: -0.022em;
}
.role { margin: 8px 0 24px; color: var(--muted); font-size: 1.06rem; }
.bio p { margin: 0 0 14px; text-wrap: pretty; }
.links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 20px 0 0; font-weight: 500; }
.students {
  margin: 28px 0 0;
  padding: 14px 18px;
  border-radius: 8px;
  background: var(--marsh);
  font-size: 0.95rem;
  line-height: 1.55;
  text-wrap: pretty;
}
.students strong { color: var(--marsh-ink); }

/* The portrait sits on the summit of a generated contour map (assets/topo.js). */
.hero-map { --cx: 125px; --cy: 125px; position: relative; width: 250px; margin-top: 6px; }
.topo-slot {
  --rx: 310px; --ry: 250px;
  position: absolute;
  left: calc(var(--cx) - 180px);
  top: calc(var(--cy) - 250px);
  width: 640px;
  height: 520px;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse var(--rx) var(--ry) at 180px 250px, #000 38%, transparent 100%);
          mask-image: radial-gradient(ellipse var(--rx) var(--ry) at 180px 250px, #000 38%, transparent 100%);
}
.topo { display: block; width: 100%; height: 100%; }
.topo path { fill: none; stroke-linejoin: round; }
.topo-reg path { stroke: var(--contour); stroke-width: 0.75; stroke-opacity: 0.5; }
.topo-idx path { stroke: var(--contour); stroke-width: 1.3; stroke-opacity: 0.7; }
.topo-marsh path { stroke: var(--water); stroke-width: 1.1; stroke-linecap: round; stroke-opacity: 0.75; }
.portrait {
  position: relative;
  display: block;
  width: 210px;
  height: 210px;
  margin: 20px auto 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--rule);
  box-shadow: 0 0 0 7px var(--paper);
}

/* The address sits on the map like a label, with a halo so the contour lines don't cross the letters. */
.hero-mail { position: relative; margin: 14px 0 0; text-align: center; font-size: 0.94rem; }
.hero-mail a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent);
  text-shadow: 0 0 2px var(--paper), 0 0 4px var(--paper), 0 0 7px var(--paper), 0 0 10px var(--paper);
}
.hero-mail a:hover { color: var(--water); text-decoration-color: currentColor; }

/* ---------- sections ---------- */
section { margin-top: 64px; }
h2 { margin: 0 0 20px; font-size: 1.4rem; line-height: 1.2; font-weight: 620; letter-spacing: -0.012em; }

.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.news li { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); column-gap: 16px; }
.news li[hidden] { display: none; }
.news time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.more {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--water);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--water) 35%, transparent);
}
.more:hover { color: var(--water-strong); text-decoration-color: currentColor; }
#news-more { margin-top: 12px; }

.pubs { display: grid; gap: 36px; }
.pub { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 26px; align-items: start; scroll-margin-top: 24px; }
.teaser { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--rule); }
.teaser img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.teaser .alt { opacity: 0; transition: opacity 0.25s ease; }
.teaser.flip .alt { opacity: 1; }
.teaser[data-effect="wiggle"] .alt { transition: none; }
.teaser .cap {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #2a2826;
  font-size: 0.74rem;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.teaser.is-on .cap { opacity: 1; }
.pub h3 { margin: 0 0 4px; font-size: 1.04rem; line-height: 1.35; font-weight: 600; text-wrap: balance; }
.pub h3 a { color: var(--ink); text-decoration: none; }
.pub h3 a:hover { color: var(--water); text-decoration: underline; text-decoration-color: currentColor; }
.authors, .venue, .pub-links, .tldr { margin: 0; font-size: 0.94rem; }
.authors { color: var(--muted); }
.authors .me { color: var(--ink); }
.venue { margin-top: 2px; font-style: italic; }
.pub-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 2px 16px; font-weight: 500; }
.tldr { margin-top: 8px; text-wrap: pretty; }

.collab { margin: 0; text-wrap: pretty; }
.collab .who { white-space: nowrap; }

footer { margin-top: 72px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.86rem; }
footer p { margin: 0; }
footer a { color: inherit; }

/* Experience: a dashed trail with one waypoint per position; the filled one is now.
   With logos (see data.js), each logo takes the place of its waypoint. */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; margin: 0 0 20px; }
.section-head h2 { margin: 0; }
.disclose {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.disclose:hover { color: var(--water); }
.disclose .chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
.disclose[aria-expanded="true"] .chev { transform: rotate(180deg); }

.exp { --mark: 12px; --mark-top: 7px; list-style: none; margin: 0; padding: 0; }
.exp.with-logos { --mark: 28px; --mark-top: -1px; }
.exp li { position: relative; padding: 0 0 14px calc(var(--mark) + 18px); }
.exp li:last-child { padding-bottom: 0; }
.exp li::before {
  content: "";
  position: absolute;
  left: calc(var(--mark) / 2 - 0.75px);
  top: calc(var(--mark-top) + var(--mark));
  bottom: calc(-1 * var(--mark-top));
  border-left: 1.5px dashed color-mix(in srgb, var(--contour) 75%, transparent);
}
.exp li:last-child::before { display: none; }
.exp li::after {
  content: "";
  position: absolute;
  left: calc(var(--mark) / 2 - 6px);
  top: calc(var(--mark-top) + var(--mark) / 2 - 6px);
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--contour);
  border-radius: 50%;
  background: var(--paper);
}
.exp li.now::after { border-color: var(--water); background: var(--water); box-shadow: 0 0 0 4px color-mix(in srgb, var(--water) 18%, transparent); }
.exp li.has-logo::after { display: none; }
.exp-mark {
  position: absolute;
  left: 0;
  top: var(--mark-top);
  width: var(--mark);
  height: var(--mark);
  padding: 2px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--rule);
}
.exp li.now .exp-mark { box-shadow: 0 0 0 2px var(--water); }
.exp-head { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 16px; }
.exp-when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The details stay folded until the toggle next to the heading opens them. */
.exp-more { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.25s ease, visibility 0s linear 0.25s; }
.exp-more > div { overflow: hidden; min-height: 0; }
.exp.open .exp-more { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.25s ease, visibility 0s; }
.exp-text { margin: 3px 0 8px; max-width: 68ch; text-wrap: pretty; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .page { padding: 24px 20px 32px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-map { --cx: 50%; --cy: 115px; order: -1; width: 100%; margin: 0 0 18px; }
  .topo-slot { --rx: 300px; --ry: 165px; }
  .portrait { width: 170px; height: 170px; margin: 30px auto 0; }
  section { margin-top: 52px; }
}
@media (max-width: 520px) {
  .pub { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .teaser { max-width: 360px; }
  .news li { grid-template-columns: 4.8rem minmax(0, 1fr); column-gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .teaser .alt, .teaser .cap, .exp-more, .disclose .chev { transition: none; }
}
